You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

274 lines
8.5 KiB

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