openbsd-ports/print/cups/patches/patch-config-scripts_cups-compiler_m4
kili 74bc48a8f7 Don't only test wether GCC support -pie but also test wether a
program built with -pie actually runs. Fixes the build on arm.

ok ajacoutot@
2010-04-04 18:42:14 +00:00

29 lines
870 B
Plaintext

$OpenBSD: patch-config-scripts_cups-compiler_m4,v 1.2 2010/04/04 18:42:14 kili Exp $
--- config-scripts/cups-compiler.m4.orig Sun May 17 02:13:47 2009
+++ config-scripts/cups-compiler.m4 Sun Apr 4 20:10:14 2010
@@ -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
@@ -152,10 +152,11 @@ if test -n "$GCC"; then
AC_MSG_CHECKING(if GCC supports -pie)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -pie -fPIE"
- AC_TRY_COMPILE(,,
- PIEFLAGS="-pie -fPIE"
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ AC_RUN_IFELSE(
+ AC_LANG_PROGRAM(,[[return 0;]]),
+ PIEFLAGS="-pie -fPIE"
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
if test "x$with_optim" = x; then