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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
Simon Wilkinson 2012-09-16 15:39:25 +01:00 committed by Derrick Brashear
parent 519f2b96c7
commit 88fc3c6f42
30 changed files with 61 additions and 58 deletions

View File

@ -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 \

View File

@ -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 \

View File

@ -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 \

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -7,6 +7,7 @@
/Makefile.config
/Makefile.libtool
/Makefile.lwp
/Makefile.lwptool
/Makefile.shared
/Makefile.pthread
/Makefile.version

View File

@ -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)

View File

@ -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) $<

View File

@ -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

View File

@ -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) $<

View File

@ -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) $<

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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 \

View File

@ -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}

View File

@ -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)

View File

@ -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@

View File

@ -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)

View File

@ -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 \

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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@

View File

@ -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@

View File

@ -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@