From 8560fa44d8d89e0b1b45e3f951d67a7c07974c43 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 7 Mar 2017 23:46:55 +0300 Subject: Fix error in configure. Improve detection functions. --- configure.ac | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index e7c32e112..e415892f5 100755 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ AC_DEFUN([AC_CHECK_LD_FLAG], OLD_LDFLAGS="$LDFLAGS" CXXFLAGS="" LDFLAGS="$LDFLAGS $1" - test_flag=no + $2=no AC_LINK_IFELSE( [AC_LANG_SOURCE([ int main(int argc, char **argv) @@ -42,16 +42,15 @@ AC_DEFUN([AC_CHECK_LD_FLAG], ])], [ AC_MSG_RESULT([yes]) - test_flag=yes + $2=yes ], [ AC_MSG_RESULT([no]) - test_flag=no + $2=no ] CXXFLAGS="$OLD_CXXFLAGS" LDFLAGS="$OLD_LDFLAGS" ) - AM_CONDITIONAL($2, test x$test_flag = xyes) ] ) @@ -508,7 +507,7 @@ if test "x$with_librt" == "xno"; then else if test "x$applebuild_enabled" == "xfalse"; then if test "x$androidbuild_enabled" == "xfalse"; then - AC_CHECK_LD_FLAG(-lrt, USE_LIBRT) + AC_CHECK_LD_FLAG(-lrt, use_librt) if test "x$test_flag" == "xyes"; then AC_CHECK_LIB(rt, shm_open, , AC_MSG_ERROR([ *** Unable to find librt library])) @@ -518,6 +517,8 @@ else without_librt=no fi +AM_CONDITIONAL(USE_LIBRT, test x$use_librt = xyes) + # Enable tmwA AC_ARG_ENABLE(tmwa, [ --enable-tmwa Turn on tmwA support], @@ -635,8 +636,8 @@ if test "x$naclbuild_enabled" == "xtrue"; then AC_CHECK_SDL() fi - -AC_CHECK_LD_FLAG(-rdynamic, HAVE_RDYNAMIC) +AC_CHECK_LD_FLAG(-rdynamic, have_rdynamic) +AM_CONDITIONAL(HAVE_RDYNAMIC, test x$have_rdynamic = xyes) AC_CONFIG_FILES([ manaplus.spec -- cgit v1.2.3-70-g09d2