*.orig
*.rej
*.o
+*.lo
*.a
+*.la
*.so
*.sl
*.so.*
/cscope.out
/include
/lib
+/libtool
/autom4te.cache
/ID
/TAGS
src/comerr/test/Makefile \
src/config/Makefile \
src/config/Makefile.config \
+ src/config/Makefile.libtool \
src/config/Makefile.lwp \
src/config/Makefile.pthread \
src/config/Makefile.shared \
--- /dev/null
+/ltmain.sh
AC_PREREQ([2.60])
AC_INIT([OpenAFS], m4_esyscmd([build-tools/git-version .]))
AC_CONFIG_AUX_DIR([build-tools])
+AC_CONFIG_MACRO_DIR([src/cf])
AC_CONFIG_SRCDIR([src/config/stds.h])
AM_INIT_AUTOMAKE
AC_USE_SYSTEM_EXTENSIONS
+LT_INIT
+
AC_PROG_CC
AC_PATH_PROGS([PATH_CPP], [cpp], [${CC-cc} -E], [$PATH:/lib:/usr/ccs/lib])
src/comerr/test/Makefile \
src/config/Makefile \
src/config/Makefile.config \
+src/config/Makefile.libtool \
src/config/Makefile.lwp \
src/config/Makefile.pthread \
src/config/Makefile.shared \
exit 1
fi
+echo "Running libtoolize"
+libtoolize -c -f
echo "Running autoconf"
autoconf
echo "Running autoconf for configure-libafs"
--- /dev/null
+/libtool.m4
+/ltoptions.m4
+/ltsugar.m4
+/ltversion.m4
+/lt~obsolete.m4
/Makefile.*_*[0123456789]
/Makefile.*_*[0123456789].in
/Makefile.config
+/Makefile.libtool
/Makefile.lwp
/Makefile.shared
/Makefile.pthread
sbindir=@sbindir@
sysconfdir=@sysconfdir@
viceetcdir=@viceetcdir@/
+top_builddir=@top_builddir@
#
LIB_hcrypto = @LIB_hcrypto@
LIB_roken = @LIB_roken@
LIB_krb5 = @KRB5_LIBS@
+LIBTOOL= @LIBTOOL@
LIBS = @LIBS@
LIB_LIBINTL = @LIB_libintl@
LINUX_KERNEL_PATH = @LINUX_KERNEL_PATH@
#
COMPILE_ET = ${TOP_OBJDIR}/src/comerr/compile_et
RXGEN = ${TOP_OBJDIR}/src/rxgen/rxgen
-SHELL = /bin/sh
+SHELL = @SHELL@
+LWPTOOL = ${TOP_SRCDIR}/config/lwptool
#
# "Pretty" build line stuff
SHD_CCRULE =$(RUN_CC) $(MT_CC) $(SHD_CFLAGS) $(CFLAGS_$(@)) -o $@ -c
SHD_CCRULE_NOQ=$(RUN_CC_NOQ) $(MT_CC) $(SHD_CFLAGS) $(CFLAGS_$(@)) -o $@ -c
+# Libtool - for objects that are part of pthread-only libraries
+LT_CCRULE=$(RUN_CC) $(LIBTOOL) --quiet --mode=compile --tag=CC \
+ $(MT_CC) $(PTH_CFLAGS) $(CFLAGS_$(@)) -o $@ -c
+
+# Libtool - for objects that are built for both pthread and lwp libraries
+LTLWP_CCRULE=$(RUN_CC) $(LWPTOOL) --mode compile \
+ --lwpcc $(CCOBJ) \
+ --mtcc "$(LIBTOOL) --quiet --mode=compile --tag=CC $(MT_CC) $(MT_CFLAGS)" \
+ -o $@ \
+ -- \
+ $(COMMON_CFLAGS) $(MODULE_CFLAGS) $(CFLAGS_$(@)) \
+ -c
+
+LT_LDLIB_lwp=$(RUN_LD) $(LWPTOOL) --mode link \
+ --ranlib "$(RANLIB)" \
+ --linker "$(AR) crv" \
+ -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) \
+ $(LDFLAGS_$(@)) -o $@
+
+LT_LDRULE_static = $(RUN_LD) $(LIBTOOL) --quiet --mode=link --tag=CC \
+ $(MT_CC) -static $(PTH_LDFLAGS) $(PTH_CFLAGS) \
+ $(LDFLAGS_$(@)) -o $@
+
+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
+
# Default rules. These will be overriden if the module Makefile specifically
# includes a particular type (lwp, pthread, or shared)
--- /dev/null
+# 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
+
+.m.lo:
+ $(LT_CCRULE) $<
+
AFS_CCRULE =$(LWP_CCRULE)
AFS_CCRULE_NOQ =$(LWP_CCRULE_NOQ)
+.c.lo:
+ $(LTLWP_CCRULE) $<
+%.lo: %.c
+ $(LTLWP_CCRULE) $<
.c.o:
$(AFS_CCRULE) $<
%.o: %.c
$(AFS_CCRULE) $<
%.o: %.c
$(AFS_CCRULE) $<
+.c.lo:
+ $(LT_CCRULE) $<
+%.lo: %.c
+ $(LT_CCRULE) $<
.m.o:
$(AFS_CCRULE) $<
--- /dev/null
+#!/bin/sh
+
+# This is a little helper script to build LWP static, and pthread shared and static
+# objects from a single source file. We use libtool to do the heavy lifting for
+# the pthreaded builds, but build the LWP objects here ourselves.
+
+lwpcc=
+mtcc=
+linker=
+ranlib=
+mode=
+object=
+done=
+
+while [ -z "$done" ] && [ $# -gt 0 ] ; do
+ case "$1" in
+ --lwpcc)
+ shift
+ lwpcc="$1"
+ shift
+ ;;
+ --mtcc)
+ shift
+ mtcc="$1"
+ shift
+ ;;
+ --linker)
+ shift
+ linker="$1"
+ shift
+ ;;
+ --mode)
+ shift
+ mode="$1"
+ shift
+ ;;
+ --ranlib)
+ shift
+ ranlib="$1"
+ shift
+ ;;
+ -o)
+ shift
+ object="$1"
+ shift
+ ;;
+ --)
+ shift;
+ done=yes
+ ;;
+ *)
+ echo "Usage: lwptool --mode compile|link -o <object> --lwpcc <lwp compiler> --mtcc <pthread compiler> -- ..." >&2;
+ exit 1;
+ ;;
+ esac
+done
+
+case "$mode" in
+compile)
+ if [ -z "$object" ] || [ -z "$lwpcc" ] || \
+ [ -z "$mtcc" ] || [ -z "$mode" ] ; then
+ echo "Usage: lwptool --mode compile -o <object>" >&2;
+ echo " --lwpcc <lwp compiler>" >&2;
+ echo " --mtcc <pthread compiler> blah -- ..." >&2;
+ exit 1
+ fi
+
+ lwpobj=`echo $object | sed -e 's/.lo$/.o/'`
+ lwpobj=".lwp/$lwpobj"
+
+ mkdir .lwp 2>/dev/null
+ echo $lwpcc -o $lwpobj "$@"
+ $lwpcc -o $lwpobj "$@" || exit 1
+ echo $mtcc -o $object "$@"
+ $mtcc -o $object "$@" || exit 1
+ ;;
+link)
+ if [ -z "$object" ] || [ -z "$linker" ] || \
+ [ -z "$ranlib" ] ; then
+ echo "Usage: l§wptool --mode linker -o <object>" >&2;
+ echo " --linker <linker and options>" >&2;
+ echo " --ranlib <ranlib>" >&2;
+ exit 1
+ fi
+
+ # This will go horribly wrong if we ever have objects with shell
+ # special characters in their names
+
+ objects=
+ while [ $# -gt 0 ] ; do
+ arg=$1;
+ realobject=`echo $arg | sed -e 's/\(.*\).lo/.lwp\/\1.o/'`
+ objects="$objects $realobject"
+ shift
+ done
+
+ rm -f $object 2>/dev/null
+ echo $linker $object $objects
+ $linker $object $objects
+ echo $ranlib $object
+ $ranlib $object
+ ;;
+esac