From 1c04bafe27990a337df6b9a8582669fe110eb2ae Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 22 Jan 2014 13:34:30 +0100 Subject: [PATCH] configure: Fixed linker options when checking for amqp_tcp_socket_new. This fixes the check when using GCC's --as-needed which fails when options are not specified in the right order. Libraries (-l options) have to be specified after any source files. autoconf does the right thing when using $LIBS for that case rather than $LDFLAGS. --- configure.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 81b26116..0f2db078 100644 --- a/configure.in +++ b/configure.in @@ -3534,8 +3534,10 @@ if test "x$with_librabbitmq" = "xyes" then SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" + SAVE_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags" - LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags -lrabbitmq" + LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags" + LIBS="-lrabbitmq" AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h) AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"]) @@ -3559,6 +3561,7 @@ then CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" + LIBS="$SAVE_LIBS" fi # }}} -- 2.11.0