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
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"
LDARCHFLAGS="$ARCHFLAGS"
fi
else
- LDARCHFLAGS="$with_archflags"
+ LDARCHFLAGS="$with_ldarchflags"
fi
AC_SUBST(ARCHFLAGS)
fi)
AC_SUBST(LIBCUPSIMAGEORDER)
+PHPOPTIONS=""
+AC_SUBST(PHPOPTIONS)
+
if test -n "$GCC"; then
# Add GCC-specific compiler options...
if test -z "$OPTIM"; 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
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...
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