2 dnl "$Id: cups-compiler.m4 4953 2006-01-19 20:30:48Z 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_WITH(optim, [ --with-optim="flags" set optimization flags ])
32 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
33 [if test x$enable_debug = xyes; then
37 AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fpie option, default=no])
39 dnl Update compiler options...
43 if test -n "$GCC"; then
44 if test -z "$OPTIM"; then
45 if test "x$with_optim" = x; then
46 # Default to optimize-for-size and debug
49 OPTIM="$with_optim $OPTIM"
53 if test $PICFLAG = 1 -a $uname != AIX; then
59 if test "x$with_optim" = x; then
60 if test "x`uname -m`" = xi386; then
61 # Build universal binaries for OSX on Intel...
62 OPTIM="-arch i386 -arch ppc $OPTIM"
63 DSOFLAGS="-arch i386 -arch ppc $DSOFLAGS"
69 if test x$enable_pie = xyes; then
71 LDFLAGS="$LDFLAGS -pie"
76 if test "x$with_optim" = x; then
77 # Add useful warning options for tracking down problems...
78 OPTIM="-Wall -Wno-format-y2k $OPTIM"
79 # Additional warning options for alpha testing...
80 OPTIM="-Wshadow -Wunused $OPTIM"
85 if test -z "$OPTIM"; then
86 if test "x$with_optim" = x; then
87 OPTIM="-O2 -qmaxmem=6000"
89 OPTIM="$with_optim $OPTIM"
94 if test -z "$OPTIM"; then
95 if test "x$with_optim" = x; then
98 OPTIM="$with_optim $OPTIM"
104 if test "x$with_optim" = x; then
105 OPTIM="+DAportable $OPTIM"
108 if test $PICFLAG = 1; then
113 if test -z "$OPTIM"; then
114 if test "x$with_optim" = x; then
117 OPTIM="$with_optim $OPTIM"
121 if test $uversion -ge 62 -a "x$with_optim" = x; then
122 OPTIM="$OPTIM -n32 -mips3"
125 if test "x$with_optim" = x; then
126 # Show most warnings, but suppress the
127 # ones about arguments not being used,
128 # string constants assigned to const
129 # char *'s, etc. We only set the warning
130 # options on IRIX 6.2 and higher because
131 # of limitations in the older SGI compiler
133 if test $uversion -ge 62; then
134 OPTIM="-fullwarn -woff 1183,1209,1349,3201 $OPTIM"
140 if test -z "$OPTIM"; then
141 if test "x$with_optim" = x; then
144 OPTIM="$with_optim $OPTIM"
148 if test "x$with_optim" = x; then
149 # Specify "generic" SPARC output and suppress
150 # all of Sun's questionable warning messages...
151 OPTIM="-w $OPTIM -xarch=generic"
154 if test $PICFLAG = 1; then
160 if test -z "$OPTIM"; then
161 if test "x$with_optim" = x; then
164 OPTIM="$with_optim $OPTIM"
168 if test $PICFLAG = 1; then
173 # Running some other operating system; inform the user they
174 # should contribute the necessary options to
175 # cups-support@cups.org...
176 echo "Building CUPS with default compiler optimizations; contact"
177 echo "cups-bugs@cups.org with uname and compiler options needed"
178 echo "for your platform, or set the CFLAGS and CXXFLAGS"
179 echo "environment variable before running configure."
184 if test $uname = HP-UX; then
185 # HP-UX 10.20 (at least) needs this definition to get the
187 OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
189 # HP-UX 11.00 (at least) needs this definition to get the
190 # u_short type used by the IP headers...
191 OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
195 dnl End of "$Id: cups-compiler.m4 4953 2006-01-19 20:30:48Z mike $".