Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: build error under mac os x (PR#894)
Home

[Freeciv-Dev] Re: build error under mac os x (PR#894)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gaute B Strokkenes <gs234@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: build error under mac os x (PR#894)
From: Brian Olson <locke@xxxxxxx>
Date: Sat, 18 Aug 2001 01:25:24 -0700

On Friday, August 17, 2001, at 08:08  PM, Gaute B Strokkenes wrote:

--- configure.in.orig   Fri Aug 17 01:54:12 2001
+++ configure.in        Fri Aug 17 01:58:17 2001
@@ -186,6 +186,11 @@
    AC_SUBST(ARFLAGS)
  fi

+dnl MacOS X or Darwin specifics
+if test x`$UNAME -s` = xDarwin ; then
+  CFLAGS="$CFLAGS -traditional-cpp"
+fi
+
  dnl Windows-specific settings
  AC_MINGW32
  if test x"$MINGW32" = "xyes"; then

I'm not sure this is the best way.  After all, it is possible to build
a stock gcc on Darwin or OS X these days, so the check should examine
the compiler, not the platform.  The question is, how do we do this?
Does Apple's gcc define a preprocessor symbol of some sort that we
could test, or do we have to grep the output of gcc -v or something?

Well, my (g)cc from apple does the following:
% cc --verbose -E - < /dev/null
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2 19991024 (release) /usr/libexec/gcc/darwin/ppc/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ppc__ -D__NATURAL_ALIGNMENT__ -D__MACH__ -D__BIG_ENDIAN__ -D__APPLE__ -D__ppc__ -D__NATURAL_ALIGNMENT__ -D__MACH__ -D__BIG_ENDIAN__ -D__APPLE__ -D__STDC__ -D__APPLE_CC__=926 -D__DYNAMIC__ -
GNU CPP version 2.95.2 19991024 (release)
[excess verbosity snipped]

I would guess that a stock gcc wouldn't define __APPLE_CC__ so maybe that's what you'd need.

Alternately, construct a test out of a piece of code that fails the apple cpp. This is probably ideal so that things will Just Work someday when apple fixes their cpp.

But I don't yet know enough autoconf to do either.

[insert clever signoff here]
Brian Olson http://bolson.org/


[Prev in Thread] Current Thread [Next in Thread]