summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-12-30 20:16:28 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-12-30 20:16:28 +0100
commit8a04ec4b278b8d2379673e038c4bb072432e261b (patch)
tree8f63eca3bd4ddcafbc3404c8145f05f4b59a8f1b
parenteb10ac5e8abd41c386d05e555406ec92a54f0164 (diff)
Fix 'unknown option: --no-undefined' error on OSX.
-rw-r--r--configure.ac17
1 files changed, 10 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index f323db2..1a3e285 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,16 +95,18 @@ dnl Check for -Wl,--no-undefined or -Wl,-undefined,error support
dnl ===========================
AC_LANG_PUSH([C++])
TMP_CXXFLAGS="$CXXFLAGS"
-AC_MSG_CHECKING([whether CXX supports '-Wl,--no-undefined'])
-CXXFLAGS="-Wall -Werror -Wl,--no-undefined"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+TMP_LDFLAGS="$LDFLAGS"
+AC_MSG_CHECKING([whether linker supports '-Wl,-no-undefined'])
+CXXFLAGS="-Wall -Werror"
+LDFLAGS="-no-undefined"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[ AC_MSG_RESULT([yes])
- NO_UNDEFINED_PARAM=-Wl,--no-undefined
+ NO_UNDEFINED_PARAM=-Wl,-no-undefined
],
[ AC_MSG_RESULT([no])
- AC_MSG_CHECKING([whether CXX supports '-Wl,-undefined,error'])
- CXXFLAGS="-Wall -Werror -Wl,-undefined,error"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ AC_MSG_CHECKING([whether linker supports '-Wl,-undefined,error'])
+ LDFLAGS="-undefined,error"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])
NO_UNDEFINED_PARAM=-Wl,-undefined,error
],
@@ -115,6 +117,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
]
)
CXXFLAGS="$TMP_CXXFLAGS"
+LDFLAGS="$TMP_LDFLAGS"
AC_LANG_POP([C++])
dnl ===========================