diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 310 |
1 files changed, 261 insertions, 49 deletions
diff --git a/configure.ac b/configure.ac index b9377b2..cfb94bd 100644 --- a/configure.ac +++ b/configure.ac @@ -6,8 +6,8 @@ m4_include([gitrev.m4]) -AC_PREREQ(2.59) -AC_INIT([chrysalide], [gitversion], [nocbos@gmail.com]) +AC_PREREQ([2.71]) +AC_INIT([chrysalide],[gitversion],[nocbos@gmail.com]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -33,7 +33,9 @@ AC_PROG_LEX AC_PROG_YACC AC_PROG_INSTALL AC_PROG_MAKE_SET -AC_PROG_LIBTOOL +LT_INIT + +CFLAGS="" AC_EGREP_CPP(yes, [#ifdef __PIE__ @@ -49,6 +51,11 @@ AC_PATH_PROG(YACC_INST, $YACC) AC_PATH_PROG(LEX_INST, $LEX) +#--- Checks for CPU + +AX_EXT + + #--- Checks for libraries AC_CHECK_LIB([dl], [dlopen]) @@ -58,7 +65,15 @@ AC_CHECK_LIB([dl], [dlopen]) AC_HEADER_DIRENT AC_HEADER_STDBOOL -AC_HEADER_STDC +m4_warn([obsolete], +[The preprocessor macro `STDC_HEADERS' is obsolete. + Except in unusual embedded environments, you can safely include all + ISO C90 headers unconditionally.])dnl +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. +AC_CHECK_INCLUDES_DEFAULT +AC_PROG_EGREP + AC_CHECK_HEADERS([malloc.h]) AC_CHECK_HEADERS([netdb.h]) AC_CHECK_HEADERS([stdlib.h]) @@ -214,6 +229,18 @@ AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [compile with debugging support [default=no]]), [], [enable_debug=no]) +AC_ARG_ENABLE([gtk-support], + AS_HELP_STRING([--disable-gtk-support], [disable GTK support [default=no]]), + [], [enable_gtk_support=yes]) + +AC_ARG_ENABLE([curl-support], + AS_HELP_STRING([--disable-curl-support], [disable cURL support [default=no]]), + [], [enable_curl_support=yes]) + +AC_ARG_ENABLE([magic-support], + AS_HELP_STRING([--disable-magic-support], [disable magic number recognition [default=no]]), + [], [enable_magic_support=yes]) + AC_ARG_ENABLE([python-bindings], AS_HELP_STRING([--disable-python-bindings], [disable Python bindings [default=no]]), [], [enable_python_bindings=yes]) @@ -234,7 +261,7 @@ AC_ARG_WITH([desktop-dir], AC_ARG_WITH([local-resources], AS_HELP_STRING([--with-local-resources], [define if built components located in the sources are used at runtime [default=no]]), - [with_local_resources=yes], [with_local_resources=no]) + [with_local_resources=$withval], [with_local_resources=no]) AM_CONDITIONAL([BUILD_PYTHON_PACKAGE], [test "x$build_python_package" = "xyes"]) @@ -249,52 +276,70 @@ if test "x$enable_rpath" = "xno"; then fi -#--- Small enumerations +#--- Small enumerations and other basic flags -CFLAGS="$CFLAGS -fshort-enums -D_LARGEFILE64_SOURCE" +CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" +CFLAGS="$CFLAGS -fshort-enums" -#--- Is debug mode needed ? -if test "x$with_gobject_leak_tracker" = "xyes"; then - enable_debug="yes" +#--- Build binaries for Python package only? + +if test "x$build_python_package" = "xyes"; then + CPPFLAGS="$CPPFLAGS -DPYTHON_PACKAGE" fi -if test "x$enable_debug" = "xyes"; then - DEBUG_CFLAGS="$DEBUG_CFLAGS -O0 -ggdb -gdwarf-2 -DDEBUG" -else - DEBUG_CFLAGS="$DEBUG_CFLAGS -DNDEBUG" + +#--- Discard local sources when looking for resources? + +if test "x$with_local_resources" = "xno"; then + CPPFLAGS="$CPPFLAGS -DDISCARD_LOCAL" fi -AC_SUBST(DEBUG_CFLAGS) + +#--- Is debug mode needed? AM_CONDITIONAL([TRACK_GOBJECT_LEAKS], [test "x$with_gobject_leak_tracker" = "xyes"]) if test "x$with_gobject_leak_tracker" = "xyes"; then - AC_DEFINE(TRACK_GOBJECT_LEAKS, 1, - [Define to 1 to enable code for dumping remaining GObject instances at exit.]) + # Enable code for dumping remaining GObject instances at exit + CPPFLAGS="$CPPFLAGS -DTRACK_GOBJECT_LEAKS" + enable_debug="yes" fi +if test "x$enable_debug" = "xyes"; then + DEBUG_CPPFLAGS="-DDEBUG" + DEBUG_CFLAGS="-O0 -ggdb -gdwarf-2" +else + DEBUG_CPPFLAGS="-Ofast -DNDEBUG" +fi -#--- Discard local sources when looking for resources ? -if test "x$build_python_package" = "xyes"; then - CFLAGS="$CFLAGS -DPYTHON_PACKAGE" -fi +#--- Compilation warnings -AC_SUBST(CFLAGS) +WARNING_CFLAGS="-Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wuninitialized -Wparentheses -Wpointer-arith -Wmissing-prototypes" +#-Wcast-qual -Wconversion -Wsign-compare -Wdisabled-optimization -#--- Discard local sources when looking for resources ? +# _BSD_SOURCE: htobe64, be64toh +# _XOPEN_SOURCE: strdup, snprintf +# _ISOC99_SOURCE: INFINITY; NAN +# _GNU_SOURCE: strcasestr +# GTK_DISABLE_DEPRECATED: on reste conforme au C99 +#COMPLIANCE_FLAGS="-D_BSD_SOURCE -D_GNU_SOURCE -DGTK_DISABLE_DEPRECATED" +COMPLIANCE_CPPFLAGS="-D_DEFAULT_SOURCE -D_GNU_SOURCE" -if test "x$with_local_resources" = "xno"; then - CFLAGS="$CFLAGS -DDISCARD_LOCAL" -fi +#--- Final exports + +CPPFLAGS="$CPPFLAGS $DEBUG_CPPFLAGS $COMPLIANCE_CPPFLAGS" +CFLAGS="$CFLAGS $DEBUG_CFLAGS $WARNING_CFLAGS" + +AC_SUBST(CPPFLAGS) AC_SUBST(CFLAGS) -#--- Custom destination for desktop resources ? +#--- Custom destination for desktop resources? if test "x$with_desktop_dir" != x; then DESKTOP_DATADIR=$with_desktop_dir @@ -306,26 +351,40 @@ AM_CONDITIONAL(DESKTOP_DATADIR, test "x$with_desktop_dir" != xno) AC_SUBST(DESKTOP_DATADIR) -#--- Compilation warnings +#--- Checks for GTK 3.0 / GObject 2.0 -#-Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wuninitialized -Wparentheses -Wpointer-arith -Wmissing-prototypes +AM_CONDITIONAL([BUILD_GTK_SUPPORT], [test "x$enable_gtk_support" = "xyes"]) -WARNING_FLAGS="-Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wuninitialized -Wparentheses -Wpointer-arith -Wmissing-prototypes" +if test "x$BUILD_GTK_SUPPORT_TRUE" = "x"; then + # GTK support is available and enabled + CPPFLAGS="$CPPFLAGS -DINCLUDE_GTK_SUPPORT" +fi -#-Wcast-qual -Wconversion -Wsign-compare -Wdisabled-optimization -AC_SUBST(WARNING_FLAGS) +PKG_CHECK_MODULES(LIBGOBJ,gobject-2.0 >= 2.66.8,[libgobj_found=yes],[libgobj_found=no]) -# _BSD_SOURCE: htobe64, be64toh -# _XOPEN_SOURCE: strdup, snprintf -# _ISOC99_SOURCE: INFINITY; NAN -# GTK_DISABLE_DEPRECATED: on reste conforme au C99 -#COMPLIANCE_FLAGS="-D_BSD_SOURCE -D_GNU_SOURCE -DGTK_DISABLE_DEPRECATED" -COMPLIANCE_FLAGS="-D_DEFAULT_SOURCE -D_GNU_SOURCE" +if test "$libgobj_found" = "yes"; then + libgobj_version=`pkg-config gobject-2.0 --modversion` +else + libgobj_version='-' +fi -AC_SUBST(COMPLIANCE_FLAGS) +PKG_CHECK_MODULES(LIBGTHREAD,gthread-2.0 >= 2.66.8,[libgthread_found=yes],[libgthread_found=no]) + +if test "$libgthread_found" = "yes"; then + libgthread_version=`pkg-config gthread-2.0 --modversion` +else + libgthread_version='-' +fi + +PKG_CHECK_MODULES(LIBGMOD,gmodule-2.0 >= 2.66.8,[libgmod_found=yes],[libgmod_found=no]) + +if test "$libgmod_found" = "yes"; then + libgmod_version=`pkg-config gmodule-2.0 --modversion` +else + libgmod_version='-' +fi -#--- Checks for GTK 2.0 PKG_CHECK_MODULES(LIBGTK,gtk+-3.0 >= 3.8.6,[libgtk_found=yes],[libgtk_found=no]) @@ -335,8 +394,24 @@ else libgtk_version='-' fi -AC_SUBST(LIBGTK_CFLAGS) -AC_SUBST(LIBGTK_LIBS) + +if test "x$enable_gtk_support" = "xyes"; then + + TOOLKIT_CFLAGS="$LIBGTK_CFLAGS $LIBGTHREAD_CFLAGS $LIBGMOD_CFLAGS" + TOOLKIT_LIBS="$LIBGTK_LIBS $LIBGTHREAD_LIBS $LIBGMOD_LIBS" + + AC_SUBST(TOOLKIT_CFLAGS) + AC_SUBST(TOOLKIT_LIBS) + +else + + TOOLKIT_CFLAGS="$LIBGOBJ_CFLAGS $LIBGTHREAD_CFLAGS $LIBGMOD_CFLAGS" + TOOLKIT_LIBS="$LIBGOBJ_LIBS $LIBGTHREAD_LIBS $LIBGMOD_LIBS" + + AC_SUBST(TOOLKIT_CFLAGS) + AC_SUBST(TOOLKIT_LIBS) + +fi #--- Checks for libxml2 @@ -383,10 +458,10 @@ AC_SUBST(LIBSQLITE_LIBS) #--- Checks for libssl -PKG_CHECK_MODULES(LIBSSL,libssl >= 1.0.1k,[libssl_found=yes],[libssl_found=no]) +PKG_CHECK_MODULES(LIBSSL,openssl >= 3.0.9,[libssl_found=yes],[libssl_found=no]) if test "$libssl_found" = "yes"; then - libssl_version=`pkg-config libssl --modversion` + libssl_version=`pkg-config openssl --modversion` else libssl_version='-' fi @@ -397,6 +472,14 @@ AC_SUBST(LIBSSL_LIBS) #--- Checks for libcurl +AM_CONDITIONAL([BUILD_CURL_SUPPORT], [test "x$enable_curl_support" = "xyes"]) + +if test "x$BUILD_CURL_SUPPORT_TRUE" = "x"; then + # cURL support is available and enabled + CPPFLAGS="$CPPFLAGS -DINCLUDE_CURL_SUPPORT" +fi + + PKG_CHECK_MODULES(LIBCURL,libcurl >= 7.64,[libcurl_found=yes],[libcurl_found=no]) if test "$libcurl_found" = "yes"; then @@ -405,8 +488,71 @@ else libcurl_version='-' fi -AC_SUBST(LIBCURL_CFLAGS) -AC_SUBST(LIBCURL_LIBS) +if test "x$enable_curl_support" = "xyes"; then + + AC_SUBST(LIBCURL_CFLAGS) + AC_SUBST(LIBCURL_LIBS) + + true # empty if/then body not allowed + +fi + + +#--- Checks for libyaml + +PKG_CHECK_MODULES(LIBYAML,yaml-0.1 >= 0.2.5,[libyaml_found=yes],[libyaml_found=no]) + +if test "$libyaml_found" = "yes"; then + libyaml_version=`pkg-config yaml-0.1 --modversion` +else + libyaml_version='-' +fi + +AC_SUBST(LIBYAML_CFLAGS) +AC_SUBST(LIBYAML_LIBS) + + +#--- Checks for libmagic + +AM_CONDITIONAL([BUILD_MAGIC_SUPPORT], [test "x$enable_magic_support" = "xyes"]) + +if test "x$BUILD_MAGIC_SUPPORT_TRUE" = "x"; then + # Magic support is available and enabled + CPPFLAGS="$CPPFLAGS -DINCLUDE_MAGIC_SUPPORT" +fi + + +PKG_CHECK_MODULES(LIBMAGIC,libmagic >= 5.44,[libmagic_found=yes],[libmagic_found=no]) + +if test "$libmagic_found" = "yes"; then + libmagic_version=`pkg-config libmagic --modversion` +else + libmagic_version='-' +fi + + +if test "x$enable_magic_support" = "xyes"; then + + AC_SUBST(LIBMAGIC_CFLAGS) + AC_SUBST(LIBMAGIC_LIBS) + + true # empty if/then body not allowed + +fi + + +#--- Checks for Hyperscan + +PKG_CHECK_MODULES(LIBHS,libhs >= 5.4.9,[libhs_found=yes],[libhs_found=no]) + +if test "$libhs_found" = "yes"; then + libhs_version=`pkg-config libhs --modversion` +else + libhs_version='-' +fi + +AC_SUBST(LIBHS_CFLAGS) +AC_SUBST(LIBHS_LIBS) #--- Checks for Python @@ -420,8 +566,8 @@ fi AM_CONDITIONAL([BUILD_PYTHON3_BINDINGS], [test "x$enable_python_bindings$python3_cfg_binary" = "xyesyes"]) if test "x$BUILD_PYTHON3_BINDINGS_TRUE" = "x"; then - AC_DEFINE(HAVE_PYTHON3_BINDINGS, 1, - [Define to 1 if the Python bindings are available and enabled.]) + # Python bindings are available and enabled + CPPFLAGS="$CPPFLAGS -DINCLUDE_PYTHON3_BINDINGS" fi if test "x$python3_cfg_binary" = "xyes"; then @@ -434,7 +580,7 @@ if test "x$python3_cfg_binary" = "xyes"; then LIBPYTHON_CFLAGS=`$pyprefix-config --cflags` LIBPYTHON_LIBS=`$pyprefix-config --libs` - LIBPYTHON_INTERPRETER_CFLAGS=`$pyprefix-config --cflags --embed` + LIBPYTHON_INTERPRETER_CFLAGS="`$pyprefix-config --cflags --embed` -DPY_SSIZE_T_CLEAN" LIBPYTHON_INTERPRETER_LIBS=`$pyprefix-config --libs --embed` LIBPYTHON_ABI_FLAGS=`$pyprefix-config --abiflags` pythondep=$pyprefix @@ -498,6 +644,12 @@ AC_CONFIG_FILES([Makefile doc/Makefile pixmaps/Makefile plugins/Makefile + plugins/apihashing/Makefile + plugins/apihashing/classics/Makefile + plugins/apihashing/custom/Makefile + plugins/apihashing/python/Makefile + plugins/apihashing/python/classics/Makefile + plugins/apihashing/python/custom/Makefile plugins/arm/Makefile plugins/arm/python/Makefile plugins/arm/python/v7/Makefile @@ -527,6 +679,10 @@ AC_CONFIG_FILES([Makefile plugins/dwarf/v2/Makefile plugins/dwarf/v3/Makefile plugins/dwarf/v4/Makefile + plugins/encodings/Makefile + plugins/encodings/python/Makefile + plugins/encodings/python/rost/Makefile + plugins/encodings/rost/Makefile plugins/elf/Makefile plugins/elf/python/Makefile plugins/fmtp/Makefile @@ -537,6 +693,14 @@ AC_CONFIG_FILES([Makefile plugins/java/Makefile plugins/javadesc/Makefile plugins/javadesc/python/Makefile + plugins/kaitai/Makefile + plugins/kaitai/parsers/Makefile + plugins/kaitai/records/Makefile + plugins/kaitai/rost/Makefile + plugins/kaitai/python/Makefile + plugins/kaitai/python/parsers/Makefile + plugins/kaitai/python/records/Makefile + plugins/kaitai/python/rost/Makefile plugins/libcsem/Makefile plugins/lnxsyscalls/Makefile plugins/mobicore/Makefile @@ -548,6 +712,11 @@ AC_CONFIG_FILES([Makefile plugins/pychrysalide/analysis/db/Makefile plugins/pychrysalide/analysis/db/items/Makefile plugins/pychrysalide/analysis/disass/Makefile + plugins/pychrysalide/analysis/scan/Makefile + plugins/pychrysalide/analysis/scan/exprs/Makefile + plugins/pychrysalide/analysis/scan/patterns/Makefile + plugins/pychrysalide/analysis/scan/patterns/backends/Makefile + plugins/pychrysalide/analysis/scan/patterns/modifiers/Makefile plugins/pychrysalide/analysis/storage/Makefile plugins/pychrysalide/analysis/types/Makefile plugins/pychrysalide/arch/Makefile @@ -589,6 +758,20 @@ AC_CONFIG_FILES([Makefile src/analysis/disass/Makefile src/analysis/human/Makefile src/analysis/human/asm/Makefile + src/analysis/scan/Makefile + src/analysis/scan/exprs/Makefile + src/analysis/scan/items/Makefile + src/analysis/scan/items/console/Makefile + src/analysis/scan/items/magic/Makefile + src/analysis/scan/items/math/Makefile + src/analysis/scan/items/string/Makefile + src/analysis/scan/items/time/Makefile + src/analysis/scan/matches/Makefile + src/analysis/scan/patterns/Makefile + src/analysis/scan/patterns/backends/Makefile + src/analysis/scan/patterns/modifiers/Makefile + src/analysis/scan/patterns/tokens/Makefile + src/analysis/scan/patterns/tokens/nodes/Makefile src/analysis/storage/Makefile src/analysis/types/Makefile src/arch/Makefile @@ -622,6 +805,8 @@ AC_CONFIG_FILES([Makefile tools/d2c/id/Makefile tools/d2c/pattern/Makefile tools/d2c/rules/Makefile + tools/fuzzing/rost/Makefile + tools/yara2rost/Makefile system/Makefile system/desktop/Makefile system/pkgconfig/Makefile @@ -640,12 +825,18 @@ echo -n $PACKAGE r echo AC_PACKAGE_VERSION echo +echo The GLib type, object and signal library..... : $libgobj_version +echo The thread support for GLib.................. : $libgthread_version +echo The dynamic module loader for GLib........... : $libgmod_version echo The GNU Image Manipulation Program Toolkit... : $libgtk_version echo The XML C parser and toolkit of Gnome........ : $libxml_version echo The flexible interface for archives I/O...... : $libarchive_version echo The small, fast and reliable database engine. : $libsqlite_version echo The cryptography and SSL/TLS toolkit......... : $libssl_version echo The client URL library....................... : $libcurl_version +echo The YAML support library..................... : $libyaml_version +echo The magic number recognition library......... : $libmagic_version +echo The high-performance matching library........ : $libhs_version echo echo Available Python programming language........ : $python3_version @@ -655,6 +846,24 @@ echo echo Found lexical analyzer generator............. : $LEX_INST echo Found general-purpose parser generator....... : $YACC_INST +if test "x$enable_gtk_support" = "xyes"; then + disable_gtk_support="no" +else + disable_gtk_support="yes" +fi + +if test "x$enable_curl_support" = "xyes"; then + disable_curl_support="no" +else + disable_curl_support="yes" +fi + +if test "x$enable_magic_support" = "xyes"; then + disable_magic_support="no" +else + disable_magic_support="yes" +fi + if test "x$enable_python_bindings" = "xyes"; then disable_python_bindings="no" else @@ -664,6 +873,9 @@ fi echo echo Print debugging messages..................... : $enable_debug echo Consider local resources..................... : $with_local_resources +echo Disable GTK support.......................... : $disable_gtk_support +echo Disable cURL support......................... : $disable_curl_support +echo Disable Magic support........................ : $disable_magic_support echo Disable Python bindings...................... : $disable_python_bindings echo Build a Python binary distribution........... : $build_python_package |