summaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/ChangeLog15
-rw-r--r--src/config/lib.in10
-rw-r--r--src/config/pre.in18
-rw-r--r--src/config/shlib.conf14
4 files changed, 45 insertions, 12 deletions
diff --git a/src/config/ChangeLog b/src/config/ChangeLog
index 87c5a5ef52..2328beb8eb 100644
--- a/src/config/ChangeLog
+++ b/src/config/ChangeLog
@@ -1,3 +1,18 @@
+2004-04-22 Ken Raeburn <raeburn@mit.edu>
+
+ * pre.in (DO_MAKE_SHLIB, SHLIB_STATIC_TARGET, LDCOMBINE,
+ LDCOMBINE_TAIL): Delete unused variables.
+ (SHLIB_EXPORT_FILE, SHLIB_EXPORT_FILE_DEP, MAKE_SHLIB_COMMAND):
+ New variables.
+ * lib.in (lib$(LIB)$(SHLIBVEXT)): Depend on
+ SHLIB_EXPORT_FILE_DEP. Set objlist to the list of object files
+ before invoking MAKE_SHLIB_COMMAND, instead of wrapping the list
+ with LDCOMBINE and LDCOMBINE_TAIL.
+ * shlib.conf: Set MAKE_SHLIB_COMMAND, using LDCOMBINE and
+ LDCOMBINE_TAIL in the common case.
+ (case *-*-aix*): Specify new commands, taken from makeshlib.sh,
+ but assume the export list is provided externally.
+
2004-03-23 Ken Raeburn <raeburn@mit.edu>
* shlib.conf (default_static, default_shared): New variables to
diff --git a/src/config/lib.in b/src/config/lib.in
index 95d938fd25..30c0f499d7 100644
--- a/src/config/lib.in
+++ b/src/config/lib.in
@@ -39,16 +39,16 @@ lib$(LIB)$(STLIBEXT): $(STOBJLISTS)
$$d/OBJS.ST; done`
$(RANLIB) $@
-lib$(LIB)$(SHLIBVEXT): $(SHOBJLISTS) $(SHLIB_EXPDEPS)
+lib$(LIB)$(SHLIBVEXT): $(SHOBJLISTS) $(SHLIB_EXPDEPS) $(SHLIB_EXPORT_FILE_DEP)
$(RM) $@
@echo "building shared $(LIB) library ($(LIBMAJOR).$(LIBMINOR))"
@dirs=`echo $(SHOBJLISTS) | \
sed -e 's%/OBJS.SH%%g' -e 's%OBJS.SH%.%'`; \
- $(LDCOMBINE) -o $@ `for d in $$dirs; do \
+ objlist=`for d in $$dirs; do \
sed -e '/^$$/d' -e "s%^%$$d/%" -e "s% % $$d/%g" \
- $$d/OBJS.SH; done` \
- $(SHLIB_EXPFLAGS) \
- $(LDCOMBINE_TAIL)
+ $$d/OBJS.SH; done` ; \
+ set -x ; $(MAKE_SHLIB_COMMAND)
+
lib$(LIB)$(SHLIBSEXT): lib$(LIB)$(SHLIBVEXT)
$(RM) $@
$(LN_S) lib$(LIB)$(SHLIBVEXT) $@
diff --git a/src/config/pre.in b/src/config/pre.in
index 63cf8c5766..c0d002c1b0 100644
--- a/src/config/pre.in
+++ b/src/config/pre.in
@@ -258,8 +258,6 @@ HOST_TYPE = @HOST_TYPE@
SHEXT = @SHEXT@
STEXT=@STEXT@
VEXT=@VEXT@
-DO_MAKE_SHLIB = @DO_MAKE_SHLIB@
-SHLIB_STATIC_TARGET=@SHLIB_STATIC_TARGET@
TOPLIBD = $(BUILDTOP)/lib
@@ -482,11 +480,19 @@ SHLIBEXT=@SHLIBEXT@
# usually _p.a
PFLIBEXT=@PFLIBEXT@
-# "cc -G", "ld -Bshareable", etc.
-LDCOMBINE=@LDCOMBINE@
+# File with symbol names to be exported, both functions and data,
+# currently not distinguished.
+SHLIB_EXPORT_FILE=$(srcdir)/lib$(LIB).exports
+
+# File that needs to be current for building the shared library,
+# usually SHLIB_EXPORT_FILE, but not always, if we have to convert
+# it to another, intermediate form for the linker.
+SHLIB_EXPORT_FILE_DEP=$(SHLIB_EXPORT_FILE)
-# Misc args to tack on the tail of LDCOMBINE
-LDCOMBINE_TAIL=@LDCOMBINE_TAIL@
+# Command to run to build a shared library.
+# In systems that require multiple commands, like AIX, it may need
+# to change to rearrange where the various parameters fit in.
+MAKE_SHLIB_COMMAND=@MAKE_SHLIB_COMMAND@
# flags for explicit libraries depending on this one,
# e.g. "-R$(SHLIB_RPATH) $(SHLIB_SHLIB_DIRFLAGS) $(SHLIB_EXPLIBS)"
diff --git a/src/config/shlib.conf b/src/config/shlib.conf
index e3d8536626..64ac7c1b53 100644
--- a/src/config/shlib.conf
+++ b/src/config/shlib.conf
@@ -16,6 +16,11 @@ SHOBJEXT=.so
PFOBJEXT=.po
# Default for systems w/o shared libraries
CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)'
+# This will do for most platforms, and we'll substitute for
+# LDCOMBINE, SHLIB_EXPFLAGS, and LDCOMBINE_TAIL below.
+# ** Perhaps we should drop LDCOMBINE* as separate substitutions?
+#MAKE_SHLIB_COMMAND='$(LDCOMBINE) -o $@ $$objlist $(SHLIB_EXPFLAGS) $(LDCOMBINE_TAIL)'
+MAKE_SHLIB_COMMAND=x
# Default to static or shared libraries?
default_static=no
@@ -289,6 +294,7 @@ mips-*-netbsd*)
# Linux ld doesn't default to stuffing the SONAME field...
# Use objdump -x to examine the fields of the library
LDCOMBINE='$(CC) -shared -fPIC -Wl,-h,lib$(LIB)$(SHLIBSEXT)'
+ # -Wl,--retain-symbols-file,$(SHLIB_EXPORT_FILE)
LDCOMBINE_TAIL=''
# For cases where we do have dependencies on other libraries
# built in this tree...
@@ -316,14 +322,16 @@ mips-*-netbsd*)
SHLIBEXT=.a
# AIX doesn't need separate PIC objects
SHOBJEXT=.o
- LDCOMBINE='$(BUILDTOP)/util/makeshlib $(LIBMAJOR).$(LIBMINOR)'
SHLIB_EXPFLAGS=' $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
PROFFLAGS=-pg
if test "$krb5_cv_prog_gcc" = "yes" ; then
RPATH_FLAG='-Wl,-blibpath:'
+ LDCOMBINE='$(CC) -shared -v -o shr.o.$(LIBMAJOR).$(LIBMINOR) $$objlist -nostartfiles -Xlinker -bgcbypass:1 -Xlinker -bfilelist -Xlinker -bM:SRE -Xlinker -bE:$(SHLIB_EXPORT_FILE) -Xlinker -berok $(SHLIB_EXPFLAGS) -lc'
else
RPATH_FLAG=-blibpath:
+ LDCOMBINE='/bin/ld -o shr.o.$(LIBMAJOR).$(LIBMINOR) $$objlist -H512 -T512 -bnoentry -bgcbypass:1 -bnodelcsect -bfilelist -bM:SRE -bE:$(SHLIB_EXPORT_FILE) -berok $(SHLIB_EXPFLAGS) -lc'
fi
+ MAKE_SHLIB_COMMAND="${LDCOMBINE}"' && ar cq $@ shr.o.$(LIBMAJOR).$(LIBMINOR) && chmod +x $@ && rm -f shr.o.$(LIBMAJOR).$(LIBMINOR)'
RPATH_TAIL=:/usr/lib:/lib
CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) $(RPATH_FLAG)$(PROG_RPATH):'"$RPATH_TAIL"' $(CFLAGS) $(LDFLAGS)'
CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)'
@@ -331,3 +339,7 @@ mips-*-netbsd*)
RUN_ENV='LIBPATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`:$(PROG_RPATH):/usr/lib:/usr/local/lib; export LIBPATH; '
esac
+
+if test "${MAKE_SHLIB_COMMAND}" = "x" ; then
+ MAKE_SHLIB_COMMAND="${LDCOMBINE} -o \$@ \$\$objlist \$(SHLIB_EXPFLAGS) ${LDCOMBINE_TAIL}"
+fi