1AC_PREREQ( 2.59 )
2
3AC_INIT(
4 [libmsiecf],
5 [20210420],
6 [joachim.metz@gmail.com])
7
8AC_CONFIG_SRCDIR(
9 [include/libmsiecf.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 libfdatetime or required headers and functions are available
101AX_LIBFDATETIME_CHECK_ENABLE
102
103dnl Check if libfguid or required headers and functions are available
104AX_LIBFGUID_CHECK_ENABLE
105
106dnl Check if libfole or required headers and functions are available
107AX_LIBFOLE_CHECK_ENABLE
108
109dnl Check if libfvalue or required headers and functions are available
110AX_LIBFVALUE_CHECK_ENABLE
111
112dnl Check if libmsiecf required headers and functions are available
113AX_LIBMSIECF_CHECK_LOCAL
114
115dnl Check if libmsiecf Python bindings (pymsiecf) required headers and functions are available
116AX_PYTHON_CHECK_ENABLE
117
118AS_IF(
119  [test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno],
120  [dnl Headers included in pymsiecf/pymsiecf_error.c
121  AC_CHECK_HEADERS([stdarg.h varargs.h])
122
123  AS_IF(
124    [test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes],
125    [AC_MSG_FAILURE(
126      [Missing headers: stdarg.h and varargs.h],
127      [1])
128    ])
129  ])
130
131dnl Check if msiecftools required headers and functions are available
132AX_MSIECFTOOLS_CHECK_LOCAL
133
134dnl Check if DLL support is needed
135AX_LIBMSIECF_CHECK_DLL_SUPPORT
136
137dnl Check if tests required headers and functions are available
138AX_TESTS_CHECK_LOCAL
139AX_TESTS_CHECK_OSSFUZZ
140
141dnl Set additional compiler flags
142CFLAGS="$CFLAGS -Wall";
143
144dnl Check if requires and build requires should be set in spec file
145AS_IF(
146 [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 || test "x$ac_cv_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfole" = xyes || test "x$ac_cv_libfvalue" = xyes],
147 [AC_SUBST(
148  [libmsiecf_spec_requires],
149  [Requires:])
150 ])
151
152dnl Set the date for the dpkg files
153AC_SUBST(
154 [DPKG_DATE],
155 [`date -R 2> /dev/null`])
156
157dnl Set the date for the spec file
158AC_SUBST(
159 [SPEC_DATE],
160 [`date +"%a %b %e %Y" 2> /dev/null`])
161
162dnl Generate Makefiles
163AC_CONFIG_FILES([Makefile])
164AC_CONFIG_FILES([include/Makefile])
165AC_CONFIG_FILES([common/Makefile])
166AC_CONFIG_FILES([libcerror/Makefile])
167AC_CONFIG_FILES([libcthreads/Makefile])
168AC_CONFIG_FILES([libcdata/Makefile])
169AC_CONFIG_FILES([libclocale/Makefile])
170AC_CONFIG_FILES([libcnotify/Makefile])
171AC_CONFIG_FILES([libcsplit/Makefile])
172AC_CONFIG_FILES([libuna/Makefile])
173AC_CONFIG_FILES([libcfile/Makefile])
174AC_CONFIG_FILES([libcpath/Makefile])
175AC_CONFIG_FILES([libbfio/Makefile])
176AC_CONFIG_FILES([libfdatetime/Makefile])
177AC_CONFIG_FILES([libfguid/Makefile])
178AC_CONFIG_FILES([libfole/Makefile])
179AC_CONFIG_FILES([libfvalue/Makefile])
180AC_CONFIG_FILES([libmsiecf/Makefile])
181AC_CONFIG_FILES([pymsiecf/Makefile])
182AC_CONFIG_FILES([pymsiecf-python2/Makefile])
183AC_CONFIG_FILES([pymsiecf-python3/Makefile])
184AC_CONFIG_FILES([msiecftools/Makefile])
185AC_CONFIG_FILES([po/Makefile.in])
186AC_CONFIG_FILES([po/Makevars])
187AC_CONFIG_FILES([manuals/Makefile])
188AC_CONFIG_FILES([tests/Makefile])
189AC_CONFIG_FILES([ossfuzz/Makefile])
190AC_CONFIG_FILES([msvscpp/Makefile])
191dnl Generate header files
192AC_CONFIG_FILES([include/libmsiecf.h])
193AC_CONFIG_FILES([include/libmsiecf/definitions.h])
194AC_CONFIG_FILES([include/libmsiecf/features.h])
195AC_CONFIG_FILES([include/libmsiecf/types.h])
196AC_CONFIG_FILES([libmsiecf/libmsiecf_definitions.h])
197dnl Generate distribution specific files
198AC_CONFIG_FILES([common/types.h])
199AC_CONFIG_FILES([dpkg/changelog])
200AC_CONFIG_FILES([libmsiecf/libmsiecf.rc])
201AC_CONFIG_FILES([libmsiecf.pc])
202AC_CONFIG_FILES([libmsiecf.spec])
203dnl Generate a source configuration file
204AC_CONFIG_HEADERS([common/config.h])
205
206AC_OUTPUT
207
208dnl Print a summary
209AC_MSG_NOTICE([
210Building:
211   libcerror support:                           $ac_cv_libcerror
212   libcthreads support:                         $ac_cv_libcthreads
213   libcdata support:                            $ac_cv_libcdata
214   libclocale support:                          $ac_cv_libclocale
215   libcnotify support:                          $ac_cv_libcnotify
216   libcsplit support:                           $ac_cv_libcsplit
217   libuna support:                              $ac_cv_libuna
218   libcfile support:                            $ac_cv_libcfile
219   libcpath support:                            $ac_cv_libcpath
220   libbfio support:                             $ac_cv_libbfio
221   libfdatetime support:                        $ac_cv_libfdatetime
222   libfguid support:                            $ac_cv_libfguid
223   libfole support:                             $ac_cv_libfole
224   libfvalue support:                           $ac_cv_libfvalue
225
226Features:
227   Multi-threading support:                     $ac_cv_libcthreads_multi_threading
228   Wide character type support:                 $ac_cv_enable_wide_character_type
229   msiecftools are build as static executables: $ac_cv_enable_static_executables
230   Python (pymsiecf) support:                   $ac_cv_enable_python
231   Verbose output:                              $ac_cv_enable_verbose_output
232   Debug output:                                $ac_cv_enable_debug_output
233]);
234
235