]> 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 07faa0c4b69ef9ad90827f31f012157f2330942f..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
@@ -21,12 +21,29 @@ AC_SUBST(INSTALL_STRIP)
 AC_SUBST(OPTIM)
 
 AC_ARG_WITH(optim, [  --with-optim="flags"    set optimization flags ])
-AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging, default=no],
-       [if test x$enable_debug = xyes; then
-               OPTIM="-g"
-       else
-               INSTALL_STRIP="-s"
-       fi])
+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"
+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"
@@ -48,7 +65,7 @@ if test -z "$with_ldarchflags"; then
                LDARCHFLAGS="$ARCHFLAGS"
        fi
 else
-       LDARCHFLAGS="$with_archflags"
+       LDARCHFLAGS="$with_ldarchflags"
 fi
 
 AC_SUBST(ARCHFLAGS)
@@ -93,6 +110,9 @@ AC_ARG_WITH(libcupsimageorder, [  --with-libcupsimagesorder
        fi)
 AC_SUBST(LIBCUPSIMAGEORDER)
 
+PHPOPTIONS=""
+AC_SUBST(PHPOPTIONS)
+
 if test -n "$GCC"; then
        # Add GCC-specific compiler options...
        if test -z "$OPTIM"; then
@@ -139,6 +159,8 @@ 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
 
@@ -522,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...
@@ -530,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