MatN work for versatile appimage creation for all types of os
[goodguy/cinelerra.git] / cinelerra-5.1 / tools / makeappimagetool / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 ACLOCAL_AMFLAGS = -I m4 --install
4
5 AC_PREREQ([2.69])
6 AC_INIT([MakeAppImage], [0.1.0])
7
8 # Put autogenerated stuff in subdir cfg, that must be created
9 # externally. This macro must be set before calling AC_INIT_AUTOMAKE
10 AC_CONFIG_AUX_DIR(cfg)
11
12 AM_INIT_AUTOMAKE([foreign])
13 AC_CONFIG_SRCDIR([./main.cpp])
14 AC_CONFIG_HEADERS([config.h])
15 AC_CONFIG_FILES([Makefile])
16
17 # Checks for programs.
18 AC_PROG_CXX
19 AC_PROG_CC
20 AC_PROG_CPP
21 AC_PROG_INSTALL
22
23 # Checks for needed executables, libraries and headers which are
24 # not optional. If missing, treat as fatal error.
25
26 # Test function copied from Cinelerra-GG.
27 # But for some reason I get a syntax error. TODO MatN
28 AC_DEFUN([REQUIRE_PROG], [
29  CHECK_PROG([$1],[$2])
30  if test "x$PROG_$1" = "xno"; then
31    AC_MSG_ERROR([$2 is missing and required.])
32    FATAL_ERROR=1
33  fi
34 ])
35
36 #REQUIRE_PROG(OBJCOPY, [objcopy])
37 #REQUIRE_PROG(PATCHELF, [patchelf])
38
39 # Note: objcopy is only required because configure creates a
40 # Makefile with -g in the compile options, which generates debug info.
41 # It also creates a compile option -I. which is not needed. With
42 # this option, you get boost compile errors, unless the include files
43 # are in a different directory. Sources have been adjusted accordingly. TODO MatN
44
45
46 # If a development header is present, then almost certainly
47 # the library itself is present too, enforced by the package
48 # manager.
49
50 AC_LANG_PUSH([C++])
51 AC_CHECK_HEADER([boost/filesystem.hpp], ,[ AC_MSG_ERROR([header is missing and required.]) ])
52 AC_CHECK_HEADER([boost/filesystem/path.hpp], ,[ AC_MSG_ERROR([header is missing and required.]) ])
53 AC_CHECK_HEADER([boost/regex.hpp],  ,[ AC_MSG_ERROR([header is missing and required.]) ])
54 AC_LANG_POP([C++])
55
56 AC_CHECK_HEADER([libpng16/png.h],  ,[ AC_MSG_ERROR([header is missing and required.]) ])
57 AC_CHECK_HEADER([zlib.h],  ,[ AC_MSG_ERROR([header is missing and required.]) ])
58 AC_CHECK_HEADER([jpeglib.h],  ,[ AC_MSG_ERROR([header is missing and required.]) ])
59
60
61 # Don't use += construct, that is from bash and will not work 
62 # with sh (macOS).
63 CFLAGS= "-O2"
64 CXXFLAGS="$CXXFLAGS -DBOOST_NO_CXX11_SCOPED_ENUMS"
65 CXXFLAGS="$CXXFLAGS -Dcimg_display=0 -Dcimg_use_jpeg=1 -Dcimg_use_png=1"
66 LIBS=" -lpng16 -lz -ljpeg -lboost_filesystem -lboost_regex -lstdc++"
67
68 # Checks for libraries.
69
70 # Checks for header files.
71 AC_PATH_X
72 AC_CHECK_HEADERS([fcntl.h memory.h sys/time.h unistd.h])
73
74 # Checks for typedefs, structures, and compiler characteristics.
75 AC_CHECK_HEADER_STDBOOL
76 AC_C_INLINE
77 AC_TYPE_INT32_T
78 AC_TYPE_INT64_T
79 AC_TYPE_SIZE_T
80 AC_TYPE_SSIZE_T
81 AC_TYPE_UINT16_T
82 AC_TYPE_UINT32_T
83 AC_TYPE_UINT64_T
84 AC_TYPE_UINT8_T
85 AC_CHECK_TYPES([ptrdiff_t])
86
87 # Checks for library functions.
88 AC_FUNC_FORK
89 AC_FUNC_MALLOC
90 AC_FUNC_MMAP
91 AC_CHECK_FUNCS([dup2 floor gettimeofday memmove memset munmap pow realpath select sqrt strcasecmp strchr strdup strerror strncasecmp strrchr strstr])
92
93 # Must be last macro in the file.
94 AC_OUTPUT