OPTIM=""
AC_SUBST(OPTIM)
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
[if test x$enable_debug = xyes; then
OPTIM="-g"
fi])
AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
CXXLIBS=""
AC_SUBST(CXXLIBS)
if test -n "$GCC"; then
AC_MSG_CHECKING(if libsupc++ is required)
SUPC="`$CXX -print-file-name=libsupc++.a 2>/dev/null`"
case "$SUPC" in
libsupc++.a*)
AC_MSG_RESULT(no)
;;
*)
CXXLIBS="-lsupc++"
AC_MSG_RESULT(yes)
;;
esac
CXX="$CC"
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
if test $uname = HP-UX; then
OPTIM="-O1"
else
OPTIM="-O2"
fi
else
OPTIM="$with_optim $OPTIM"
fi
fi
if test $PICFLAG = 1 -a $uname != AIX; then
OPTIM="-fPIC $OPTIM"
fi
if test "x$with_optim" = x; then
OPTIM="-Wall $OPTIM"
fi
else
case $uname in
AIX*)
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O2 -qmaxmem=6000"
else
OPTIM="$with_optim $OPTIM"
fi
fi
;;
HP-UX*)
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="+O2"
else
OPTIM="$with_optim $OPTIM"
fi
fi
CFLAGS="-Ae $CFLAGS"
if test "x$with_optim" = x; then
OPTIM="+DAportable $OPTIM"
fi
if test $PICFLAG = 1; then
OPTIM="+z $OPTIM"
fi
;;
IRIX*)
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O2"
else
OPTIM="$with_optim $OPTIM"
fi
fi
if test $uversion -ge 62 -a "x$with_optim" = x; then
OPTIM="$OPTIM -n32 -mips3"
fi
if test "x$with_optim" = x; then
OPTIM="-fullwarn $OPTIM"
fi
;;
SunOS*)
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-xO4"
else
OPTIM="$with_optim $OPTIM"
fi
fi
if test "x$with_optim" = x; then
OPTIM="$OPTIM -xarch=generic"
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
;;
UNIX_SVR*)
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O"
else
OPTIM="$with_optim $OPTIM"
fi
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
;;
*)
echo "Building CUPS with default compiler optimizations; contact"
echo "cups-bugs@cups.org with uname and compiler options needed"
echo "for your platform, or set the CFLAGS and CXXFLAGS"
echo "environment variable before running configure."
;;
esac
fi
if test $uname = HP-UX; then
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
fi