diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 3b34e62..be33655 100644 --- a/configure.ac +++ b/configure.ac @@ -8,13 +8,31 @@ AM_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC +# Debug mode +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug], + [Compile binaries in debug mode])) + +if test "$enable_debug" = "yes"; then + CFLAGS="$CFLAGS -g -O0" + AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode]) + echo "enabling debug compile mode" +fi + # Checks for libraries. -AC_CHECK_LIB([kvm], [kvm_open]) +AC_CHECK_LIB([kvm], [kvm_open], , + [ echo "ERROR: Must have FreeBSD 4.x or higher"; exit 1]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([syslog.h path.h fcntl.h limits.h sys/param.h]) +# Check for jail stuff and figure out jail capabilities +AC_CHECK_LIB([c], [jail], , + [ echo "ERROR: Must have jail capabilities (FreeBSD 4.x or higher)"; exit 1]) +AC_CHECK_LIB([c], [jail_attach], + [ JAIL_ATTACH=yes; ], ) + # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T @@ -28,6 +46,13 @@ AC_FUNC_MALLOC AC_STRUCT_TM -AC_CONFIG_FILES([Makefile src/Makefile]) +if test "$JAIL_ATTACH" = "yes"; then + SRC_SUB=srcx +else + SRC_SUB=src +fi + +AC_SUBST([SRC_SUB]) +AC_CONFIG_FILES([Makefile src/Makefile srcx/Makefile]) AC_OUTPUT |