OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -xstrconst"
fi
-SOLARIS_64BIT
+ENABLE_64BIT
#--------------------------------------------------------------------
# Check for libpthread
if test "$GCC" = "yes"
then
+ 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 ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([],[])],
+ [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
+ [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
+ [
+ F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
+ ])
+
+
+ AC_CACHE_CHECK([whether it is safe to use -Wconversion],
+ [ac_cv_safe_to_use_wconversion_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="-Werror -Wconversion ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <stdbool.h>
+void foo(bool a)
+{
+ (void)a;
+}
+ ]],[[
+foo(0);
+ ]])],
+ [ac_cv_safe_to_use_wconversion_=yes],
+ [ac_cv_safe_to_use_wconversion_=no])
+ CFLAGS="$save_CFLAGS"])
+ AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
+ [W_CONVERSION="-Wconversion"
+ AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
+ [ac_cv_safe_to_use_Wconversion_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="-Werror -Wconversion ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <netinet/in.h>
+ ]],[[
+uint16_t x= htons(80);
+ ]])],
+ [ac_cv_safe_to_use_Wconversion_=yes],
+ [ac_cv_safe_to_use_Wconversion_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
+ [
+ NO_CONVERSION="-Wno-conversion"
+ ])
+ ])
+
+ W_STRICT_ALIASING="-Wno-strict-aliasing"
AS_IF([test "$ac_profiling" = "yes"],
[CC_PROFILING="-pg"])
AS_IF([test "$building_from_bzr" = "yes"],
[W_FAIL="-Werror"])
- BASE_WARNINGS="-pedantic -W -Wall -Wextra ${W_FAIL} -Wundef -Wshadow -Wmissing-declarations ${W_STRICT_ALIASING} -fdiagnostics-show-option"
+ BASE_WARNINGS="-pedantic -W -Wall -Wextra ${W_FAIL} -Wundef -Wshadow -Wmissing-declarations ${W_STRICT_ALIASING} ${F_DIAGNOSTICS_SHOW_OPTION} ${W_CONVERSION}"
CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wswitch-default -Wswitch-enum -Wcast-align -Wconversion"
CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -Weffc++ -Wno-long-long -Wconversion"
- AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
- [ac_cv_safe_to_use_Wconversion_],
- [save_CFLAGS="$CFLAGS"
- CFLAGS="-Wconversion -Werror ${CFLAGS}"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <arpa/inet.h>
-#include <netinet/in.h>
- ]],[[
-uint16_t x= htons(80);
- ]])],
- [ac_cv_safe_to_use_Wconversion_=yes],
- [ac_cv_safe_to_use_Wconversion_=no])
- CFLAGS="$save_CFLAGS"])
-
- AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
- [
- NO_CONVERSION="-Wno-conversion"
- ])
-
AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
[ac_cv_safe_to_use_Wlogical_op_],
dnl ---------------------------------------------------------------------------
-dnl Macro: SOLARIS_64BIT
+dnl Macro: ENABLE_64BIT
dnl ---------------------------------------------------------------------------
-AC_DEFUN([SOLARIS_64BIT],[
-AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
-if test "x$ISAINFO" != "xno"
-then
- isainfo_b=`${ISAINFO} -b`
- spro_common_flags="-mt"
- if test "x$isainfo_b" = "x64"
- then
- AC_ARG_ENABLE([64bit],
- [AS_HELP_STRING([--disable-64bit],
- [Build 64 bit binary @<:@default=on@:>@])],
- [ac_enable_64bit="$enableval"],
- [ac_enable_64bit="yes"])
+AC_DEFUN([ENABLE_64BIT],[
- if test "x$ac_enable_64bit" = "xyes"
- then
+ 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
CFLAGS="-xmemalign=8s $CFLAGS"
CXXFLAGS="-xmemalign=8s $CXXFLAGS"
fi
- fi
- fi
-fi
+ ])
])
dnl ---------------------------------------------------------------------------
-dnl End Macro: 64BIT
+dnl End Macro: ENABLE_64BIT
dnl ---------------------------------------------------------------------------