Use both -fPIE and -pie in the config test.
Actually try to run the test program, not only to compile it.
Fixes the build on arm.
ok?
Ciao,
Kili
Index: patches/patch-config-scripts_cups-compiler_m4
===================================================================
RCS file: /cvs/ports/print/cups/patches/patch-config-scripts_cups-compiler_m4,v
retrieving revision 1.3
diff -u -p -r1.3 patch-config-scripts_cups-compiler_m4
--- patches/patch-config-scripts_cups-compiler_m4 28 Jun 2011 11:52:38
-0000 1.3
+++ patches/patch-config-scripts_cups-compiler_m4 5 Jul 2011 15:00:17
-0000
@@ -1,6 +1,6 @@
$OpenBSD: patch-config-scripts_cups-compiler_m4,v 1.3 2011/06/28 11:52:38
ajacoutot Exp $
--- config-scripts/cups-compiler.m4.orig Sat Jun 11 00:59:36 2011
-+++ config-scripts/cups-compiler.m4 Tue Jun 28 13:32:08 2011
++++ config-scripts/cups-compiler.m4 Tue Jul 5 16:58:53 2011
@@ -123,7 +123,7 @@ if test -n "$GCC"; then
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
@@ -10,3 +10,23 @@ $OpenBSD: patch-config-scripts_cups-comp
else
OPTIM="$with_optim $OPTIM"
fi
+@@ -151,16 +151,9 @@ if test -n "$GCC"; then
+ # that depend on a fixed address for common functions.
+ AC_MSG_CHECKING(if GCC supports -fPIE)
+ OLDCFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -fPIE"
+- AC_TRY_COMPILE(,,
+- [case "$CC" in
+- *clang)
+- PIEFLAGS="-fPIE -Wl,-pie"
+- ;;
+- *)
+- PIEFLAGS="-fPIE -pie"
+- ;;
+- esac
++ CFLAGS="$CFLAGS -fPIE -pie"
++ AC_RUN_IFELSE(AC_LANG_PROGRAM(),
++ [PIEFLAGS="-fPIE -pie"
+ AC_MSG_RESULT(yes)],
+ AC_MSG_RESULT(no))
+ CFLAGS="$OLDCFLAGS"