]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-compiler.m4
Merge changes from CUPS 1.4svn-r7874.
[thirdparty/cups.git] / config-scripts / cups-compiler.m4
index 004a0990c666ed14669bef9c2b541befc959522b..2781e18bab2de1729c94516eff3d25c1d6e01c60 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-compiler.m4 6975 2007-09-18 20:37:09Z mike $"
+dnl "$Id: cups-compiler.m4 7644 2008-06-16 17:15:47Z mike $"
 dnl
 dnl   Compiler stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -22,15 +22,29 @@ AC_SUBST(OPTIM)
 
 AC_ARG_WITH(optim, [  --with-optim="flags"    set optimization flags ])
 AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging, default=no])
+AC_ARG_ENABLE(debug_printfs, [  --enable-debug-printfs  turn on debug printfs, default=no])
+AC_ARG_ENABLE(unit_tests, [  --enable-unit-tests     turn on unit tests, default=no])
 
 dnl For debugging, keep symbols, otherwise strip them...
 if test x$enable_debug = xyes; then
        OPTIM="-g"
-       CFLAGS="$CFLAGS -DDEBUG"
 else
        INSTALL_STRIP="-s"
 fi
 
+dnl Debug printfs can slow things down, so provide a separate option for that
+if test x$enable_debug_printf = xyes; then
+       CFLAGS="$CFLAGS -DDEBUG"
+fi
+
+dnl Unit tests take up time during a compile...
+if test x$enable_unit_tests = xyes; then
+       UNITTESTS="unittests"
+else
+       UNITTESTS=""
+fi
+AC_SUBST(UNITTESTS)
+
 dnl Setup general architecture flags...
 AC_ARG_WITH(archflags, [  --with-archflags="flags"
                           set default architecture flags ])
@@ -145,6 +159,7 @@ if test -n "$GCC"; then
                # Additional warning options for development testing...
                if test -d .svn; then
                        OPTIM="-Wshadow -Wunused $OPTIM"
+                       CFLAGS="-Werror-implicit-function-declaration $CFLAGS"
                        PHPOPTIONS="-Wno-shadow"
                fi
        fi
@@ -529,6 +544,12 @@ case $uname in
                OPTIM="$OPTIM -D_HPUX_SOURCE"
                ;;
 
+       Linux*)
+               # glibc 2.8 and higher breaks peer credentials unless you
+               # define _GNU_SOURCE...
+               OPTIM="$OPTIM -D_GNU_SOURCE"
+               ;;
+
        OSF*)
                # Tru64 UNIX aka Digital UNIX aka OSF/1 need to be told
                # to be POSIX-compliant...
@@ -537,5 +558,5 @@ case $uname in
 esac
 
 dnl
-dnl End of "$Id: cups-compiler.m4 6975 2007-09-18 20:37:09Z mike $".
+dnl End of "$Id: cups-compiler.m4 7644 2008-06-16 17:15:47Z mike $".
 dnl