diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 60 |
1 files changed, 55 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 40d6a61..0b3f3c0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,12 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -m4_define([procenv_version], 0.43) +m4_define([procenv_version], [0.50]) + +AC_INIT(procenv,[procenv_version],[jamesodhunt@ubuntu.com],,[https://github.com/jamesodhunt/procenv]) + +AC_COPYRIGHT([Copyright (C) 2012-2017 James Hunt <jamesodhunt@ubuntu.com> and Kees Cook <kees@ubuntu.com>]) -AC_INIT(procenv, [procenv_version], [jamesodhunt@ubuntu.com], , https://github.com/jamesodhunt/procenv) -AC_COPYRIGHT([Copyright (C) 2012-2015 James Hunt <jamesodhunt@ubuntu.com> and Kees Cook <kees@ubuntu.com>]) AC_CONFIG_SRCDIR([src/procenv.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) @@ -15,6 +17,9 @@ AC_SUBST(PROCENV_VERSION, procenv_version) AC_GNU_SOURCE AC_SYS_LARGEFILE +# expose $target +AC_CANONICAL_TARGET + #--------------------------------------------------------------------- # Checks for programs. AC_PROG_CC @@ -38,7 +43,7 @@ AC_CHECK_HEADERS(pthread.h,, [AC_MSG_ERROR([pthread.h required])]) AC_HEADER_STDBOOL # Checks for library functions. -AC_CHECK_FUNCS([clock_gettime getcwd localtime_r strcasecmp strchr strstr sched_getcpu]) +AC_CHECK_FUNCS([clock_gettime getcwd localtime_r strcasecmp strchr strstr sched_getcpu ttyname getresuid getresgid cpuset_alloc]) # BSD process inspection library AC_SEARCH_LIBS([kvm_openfiles], [kvm], @@ -72,6 +77,10 @@ AC_SEARCH_LIBS([aa_gettaskcon], [apparmor], [HAVE_APPARMOR=yes], [HAVE_APPARMOR=no]) +AC_SEARCH_LIBS([clock_gettime], [rt], + [HAVE_LIBRT=yes], + [HAVE_LIBRT=no]) + AM_CONDITIONAL([HAVE_APPARMOR], [test x$HAVE_APPARMOR = xtrue]) AC_CHECK_HEADERS([sys/apparmor.h]) @@ -144,6 +153,44 @@ if test "$reproducible_build" = yes; then AC_DEFINE([PROCENV_REPRODUCIBLE_BUILD], [1], [Generate a reproducible build]) fi +AC_ARG_WITH([forced_driver], + AS_HELP_STRING([--with-forced-driver=...], + [Used to force a particular platform driver. Warning: These aren't the droids you're looking for...])) + +target_to_consider="$target" + +AS_IF([test "x$with_forced_driver" != "x"], [ + target_to_consider="$withval" + ]) + +#--------------------------------------------------------------------- +# Determine platform + +case "$target_to_consider" in + *darwin*) procenv_platform=darwin;; + *freebsd*) procenv_platform=freebsd;; + + # BUG: FIXME: this test does not look reliable! + *hurd*|*unknown-gnu*) procenv_platform=hurd;; + + *linux*) procenv_platform=linux;; + *minix*) procenv_platform=minix;; + *netbsd*) procenv_platform=netbsd;; + *openbsd*) procenv_platform=openbsd;; + *) procenv_platform=unknown;; +esac + +AM_CONDITIONAL([PROCENV_PLATFORM_DARWIN], [test "$procenv_platform" = darwin]) +AM_CONDITIONAL([PROCENV_PLATFORM_FREEBSD], [test "$procenv_platform" = freebsd]) +AM_CONDITIONAL([PROCENV_PLATFORM_HURD], [test "$procenv_platform" = hurd]) +AM_CONDITIONAL([PROCENV_PLATFORM_NETBSD], [test "$procenv_platform" = netbsd]) +AM_CONDITIONAL([PROCENV_PLATFORM_OPENBSD], [test "$procenv_platform" = openbsd]) +AM_CONDITIONAL([PROCENV_PLATFORM_LINUX], [test "$procenv_platform" = linux]) +AM_CONDITIONAL([PROCENV_PLATFORM_MINIX], [test "$procenv_platform" = minix]) +AM_CONDITIONAL([PROCENV_PLATFORM_GENERIC], [test "$procenv_platform" = unknown]) + +AC_SUBST([procenv_platform]) + #--------------------------------------------------------------------- # XXX: Dump details of the preprocess/compiler/linker *NOW* so that if # procenv fails to build later, the build logs will show details of the @@ -165,9 +212,12 @@ AC_OUTPUT(Makefile src/Makefile procenv.spec) AC_MSG_RESULT([ Configure settings for $PACKAGE_NAME version $VERSION + Build platform : $procenv_platform Reproducible build : ${reproducible_build} Debug build : ${DEBUG_BUILD} - Check Unit Test Framework : ${HAVE_CHECK} + Check unit test framework : ${HAVE_CHECK} + + Libraries: libapparmor : ${HAVE_APPARMOR} libselinux : ${HAVE_SELINUX} |