$OpenBSD: patch-config-scripts_cups-compiler_m4,v 1.6 2012/08/04 14:37:04 ajacoutot Exp $

Don't only test wether GCC support -pie but also test wether a program
built with -pie actually runs; this fixes the build on arm.

--- config-scripts/cups-compiler.m4.orig	Fri Jan 20 17:22:58 2012
+++ config-scripts/cups-compiler.m4	Thu Jul 26 10:38:03 2012
@@ -124,16 +124,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"
