1AC_PREREQ( 2.59 )
2
3AC_INIT(
4 [libsigscan],
5 [20210419],
6 [joachim.metz@gmail.com])
7
8AC_CONFIG_SRCDIR(
9 [include/libsigscan.h.in])
10
11AM_INIT_AUTOMAKE([gnu 1.6 tar-ustar])
12
13AC_CONFIG_MACRO_DIR([m4])
14
15dnl Check for host type
16AC_CANONICAL_HOST
17
18dnl Check for libtool DLL support
19AC_LIBTOOL_WIN32_DLL
20
21dnl Checks for programs
22AC_PROG_CC
23AC_PROG_GCC_TRADITIONAL
24AC_PROG_CXX
25AC_PROG_MAKE_SET
26AC_PROG_INSTALL
27
28dnl Check for libtool
29AC_PROG_LIBTOOL
30AC_SUBST(LIBTOOL_DEPS)
31
32dnl Check for pkg-config
33AC_PATH_PROG(PKGCONFIG,[pkg-config])
34
35dnl Support of internationalization (i18n)
36AM_GNU_GETTEXT([external])
37AM_GNU_GETTEXT_VERSION([0.18.1])
38
39dnl Check for compiler language support
40AC_C_CONST
41AC_C_VOLATILE
42
43dnl Check for large file support
44AC_SYS_LARGEFILE
45
46dnl Check if shared library support should be disabled
47AX_COMMON_CHECK_DISABLE_SHARED_LIBS
48
49dnl Check if tools should be build as static executables
50AX_COMMON_CHECK_ENABLE_STATIC_EXECUTABLES
51
52dnl Check if WINAPI support should be enabled
53AX_COMMON_CHECK_ENABLE_WINAPI
54
55dnl Check if wide character type should be enabled
56AX_COMMON_CHECK_ENABLE_WIDE_CHARACTER_TYPE
57
58dnl Check if verbose output should be enabled
59AX_COMMON_CHECK_ENABLE_VERBOSE_OUTPUT
60
61dnl Check if debug output should be enabled
62AX_COMMON_CHECK_ENABLE_DEBUG_OUTPUT
63
64dnl Check for type definitions
65AX_TYPES_CHECK_LOCAL
66
67dnl Check if common required headers and functions are available
68AX_COMMON_CHECK_LOCAL
69
70dnl Check if libcerror or required headers and functions are available
71AX_LIBCERROR_CHECK_ENABLE
72
73dnl Check if libcthreads or required headers and functions are available
74AX_LIBCTHREADS_CHECK_ENABLE
75
76dnl Check if libcdata or required headers and functions are available
77AX_LIBCDATA_CHECK_ENABLE
78
79dnl Check if libclocale or required headers and functions are available
80AX_LIBCLOCALE_CHECK_ENABLE
81
82dnl Check if libcnotify or required headers and functions are available
83AX_LIBCNOTIFY_CHECK_ENABLE
84
85dnl Check if libcsplit or required headers and functions are available
86AX_LIBCSPLIT_CHECK_ENABLE
87
88dnl Check if libuna or required headers and functions are available
89AX_LIBUNA_CHECK_ENABLE
90
91dnl Check if libcfile or required headers and functions are available
92AX_LIBCFILE_CHECK_ENABLE
93
94dnl Check if libcpath or required headers and functions are available
95AX_LIBCPATH_CHECK_ENABLE
96
97dnl Check if libbfio or required headers and functions are available
98AX_LIBBFIO_CHECK_ENABLE
99
100dnl Check if libsigscan required headers and functions are available
101AX_LIBSIGSCAN_CHECK_LOCAL
102
103dnl Check if libsigscan Python bindings (pysigscan) required headers and functions are available
104AX_PYTHON_CHECK_ENABLE
105
106AS_IF(
107  [test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno],
108  [dnl Headers included in pysigscan/pysigscan_error.c
109  AC_CHECK_HEADERS([stdarg.h varargs.h])
110
111  AS_IF(
112    [test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes],
113    [AC_MSG_FAILURE(
114      [Missing headers: stdarg.h and varargs.h],
115      [1])
116    ])
117  ])
118
119dnl Check if sigscantools required headers and functions are available
120AX_SIGSCANTOOLS_CHECK_LOCAL
121
122dnl Check if DLL support is needed
123AX_LIBSIGSCAN_CHECK_DLL_SUPPORT
124
125dnl Check if tests required headers and functions are available
126AX_TESTS_CHECK_LOCAL
127AX_TESTS_CHECK_OSSFUZZ
128
129dnl Set additional compiler flags
130CFLAGS="$CFLAGS -Wall";
131
132dnl Check if requires and build requires should be set in spec file
133AS_IF(
134 [test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes],
135 [AC_SUBST(
136  [libsigscan_spec_requires],
137  [Requires:])
138 ])
139
140dnl Set the date for the dpkg files
141AC_SUBST(
142 [DPKG_DATE],
143 [`date -R 2> /dev/null`])
144
145dnl Set the date for the spec file
146AC_SUBST(
147 [SPEC_DATE],
148 [`date +"%a %b %e %Y" 2> /dev/null`])
149
150dnl Generate Makefiles
151AC_CONFIG_FILES([Makefile])
152AC_CONFIG_FILES([include/Makefile])
153AC_CONFIG_FILES([common/Makefile])
154AC_CONFIG_FILES([libcerror/Makefile])
155AC_CONFIG_FILES([libcthreads/Makefile])
156AC_CONFIG_FILES([libcdata/Makefile])
157AC_CONFIG_FILES([libclocale/Makefile])
158AC_CONFIG_FILES([libcnotify/Makefile])
159AC_CONFIG_FILES([libcsplit/Makefile])
160AC_CONFIG_FILES([libuna/Makefile])
161AC_CONFIG_FILES([libcfile/Makefile])
162AC_CONFIG_FILES([libcpath/Makefile])
163AC_CONFIG_FILES([libbfio/Makefile])
164AC_CONFIG_FILES([libsigscan/Makefile])
165AC_CONFIG_FILES([pysigscan/Makefile])
166AC_CONFIG_FILES([pysigscan-python2/Makefile])
167AC_CONFIG_FILES([pysigscan-python3/Makefile])
168AC_CONFIG_FILES([sigscantools/Makefile])
169AC_CONFIG_FILES([po/Makefile.in])
170AC_CONFIG_FILES([po/Makevars])
171AC_CONFIG_FILES([manuals/Makefile])
172AC_CONFIG_FILES([tests/Makefile])
173AC_CONFIG_FILES([ossfuzz/Makefile])
174AC_CONFIG_FILES([msvscpp/Makefile])
175dnl Generate header files
176AC_CONFIG_FILES([include/libsigscan.h])
177AC_CONFIG_FILES([include/libsigscan/definitions.h])
178AC_CONFIG_FILES([include/libsigscan/features.h])
179AC_CONFIG_FILES([include/libsigscan/types.h])
180AC_CONFIG_FILES([libsigscan/libsigscan_definitions.h])
181dnl Generate distribution specific files
182AC_CONFIG_FILES([common/types.h])
183AC_CONFIG_FILES([dpkg/changelog])
184AC_CONFIG_FILES([libsigscan/libsigscan.rc])
185AC_CONFIG_FILES([libsigscan.pc])
186AC_CONFIG_FILES([libsigscan.spec])
187dnl Generate a source configuration file
188AC_CONFIG_HEADERS([common/config.h])
189
190AC_OUTPUT
191
192dnl Print a summary
193AC_MSG_NOTICE([
194Building:
195   libcerror support:                            $ac_cv_libcerror
196   libcthreads support:                          $ac_cv_libcthreads
197   libcdata support:                             $ac_cv_libcdata
198   libclocale support:                           $ac_cv_libclocale
199   libcnotify support:                           $ac_cv_libcnotify
200   libcsplit support:                            $ac_cv_libcsplit
201   libuna support:                               $ac_cv_libuna
202   libcfile support:                             $ac_cv_libcfile
203   libcpath support:                             $ac_cv_libcpath
204   libbfio support:                              $ac_cv_libbfio
205
206Features:
207   Multi-threading support:                      $ac_cv_libcthreads_multi_threading
208   Wide character type support:                  $ac_cv_enable_wide_character_type
209   sigscantools are build as static executables: $ac_cv_enable_static_executables
210   Python (pysigscan) support:                   $ac_cv_enable_python
211   Verbose output:                               $ac_cv_enable_verbose_output
212   Debug output:                                 $ac_cv_enable_debug_output
213]);
214
215