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