]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-compiler.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-compiler.m4
index c3b82a8523b2bd70a3f75000172b22e11d80bee1..adbc1294ff0df830b0d621b0a6190925a5f96683 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-compiler.m4 5473 2006-05-01 15:51:09Z mike $"
+dnl "$Id: cups-compiler.m4 5643 2006-06-07 20:58:29Z mike $"
 dnl
 dnl   Compiler stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -24,22 +24,31 @@ dnl
 
 dnl Clear the debugging and non-shared library options unless the user asks
 dnl for them...
-ARCHFLAGS=""
 OPTIM=""
-AC_SUBST(ARCHFLAGS)
 AC_SUBST(OPTIM)
 
 AC_ARG_WITH(optim, [  --with-optim="flags"    set optimization flags ])
-AC_ARG_WITH(archflags, [  --with-arch="flags"     set default architecture flags ])
-
 AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging, default=no],
        [if test x$enable_debug = xyes; then
                OPTIM="-g"
        fi])
 
+dnl Setup general architecture flags...
+AC_ARG_WITH(archflags, [  --with-archflags="flags"
+                          set default architecture flags ])
+
+if test -z "$with_archflags"; then
+       ARCHFLAGS=""
+else
+       ARCHFLAGS="$with_archflags"
+fi
+
+AC_SUBST(ARCHFLAGS)
+
 dnl Setup support for separate 32/64-bit library generation...
 AC_ARG_ENABLE(32bit, [  --enable-32bit          generate 32-bit libraries on 32/64-bit systems, default=no])
-AC_ARG_WITH(arch32flags, [  --with-arch32="flags"   specifies 32-bit architecture flags])
+AC_ARG_WITH(arch32flags, [  --with-arch32flags="flags"
+                          specifies 32-bit architecture flags])
 
 ARCH32FLAGS=""
 INSTALL32=""
@@ -56,7 +65,8 @@ AC_SUBST(LIB32DIR)
 AC_SUBST(UNINSTALL32)
 
 AC_ARG_ENABLE(64bit, [  --enable-64bit          generate 64-bit libraries on 32/64-bit systems, default=no])
-AC_ARG_WITH(arch64flags, [  --with-arch64="flags"   specifies 64-bit architecture flags])
+AC_ARG_WITH(arch64flags, [  --with-arch64flags="flags"
+                          specifies 64-bit architecture flags])
 
 ARCH64FLAGS=""
 INSTALL64=""
@@ -118,17 +128,6 @@ if test -n "$GCC"; then
        fi
 
        case "$uname" in
-               Darwin*)
-                       if test -z "$with_archflags"; then
-                               if test "x`uname -m`" = xi386; then
-                                       # Build universal binaries for OSX on Intel...
-                                       ARCHFLAGS="-arch i386 -arch ppc"
-                               fi
-                       else
-                               ARCHFLAGS="$with_archflags"
-                       fi
-                       ;;
-
                IRIX)
                        if test "x$enable_32bit" = xyes; then
                                # Build 32-bit libraries, 64-bit base...
@@ -138,8 +137,8 @@ if test -n "$GCC"; then
                                        ARCH32FLAGS="$with_arch32flags"
                                fi
                                INSTALL32="install32bit"
-                               LIB32CUPS="libcups.32.so.2"
-                               LIB32CUPSIMAGE="libcupsimage.32.so.2"
+                               LIB32CUPS="32bit/libcups.so.2"
+                               LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
                                LIB32DIR="$prefix/lib32"
                                UNINSTALL32="uninstall32bit"
 
@@ -149,8 +148,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -162,8 +159,8 @@ if test -n "$GCC"; then
                                        ARCH64FLAGS="$with_arch64flags"
                                fi
                                INSTALL64="install64bit"
-                               LIB64CUPS="libcups.64.so.2"
-                               LIB64CUPSIMAGE="libcupsimage.64.so.2"
+                               LIB64CUPS="64bit/libcups.so.2"
+                               LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
                                LIB64DIR="$prefix/lib64"
                                UNINSTALL64="uninstall64bit"
 
@@ -173,8 +170,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -188,8 +183,8 @@ if test -n "$GCC"; then
                                        ARCH32FLAGS="$with_arch32flags"
                                fi
                                INSTALL32="install32bit"
-                               LIB32CUPS="libcups.32.so.2"
-                               LIB32CUPSIMAGE="libcupsimage.32.so.2"
+                               LIB32CUPS="32bit/libcups.so.2"
+                               LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
                                LIB32DIR="$exec_prefix/lib"
                                if test -d /usr/lib32; then
                                        LIB32DIR="${LIB32DIR}32"
@@ -202,8 +197,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -215,8 +208,8 @@ if test -n "$GCC"; then
                                        ARCH64FLAGS="$with_arch64flags"
                                fi
                                INSTALL64="install64bit"
-                               LIB64CUPS="libcups.64.so.2"
-                               LIB64CUPSIMAGE="libcupsimage.64.so.2"
+                               LIB64CUPS="64bit/libcups.so.2"
+                               LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
                                LIB64DIR="$exec_prefix/lib"
                                if test -d /usr/lib64; then
                                        LIB64DIR="${LIB64DIR}64"
@@ -229,8 +222,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -244,8 +235,8 @@ if test -n "$GCC"; then
                                        ARCH32FLAGS="$with_arch32flags"
                                fi
                                INSTALL32="install32bit"
-                               LIB32CUPS="libcups.32.so.2"
-                               LIB32CUPSIMAGE="libcupsimage.32.so.2"
+                               LIB32CUPS="32bit/libcups.so.2"
+                               LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
                                LIB32DIR="$exec_prefix/lib/32"
                                UNINSTALL32="uninstall32bit"
 
@@ -255,8 +246,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -268,8 +257,8 @@ if test -n "$GCC"; then
                                        ARCH64FLAGS="$with_arch64flags"
                                fi
                                INSTALL64="install64bit"
-                               LIB64CUPS="libcups.64.so.2"
-                               LIB64CUPSIMAGE="libcupsimage.64.so.2"
+                               LIB64CUPS="64bit/libcups.so.2"
+                               LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
                                LIB64DIR="$exec_prefix/lib/64"
                                UNINSTALL64="uninstall64bit"
 
@@ -279,8 +268,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -310,8 +297,9 @@ else
                        # Warning 829 is passing constant string as char *
                        CXXFLAGS="+W336,829 $CXXFLAGS"
 
-                       if test "x$with_optim" = x; then
-                               OPTIM="+DAportable $OPTIM"
+                       if test -z "$with_archflags"; then
+                               # Build portable binaries for all HP systems...
+                               ARCHFLAGS="+DAportable"
                        fi
 
                        if test $PICFLAG = 1; then
@@ -339,8 +327,8 @@ else
                                        ARCH32FLAGS="$with_arch32flags"
                                fi
                                INSTALL32="install32bit"
-                               LIB32CUPS="libcups.32.so.2"
-                               LIB32CUPSIMAGE="libcupsimage.32.so.2"
+                               LIB32CUPS="32bit/libcups.so.2"
+                               LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
                                LIB32DIR="$prefix/lib32"
                                UNINSTALL32="uninstall32bit"
 
@@ -350,8 +338,6 @@ else
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -363,8 +349,8 @@ else
                                        ARCH64FLAGS="$with_arch64flags"
                                fi
                                INSTALL64="install64bit"
-                               LIB64CUPS="libcups.64.so.2"
-                               LIB64CUPSIMAGE="libcupsimage.64.so.2"
+                               LIB64CUPS="64bit/libcups.so.2"
+                               LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
                                LIB64DIR="$prefix/lib64"
                                UNINSTALL64="uninstall64bit"
 
@@ -374,8 +360,6 @@ else
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -383,7 +367,7 @@ else
                        # Solaris
                        if test -z "$OPTIM"; then
                                if test "x$with_optim" = x; then
-                                       OPTIM="-xO4"
+                                       OPTIM="-xO2"
                                else
                                        OPTIM="$with_optim $OPTIM"
                                fi
@@ -398,8 +382,8 @@ else
                                # binaries with separate 32-bit libraries...
                                ARCH32FLAGS="-xarch=generic"
                                INSTALL32="install32bit"
-                               LIB32CUPS="libcups.32.so.2"
-                               LIB32CUPSIMAGE="libcupsimage.32.so.2"
+                               LIB32CUPS="32bit/libcups.so.2"
+                               LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
                                LIB32DIR="$exec_prefix/lib/32"
                                UNINSTALL32="uninstall32bit"
 
@@ -408,32 +392,38 @@ else
                                        # warning messages, and default to
                                        # 64-bit compiles of everything else...
                                        OPTIM="-w $OPTIM"
-                                       CFLAGS="-xarch=generic64 $CFLAGS"
+                               fi
+
+                               if test -z "$with_archflags"; then
+                                       if test -z "$with_arch64flags"; then
+                                               ARCHFLAGS="-xarch=generic64"
+                                       else
+                                               ARCHFLAGS="$with_arch64flags"
+                                       fi
                                fi
                        else
                                if test "x$enable_64bit" = xyes; then
                                        # Build 64-bit libraries...
                                        ARCH64FLAGS="-xarch=generic64"
                                        INSTALL64="install64bit"
-                                       LIB64CUPS="libcups.64.so.2"
-                                       LIB64CUPSIMAGE="libcupsimage.64.so.2"
+                                       LIB64CUPS="64bit/libcups.so.2"
+                                       LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
                                        LIB64DIR="$exec_prefix/lib/64"
                                        UNINSTALL64="uninstall64bit"
+                               fi
 
-                                       if test "x$with_optim" = x; then
-                                               # Suppress all of Sun's questionable
-                                               # warning messages, and default to
-                                               # 32-bit compiles of everything else...
-                                               OPTIM="-w $OPTIM"
-                                               CFLAGS="-xarch=generic $CFLAGS"
-                                       fi
-                               else
-                                       if test "x$with_optim" = x; then
-                                               # Suppress all of Sun's questionable
-                                               # warning messages, and default to
-                                               # 32-bit compiles of everything else...
-                                               OPTIM="-w $OPTIM"
-                                               CFLAGS="-xarch=generic $CFLAGS"
+                               if test "x$with_optim" = x; then
+                                       # Suppress all of Sun's questionable
+                                       # warning messages, and default to
+                                       # 32-bit compiles of everything else...
+                                       OPTIM="-w $OPTIM"
+                               fi
+
+                               if test -z "$with_archflags"; then
+                                       if test -z "$with_arch32flags"; then
+                                               ARCHFLAGS="-xarch=generic"
+                                       else
+                                               ARCHFLAGS="$with_arch32flags"
                                        fi
                                fi
                        fi
@@ -475,5 +465,5 @@ if test $uname = HP-UX; then
 fi
 
 dnl
-dnl End of "$Id: cups-compiler.m4 5473 2006-05-01 15:51:09Z mike $".
+dnl End of "$Id: cups-compiler.m4 5643 2006-06-07 20:58:29Z mike $".
 dnl