r1936 - packages/trunk/prboom/autotools
Jon Dowland
jmtd-guest at costa.debian.org
Tue Oct 24 21:27:25 UTC 2006
Author: jmtd-guest
Date: 2006-10-24 21:27:25 +0000 (Tue, 24 Oct 2006)
New Revision: 1936
Added:
packages/trunk/prboom/autotools/ac_c_compile_flags.m4
packages/trunk/prboom/autotools/ac_cpu_optimisations.m4
Log:
more missing files
Added: packages/trunk/prboom/autotools/ac_c_compile_flags.m4
===================================================================
--- packages/trunk/prboom/autotools/ac_c_compile_flags.m4 (rev 0)
+++ packages/trunk/prboom/autotools/ac_c_compile_flags.m4 2006-10-24 21:27:25 UTC (rev 1936)
@@ -0,0 +1,15 @@
+AC_DEFUN([AC_C_COMPILE_FLAGS],[
+NEW_CFLAGS="$CFLAGS"
+for ac_flag in $1
+do
+ AC_MSG_CHECKING(whether compiler supports $ac_flag)
+ CFLAGS="$NEW_CFLAGS $ac_flag"
+ AC_TRY_COMPILE(,[
+ void f() {};
+ ],[
+ NEW_CFLAGS="$CFLAGS"
+ AC_MSG_RESULT(yes)
+ ],AC_MSG_RESULT(no))
+done
+CFLAGS="$NEW_CFLAGS"
+])
Added: packages/trunk/prboom/autotools/ac_cpu_optimisations.m4
===================================================================
--- packages/trunk/prboom/autotools/ac_cpu_optimisations.m4 (rev 0)
+++ packages/trunk/prboom/autotools/ac_cpu_optimisations.m4 2006-10-24 21:27:25 UTC (rev 1936)
@@ -0,0 +1,29 @@
+dnl AC_CPU_OPTIMISATIONS
+dnl Tries to find compiler optimisation flags for the target system
+AC_DEFUN([AC_CPU_OPTIMISATIONS],[
+AC_REQUIRE([AC_CANONICAL_TARGET])
+AC_ARG_ENABLE(cpu-opt,AC_HELP_STRING([--disable-cpu-opt],[turns off cpu specific optimisations]),[
+],[
+AC_MSG_CHECKING(whether compiler supports -march=native)
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$OLD_CFLAGS -march=native"
+AC_TRY_COMPILE(,[
+ void f() {};
+],[
+ AC_MSG_RESULT(yes)
+],[
+ AC_MSG_RESULT(no)
+ CFLAGS="$OLD_CFLAGS"
+
+ case "$target" in
+ # marginal gains from aligning code
+ i386-*) ;;
+ i486-*) CPU_CFLAGS="-mtune=i486" ;;
+ # nothing special for pentium
+ # CMOV op on ppro/II/686 can help us
+ i686-*) CPU_CFLAGS="-march=i686" ;;
+ esac
+ AC_C_COMPILE_FLAGS($CPU_CFLAGS)
+])
+])
+])
More information about the Pkg-games-commits
mailing list