The attached patch puts the library list used by mklibs into a variable, and 
does it in a fashion that makes it easy to add new libraries to the list.  
It's needed because there are more library directories of the source tree 
that need to be added to the list (patch for that to be submitted later).

This patch replicates the behavior of the current Makefile, even including the 
things I think are bugs ;-).  We can argue about that later.  It also adds a 
make target 'show_mklibs_list' so you can easily view what library list will 
be passed to mklibs.

Index: Makefile
===================================================================
RCS file: /cvsroot/systemimager/systemimager/Makefile,v
retrieving revision 1.189
diff -u -r1.189 Makefile
--- Makefile	12 May 2005 15:04:32 -0000	1.189
+++ Makefile	12 May 2005 21:01:50 -0000
@@ -239,6 +239,28 @@
 # This has to be right after all to make all the default target
 include $(TOPDIR)/make.d/*.rul $(INITRD_DIR)/initrd.rul
 
+# Construct the list of directories for mklibs to search
+#
+# This 'ifeq' mirrors what's in the previous revision of this Makefile.
+# I think it's a bug, because with build host libraries "first" it means we'll
+# prefer .so files from the build host's directories over the ones we build.  So,
+# whether we use the libraries we built is dependent upon whether or not there was a
+# corresponding -devel package installed on the build host. jerrygd
+# I think they should be last, not first, in the library search list.
+
+ifeq ($(USERSPACE64),1)
+	BOEL_MKLIBS_LOCATIONS := /lib64:/usr/lib64
+else
+	BOEL_MKLIBS_LOCATIONS := /lib:/usr/lib
+endif
+BOEL_MKLIBS_LOCATIONS := $(BOEL_MKLIBS_LOCATIONS):$(SRC_DIR)/$(PARTED_DIR)/libparted/.libs
+# The only reason you need this is because openssh is linking against the openssl on the build
+# host distro, and it is built with kerberos enabled.
+BOEL_MKLIBS_LOCATIONS := $(BOEL_MKLIBS_LOCATIONS):/usr/kerberos/lib
+BOEL_MKLIBS_LOCATIONS := $(BOEL_MKLIBS_LOCATIONS):$(SRC_DIR)/$(DISCOVER_DIR)/lib/.libs
+show_mklibs_locations:
+	@echo $(BOEL_MKLIBS_LOCATIONS)
+
 # a complete server install
 .PHONY:	install_server_all
 install_server_all:	install_server install_common install_binaries
@@ -563,13 +585,8 @@
 	test ! -d /lib64 || cp -a /lib64/ld* $(BOEL_BINARIES_DIR)/lib64
 endif
 
-ifeq ($(USERSPACE64),1)
 	cd $(BOEL_BINARIES_DIR) \
-		&& $(PYTHON) $(TOPDIR)/initrd_source/mklibs -L /lib64:/usr/lib64:$(SRC_DIR)/$(PARTED_DIR)/libparted/.libs:/usr/kerberos/lib:$(SRC_DIR)/$(DISCOVER_DIR)/lib/.libs -v -d lib bin/* sbin/*
-else
-	cd $(BOEL_BINARIES_DIR) \
-		&& $(PYTHON) $(TOPDIR)/initrd_source/mklibs -L /lib:/usr/lib:$(SRC_DIR)/$(PARTED_DIR)/libparted/.libs:/usr/kerberos/lib:$(SRC_DIR)/$(DISCOVER_DIR)/lib/.libs -v -d lib bin/* sbin/*
-endif
+		&& $(PYTHON) $(TOPDIR)/initrd_source/mklibs -L $(BOEL_MKLIBS_LOCATIONS) -v -d lib bin/* sbin/*
 	#
 	# Include other files required by openssh that apparently aren't 
 	# picked up by mklibs for some reason. -BEF-

Reply via email to