<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40672 >

2009/1/28 Daniel Markstedt:
>
> On Tue, 27 Jan 2009 23:12:19 +0900, Marko Lindqvist wrote:
>>
>>  Does this help?
>
> Unfortunately not. :(
>

 How about this?


 - ML

diff -Nurd -X.diff_ignore freeciv/configure.ac freeciv/configure.ac
--- freeciv/configure.ac        2009-01-25 16:51:10.000000000 +0200
+++ freeciv/configure.ac        2009-01-28 17:33:17.000000000 +0200
@@ -569,7 +569,7 @@
   AC_CHECK_FUNCS([chdir mkdtemp])
 fi
 
-FC_ADD_WORDS_TO_VAR([LDFLAGS], ["-Wl,-rpath=${lib_prefix}"])
+FC_LD_FLAGS(["-Wl,-rpath=${lib_prefix}"], [], [LDFLAGS])
 
 AC_SUBST(gui_sources)
 AC_SUBST(CLIENT_CFLAGS)
diff -Nurd -X.diff_ignore freeciv/m4/compiler.m4 freeciv/m4/compiler.m4
--- freeciv/m4/compiler.m4      2009-01-25 16:51:08.000000000 +0200
+++ freeciv/m4/compiler.m4      2009-01-28 17:33:50.000000000 +0200
@@ -49,7 +49,7 @@
 AC_LANG_POP([$1])
 ])
 
-# Commandling flag tests for C and C++
+# Commandline flag tests for C and C++
 #
 #
 # $1 - Parameters to test
@@ -66,3 +66,25 @@
 [
 FC_COMPILER_FLAGS([C++], [CXXFLAGS], [$1], [$2], [$3])
 ])
+
+# Commandline flag tests for linker
+#
+#
+# $1 - Parameters to test
+# $2 - Additional parameters
+# $3 - Variable where to add
+AC_DEFUN([FC_LD_FLAGS],
+[
+flags_save=$LDFLAGS
+accepted_flags=""
+
+for flag in $1
+do
+  LDFLAGS="$flags_save $accepted_flags $flag $2"
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [int a;])],
+                 [FC_ADD_WORDS_TO_VAR([accepted_flags], [$flag])])
+done
+FC_ADD_WORDS_TO_VAR([$3], [$accepted_flags])
+
+LDFLAGS="$flags_save"
+])
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to