From 88fc3c6f4257561d30234651fc5ec46ea62b020f Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 16 Sep 2012 15:39:25 +0100 Subject: [PATCH] Split up libtool support into LWP and pthread Currently, the type of library you build is determined by whether the library is build in a pthread, or an lwp build directory. However, this prevents building an LWP library in a directory that builds pthreaded clients and servers. As we want to continue to provide LWP libraries for backwards compatibility, but move over to pthreaded binaries, this causes some issues. So, split up the libtool logic, so we have Makefile.libtool, which you include if you want to build a pthreaded libtool library, and Makefile.lwptool, for building a library which supports LWP and pthreaded use. These only affect how .lo files are built - so the .o files used for non-library objects are managed with the Makefile.pthread and Makefile.lwp includes as before. Change-Id: Ib1af48342253230abab9056eb15a3f79bd77a6de Reviewed-on: http://gerrit.openafs.org/8126 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- Makefile.in | 1 + configure.ac | 1 + src/audit/Makefile.in | 2 +- src/auth/Makefile.in | 2 +- src/cmd/Makefile.in | 2 +- src/comerr/Makefile.in | 2 +- src/config/.gitignore | 1 + src/config/Makefile.config.in | 27 +++++++++++++++++++++++++-- src/config/Makefile.libtool.in | 30 ++++-------------------------- src/config/Makefile.lwp.in | 4 ---- src/config/Makefile.lwptool.in | 10 ++++++++++ src/config/Makefile.pthread.in | 4 ---- src/fsint/Makefile.in | 2 +- src/kauth/Makefile.in | 2 +- src/libacl/Makefile.in | 2 +- src/libafsauthent/Makefile.in | 1 - src/libafsrpc/Makefile.in | 1 - src/lwp/Makefile.in | 2 +- src/opr/Makefile.in | 2 +- src/ptserver/Makefile.in | 2 +- src/rx/Makefile.in | 2 +- src/rxkad/Makefile.in | 2 +- src/rxstat/Makefile.in | 2 +- src/sys/Makefile.in | 2 +- src/tbutc/Makefile.in | 1 - src/ubik/Makefile.in | 2 +- src/usd/Makefile.in | 2 +- src/util/Makefile.in | 2 +- src/vlserver/Makefile.in | 2 +- src/volser/Makefile.in | 2 +- 30 files changed, 61 insertions(+), 58 deletions(-) create mode 100644 src/config/Makefile.lwptool.in diff --git a/Makefile.in b/Makefile.in index 6ccbb03dd9..b8cfb81852 100644 --- a/Makefile.in +++ b/Makefile.in @@ -815,6 +815,7 @@ distclean: clean src/config/Makefile.config \ src/config/Makefile.libtool \ src/config/Makefile.lwp \ + src/config/Makefile.lwptool \ src/config/Makefile.pthread \ src/config/Makefile.shared \ src/config/Makefile.version \ diff --git a/configure.ac b/configure.ac index 03143eee62..627781585a 100644 --- a/configure.ac +++ b/configure.ac @@ -154,6 +154,7 @@ src/config/Makefile \ src/config/Makefile.config \ src/config/Makefile.libtool \ src/config/Makefile.lwp \ +src/config/Makefile.lwptool \ src/config/Makefile.pthread \ src/config/Makefile.shared \ src/config/Makefile.version-CML \ diff --git a/src/audit/Makefile.in b/src/audit/Makefile.in index 037b3d9be3..8ac4e0fc1b 100644 --- a/src/audit/Makefile.in +++ b/src/audit/Makefile.in @@ -14,8 +14,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool LT_objs=audit.lo audit-file.lo audit-sysvmq.lo LT_deps = $(top_builddir)/src/rxkad/liboafs_rxkad.la \ diff --git a/src/auth/Makefile.in b/src/auth/Makefile.in index 784664ba38..e6001c2035 100644 --- a/src/auth/Makefile.in +++ b/src/auth/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool BASE_objs= cellconfig.lo keys.lo userok.lo writeconfig.lo authcon.lo \ acfg_errors.lo ktc_errors.lo netrestrict.lo token.xdr.lo token.lo \ diff --git a/src/cmd/Makefile.in b/src/cmd/Makefile.in index f0d2f4c043..452aca9922 100644 --- a/src/cmd/Makefile.in +++ b/src/cmd/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.pthread +include @TOP_OBJDIR@/src/config/Makefile.libtool LT_objs=cmd_errors.lo cmd.lo config_file.lo AFS_component_version_number.lo LT_deps=$(top_builddir)/src/comerr/liboafs_comerr.la diff --git a/src/comerr/Makefile.in b/src/comerr/Makefile.in index d6ec21b0ac..75bc1615e1 100644 --- a/src/comerr/Makefile.in +++ b/src/comerr/Makefile.in @@ -6,8 +6,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool LT_objs = error_msg.lo et_name.lo com_err.lo LT_deps = $(top_builddir)/src/opr/liboafs_opr.la diff --git a/src/config/.gitignore b/src/config/.gitignore index 3d3de334de..14b88ac1ac 100644 --- a/src/config/.gitignore +++ b/src/config/.gitignore @@ -7,6 +7,7 @@ /Makefile.config /Makefile.libtool /Makefile.lwp +/Makefile.lwptool /Makefile.shared /Makefile.pthread /Makefile.version diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index ecd15e9619..a8ba4842de 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -232,6 +232,30 @@ SHD_CCRULE_NOQ=$(RUN_CC_NOQ) $(MT_CC) $(SHD_CFLAGS) $(CFLAGS_$(@)) -o $@ -c LT_CCRULE=$(RUN_CC) $(LIBTOOL) --quiet --mode=compile --tag=CC \ $(MT_CC) $(PTH_CFLAGS) $(CFLAGS_$(@)) -o $@ -c +LT_current=0 +LT_revision=0 +LT_age=0 + +# Basic rule to link a shared library. +LT_LDLIB_shlib=$(LIBTOOL) --quiet --mode=link --tag=CC \ + $(MT_CC) -rpath $(libdir) \ + $(PTH_LDFLAGS) $(PTH_CFLAGS) $(LDFLAGS_$(@)) \ + -o $@ \ + -no-undefined \ + -export-symbols $@.sym \ + -version-info=$(LT_current):$(LT_revision):$(LT_age) + + +# Link a static convenience library (contains no PIC code) +LT_LDLIB_static=$(LIBTOOL) --quiet --mode=link --tag=CC \ + $(MT_CC) -static $(LDFLAGS) $(DBG) $(OPTMZ) \ + $(LDFLAGS_$(@)) -o $@ + +# Link a convenience library for use in other libs (contains PIC code) +LT_LDLIB_pic= $(LIBTOOL) --quiet --mode=link --tag=CC \ + $(MT_CC) $(LDFLAGS) $(DBG) $(OPTMZ) \ + $(LDFLAGS_$(@)) -o $@ + # Libtool - for objects that are built for both pthread and lwp libraries LTLWP_CCRULE=$(RUN_CC) $(LWPTOOL) --mode compile \ --lwpcc "$(CCOBJ)" \ @@ -247,7 +271,6 @@ LT_LDLIB_lwp=$(RUN_LD) $(LWPTOOL) --mode link \ -o $@ \ -- - # Use this to link an executable with one or more libtool libraries LT_LDRULE = $(RUN_LD) $(LIBTOOL) --quiet --mode=link --tag=CC \ $(MT_CC) $(PTH_LDFLAGS) $(PTH_CFLAGS) \ @@ -260,7 +283,7 @@ LT_LDRULE_static = $(RUN_LD) $(LIBTOOL) --quiet --mode=link --tag=CC \ LT_INSTALL_DATA=$(LIBTOOL) --quiet --mode=install $(INSTALL_DATA) LT_INSTALL_PROGRAM=$(LIBTOOL) --quiet --mode=install $(INSTALL_PROGRAM) -LT_CLEAN=$(RM) -rf .libs *.la *.lo +LT_CLEAN=$(RM) -rf .lwp .libs *.la *.lo # Default rules. These will be overriden if the module Makefile specifically # includes a particular type (lwp, pthread, or shared) diff --git a/src/config/Makefile.libtool.in b/src/config/Makefile.libtool.in index 534809e9d5..e0a732d754 100644 --- a/src/config/Makefile.libtool.in +++ b/src/config/Makefile.libtool.in @@ -1,34 +1,12 @@ # This Makefile fragment contains rules necessary to build libtool libraries, # the Makefile rules necessary to use them are all in Makefile.config -LT_current=0 -LT_revision=0 -LT_age=0 - -# Basic rule to link a shared library. -LT_LDLIB_shlib=$(LIBTOOL) --quiet --mode=link --tag=CC \ - $(MT_CC) -rpath $(libdir) \ - $(PTH_LDFLAGS) $(PTH_CFLAGS) $(LDFLAGS_$(@)) \ - -o $@ \ - -no-undefined \ - -export-symbols $@.sym \ - -version-info=$(LT_current):$(LT_revision):$(LT_age) - - -# Link a static convenience library (contains no PIC code) -LT_LDLIB_static=$(LIBTOOL) --quiet --mode=link --tag=CC \ - $(MT_CC) -static $(LDFLAGS) $(DBG) $(OPTMZ) \ - $(LDFLAGS_$(@)) -o $@ - -# Link a convenience library for use in other libs (contains PIC code) -LT_LDLIB_pic= $(LIBTOOL) --quiet --mode=link --tag=CC \ - $(MT_CC) $(LDFLAGS) $(DBG) $(OPTMZ) \ - $(LDFLAGS_$(@)) -o $@ - -LT_CLEAN=$(RM) -rf .libs *.la *.lo - .SUFFIXES: .lo +.c.lo: + $(LT_CCRULE) $< +%.lo: %.c + $(LT_CCRULE) $< .m.lo: $(LT_CCRULE) $< diff --git a/src/config/Makefile.lwp.in b/src/config/Makefile.lwp.in index 0d536d6516..0025968065 100644 --- a/src/config/Makefile.lwp.in +++ b/src/config/Makefile.lwp.in @@ -3,10 +3,6 @@ AFS_LDFLAGS = $(LWP_LDFLAGS) AFS_CCRULE =$(LWP_CCRULE) AFS_CCRULE_NOQ =$(LWP_CCRULE_NOQ) -.c.lo: - $(LTLWP_CCRULE) $< -%.lo: %.c - $(LTLWP_CCRULE) $< .c.o: $(AFS_CCRULE) $< %.o: %.c diff --git a/src/config/Makefile.lwptool.in b/src/config/Makefile.lwptool.in new file mode 100644 index 0000000000..4cdb417eba --- /dev/null +++ b/src/config/Makefile.lwptool.in @@ -0,0 +1,10 @@ +# This Makefile fragment contains rules for building libraries that are +# an lwp/libtool mixture + +.SUFFIXES: .lo + +.c.lo: + $(LTLWP_CCRULE) $< +%.lo: %.c + $(LTLWP_CCRULE) $< + diff --git a/src/config/Makefile.pthread.in b/src/config/Makefile.pthread.in index 471b0d4363..f4af720d7a 100644 --- a/src/config/Makefile.pthread.in +++ b/src/config/Makefile.pthread.in @@ -10,9 +10,5 @@ AFS_LDRULE_NOQ=$(RUN_LD_NOQ) $(MT_CC) $(AFS_LDFLAGS) $(AFS_CFLAGS) $(LDFLAGS_$(@ $(AFS_CCRULE) $< %.o: %.c $(AFS_CCRULE) $< -.c.lo: - $(LT_CCRULE) $< -%.lo: %.c - $(LT_CCRULE) $< .m.o: $(AFS_CCRULE) $< diff --git a/src/fsint/Makefile.in b/src/fsint/Makefile.in index f0e3127911..925e50e4b9 100644 --- a/src/fsint/Makefile.in +++ b/src/fsint/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool LT_objs = \ afsaux.lo \ diff --git a/src/kauth/Makefile.in b/src/kauth/Makefile.in index 37ce7edb48..f57ef52d76 100644 --- a/src/kauth/Makefile.in +++ b/src/kauth/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool BASE_objs = kauth.xdr.lo kauth.cs.lo kaaux.lo client.lo authclient.lo \ katoken.lo kautils.lo kalocalcell.lo kaerrors.lo diff --git a/src/libacl/Makefile.in b/src/libacl/Makefile.in index 62e14066e1..a8a795e057 100644 --- a/src/libacl/Makefile.in +++ b/src/libacl/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool LT_objs = aclprocs.lo netprocs.lo AFS_component_version_number.lo LT_deps = $(top_builddir)/src/ptserver/liboafs_prot.la diff --git a/src/libafsauthent/Makefile.in b/src/libafsauthent/Makefile.in index 51ecccc6e7..4033a8084c 100644 --- a/src/libafsauthent/Makefile.in +++ b/src/libafsauthent/Makefile.in @@ -10,7 +10,6 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config include @TOP_OBJDIR@/src/config/Makefile.libtool -include @TOP_OBJDIR@/src/config/Makefile.pthread LT_objs = \ $(top_builddir)/src/audit/libauthent_audit.la \ diff --git a/src/libafsrpc/Makefile.in b/src/libafsrpc/Makefile.in index 54e3e6aa86..97f1cc5736 100644 --- a/src/libafsrpc/Makefile.in +++ b/src/libafsrpc/Makefile.in @@ -8,7 +8,6 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config include @TOP_OBJDIR@/src/config/Makefile.libtool -include @TOP_OBJDIR@/src/config/Makefile.pthread LT_objs = \ $(top_builddir)/src/fsint/libafsrpc_fsint.la \ diff --git a/src/lwp/Makefile.in b/src/lwp/Makefile.in index cf061a4434..9ea5f77198 100644 --- a/src/lwp/Makefile.in +++ b/src/lwp/Makefile.in @@ -9,8 +9,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool DBG=${LWP_DBG} OPTMZ=${LWP_OPTMZ} diff --git a/src/opr/Makefile.in b/src/opr/Makefile.in index 48430a6e9d..6414697f5c 100644 --- a/src/opr/Makefile.in +++ b/src/opr/Makefile.in @@ -1,7 +1,7 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.pthread +include @TOP_OBJDIR@/src/config/Makefile.libtool LT_objs = assert.lo casestrcpy.lo rbtree.lo uuid.lo LT_libs = $(LIB_hcrypto) $(LIB_roken) diff --git a/src/ptserver/Makefile.in b/src/ptserver/Makefile.in index 7f8b811ed2..aa0c3a4963 100644 --- a/src/ptserver/Makefile.in +++ b/src/ptserver/Makefile.in @@ -6,8 +6,8 @@ # directory or online at http://www.openafs.org/dl/license10.html srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool ENABLE_PTHREADED_UBIK=@ENABLE_PTHREADED_UBIK@ diff --git a/src/rx/Makefile.in b/src/rx/Makefile.in index 0af5f5ae95..b5cfe3b525 100644 --- a/src/rx/Makefile.in +++ b/src/rx/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool MODULE_CFLAGS=$(RXDEBUG) diff --git a/src/rxkad/Makefile.in b/src/rxkad/Makefile.in index 6351131b26..31ba16e9f4 100644 --- a/src/rxkad/Makefile.in +++ b/src/rxkad/Makefile.in @@ -9,8 +9,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool INCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \ ${TOP_INCDIR}/rx/fcrypt.h \ diff --git a/src/rxstat/Makefile.in b/src/rxstat/Makefile.in index 9fb4a0db66..a84e7ce5b1 100644 --- a/src/rxstat/Makefile.in +++ b/src/rxstat/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool LT_objs = rxstat.cs.lo rxstat.ss.lo rxstat.xdr.lo rxstat.lo LT_deps = $(top_builddir)/src/rx/liboafs_rx.la diff --git a/src/sys/Makefile.in b/src/sys/Makefile.in index a3e3e8d035..fcad0cad08 100644 --- a/src/sys/Makefile.in +++ b/src/sys/Makefile.in @@ -9,8 +9,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool SFLAGS=-I${TOP_INCDIR} LIBS=libsys.a \ diff --git a/src/tbutc/Makefile.in b/src/tbutc/Makefile.in index e0886f8df2..a96b05c421 100644 --- a/src/tbutc/Makefile.in +++ b/src/tbutc/Makefile.in @@ -7,7 +7,6 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.pthread diff --git a/src/ubik/Makefile.in b/src/ubik/Makefile.in index 76b6a4b274..60b37bf73f 100644 --- a/src/ubik/Makefile.in +++ b/src/ubik/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool LT_authent_objs = uinit.lo ubikclient.lo uerrors.lo ubik_int.cs.lo \ ubik_int.xdr.lo diff --git a/src/usd/Makefile.in b/src/usd/Makefile.in index c4249bbdf6..ff5f9f635a 100644 --- a/src/usd/Makefile.in +++ b/src/usd/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.pthread +include @TOP_OBJDIR@/src/config/Makefile.libtool LT_objs = usd_file.lo AFS_component_version_number.lo LT_deps = $(top_builddir)/src/opr/liboafs_opr.la diff --git a/src/util/Makefile.in b/src/util/Makefile.in index f669840468..021e2ddecf 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool HELPER_SPLINT=@HELPER_SPLINT@ diff --git a/src/vlserver/Makefile.in b/src/vlserver/Makefile.in index 54980dcc34..d2ac689395 100644 --- a/src/vlserver/Makefile.in +++ b/src/vlserver/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool ENABLE_PTHREADED_UBIK = @ENABLE_PTHREADED_UBIK@ diff --git a/src/volser/Makefile.in b/src/volser/Makefile.in index 1c4334b52f..87f4dd4980 100644 --- a/src/volser/Makefile.in +++ b/src/volser/Makefile.in @@ -7,8 +7,8 @@ srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config -include @TOP_OBJDIR@/src/config/Makefile.libtool include @TOP_OBJDIR@/src/config/Makefile.lwp +include @TOP_OBJDIR@/src/config/Makefile.lwptool HELPER_SPLINT=@HELPER_SPLINT@