openbsd-ports/print/cups/patches/patch-config-scripts_cups-compiler_m4
kili 21c389b0db 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 ajacoutot@ (maintainer)
2011-07-05 16:36:04 +00:00

33 lines
944 B
Plaintext

$OpenBSD: patch-config-scripts_cups-compiler_m4,v 1.4 2011/07/05 16:36:04 kili Exp $
--- config-scripts/cups-compiler.m4.orig Sat Jun 11 00:59:36 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
# Default to optimize-for-size and debug
- OPTIM="-Os -g"
+ OPTIM=""
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"