aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--m4/iem_checkflags.m432
-rw-r--r--m4/iem_fat.m47
-rw-r--r--m4/iem_simd.m45
4 files changed, 22 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac
index c85e048..14278c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,7 +130,7 @@ AC_SUBST(ARCH_FLAG)
dnl check for "-mms-bitfields" cflag
dnl why is there no generic compiler-check for a given flag ?
dnl it would make things so easy: AC_CHECK_FLAG([-mms-bitfields],,)
-AC_CHECK_CFLAGS([-mms-bitfields])
+IEM_CHECK_CFLAGS([-mms-bitfields])
IEM_CHECK_SIMD
IEM_CHECK_LPT
diff --git a/m4/iem_checkflags.m4 b/m4/iem_checkflags.m4
index dfec75a..cd21632 100644
--- a/m4/iem_checkflags.m4
+++ b/m4/iem_checkflags.m4
@@ -3,11 +3,11 @@ dnl This file is free software; IOhannes m zmölnig
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-# AC_CHECK_CPPFLAGS(ADDITIONAL-CPPFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+# IEM_CHECK_CPPFLAGS(ADDITIONAL-CPPFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
#
# checks whether the $(C) compiler accepts the ADDITIONAL-CPPFLAGS
# if so, they are added to the CPPFLAGS
-AC_DEFUN([AC_CHECK_CPPFLAGS],
+AC_DEFUN([IEM_CHECK_CPPFLAGS],
[
AC_MSG_CHECKING([whether $CPP accepts "$1"])
temp_check_cppflags="${CPPFLAGS}"
@@ -16,15 +16,15 @@ AC_DEFUN([AC_CHECK_CPPFLAGS],
[AC_LANG_SOURCE([[int main(void){return 0;}]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]); CPPFLAGS="${temp_check_cppflags}"])
-])# AC_CHECK_CPPFLAGS
+])# IEM_CHECK_CPPFLAGS
-# AC_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+# IEM_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
#
# checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS
# if so, they are added to the CFLAGS
-AC_DEFUN([AC_CHECK_CFLAGS],
+AC_DEFUN([IEM_CHECK_CFLAGS],
[
AC_MSG_CHECKING([whether $CC accepts "$1"])
cat > conftest.c << EOF
@@ -36,19 +36,18 @@ if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1
then
AC_MSG_RESULT([yes])
CFLAGS="${CFLAGS} [$1]"
- AC_CHECK_CPPFLAGS([$1])
[$2]
else
AC_MSG_RESULT([no])
[$3]
fi
-])# AC_CHECK_CFLAGS
+])# IEM_CHECK_CFLAGS
-# AC_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+# IEM_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
#
# checks whether the $(CXX) (c++) compiler accepts the ADDITIONAL-CXXFLAGS
# if so, they are added to the CXXFLAGS
-AC_DEFUN([AC_CHECK_CXXFLAGS],
+AC_DEFUN([IEM_CHECK_CXXFLAGS],
[
AC_MSG_CHECKING([whether $CXX accepts "$1"])
cat > conftest.c++ << EOF
@@ -60,18 +59,17 @@ if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1
then
AC_MSG_RESULT([yes])
CXXFLAGS="${CXXFLAGS} [$1]"
- AC_CHECK_CPPFLAGS([$1])
[$2]
else
AC_MSG_RESULT([no])
[$3]
fi
-])# AC_CHECK_CXXFLAGS
+])# IEM_CHECK_CXXFLAGS
-# AC_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+# IEM_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
#
#
-AC_DEFUN([AC_CHECK_FRAMEWORK],
+AC_DEFUN([IEM_CHECK_FRAMEWORK],
[
AC_MSG_CHECKING([for "$1"-framework])
@@ -88,13 +86,13 @@ AC_DEFUN([AC_CHECK_FRAMEWORK],
LDFLAGS="$temp_check_ldflags_org"
[$3]
fi
-])# AC_CHECK_FRAMEWORK
+])# IEM_CHECK_FRAMEWORK
-# AC_CHECK_LDFLAGS(ADDITIONAL-LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+# IEM_CHECK_LDFLAGS(ADDITIONAL-LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
#
# checks whether the $(LD) linker accepts the ADDITIONAL-LDFLAGS
# if so, they are added to the LDFLAGS
-AC_DEFUN([AC_CHECK_LDFLAGS],
+AC_DEFUN([IEM_CHECK_LDFLAGS],
[
AC_MSG_CHECKING([whether linker accepts "$1"])
temp_check_ldflags_org="${LDFLAGS}"
@@ -110,4 +108,4 @@ AC_DEFUN([AC_CHECK_LDFLAGS],
LDFLAGS="$temp_check_ldflags_org"
[$3]
fi
-])# AC_CHECK_LDFLAGS
+])# IEM_CHECK_LDFLAGS
diff --git a/m4/iem_fat.m4 b/m4/iem_fat.m4
index f587734..712e1db 100644
--- a/m4/iem_fat.m4
+++ b/m4/iem_fat.m4
@@ -40,12 +40,11 @@ if test "$fat_binary" != no; then
done
if test "x$[]Name" != "x"; then
- AC_CHECK_CFLAGS($[]Name,,[]Name="")
+ IEM_CHECK_CFLAGS($[]Name,,[]Name="")
+ IEM_CHECK_CXXFLAGS($[]Name,,[]Name="")
+ IEM_CHECK_LDFLAGS($[]Name,,[]Name="")
fi
- if test "x$[]Name" != "x"; then
- AC_CHECK_LDFLAGS($[]Name,,[]Name="")
- fi
undefine([Name])
fi
diff --git a/m4/iem_simd.m4 b/m4/iem_simd.m4
index 38a8137..6ae4c2e 100644
--- a/m4/iem_simd.m4
+++ b/m4/iem_simd.m4
@@ -21,13 +21,14 @@ if test "$simd" != no; then
# Choose a default set of architectures based upon platform.
SIMD="SSE2"
fi
- AC_MSG_RESULT([$SIMD])
for smd in $SIMD
do
case "${smd}" in
SSE2|sse2)
- AC_CHECK_CFLAGS([-mfpmath=sse -msse])
+ AC_MSG_RESULT([SSE2])
+ IEM_CHECK_CFLAGS([-mfpmath=sse -msse])
+ IEM_CHECK_CXXFLAGS([-mfpmath=sse -msse])
;;
*)
AC_MSG_RESULT([unknown SIMD instructions: ${smd}])