Updated pandora-build.
authorMonty Taylor <mordred@inaugust.com>
Sat, 2 Jan 2010 04:59:12 +0000 (20:59 -0800)
committerMonty Taylor <mordred@inaugust.com>
Sat, 2 Jan 2010 04:59:12 +0000 (20:59 -0800)
m4/pandora_canonical.m4
m4/pandora_drizzle_build.m4
m4/pandora_optimize.m4
m4/pandora_platform.m4
m4/pandora_visibility.m4 [new file with mode: 0644]
m4/pandora_warnings.m4
m4/pandora_with_python.m4
m4/pandora_with_python3.m4
m4/visibility.m4 [deleted file]

index 0542e3d3ce6b43d6ed0e0250d5771524f54161c2..cc945c1bacde480cd689cfc168aee637e7501abf 100644 (file)
@@ -4,13 +4,23 @@ dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Which version of the canonical setup we're using
-AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.86])
+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.91])
 
 AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
+  AC_ARG_ENABLE([fat-binaries],
+    [AS_HELP_STRING([--enable-fat-binaries],
+      [Enable fat binary support on OSX @<:@default=off@:>@])],
+    [ac_enable_fat_binaries="$enableval"],
+    [ac_enable_fat_binaries="no"])
+
   dnl Force dependency tracking on for Sun Studio builds
   AS_IF([test "x${enable_dependency_tracking}" = "x"],[
     enable_dependency_tracking=yes
   ])
+  dnl If we're building OSX Fat Binaries, we have to turn off -M options
+  AS_IF([test "x${ac_enable_fat_binaries}" = "xyes"],[
+    enable_dependency_tracking=no
+  ])
 ])
 
 dnl The standard setup for how we build Pandora projects
@@ -195,7 +205,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     dnl We need to inject error into the cflags to test if visibility works or not
     save_CFLAGS="${CFLAGS}"
     CFLAGS="${CFLAGS} -Werror"
-    gl_VISIBILITY
+    PANDORA_VISIBILITY
     CFLAGS="${save_CFLAGS}"
   ])
 
@@ -232,5 +242,6 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   AC_SUBST([AM_CFLAGS])
   AC_SUBST([AM_CXXFLAGS])
   AC_SUBST([AM_CPPFLAGS])
+  AC_SUBST([AM_LDFLAGS])
 
 ])
index 35f27161ff0709a1de68b1d9ea9ae35e81d50664..fa132ccaab7aec11e163299cad75f6392eb71a10 100644 (file)
@@ -75,11 +75,23 @@ AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
 #ifndef __CONFIG_H__
 #define __CONFIG_H__
 
+#include "config/top.h"
+])
+  mkdir -p config
+  cat > config/top.h.stamp <<EOF_CONFIG_TOP
+
 #if defined(i386) && !defined(__i386__)
 #define __i386__
 #endif
 
-  ])
+#if defined(_FILE_OFFSET_BITS)
+# undef _FILE_OFFSET_BITS
+#endif
+EOF_CONFIG_TOP
+  diff config/top.h.stamp config/top.h >/dev/null 2>&1 || mv config/top.h.stamp config/top.h
+  rm -f config/top.h.stamp
+
+
   AH_BOTTOM([
 #if defined(__cplusplus)
 # include CSTDINT_H
index 17b636bfd09a144ba67ed5a5700894031c04e5e1..65f9cdc80692be2464362195d5e71312ada77051 100644 (file)
@@ -51,7 +51,7 @@ AC_DEFUN([PANDORA_OPTIMIZE],[
     CXX="${CXX} -xlang=c99"
 
     AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}"
-    AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}"
+    AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -library=Crun -template=no%extdef ${AM_CXXFLAGS}"
 
     DEBUG_CXXFLAGS="-g"
 
index 678b51ea029e2b6dd62a9d12bd420fe37744d298..4e54562dce534597cbaa7db144a49ca5b20fb07e 100644 (file)
@@ -74,4 +74,12 @@ AC_DEFUN([PANDORA_PLATFORM],[
       [Cause Sun Studio to not be quite so strict with standards conflicts])
   ])
 
+  AS_IF([test "x$TARGET_OSX" = "xtrue"],[
+    AS_IF([test "x$ac_enable_fat_binaries" = "xyes"],[
+      AM_CFLAGS="-arch i386 -arch x86_64 -arch ppc"
+      AM_CXXFLAGS="-arch i386 -arch x86_64 -arch ppc"
+      AM_LDFLAGS="-arch i386 -arch x86_64 -arch ppc"
+    ])
+  ])
+
 ])
diff --git a/m4/pandora_visibility.m4 b/m4/pandora_visibility.m4
new file mode 100644 (file)
index 0000000..cb68644
--- /dev/null
@@ -0,0 +1,57 @@
+dnl Copyright (C) 2005, 2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2009 Monty Taylor
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([PANDORA_VISIBILITY],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([PANDORA_PLATFORM])
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  AS_IF([test -n "$GCC"],[
+    AC_MSG_CHECKING([for simple visibility declarations])
+    AC_CACHE_VAL([gl_cv_cc_visibility], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -fvisibility=hidden"
+      AC_TRY_COMPILE(
+        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+         extern __attribute__((__visibility__("default"))) int exportedvar;
+         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+         extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
+        [],
+        [gl_cv_cc_visibility=yes],
+        [gl_cv_cc_visibility=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_visibility])
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  ])
+  AS_IF([test "x$SUNCC" = "xyes"],[
+    CFLAG_VISIBILITY="-xldscope=hidden"
+    HAVE_VISIBILITY=1
+  ])
+  AC_SUBST([CFLAG_VISIBILITY])
+  AC_SUBST([HAVE_VISIBILITY])
+  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
index b26b860ed6085cbfa27d265c45424b1e5db55980..eb0f7b4cf7334196986c20528ecb7db4889ea347 100644 (file)
@@ -329,8 +329,8 @@ inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
       CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
     ])
 
-    CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
-    CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
+    CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL} ${CFLAG_VISIBILITY}"
+    CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL} ${CFLAG_VISIBILITY}"
     PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
     NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
     NO_WERROR="-errwarn=%none"
index 348e7edd82b424d1e57c1755ccbcee4700091159..5b28c8ed0e233e28652bcdc0cb3d150a9ea9ddf2 100644 (file)
@@ -15,8 +15,12 @@ AC_DEFUN([PANDORA_WITH_PYTHON], [
   AC_ARG_WITH([python], 
     [AS_HELP_STRING([--with-python],
       [Build Python Bindings @<:@default=yes@:>@])],
-    [with_python=$withval], 
-    [with_python=yes])
+    [with_python=$withval
+     python_requested=$withval
+    ], 
+    [with_python=yes
+     python_requested=no
+    ])
 
   AS_IF([test "x$with_python" != "xno"],[
     AS_IF([test "x$with_python" != "xyes"],[PYTHON=$with_python])
@@ -24,5 +28,10 @@ AC_DEFUN([PANDORA_WITH_PYTHON], [
     AC_PYTHON_DEVEL()
     AS_IF([test "x$pythonexists" = "xno"],[with_python="no"])
   ])
+  AS_IF([test "x$with_python" = "xno" -a "$python_requested" = "yes"],[
+    AC_MSG_ERROR([Python support was explicity requested, but Python support
+                  was not found. Please correct your build environment and try
+                  again])
+  ])
   AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" = "yes"])
 ])
index 4ad67a9b2356ba45f231ee5975e8a7fd6f51616a..0119ed9408794082401c8829873c9a46c906f1c6 100644 (file)
@@ -17,7 +17,7 @@ AC_DEFUN([PANDORA_WITH_PYTHON3], [
     [AS_HELP_STRING([--with-python3],
       [Build Python3 Bindings @<:@default=yes@:>@])],[
         with_python3=$withval
-        python3_requested=yes
+        python3_requested=$withval
       ],[ 
         with_python3=yes
         python3_requested=no
diff --git a/m4/visibility.m4 b/m4/visibility.m4
deleted file mode 100644 (file)
index 70bca56..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# visibility.m4 serial 2 (gettext-0.18)
-dnl Copyright (C) 2005, 2008 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl Tests whether the compiler supports the command-line option
-dnl -fvisibility=hidden and the function and variable attributes
-dnl __attribute__((__visibility__("hidden"))) and
-dnl __attribute__((__visibility__("default"))).
-dnl Does *not* test for __visibility__("protected") - which has tricky
-dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
-dnl MacOS X.
-dnl Does *not* test for __visibility__("internal") - which has processor
-dnl dependent semantics.
-dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
-dnl "really only recommended for legacy code".
-dnl Set the variable CFLAG_VISIBILITY.
-dnl Defines and sets the variable HAVE_VISIBILITY.
-
-AC_DEFUN([gl_VISIBILITY],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  CFLAG_VISIBILITY=
-  HAVE_VISIBILITY=0
-  if test -n "$GCC"; then
-    AC_MSG_CHECKING([for simple visibility declarations])
-    AC_CACHE_VAL([gl_cv_cc_visibility], [
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -fvisibility=hidden"
-      AC_TRY_COMPILE(
-        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
-         extern __attribute__((__visibility__("default"))) int exportedvar;
-         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
-         extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
-        [],
-        [gl_cv_cc_visibility=yes],
-        [gl_cv_cc_visibility=no])
-      CFLAGS="$gl_save_CFLAGS"])
-    AC_MSG_RESULT([$gl_cv_cc_visibility])
-    if test $gl_cv_cc_visibility = yes; then
-      CFLAG_VISIBILITY="-fvisibility=hidden"
-      HAVE_VISIBILITY=1
-    fi
-  fi
-  AC_SUBST([CFLAG_VISIBILITY])
-  AC_SUBST([HAVE_VISIBILITY])
-  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
-    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
-])