]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
correct NTP_OS_CFLAGS [Bug 1412]
authorDave Hart <hart@ntp.org>
Fri, 18 Dec 2009 05:18:12 +0000 (05:18 +0000)
committerDave Hart <hart@ntp.org>
Fri, 18 Dec 2009 05:18:12 +0000 (05:18 +0000)
allow $CC to contain slash and space in build

bk: 4b2b1094S8mgBK8Vlma7uuROpeUvdg

build
m4/os_cflags.m4

diff --git a/build b/build
index fc2ba4c85de4f843033107f01b064ed2e2a1a8ca..ee1a1c93bf54f0321063abfd85c040692ce1557e 100755 (executable)
--- a/build
+++ b/build
@@ -18,8 +18,8 @@ case "$1" in
        echo "This is <`pwd`>"
        echo "SIG is <$SIG>"
        echo "KEY is <$KEY>"
-        exit 1
-        ;;
+       exit 1
+       ;;
     esac
     ;;
  *)
@@ -88,7 +88,7 @@ CCSUF=""
 
 case "$CC" in
  '') ;;
- *) CCSUF="-$CC"
+ *) CCSUF="-`echo $CC | sed -e 's: :_:g' -e's:/:+:g`"
     ;;
 esac
 
index 5e9ced12fd61e6523e00fe67cf0f98773ccc2863..40bf18e441e364999546d19856506cadf31be166 100644 (file)
 dnl ######################################################################
 dnl Specify additional compile options based on the OS and the compiler
-AC_DEFUN(
-    [NTP_OS_CFLAGS],
-    [
-       AC_MSG_CHECKING([additional compiler flags])
-       # allow ntp_os_flags to be preset to skip this stuff
-       case "${ntp_os_cflags+set}" in
-        set)
+AC_DEFUN([NTP_OS_CFLAGS], [
+    AC_MSG_CHECKING([additional compiler flags])
+    # allow ntp_os_flags to be preset to skip this stuff
+    case "${ntp_os_cflags+set}" in
+     set)
+       ;;
+     *)
+       ntp_os_cflags=""
+       case "$host_os" in
+        aix[[1-3]]*)
            ;;
-        *)
-           ntp_os_cflags=""
-           case "$host_os" in
-            aix[[1-3]]*)
-               ;;
-            aix4.[[0-2]]*)
-               # turn on additional headers
-               ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
-               ;;
-            aix5.3*)
-               # avoid circular dependencies in yp headers, and more
-               ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
-               ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT"
-               ;;
-            aix*)
-               # avoid circular dependencies in yp headers
-               ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
-               ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS"
-               ;;
-            amigaos)
-               ntp_os_cflags="-DSYS_AMIGA"
-               ;;
-            darwin*|macosx*|rhapsody*)
-               ntp_os_cflags="-D_P1003_1B_VISIBLE"
-               ;;
-            hpux10.*)          # at least for hppa2.0-hp-hpux10.20
-               case "$GCC" in
-                yes)
-                   ;;
-                *)
-                   # use Ansi compiler on HPUX, and some -Wp magic
-                   ntp_os_cflags="-Ae -Wp,-H18816"
-                   ;;
-               esac
-               ;;
-            hpux*)
-               case "$GCC" in
-                yes)
-                   ;;
-                *)
-                   # use Ansi compiler on HPUX
-                   ntp_os_cflags="-Ae"
-               esac
-               ;;
-            irix6*)
-               case "$CC" in
-                cc)
-                   # do not use 64-bit compiler
-                   ntp_os_cflags="-n32 -mips3 -Wl,-woff,84"
-               esac
-               ;;
-            nextstep3)
-               ntp_os_cflags="-posix"
+        aix4.[[0-2]]*)
+           # turn on additional headers
+           ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
+           ;;
+        aix5.3*)
+           # avoid circular dependencies in yp headers, and more
+           ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
+           ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT"
+           ;;
+        aix*)
+           # avoid circular dependencies in yp headers
+           ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
+           ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS"
+           ;;
+        amigaos)
+           ntp_os_cflags="-DSYS_AMIGA"
+           ;;
+        darwin*|macosx*|rhapsody*)
+           ntp_os_cflags="-D_P1003_1B_VISIBLE"
+           ;;
+        hpux10.*)              # at least for hppa2.0-hp-hpux10.20
+           case "$GCC" in
+            yes)
                ;;
-            solaris1*|solaris2.[[0-5]]|solaris2.5.*)
+            *)
+               # use Ansi compiler on HPUX, and some -Wp magic
+               ntp_os_cflags="-Ae -Wp,-H18816"
                ;;
-            sunos[[34]]*|sunos5.[[0-5]]|sunos5.5.*)
+           esac
+           ;;
+        hpux*)
+           case "$GCC" in
+            yes)
                ;;
-            solaris2*|sunos5*)
-               # turn on 64-bit file offset interface
-               ntp_os_cflags="-D_LARGEFILE64_SOURCE"
+            *)
+               # use Ansi compiler on HPUX
+               ntp_os_cflags="-Ae"
+           esac
+           ;;
+        irix6*)
+           case "$CC" in
+            cc)
+               # do not use 64-bit compiler
+               ntp_os_cflags="-n32 -mips3 -Wl,-woff,84"
+           esac
+           ;;
+        nextstep3)
+           ntp_os_cflags="-posix"
+           ;;
+        solaris1*|solaris2.[[0-5]]|solaris2.5.*)
+           ;;
+        sunos[[34]]*|sunos5.[[0-5]]|sunos5.5.*)
+           ;;
+        solaris2*|sunos5*)
+           # turn on 64-bit file offset interface
+           ntp_os_cflags="-D_LARGEFILE64_SOURCE"
+           ;;
+        vxworks*)
+           case "$build" in
+            $host)
                ;;
-            vxworks*)
-               case "$build" in
-                $host)
-                   ;;
-                *)
-                   # Quick and dirty sanity check
-                   case "$VX_KERNEL" in
-                    '')
-                       AC_MSG_ERROR([See html/build/hints/vxworks.html])
-                   esac
-                   ntp_os_cflags="-DSYS_VXWORKS"
+            *)
+               # Quick and dirty sanity check
+               case "$VX_KERNEL" in
+                '')
+                   AC_MSG_ERROR([See html/build/hints/vxworks.html])
                esac
-               ;;
+               ntp_os_cflags="-DSYS_VXWORKS"
            esac
-       esac
-       case "$ntp_os_flags" in
-        '')
-           ntp_os_cflags_msg="none needed"
            ;;
-        *)
-           ntp_os_cflags_msg="$ntp_os_cflags"
-           CFLAGS="$CFLAGS $ntp_os_cflags"
        esac
-       AC_MSG_RESULT([$ntp_os_flags_msg])
-       AS_UNSET([ntp_os_cflags_msg])
-    ]
-)
+    esac
+    case "$ntp_os_flags" in
+     '')
+       ntp_os_cflags_msg="none needed"
+       ;;
+     *)
+       ntp_os_cflags_msg="$ntp_os_cflags"
+       CFLAGS="$CFLAGS $ntp_os_cflags"
+    esac
+    AC_MSG_RESULT([$ntp_os_cflags_msg])
+    AS_UNSET([ntp_os_cflags_msg])
+])
 dnl ======================================================================