dnl ---------------------------------------------------------------------------
AC_DEFUN([PANDORA_64BIT],[
+ AC_ARG_ENABLE([64bit],[
+ AS_HELP_STRING([--disable-64bit],
+ [Build 64 bit binary @<:@default=on@:>@])],
+ [ac_enable_64bit="$enableval"],
+ [ac_enable_64bit="yes"])
+
AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
AS_IF([test "x$ISAINFO" != "xno"],
[isainfo_b=`${ISAINFO} -b`],
[isainfo_b="x"])
- AS_IF([test "$isainfo_b" != "x"],
- [AC_ARG_ENABLE([64bit],
- [AS_HELP_STRING([--disable-64bit],
- [Build 64 bit binary @<:@default=on@:>@])],
- [ac_enable_64bit="$enableval"],
- [ac_enable_64bit="yes"])])
-
- AS_IF([test "x$ac_enable_64bit" = "xyes"],[
- if test "x$libdir" = "x\${exec_prefix}/lib" ; then
- # The user hasn't overridden the default libdir, so we'll
- # the dir suffix to match solaris 32/64-bit policy
- isainfo_k=`${ISAINFO} -k`
- libdir="${libdir}/${isainfo_k}"
- fi
- CPPFLAGS="-m64 ${CPPFLAGS}"
- LDFLAGS="-m64 ${LDFLAGS}"
- DTRACEFLAGS="${DTRACEFLAGS} -64"
- if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"
- then
- AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
- AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
- fi
- ],[DTRACEFLAGS="${DTRACEFLAGS} -32"])
+ AS_IF([test "$isainfo_b" != "x"],[
+
+ isainfo_k=`${ISAINFO} -k`
+ DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_k}"
+
+ AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[
+ CPPFLAGS="-I/usr/local ${CPPFLAGS}"
+ ])
+
+ AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
+ LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
+ ])
+
+ AS_IF([test "x$ac_enable_64bit" = "xyes"],[
+ AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
+ dnl The user hasn't overridden the default libdir, so we'll
+ dnl the dir suffix to match solaris 32/64-bit policy
+ libdir="${libdir}/${isainfo_k}"
+ ])
+
+ CPPFLAGS="-m64 ${CPPFLAGS}"
+ LDFLAGS="-m64 ${LDFLAGS}"
+ AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
+ AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
+ AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
+ ])
+ ])
+ ])
])
dnl ---------------------------------------------------------------------------
dnl End Macro: PANDORA_64BIT
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.3])
+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.13])
AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
dnl Force dependency tracking on for Sun Studio builds
m4_define([PCT_USE_GNULIB],[no])
m4_define([PCT_REQUIRE_CXX],[no])
m4_define([PCT_IGNORE_SHARED_PTR],[no])
- m4_foreach([pct_arg],$*,[
+ m4_define([PCT_FORCE_GCC42],[no])
+ m4_foreach([pct_arg],[$*],[
m4_case(pct_arg,
[use-gnulib], [
m4_undefine([PCT_USE_GNULIB])
[ignore-shared-ptr], [
m4_undefine([PCT_IGNORE_SHARED_PTR])
m4_define([PCT_IGNORE_SHARED_PTR],[yes])
+ ],
+ [force-gcc42], [
+ m4_undefine([PCT_FORCE_GCC42])
+ m4_define([PCT_FORCE_GCC42],[yes])
])
])
m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ])
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([PANDORA_MAC_GCC42])
dnl Once we can use a modern autoconf, we can use this
dnl AC_PROG_CC_C99
AM_PROG_CC_C_O
gl_USE_SYSTEM_EXTENSIONS
+ m4_if(PCT_FORCE_GCC42, [yes], [
+ AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)
+ ])
PANDORA_LIBTOOL
AC_SYS_LARGEFILE
- AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)
PANDORA_CHECK_C_VERSION
PANDORA_CHECK_CXX_VERSION
PANDORA_OPTIMIZE
PANDORA_64BIT
- PANDORA_WARNINGS(PCT_ALL_ARGS)
+ dnl We need to inject error into the cflags to test if visibility works or not
+ save_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} -Werror"
gl_VISIBILITY
+ CFLAGS="${save_CFLAGS}"
- PANDORA_ENABLE_DTRACE
PANDORA_HEADER_ASSERT
+ PANDORA_WARNINGS(PCT_ALL_ARGS)
+
+ PANDORA_ENABLE_DTRACE
+
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AC_CHECK_PROGS([PERL], [perl])
dnl First check for gcc and g++
AS_IF([test "$GCC" = "yes"],[
- AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
-
dnl The following is required for portable results of floating point
dnl calculations on PowerPC. The same must also be done for IA-64, but
dnl this options is missing in the IA-64 gcc backend.
CXX="${CXX} -xlang=c99"
AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}"
- AM_CXXFLAGS="-g -mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}"
+ AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}"
+
+ DEBUG_CXXFLAGS="-g"
dnl TODO: Make a test for -xO4 usability here
OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin"
OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}"
- OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
+ OPTIMIZE_CXXFLAGS="-g0 ${OPTIMIZE_FLAGS}"
+
])
AC_ARG_WITH([debug],
m4_define([PW_WARN_ALWAYS_ON],[no])
ifdef([m4_define],,[define([m4_define], defn([define]))])
ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
- m4_foreach([pw_arg],$*,[
+ m4_foreach([pw_arg],[$*],[
m4_case(pw_arg,
[less-warnings],[
m4_undefine([PW_LESS_WARNINGS])
AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
[ac_cv_safe_to_use_fdiagnostics_show_option_],
[save_CFLAGS="$CFLAGS"
- CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS}"
+ CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([],[])],
[ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
[save_CFLAGS="$CFLAGS"
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
dnl conversion warnings to all the tarball folks
- CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS}"
+ CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <stdbool.h>
[save_CFLAGS="$CFLAGS"
dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
dnl conversion warnings to all the tarball folks
- CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS}"
+ CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
m4_if(PW_LESS_WARNINGS,[no],[
BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
- CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum"
+ CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
],[
BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
])
- BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow -Wstrict-aliasing ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
+ AS_IF([test "${ac_cv_assert}" = "no"],
+ [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
+
+ BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
[ac_cv_safe_to_use_Wlogical_op_],
[save_CFLAGS="$CFLAGS"
- CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS}"
+ CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[[