[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: library dependancies



>>>>> "Brian" == Brian May <bam@snoopy.apana.org.au> writes:

    Brian> 1. where is this function defined?

    Brian> [555] [snoopy:unstable:bam]
    Brian> ~/source/ext2fs/heimdal-0.3e/build-tree/heimdal-0.3e/lib
    Brian> >gcc -o/dev/null sl/.libs/libss.so /usr/lib/crt1.o: In
    Brian> function `_start': /usr/lib/crt1.o(.text+0x18): undefined
    Brian> reference to `main' sl/.libs/libss.so: undefined reference
    Brian> to `com_err_va' collect2: ld returned 1 exit status

I get the impression that function must get imported from the
application, as kadmin works fine.

I have attached a new patch. This is the same as the last one, except:

- adds -no-undefined to all libraries (in hindsight this probably
wasn't a good idea for libsl, as one function is meant to be
undefined, see above).

- removes the --static flag for libeditline, as this confuses libtool
into building a shared library with non-PIC code.

Please can you add this patch ASAP? I think it is very important that
interdependencies are handled correctly. Even better, add libtool 1.4
support too (this was easy to do, once I re-installed the latest CVS
versions of autoconf and automake).

Thanks.

diff -ruN heimdal-0.3e-old/cf/Makefile.am.common heimdal-0.3e/cf/Makefile.am.common
--- heimdal-0.3e-old/cf/Makefile.am.common	Tue Dec  5 20:11:09 2000
+++ heimdal-0.3e/cf/Makefile.am.common	Sat May 12 17:00:04 2001
@@ -171,8 +171,7 @@
 endif
 
 if KRB5
-LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
-	$(top_builddir)/lib/asn1/libasn1.la
+LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la
 LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
 endif
 
diff -ruN heimdal-0.3e-old/cf/roken-frag.m4 heimdal-0.3e/cf/roken-frag.m4
--- heimdal-0.3e-old/cf/roken-frag.m4	Sat Dec 16 01:29:54 2000
+++ heimdal-0.3e/cf/roken-frag.m4	Sat May 12 17:22:41 2001
@@ -578,9 +578,9 @@
 dnl moved to AC_OUTPUT in configure.in
 dnl AC_CONFIG_FILES($1/Makefile)
 
-LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
+dnl LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
 
 AC_SUBST(DIR_roken)dnl
 AC_SUBST(LIB_roken)dnl
 AC_SUBST(INCLUDES_roken)dnl
-])
\ No newline at end of file
+])
diff -ruN heimdal-0.3e-old/cf/roken.m4 heimdal-0.3e/cf/roken.m4
--- heimdal-0.3e-old/cf/roken.m4	Sun Jul  9 01:50:34 2000
+++ heimdal-0.3e/cf/roken.m4	Sat May 12 16:30:55 2001
@@ -56,7 +56,7 @@
   CPPFLAGS_roken="-I$i/include"
 fi
 
-LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
+dnl LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
 
 AC_SUBST(LIB_roken)dnl
 AC_SUBST(DIR_roken)dnl
diff -ruN heimdal-0.3e-old/lib/asn1/Makefile.am heimdal-0.3e/lib/asn1/Makefile.am
--- heimdal-0.3e-old/lib/asn1/Makefile.am	Tue Jan 30 12:46:53 2001
+++ heimdal-0.3e/lib/asn1/Makefile.am	Sat May 12 18:50:28 2001
@@ -5,7 +5,9 @@
 YFLAGS = -d
 
 lib_LTLIBRARIES = libasn1.la
-libasn1_la_LDFLAGS = -version-info 4:0:2
+libasn1_la_LDFLAGS = -version-info 4:0:2 -no-undefined
+libasn1_la_LIBADD = \
+	$(top_builddir)/lib/com_err/libcom_err.la
 
 BUILT_SOURCES =			\
 	$(gen_files:.x=.c)	\
diff -ruN heimdal-0.3e-old/lib/auth/sia/Makefile.am heimdal-0.3e/lib/auth/sia/Makefile.am
--- heimdal-0.3e-old/lib/auth/sia/Makefile.am	Tue Jan 30 09:38:36 2001
+++ heimdal-0.3e/lib/auth/sia/Makefile.am	Sat May 12 18:51:33 2001
@@ -74,7 +74,7 @@
 foodir = $(libdir)
 foo_DATA = $(MOD)
 
-LDFLAGS = -rpath $(libdir) -hidden -exported_symbol siad_\* 
+LDFLAGS = -rpath $(libdir) -hidden -exported_symbol siad_\*  -no-undefined
 
 OBJS = sia.o posix_getpw.o
 
diff -ruN heimdal-0.3e-old/lib/com_err/Makefile.am heimdal-0.3e/lib/com_err/Makefile.am
--- heimdal-0.3e-old/lib/com_err/Makefile.am	Wed Aug 16 21:24:54 2000
+++ heimdal-0.3e/lib/com_err/Makefile.am	Sat May 12 18:51:37 2001
@@ -5,7 +5,7 @@
 YFLAGS = -d
 
 lib_LTLIBRARIES = libcom_err.la
-libcom_err_la_LDFLAGS = -version-info 1:1:0
+libcom_err_la_LDFLAGS = -version-info 1:1:0 -no-undefined
 
 bin_PROGRAMS = compile_et
 
diff -ruN heimdal-0.3e-old/lib/des/Makefile.am heimdal-0.3e/lib/des/Makefile.am
--- heimdal-0.3e-old/lib/des/Makefile.am	Tue Jan 30 12:47:41 2001
+++ heimdal-0.3e/lib/des/Makefile.am	Sat May 12 18:51:43 2001
@@ -3,7 +3,7 @@
 include $(top_srcdir)/Makefile.am.common
 
 lib_LTLIBRARIES = libdes.la
-libdes_la_LDFLAGS = -version-info 3:0:0
+libdes_la_LDFLAGS = -version-info 3:0:0 -no-undefined
 
 include_HEADERS = des.h md4.h md5.h sha.h rc4.h
 
diff -ruN heimdal-0.3e-old/lib/editline/Makefile.am heimdal-0.3e/lib/editline/Makefile.am
--- heimdal-0.3e-old/lib/editline/Makefile.am	Wed Nov 15 10:22:29 2000
+++ heimdal-0.3e/lib/editline/Makefile.am	Sun May 13 08:37:43 2001
@@ -38,13 +38,13 @@
 	unix.h \
 	$(EXTRA_SOURCE)
 
-libeditline_la_LDFLAGS = -static
+libeditline_la_LDFLAGS = -no-undefined
 
 EXTRA_SOURCE = $(ES) 
 
 libel_compat_la_SOURCES = edit_compat.c
 
-libel_compat_la_LDFLAGS = -static
+libel_compat_la_LDFLAGS = -no-undefined
 
 EXTRA_DIST = $(man_MANS)
 
diff -ruN heimdal-0.3e-old/lib/gssapi/Makefile.am heimdal-0.3e/lib/gssapi/Makefile.am
--- heimdal-0.3e-old/lib/gssapi/Makefile.am	Tue Jan 30 12:51:53 2001
+++ heimdal-0.3e/lib/gssapi/Makefile.am	Sat May 12 18:52:05 2001
@@ -5,7 +5,11 @@
 INCLUDES += -I$(srcdir)/../krb5 $(INCLUDE_krb4)
 
 lib_LTLIBRARIES = libgssapi.la
-libgssapi_la_LDFLAGS = -version-info 3:0:2
+libgssapi_la_LDFLAGS = -version-info 3:0:2 -no-undefined
+libgssapi_la_LIBADD = \
+	$(LIB_krb5) \
+	$(LIB_des) \
+	$(top_builddir)/lib/asn1/libasn1.la 
 
 include_HEADERS = gssapi.h
 
diff -ruN heimdal-0.3e-old/lib/hdb/Makefile.am heimdal-0.3e/lib/hdb/Makefile.am
--- heimdal-0.3e-old/lib/hdb/Makefile.am	Tue Jan 30 12:49:16 2001
+++ heimdal-0.3e/lib/hdb/Makefile.am	Sat May 12 18:52:10 2001
@@ -12,17 +12,18 @@
 CLEANFILES = $(BUILT_SOURCES) $(foo) hdb_asn1.h asn1_files
 
 noinst_PROGRAMS = convert_db
-LDADD = libhdb.la \
+LDADD = libhdb.la
+
+lib_LTLIBRARIES = libhdb.la
+libhdb_la_LDFLAGS = -version-info 7:0:0 -no-undefined
+libhdb_la_LIBADD = \
 	$(LIB_openldap) \
 	../krb5/libkrb5.la \
 	../asn1/libasn1.la \
-	$(LIB_des) \
 	$(LIB_roken) \
+	$(top_builddir)/lib/com_err/libcom_err.la \
 	$(DBLIB)
 
-lib_LTLIBRARIES = libhdb.la
-libhdb_la_LDFLAGS = -version-info 7:0:0
-
 libhdb_la_SOURCES =				\
 	common.c				\
 	db.c					\
@@ -38,8 +39,6 @@
 INCLUDES += $(INCLUDE_openldap)
 
 include_HEADERS = hdb.h hdb_err.h hdb_asn1.h hdb-protos.h hdb-private.h
-
-libhdb_la_LIBADD = $(LIB_openldap)
 
 $(libhdb_la_OBJECTS): $(srcdir)/hdb-protos.h $(srcdir)/hdb-private.h
 
diff -ruN heimdal-0.3e-old/lib/kadm5/Makefile.am heimdal-0.3e/lib/kadm5/Makefile.am
--- heimdal-0.3e-old/lib/kadm5/Makefile.am	Tue Jan 30 12:56:00 2001
+++ heimdal-0.3e/lib/kadm5/Makefile.am	Sat May 12 18:52:14 2001
@@ -3,8 +3,21 @@
 include $(top_srcdir)/Makefile.am.common
 
 lib_LTLIBRARIES = libkadm5srv.la libkadm5clnt.la
-libkadm5srv_la_LDFLAGS = -version-info 7:3:0
+libkadm5srv_la_LDFLAGS = -version-info 7:3:0 -no-undefined
+libkadm5srv_la_LIBADD = \
+	$(LIB_roken) \
+	$(LIB_krb5) \
+	$(top_builddir)/lib/com_err/libcom_err.la \
+	$(top_builddir)/lib/asn1/libasn1.la \
+	$(top_builddir)/lib/hdb/libhdb.la \
+	$(LIB_dlopen)
+
 libkadm5clnt_la_LDFLAGS = -version-info 6:1:2
+libkadm5clnt_la_LIBADD = \
+	$(LIB_roken) \
+	$(LIB_krb5) \
+	$(top_builddir)/lib/com_err/libcom_err.la
+
 sbin_PROGRAMS = dump_log replay_log truncate_log
 
 libexec_PROGRAMS = ipropd-master ipropd-slave
diff -ruN heimdal-0.3e-old/lib/kafs/Makefile.am heimdal-0.3e/lib/kafs/Makefile.am
--- heimdal-0.3e-old/lib/kafs/Makefile.am	Mon Dec 11 11:44:50 2000
+++ heimdal-0.3e/lib/kafs/Makefile.am	Sat May 12 18:52:17 2001
@@ -41,7 +41,7 @@
 
 
 lib_LTLIBRARIES = $(AFSLIBS)
-libkafs_la_LDFLAGS = -version-info 2:3:2
+libkafs_la_LDFLAGS = -version-info 2:3:2 -no-undefined
 foodir = $(libdir)
 foo_DATA = $(AFS_EXTRA_LIBS)
 # EXTRA_DATA = afslib.so
diff -ruN heimdal-0.3e-old/lib/kdfs/Makefile.am heimdal-0.3e/lib/kdfs/Makefile.am
--- heimdal-0.3e-old/lib/kdfs/Makefile.am	Mon Dec 11 11:46:47 2000
+++ heimdal-0.3e/lib/kdfs/Makefile.am	Sat May 12 18:52:23 2001
@@ -7,4 +7,4 @@
 libkdfs_la_SOURCES = \
 	k5dfspag.c
 
-libkdfs_la_LDFLAGS = -version-info 0:1:0
+libkdfs_la_LDFLAGS = -version-info 0:1:0 -no-undefined
diff -ruN heimdal-0.3e-old/lib/krb5/Makefile.am heimdal-0.3e/lib/krb5/Makefile.am
--- heimdal-0.3e-old/lib/krb5/Makefile.am	Tue Jan 30 12:50:52 2001
+++ heimdal-0.3e/lib/krb5/Makefile.am	Sat May 12 18:52:27 2001
@@ -9,16 +9,15 @@
 check_PROGRAMS = n-fold-test string-to-key-test
 TESTS = n-fold-test string-to-key-test
 
-LDADD = libkrb5.la \
-	$(LIB_des) \
-	$(top_builddir)/lib/asn1/libasn1.la \
-	$(LIB_roken)
+LDADD = libkrb5.la
 
 libkrb5_la_LIBADD = \
-	../com_err/error.lo ../com_err/com_err.lo \
+	$(LIB_res_search) \
+	$(top_builddir)/lib/com_err/libcom_err.la \
 	$(LIB_des) \
 	$(top_builddir)/lib/asn1/libasn1.la \
-	$(LIB_roken)
+	$(LIB_roken) \
+	$(LIB_dbopen)
 
 lib_LTLIBRARIES = libkrb5.la
 
@@ -119,7 +118,7 @@
 	write_message.c \
 	$(ERR_FILES)
 
-libkrb5_la_LDFLAGS = -version-info 15:0:0
+libkrb5_la_LDFLAGS = -version-info 15:0:0 -no-undefined
 
 $(libkrb5_la_OBJECTS): $(srcdir)/krb5-protos.h $(srcdir)/krb5-private.h
 
diff -ruN heimdal-0.3e-old/lib/otp/Makefile.am heimdal-0.3e/lib/otp/Makefile.am
--- heimdal-0.3e-old/lib/otp/Makefile.am	Tue Jan 30 12:54:48 2001
+++ heimdal-0.3e/lib/otp/Makefile.am	Sat May 12 18:52:31 2001
@@ -6,15 +6,16 @@
 
 noinst_PROGRAMS = otptest
 
-otptest_LDADD = libotp.la \
-	$(LIB_des) \
-	$(LIB_roken) \
-	$(DBLIB)
+otptest_LDADD = libotp.la
 
 include_HEADERS = otp.h
 
 lib_LTLIBRARIES = libotp.la
-libotp_la_LDFLAGS = -version-info 1:2:1
+libotp_la_LDFLAGS = -version-info 1:2:1 -no-undefined
+libotp_la_LIBADD = \
+	$(LIB_roken) \
+	$(LIB_des) \
+	$(DBLIB)
 
 libotp_la_SOURCES = \
 	otp.c \
diff -ruN heimdal-0.3e-old/lib/roken/Makefile.am heimdal-0.3e/lib/roken/Makefile.am
--- heimdal-0.3e-old/lib/roken/Makefile.am	Tue Jan 30 12:53:30 2001
+++ heimdal-0.3e/lib/roken/Makefile.am	Sat May 12 18:52:34 2001
@@ -10,7 +10,12 @@
 CLEANFILES = roken.h make-roken.c $(XHEADERS)
 
 lib_LTLIBRARIES = libroken.la
-libroken_la_LDFLAGS = -version-info 11:1:2
+libroken_la_LDFLAGS = -version-info 11:1:2 -no-undefined
+libroken_la_LIBADD = \
+	@LIB_res_search@ \
+	$(LIB_des) \
+	@LIB_dbopen@ \
+	@LTLIBOBJS@
 
 noinst_PROGRAMS = make-roken
 
@@ -149,8 +154,6 @@
 	writev.c
 
 EXTRA_DIST = roken.awk roken.h.in
-
-libroken_la_LIBADD = @LTLIBOBJS@
 
 $(LTLIBOBJS) $(libroken_la_OBJECTS): $(include_HEADERS) roken.h
 
diff -ruN heimdal-0.3e-old/lib/sl/Makefile.am heimdal-0.3e/lib/sl/Makefile.am
--- heimdal-0.3e-old/lib/sl/Makefile.am	Sat Jan 27 02:00:09 2001
+++ heimdal-0.3e/lib/sl/Makefile.am	Sat May 12 19:01:23 2001
@@ -7,11 +7,11 @@
 include_HEADERS = sl.h
 
 lib_LTLIBRARIES = libsl.la libss.la
-libsl_la_LDFLAGS = -version-info 1:1:1
-libss_la_LDFLAGS = -version-info 1:3:1
+libsl_la_LDFLAGS = -version-info 1:1:1 -no-undefined
+libss_la_LDFLAGS = -version-info 1:3:1 -no-undefined
 
-libsl_la_LIBADD = @LIB_readline@
-libss_la_LIBADD = @LIB_readline@
+libsl_la_LIBADD = $(LIB_roken) @LIB_readline@
+libss_la_LIBADD = $(LIB_roken) @LIB_readline@
 
 RENAME_SRC = roken_rename.h strtok_r.c snprintf.c
 
diff -ruN heimdal-0.3e-old/lib/vers/Makefile.am heimdal-0.3e/lib/vers/Makefile.am
--- heimdal-0.3e-old/lib/vers/Makefile.am	Wed Jan 31 14:50:48 2001
+++ heimdal-0.3e/lib/vers/Makefile.am	Sat May 12 18:53:25 2001
@@ -19,6 +19,7 @@
 endif
 
 libvers_la_SOURCES	= print_version.c
+libvers_la_LDFLAGS	= -no-undefined
 
 print_version.lo: print_version.h
 
diff -ruN heimdal-0.3e-old/tools/krb5-config.in heimdal-0.3e/tools/krb5-config.in
--- heimdal-0.3e-old/tools/krb5-config.in	Mon Jan 29 17:56:51 2001
+++ heimdal-0.3e/tools/krb5-config.in	Sat May 12 17:01:01 2001
@@ -89,6 +89,9 @@
 if test "$do_libs" = "yes"; then
     lib_flags="-L${libdir}"
     case $library in
+    krb5)
+	lib_flags="$lib_flags -lkrb5"
+	;;
     gssapi)
 	lib_flags="$lib_flags -lgssapi"
 	;;
@@ -99,8 +102,8 @@
 	lib_flags="$lib_flags -lkadm5srv"
 	;;
     esac
-    lib_flags="$lib_flags -lkrb5 -lasn1 @LIB_des_appl@ -lroken"
-    lib_flags="$lib_flags @LIB_crypt@ @LIB_dbopen@ @LIBS@"
+#    lib_flags="$lib_flags -lkrb5 -lasn1 @LIB_des_appl@ -lroken"
+#    lib_flags="$lib_flags @LIB_crypt@ @LIB_dbopen@ @LIBS@"
     echo $lib_flags
 fi
 if test "$do_cflags" = "yes"; then
-- 
Brian May <bam@snoopy.apana.org.au>