summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-12-10 11:36:55 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-12-10 11:36:55 +0100
commit3abdd4484cca514988ff190f0547811d48f41031 (patch)
treef8749e9644300eba7d3d8a883511eec4b671c257 /configure.ac
parent38934122192a7c1fff8686c7a49ffce5b0fa399c (diff)
Added check for -Wl,--no-undefined or -Wl,-undefined,error in the CXX to be able to support no-undefined during linking with clang.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 29 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 8f2c71a..120944c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,9 +70,37 @@ HUGIN_PARM="-DDISABLE_HUGIN"
AC_ARG_WITH([debug],
AS_HELP_STRING([--with-debug], [Build with debug support]))
+dnl ===========================
+dnl Check for -Wl,--no-undefined or -Wl,-undefined,error support
+dnl ===========================
+TMP_CXXFLAGS="$CXXFLAGS"
+AC_MSG_CHECKING([whether CXX supports '-Wl,--no-undefined'])
+CXXFLAGS=-Wl,--no-undefined
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [ AC_MSG_RESULT([yes])
+ NO_UNDEFINED_PARAM=-Wl,--no-undefined
+ ],
+ [ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([whether CXX supports '-Wl,-undefined,error'])
+ CXXFLAGS=-Wl,-undefined,error
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [AC_MSG_RESULT([yes])
+ NO_UNDEFINED_PARAM=-Wl,-undefined,error
+ ],
+ [AC_MSG_RESULT([no])
+ NO_UNDEFINED_PARAM=""
+ ]
+ )
+ ]
+)
+CXXFLAGS="$TMP_CXXFLAGS"
+
+dnl ===========================
+dnl Set up debug compile args if the user requested it
+dnl ===========================
AS_IF([test "x$with_debug" == "xyes"],
[AC_MSG_WARN([*** Building with debug support!])
- CXXFLAGS="$CXXFLAGS -Wall -Werror -g -Wl,--no-undefined"
+ CXXFLAGS="$CXXFLAGS -Wall -Werror -g $NO_UNDEFINED_PARAM"
HUGIN_PARM=""]
)