On Sun, Sep 25, 2005 at 12:18:05PM +0200, Petr Salinger wrote: > When library is in the same project, it is for linking better > to specify "$dir/lib$name.la" instead of "-L$dir -l$name".
Thankyou. I'd tried this before with a different problem, and was bitten by libtool1.4 turning .la references into -lblah references, which obviously breaks if the filename doesn't start with 'lib'. I'd not thought of trying it here, where the filename _does_ start with 'lib'. > When attached patch is applied, freeradius can be compiled > and started on amd64. Interestingly, just the supplied patch caused rlm_eap to be left out of the build entirely here, as during make install the .la file sent rlm_eap.so's build looking at the install directory, and libeap.so was not yet in place. > The patch patches same files as 06_libtool14_vs_rlm_eap_tls.dpatch > and (unused) 08_make_install_libeap_before_make_dynamic_eap_types.dpatch. > The attached patch should be applied after "debian/rules patch" The 08 patch was my first cut at fixing this exact problem, which wasn't wildly successful. > It would be better to integrate this patches together. Thanks for the patch, I've managed to integrate it here, although it did still require that libeap be make-installed before rlm_eap in order to install rlm_eap properly. (So it took some extra Makefile mucking about which I'll push upstream, altough I doubt a 1.0.6 is on the cards.) It'll be fixed in the next upload, which may be delayed as the libtool maintainer has broken support for libtool1.4 and libltdl3-dev being simultaneously supported, and I am hoping he'll manage to fix FreeRADIUS for me, but in the meantime it'll FTBFS. Since the fix may involve a libtool 1.5 port, this might all become meaningless. Or need redoing. I won't tag this, as I can't promise an upload soon. I have however attached the updated 06 dpatch for your edification. (Renamed as it no longer applies to just rlm_eap_tls). #! /bin/sh /usr/share/dpatch/dpatch-run ## 07_libtool14_vs_rlm_eap.dpatch by Paul Hampson <[EMAIL PROTECTED]> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: libtool 1.4 is the libtool for the FreeRADIUS 1.0 series, ## DP: but it can't link against a library that's not lib*.so as ## DP: it unconditionally changes references to libraries into ## DP: "-Ldir -lblah" on the command line. ## DP: This patch works around that by hardlinking rlm_eap_* to ## DP: librlm_eap_* so that libtool can find it in the build ## DP: directory. The right soname gets extracted, so at runtime ## DP: the correct rlm_eap_* is used. ## DP: From FreeRADIUS bugzilla #75 http://bugs.freeradius.org/show_bug.cgi?id=75 ## DP: Patch ID #77 by Luca Landi ## DP: Modified to match a patch by Petr Salinger in Debian BTS 288547 to access ## DP: needed modules by directly referencing the .la instead of -L-l-ing them. ## DP: This however requires libeap to be installed before rlm_eap_sim, so there's ## DP: a little Makefile hackery here to add RLM_PREINSTALL to the Rules.mak file ## DP: and use it to install libeap before rlm_eap, or rlm_eap fails to link. @DPATCH@ diff -urNad freeradius-1.0.5~/src/modules/rlm_eap/Makefile.in freeradius-1.0.5/src/modules/rlm_eap/Makefile.in --- freeradius-1.0.5~/src/modules/rlm_eap/Makefile.in 2005-04-12 07:18:28.000000000 +1000 +++ freeradius-1.0.5/src/modules/rlm_eap/Makefile.in 2005-09-26 02:49:05.000000000 +1000 @@ -2,14 +2,15 @@ SRCS = rlm_eap.c eap.c mem.c state.c HEADERS = eap.h rlm_eap.h RLM_CFLAGS = $(INCLTDL) [EMAIL PROTECTED]@/libeap -CLIENTLIBS = -Llibeap -leap -L../../lib -lradius -RLM_LIBS = -Llibeap -leap +RLM_LIBS = @srcdir@/libeap/libeap.la +CLIENTLIBS = $(RLM_LIBS) -L../../lib -lradius #RLM_LIBS = $(shell for x in types/rlm_eap*/rlm_eap*.la;do echo -dlpreopen $$x;done) +RLM_PREINSTALL = install-libeap RLM_INSTALL = install-types RLM_SUBDIRS = libeap @eaptypes@ RLM_UTILS = radeapclient -.PHONY: all install-types common +.PHONY: all install-types install-libeap common $(STATIC_OBJS): $(HEADERS) @@ -32,8 +33,15 @@ radeapclient.o: radeapclient.c $(INCLUDES) $(CC) $(CFLAGS) ${RLM_CFLAGS} -c radeapclient.c +install-libeap: + @echo "Making install in libeap..." + @(cd libeap && $(MAKE) $(MFLAGS) install) + install-types: - @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=install common + @for dir in @eaptypes@; do \ + echo "Making install in $$dir..."; \ + (cd $$dir && $(MAKE) $(MFLAGS) install) || exit $?;\ + done $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radeapclient$(EXEEXT) $(R)$(bindir) common: diff -urNad freeradius-1.0.5~/src/modules/rlm_eap/types/Makefile freeradius-1.0.5/src/modules/rlm_eap/types/Makefile --- freeradius-1.0.5~/src/modules/rlm_eap/types/Makefile 2005-04-12 07:18:28.000000000 +1000 +++ freeradius-1.0.5/src/modules/rlm_eap/types/Makefile 2005-09-26 02:48:12.000000000 +1000 @@ -16,7 +16,7 @@ $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common common: - @for mod in rlm_eap*; do \ + @for mod in rlm_eap_tls rlm_eap*; do \ what=$(WHAT_TO_MAKE); \ [ "$$what" = "all" ] && what="$(TARGET_LIBS)"; \ if [ -d $$mod ] && [ -f $$mod/Makefile ]; then \ diff -urNad freeradius-1.0.5~/src/modules/rlm_eap/types/rlm_eap_peap/Makefile.in freeradius-1.0.5/src/modules/rlm_eap/types/rlm_eap_peap/Makefile.in --- freeradius-1.0.5~/src/modules/rlm_eap/types/rlm_eap_peap/Makefile.in 2004-06-04 01:49:23.000000000 +1000 +++ freeradius-1.0.5/src/modules/rlm_eap/types/rlm_eap_peap/Makefile.in 2005-09-26 02:48:12.000000000 +1000 @@ -3,7 +3,7 @@ RLM_CFLAGS = $(INCLTDL) -I../.. @eap_peap_cflags@ -I../rlm_eap_tls -DOPENSSL_NO_KRB5 [EMAIL PROTECTED]@/../../libeap HEADERS = ../rlm_eap_tls/rlm_eap_tls.h eap_peap.h ../../eap.h ../../rlm_eap.h RLM_INSTALL = -RLM_LIBS = [EMAIL PROTECTED]@/../../libeap -leap @eap_peap_ldflags@ +RLM_LIBS = @srcdir@/../../libeap/libeap.la @srcdir@/../rlm_eap_tls/liblrlm_eap_tls.la @eap_peap_ldflags@ $(STATIC_OBJS): $(HEADERS) diff -urNad freeradius-1.0.5~/src/modules/rlm_eap/types/rlm_eap_sim/Makefile.in freeradius-1.0.5/src/modules/rlm_eap/types/rlm_eap_sim/Makefile.in --- freeradius-1.0.5~/src/modules/rlm_eap/types/rlm_eap_sim/Makefile.in 2004-05-29 02:17:48.000000000 +1000 +++ freeradius-1.0.5/src/modules/rlm_eap/types/rlm_eap_sim/Makefile.in 2005-09-26 02:48:12.000000000 +1000 @@ -2,7 +2,7 @@ SRCS = rlm_eap_sim.c RLM_CFLAGS = $(INCLTDL) [EMAIL PROTECTED]@/../.. [EMAIL PROTECTED]@/../../libeap HEADERS = eap_sim.h -RLM_LIBS = [EMAIL PROTECTED]@/../../libeap -leap +RLM_LIBS = @srcdir@/../../libeap/libeap.la RLM_INSTALL = $(STATIC_OBJS): $(HEADERS) diff -urNad freeradius-1.0.5~/src/modules/rlm_eap/types/rlm_eap_ttls/Makefile.in freeradius-1.0.5/src/modules/rlm_eap/types/rlm_eap_ttls/Makefile.in --- freeradius-1.0.5~/src/modules/rlm_eap/types/rlm_eap_ttls/Makefile.in 2004-06-04 01:49:24.000000000 +1000 +++ freeradius-1.0.5/src/modules/rlm_eap/types/rlm_eap_ttls/Makefile.in 2005-09-26 02:48:12.000000000 +1000 @@ -3,7 +3,7 @@ RLM_CFLAGS = $(INCLTDL) [EMAIL PROTECTED]@/../.. [EMAIL PROTECTED]@/../../libeap @eap_ttls_cflags@ -I../rlm_eap_tls -DOPENSSL_NO_KRB5 HEADERS = ../rlm_eap_tls/rlm_eap_tls.h eap_ttls.h ../../eap.h ../../rlm_eap.h RLM_INSTALL = -RLM_LIBS = [EMAIL PROTECTED]@/../../libeap -leap @eap_ttls_ldflags@ +RLM_LIBS = @srcdir@/../../libeap/libeap.la @srcdir@/../rlm_eap_tls/librlm_eap_tls.la @eap_ttls_ldflags@ $(STATIC_OBJS): $(HEADERS) diff -urNad freeradius-1.0.5~/src/modules/rules.mak freeradius-1.0.5/src/modules/rules.mak --- freeradius-1.0.5~/src/modules/rules.mak 2005-07-31 22:48:01.000000000 +1000 +++ freeradius-1.0.5/src/modules/rules.mak 2005-09-26 02:48:12.000000000 +1000 @@ -98,6 +98,13 @@ $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \ -module $(LINK_MODE) $(LDFLAGS) $(RLM_LDFLAGS) \ -o $@ -rpath $(libdir) $^ $(RLM_LIBS) $(LIBS) + for file in .libs/rlm_eap_*.so ; do \ + [ -f $$file ] || continue; \ + name=$${file#.libs/}; \ + name=$${name%.so}; \ + ln -s .libs/$${name}.so lib$${name}.so; \ + ln -s .libs/$${name}.la lib$${name}.la; \ + done ####################################################################### # @@ -138,6 +145,7 @@ @rm -f *.a *.o *.lo *.la *~ @rm -rf .libs _libs @rm -f config.cache config.log config.status $(RLM_UTILS) + @rm -f librlm_eap_*.la librlm_eap_*.so @[ "x$(RLM_SUBDIRS)" = "x" ] || $(MAKE) $(MFLAGS) WHAT_TO_MAKE=clean common distclean: clean @@ -155,6 +163,7 @@ # Otherwise, install the libraries into $(libdir) # install: + @[ "x$(RLM_PREINSTALL)" = "x" ] || $(MAKE) $(MFLAGS) $(RLM_PREINSTALL) if [ "x$(TARGET)" != "x" ]; then \ $(LIBTOOL) --mode=install $(INSTALL) -c \ $(TARGET).la $(R)$(libdir)/$(TARGET).la; \ -- Paul "TBBle" Hampson, [EMAIL PROTECTED] 8th year CompSci/Asian Studies student, ANU Shorter .sig for a more eco-friendly paperless office.
pgplm2uEFdT1h.pgp
Description: PGP signature