Commits

Martin Albrecht  committed e2e3e87

considerable protability improvement in configure.ac due to David Kirkby
cf. http://trac.sagemath.org/sage_trac/ticket/7375#comment:6

  • Participants
  • Parent commits f140906

Comments (0)

Files changed (4)

 AUTOMAKE_OPTIONS = gnu
 
-AM_CFLAGS=${C99_FLAG} ${SIMD_FLAGS} ${OPENMP_CFLAGS} ${DEBUG_FLAGS}
+AM_CFLAGS=${SIMD_FLAGS} ${OPENMP_CFLAGS} ${DEBUG_FLAGS}
 
 lib_LTLIBRARIES = libm4ri.la
 

File configure.ac

+AC_INIT(libm4ri,1.0.1)
+
+AC_PREREQ([2.64])
+
+AC_CANONICAL_HOST
+
+AC_CONFIG_SRCDIR(src/brilliantrussian.c)
+
+AM_INIT_AUTOMAKE
+
+AC_PROG_LIBTOOL
+
+AC_PROG_INSTALL
+
+AC_CONFIG_HEADERS(src/config.h)
+
+m4_include([m4/ax_gcc_x86_cpuid.m4])
+m4_include([m4/ax_ext.m4])dnl
+m4_include([m4/ax_cpu_vendor.m4])dnl
+m4_include([m4/ax_cache_size.m4])dnl
+m4_include([m4/ax_cache_size_tune.m4])dnl
+m4_include([m4/ax_check_compiler_flags.m4])dnl
+m4_include([m4/ax_openmp.m4])dnl
+
+AC_PROG_CC_C99()
+
+if test "$ac_cv_prog_cc_c99" = "no"; then
+   AC_MSG_ERROR([C99 support is required but not found.])
+fi
+
+# SSE2 support
+case $host_cpu in
+     i[[3456]]86*|x86_64*)
+        AX_CPU_VENDOR()
+        if test "x$ax_cv_cpu_vendor" = "xIntel"; then
+            AX_EXT() # SSE2 is slower on the Opteron
+        fi
+esac
+
+AC_CHECK_HEADER([mm_malloc.h],AC_DEFINE(HAVE_MM_MALLOC,,[Support aligned allocations]),)
+
+# OpenMP support
+AC_ARG_WITH(openmp, [  --enable-openmp           add support for OpenMP Parallelism])
+if test "x$enable_openmp" = "xyes"; then
+   AX_OPENMP()
+fi
+AC_SUBST(OPENMP_CFLAGS)
+
+# Debugging support
+AC_ARG_ENABLE(debug, [  --enable-debug          Enable assert() statements for debugging.])
+if test "x$enable_debug" = x"yes"; then
+   DEBUG_FLAGS="-g"
+   AC_SUBST(DEBUG_FLAGS)
+else
+   AC_DEFINE(NDEBUG,1,[Define whether debugging is enabled])
+fi
+
+# L1 and L2 Cache Size
+AX_CACHE_SIZE()
+AC_ARG_ENABLE(cachetune, [  --enable-cachetune Calculate cache size from timing information.])
+if test "x$enable_cachetune" = x"yes"; then
+    AX_CACHE_SIZE_TUNE()
+fi
+
+AC_PROG_MAKE_SET
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+

File configure.in

-################################# 
-# Check this is SUN compiler # 
-################################# 
-
-AC_DEFUN([AX_CHECK_SUN_COMPILER], 
-[ 
-       $CC -V 2>test.txt 
-       SUN_STR=`head -1 test.txt |cut -f2 -d" "` 
-       rm -rf test.txt 
-       if test "$SUN_STR" = "Sun"; then 
-               ax_sun_cc_compiler=yes 
-       fi 
-
-       $CXX -V 2>test.txt 
-       SUN_STR=`head -1 test.txt |cut -f2 -d" "` 
-       rm -rf test.txt 
-       if test "$SUN_STR" = "Sun"; then 
-               ax_sun_cc_compiler=yes 
-       fi 
-
-]) 
-
-# ===========================================================================
-#                                    Main
-# ===========================================================================
-
-AC_INIT(libm4ri,1.0.1)
-
-AC_CANONICAL_HOST
-
-AC_CONFIG_SRCDIR(src/brilliantrussian.c)
-
-AM_INIT_AUTOMAKE
-
-AC_PROG_LIBTOOL
-
-AC_PROG_INSTALL
-
-AC_CONFIG_HEADERS(src/config.h)
-
-m4_include([m4/ax_gcc_x86_cpuid.m4])
-m4_include([m4/ax_ext.m4])dnl
-m4_include([m4/ax_cpu_vendor.m4])dnl
-m4_include([m4/ax_cache_size.m4])dnl
-m4_include([m4/ax_cache_size_tune.m4])dnl
-m4_include([m4/ax_check_compiler_flags.m4])dnl
-m4_include([m4/ax_openmp.m4])dnl
-
-# C99 for suncc
-AX_CHECK_SUN_COMPILER()
-C99_FLAG="-std=c99"
-if test "x$ax_sun_cc_compiler" = "xyes"; then
-   C99_FLAG="-xc99=all,lib"
-fi
-AC_SUBST(C99_FLAG)
-
-# SSE2 support
-case $host_cpu in
-     i[[3456]]86*|x86_64*)
-        AX_CPU_VENDOR()
-        if test "x$ax_cv_cpu_vendor" = "xIntel"; then
-            AX_EXT() # SSE2 is slower on the Opteron
-        fi
-esac
-
-AC_CHECK_HEADER([mm_malloc.h],AC_DEFINE(HAVE_MM_MALLOC,,[Support aligned allocations]),)
-
-# OpenMP support
-AC_ARG_WITH(openmp, [  --enable-openmp           add support for OpenMP Parallelism])
-if test "x$enable_openmp" = "xyes"; then
-   AX_OPENMP()
-fi
-AC_SUBST(OPENMP_CFLAGS)
-
-# Debugging support
-AC_ARG_ENABLE(debug, [  --enable-debug          Enable assert() statements for debugging.])
-if test "x$enable_debug" = x"yes"; then
-   DEBUG_FLAGS="-g"
-   AC_SUBST(DEBUG_FLAGS)
-else
-   AC_DEFINE(NDEBUG,1,[Define whether debugging is enabled])
-fi
-
-# L1 and L2 Cache Size
-AX_CACHE_SIZE()
-AC_ARG_ENABLE(cachetune, [  --enable-cachetune Calculate cache size from timing information.])
-if test "x$enable_cachetune" = x"yes"; then
-    AX_CACHE_SIZE_TUNE()
-fi
-
-AC_PROG_MAKE_SET
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-

File src/config.h.in

-/* src/config.h.in.  Generated from configure.in by autoheader.  */
+/* src/config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* L1 cache size (in Bytes) */
 #undef CPU_L1_CACHE