2 dnl "$Id: cups-compiler.m4 4915 2006-01-11 15:57:53Z mike $"
4 dnl Compiler stuff for the Common UNIX Printing System (CUPS).
6 dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636 USA
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
25 dnl Clear the debugging and non-shared library options unless the user asks
30 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
31 [if test x$enable_debug = xyes; then
35 AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
37 dnl Update compiler options...
41 if test -n "$GCC"; then
42 if test -z "$OPTIM"; then
43 if test "x$with_optim" = x; then
44 # Default to optimize-for-size and debug
47 OPTIM="$with_optim $OPTIM"
51 if test $PICFLAG = 1 -a $uname != AIX; then
57 if test "x$with_optim" = x; then
58 if test "x`uname -m`" = xi386; then
59 # Build universal binaries for OSX on Intel...
60 OPTIM="-arch i386 -arch ppc $OPTIM"
61 DSOFLAGS="-arch i386 -arch ppc $DSOFLAGS"
67 AC_MSG_CHECKING(if GCC supports -fpie)
70 CFLAGS="$CFLAGS -fpie"
73 LDFLAGS="$LDFLAGS -pie"
80 if test "x$with_optim" = x; then
81 # Add useful warning options for tracking down problems...
82 OPTIM="-Wall -Wno-format-y2k $OPTIM"
83 # Additional warning options for alpha testing...
84 OPTIM="-Wshadow -Wunused $OPTIM"
89 if test -z "$OPTIM"; then
90 if test "x$with_optim" = x; then
91 OPTIM="-O2 -qmaxmem=6000"
93 OPTIM="$with_optim $OPTIM"
98 if test -z "$OPTIM"; then
99 if test "x$with_optim" = x; then
102 OPTIM="$with_optim $OPTIM"
108 if test "x$with_optim" = x; then
109 OPTIM="+DAportable $OPTIM"
112 if test $PICFLAG = 1; then
117 if test -z "$OPTIM"; then
118 if test "x$with_optim" = x; then
121 OPTIM="$with_optim $OPTIM"
125 if test $uversion -ge 62 -a "x$with_optim" = x; then
126 OPTIM="$OPTIM -n32 -mips3"
129 if test "x$with_optim" = x; then
130 # Show most warnings, but suppress the
131 # ones about arguments not being used,
132 # string constants assigned to const
133 # char *'s, etc. We only set the warning
134 # options on IRIX 6.2 and higher because
135 # of limitations in the older SGI compiler
137 if test $uversion -ge 62; then
138 OPTIM="-fullwarn -woff 1183,1209,1349,3201 $OPTIM"
144 if test -z "$OPTIM"; then
145 if test "x$with_optim" = x; then
148 OPTIM="$with_optim $OPTIM"
152 if test "x$with_optim" = x; then
153 # Specify "generic" SPARC output and suppress
154 # all of Sun's questionable warning messages...
155 OPTIM="-w $OPTIM -xarch=generic"
158 if test $PICFLAG = 1; then
164 if test -z "$OPTIM"; then
165 if test "x$with_optim" = x; then
168 OPTIM="$with_optim $OPTIM"
172 if test $PICFLAG = 1; then
177 # Running some other operating system; inform the user they
178 # should contribute the necessary options to
179 # cups-support@cups.org...
180 echo "Building CUPS with default compiler optimizations; contact"
181 echo "cups-bugs@cups.org with uname and compiler options needed"
182 echo "for your platform, or set the CFLAGS and CXXFLAGS"
183 echo "environment variable before running configure."
188 if test $uname = HP-UX; then
189 # HP-UX 10.20 (at least) needs this definition to get the
191 OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
193 # HP-UX 11.00 (at least) needs this definition to get the
194 # u_short type used by the IP headers...
195 OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
199 dnl End of "$Id: cups-compiler.m4 4915 2006-01-11 15:57:53Z mike $".