dump makeshlib.sh. Use the new saved export list files for AIX.
* aclocal.m4 (KRB5_BUILD_LIBRARY_WITH_DEPS): Substitute MAKE_SHLIB_COMMAND, not
LDCOMBINE and LDCOMBINE_TAIL.
* 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.
* config/lib.in (lib$(LIB)$(SHLIBVEXT)): Set objlist to the list of object
files before invoking MAKE_SHLIB_COMMAND, instead of wrapping the list with
LDCOMBINE and LDCOMBINE_TAIL. Depend on SHLIB_EXPORT_FILE_DEP.
* config/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.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16263
dc483132-0cff-0310-8789-
dd5450dbe970
+2004-04-22 Ken Raeburn <raeburn@mit.edu>
+
+ * aclocal.m4 (KRB5_BUILD_LIBRARY_WITH_DEPS): Substitute
+ MAKE_SHLIB_COMMAND, not LDCOMBINE and LDCOMBINE_TAIL.
+
2004-03-23 Ken Raeburn <raeburn@mit.edu>
* aclocal.m4 (KRB5_AC_MAINTAINER_MODE, KRB5_AC_ENABLE_THREADS,
AC_CHECK_PROG(AR, ar, ar, false)
AC_SUBST(LIBLIST)
AC_SUBST(LIBLINKS)
-AC_SUBST(LDCOMBINE)
-AC_SUBST(LDCOMBINE_TAIL)
+AC_SUBST(MAKE_SHLIB_COMMAND)
AC_SUBST(SHLIB_EXPFLAGS)
AC_SUBST(INSTALL_SHLIB)
AC_SUBST(STLIBEXT)
+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
$$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) $@
SHEXT = @SHEXT@
STEXT=@STEXT@
VEXT=@VEXT@
-DO_MAKE_SHLIB = @DO_MAKE_SHLIB@
-SHLIB_STATIC_TARGET=@SHLIB_STATIC_TARGET@
TOPLIBD = $(BUILDTOP)/lib
# 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)"
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
# 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...
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)'
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