Browse Source

Merged from Drizzle.

Monty Taylor 15 years ago
parent
commit
fa52658970
2 changed files with 27 additions and 9 deletions
  1. 12 3
      configure.ac
  2. 15 6
      m4/lib-link.m4

+ 12 - 3
configure.ac

@@ -102,14 +102,23 @@ AS_IF([test "$ac_cv_prog_cc_c99" != "no"],
 if test "$GCC" = "yes"
 then
   CFLAGS="-ggdb3 ${CFLAGS}"
+  CXXFLAGS="-ggdb3 ${CXXFLAGS}"
+
   DEBUG_CFLAGS="-O0"
+  DEBUG_CXXFLAGS="-O0"
+
   OPTIMIZE_CFLAGS="-O3"
+  OPTIMIZE_CXXFLAGS="-O3"
 fi
 if test "x$SUNCC" = "xyes"
 then
-   CFLAGS="-g -mt $CFLAGS"
-   CXXFLAGS="-g -mt -xlang=c99 $CXXFLAGS"
-   OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -xstrconst"
+  CFLAGS="-g -mt ${CFLAGS}"
+  CXXFLAGS="-g -mt -xlang=c99 ${CXXFLAGS}"
+
+  OPTIMIZE_FLAGS="-xO4 -xlibmil -xdepend -xbuiltin -lmopt"
+  OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
+  OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
+
 fi
 
 ENABLE_64BIT

+ 15 - 6
m4/lib-link.m4

@@ -43,7 +43,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
   popdef([Name])
 ])
 
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [system])
 dnl searches for libname and the libraries corresponding to explicit and
 dnl implicit dependencies, together with the specified include files and
 dnl the ability to compile and link the specified testcode. If found, it
@@ -63,7 +63,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 
   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
   dnl accordingly.
-  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+  AC_LIB_LINKFLAGS_BODY([$1], [$2], [$5])
 
   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
   dnl because if the user has installed lib[]Name and not disabled its use
@@ -157,11 +157,13 @@ AC_DEFUN([AC_LIB_FROMPACKAGE],
   popdef([PACK])
 ])
 
-dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies, system]) searches for
+dnl libname and the libraries corresponding to explicit and implicit
+dnl dependencies.
 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+dnl If system==system, -isystem is used instead of -I
 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 [
   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
@@ -175,6 +177,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
   pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
+  if test "x$GCC" = "xyes" -a "x$3" = "xsystem"
+  then
+    i_system="-isystem "
+  else
+    i_system="-I"
+  fi
+
   AC_LIB_WITH_FINAL_PREFIX([
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
@@ -479,7 +488,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                 if test -z "$haveit"; then
                   for x in $CPPFLAGS $INC[]NAME; do
                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                    if test "X$x" = "X-I$additional_includedir"; then
+                    if test "X$x" = "X${i_system}$additional_includedir"; then
                       haveit=yes
                       break
                     fi
@@ -487,7 +496,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                   if test -z "$haveit"; then
                     if test -d "$additional_includedir"; then
                       dnl Really add $additional_includedir to $INCNAME.
-                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }${i_system}$additional_includedir"
                     fi
                   fi
                 fi