aclocal.m4 (WITH_CC): Add -fno-common to CFLAGS on Darwin, unless -fcommon or
authorKen Raeburn <raeburn@mit.edu>
Sat, 14 Feb 2004 00:34:15 +0000 (00:34 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 14 Feb 2004 00:34:15 +0000 (00:34 +0000)
-fno-common is already given.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16081 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4

index e3119eebadaab5f719ab21133d4f40d8abc549d1..7306fd01e5188915af2b19c4dd0114483e87de2c 100644 (file)
@@ -5,6 +5,8 @@
        corresponding getsockname arg types.
        (KRB5_GETSOCKNAME_ARGS): If nothing matches, assume struct
        sockaddr and socklen_t.
+       (WITH_CC): Add -fno-common to CFLAGS on Darwin, unless -fcommon or
+       -fno-common is already given.
 
 2004-02-12  Tom Yu  <tlyu@mit.edu>
 
index 34187615377f02aa1b4289da1bbacb4f08d81753..0bcefa3b9eca658d2d21c5a48f44ba683b0b2e0e 100644 (file)
@@ -485,6 +485,22 @@ if test "$GCC" = yes ; then
       CFLAGS="$CFLAGS -pedantic"
     fi
   fi
+  if test "`uname -s`" = Darwin ; then
+    # Someday this should be a feature test.
+    # One current (Jaguar = OS 10.2) problem:
+    # Archive library with foo.o undef sym X and bar.o common sym X,
+    # if foo.o is pulled in at link time, bar.o may not be, causing
+    # the linker to complain.
+    # Dynamic library problems too?
+    case "$CC $CFLAGS" in
+    *-fcommon*) ;; # why someone would do this, I don't know
+    *-fno-common*) ;; # okay, they're already doing the right thing
+    *)
+      AC_MSG_NOTICE(disabling the use of common storage on Darwin)
+      CFLAGS="$CFLAGS -fno-common"
+      ;;
+    esac
+  fi
 fi
 ])dnl
 dnl