summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-07 00:56:53 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-07 00:56:53 +0300
commit743f46105e1fc10acf08bd5c79cfbf3ca571282a (patch)
tree5c3346f080bf80c0c65b993dda5c9a5405027144 /configure.ac
parentabe7009c7347dd2821bc687d8eb692bac2609bc2 (diff)
downloadmv-743f46105e1fc10acf08bd5c79cfbf3ca571282a.tar.gz
mv-743f46105e1fc10acf08bd5c79cfbf3ca571282a.tar.bz2
mv-743f46105e1fc10acf08bd5c79cfbf3ca571282a.tar.xz
mv-743f46105e1fc10acf08bd5c79cfbf3ca571282a.zip
Enable -rdynamic flag only if it supported by linker.
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac54
1 files changed, 54 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4df89a250..406fc3688 100755
--- a/configure.ac
+++ b/configure.ac
@@ -580,6 +580,60 @@ if test "x$naclbuild_enabled" == "xtrue"; then
AC_CHECK_SDL()
fi
+AC_DEFUN([AC_CHECK_CXX_FLAG],
+ [
+ AC_MSG_CHECKING([whether $CC supports $1])
+ OLD_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -Werror $1"
+ test_flag=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [
+ AC_MSG_RESULT([yes])
+ test_flag=yes
+ ],
+ [
+ AC_MSG_RESULT([no])
+ test_flag=no
+ ]
+ CXXFLAGS="$OLD_CXXFLAGS"
+ )
+ AM_CONDITIONAL($2, test x$test_flag = xtrue)
+ ]
+)
+
+AC_DEFUN([AC_CHECK_LD_FLAG],
+ [
+ AC_MSG_CHECKING([whether $LD supports $1])
+ OLD_CXXFLAGS="$CXXFLAGS"
+ OLD_LDFLAGS="$LDFLAGS"
+ CXXFLAGS=""
+ LDFLAGS="$LDFLAGS $1"
+ test_flag=no
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([
+ int main(int argc, char **argv)
+ {
+ return 0;
+ }
+ ])],
+ [
+ AC_MSG_RESULT([yes])
+ test_flag=yes
+ ],
+ [
+ AC_MSG_RESULT([no])
+ test_flag=no
+ ]
+ CXXFLAGS="$OLD_CXXFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+ )
+ AM_CONDITIONAL($2, test x$test_flag = xyes)
+ ]
+)
+
+AC_CHECK_LD_FLAG(-rdynamic, HAVE_RDYNAMIC)
+
AC_CONFIG_FILES([
manaplus.spec
Makefile