summaryrefslogtreecommitdiff
path: root/config-scripts/cups-compiler.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config-scripts/cups-compiler.m4')
-rw-r--r--config-scripts/cups-compiler.m425
1 files changed, 15 insertions, 10 deletions
diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4
index 2bf1442a..252f2aa2 100644
--- a/config-scripts/cups-compiler.m4
+++ b/config-scripts/cups-compiler.m4
@@ -132,18 +132,23 @@ if test -n "$GCC"; then
# Not available to LSB binaries...
AC_MSG_CHECKING(if GCC supports -fPIE)
OLDCFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -fPIE"
- AC_TRY_COMPILE(,,
- [case "$CC" in
- *clang)
+ case "$uname" in
+ Darwin*)
+ CFLAGS="$CFLAGS -fPIE -Wl,-pie"
+ AC_TRY_COMPILE(,,[
PIEFLAGS="-fPIE -Wl,-pie"
- ;;
- *)
+ AC_MSG_RESULT(yes)],
+ AC_MSG_RESULT(no))
+ ;;
+
+ *)
+ CFLAGS="$CFLAGS -fPIE -pie"
+ AC_TRY_COMPILE(,,[
PIEFLAGS="-fPIE -pie"
- ;;
- esac
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
+ AC_MSG_RESULT(yes)],
+ AC_MSG_RESULT(no))
+ ;;
+ esac
CFLAGS="$OLDCFLAGS"
fi