--- libaitsess/configure.in 2008/09/30 20:11:27 1.1.2.1 +++ libaitsess/configure.in 2011/04/30 21:35:21 1.2 @@ -1,6 +1,6 @@ # # $Author: misho $ -# $Id: configure.in,v 1.1.2.1 2008/09/30 20:11:27 misho Exp $ +# $Id: configure.in,v 1.2 2011/04/30 21:35:21 misho Exp $ # AC_INIT(libaitsess, 2.0, misho@openbsd-bg.org) AC_CONFIG_SRCDIR([src/aitsess.c]) @@ -32,6 +32,20 @@ AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([bzero memset munmap]) +# It's stupid, but not all platforms have union semun, even those that need it. +AC_MSG_CHECKING(looking for union semun in sys/sem.h) +AC_TRY_COMPILE([ + #include + #include + #include + ],[ + union semun arg; + semctl(0, 0, 0, arg); + ], [ + AC_DEFINE(HAVE_UNION_SEMUN,, [union semun]) + ] msg=yes, msg=no ) +AC_MSG_RESULT([$msg]) + DEBUG=no AC_MSG_CHECKING(Debug Build) AC_ARG_ENABLE(debug, @@ -40,6 +54,7 @@ AC_ARG_ENABLE(debug, case "$enableval" in yes) AC_DEFINE(__DEBUG,, [Build libraries with debug information and additional messages]) + CFLAGS="-g ${CFLAGS}" ;; *) ;;