Closed GoogleCodeExporter closed 9 years ago
That's peculiar, why do you need LIBS set, it's filling in LDFLAGS, so it
should work.
Documentation for AC_LINK_IFELSE says it observes LDFLAGS:
http://www.hep.by/gnu/autoconf/Running-the-Linker.html
Original comment by breser
on 3 Jun 2013 at 10:55
Yes, I would expect this to work, and it only seems to occur in the chrooted
osc build environment (open build service). Works fine in a regular system.
Relevant config.log section below. The exact gcc command compiles the conftest
code fine elsewhere. Odd.
configure:4779: checking for krb5-config
configure:4783: result: /usr/lib/mit//bin/krb5-config
configure:4785: checking for gssapi support in krb5-config
configure:4788: result: yes
configure:4869: checking if gssapi works
configure:4878: gcc -std=gnu99 -o conftest -fomit-frame-pointer
-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -pthread
-DSERF_HAVE_GSSAPI -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE
-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err conftest.c >&5
/tmp/ccoQtD6s.o: In function `main':
/home/abuild/rpmbuild/BUILD/serf-1.2.1/conftest.c:22: undefined reference to
`gss_init_sec_context'
collect2: error: ld returned 1 exit status
configure:4878: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
|
| #include <gssapi.h>
| int main()
| {gss_init_sec_context(NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL,
NULL, NULL, NULL);}
configure:4889: result: no
configure:4891: error: cannot find GSSAPI (Kerberos)
Original comment by andreas.stieger@gmx.de
on 4 Jun 2013 at 6:09
This works as well:
Index: serf-1.2.1/configure.in
===================================================================
--- serf-1.2.1.orig/configure.in 2013-06-03 18:52:41.000000000 +0100
+++ serf-1.2.1/configure.in 2013-06-04 07:15:02.000000000 +0100
@@ -230,7 +230,7 @@ AC_ARG_WITH(gssapi,
fi
APR_ADDTO(CFLAGS, "$GSSAPI_cflags")
APR_ADDTO(CFLAGS, [-DSERF_HAVE_GSSAPI])
- APR_ADDTO(LDFLAGS, "$GSSAPI_libs")
+ APR_ADDTO(LIBS, "$GSSAPI_libs")
AC_MSG_CHECKING([if gssapi works])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <gssapi.h>
Original comment by andreas.stieger@gmx.de
on 4 Jun 2013 at 6:17
LIBS should be used instead of LDFLAGS, because order is important.
`man ld` in description of -l option says:
The linker will search an archive only once, at the location where it is
specified on the command line. If the archive defines a symbol which was
undefined in some object which appeared before the archive on the command line,
the linker will include the appropriate file(s) from the archive. However, an
undefined symbol in an object appearing later on the command line will not
cause the linker to search the archive again.
Original comment by Arfrever...@gmail.com
on 4 Jun 2013 at 6:20
Applied the patch to use LIBS by Andreas Stieger.
Original comment by breser
on 5 Jun 2013 at 11:30
Original comment by breser
on 5 Jun 2013 at 11:33
Original issue reported on code.google.com by
andreas.stieger@gmx.de
on 3 Jun 2013 at 9:36Attachments: