libtool blah take 2 (FSBUILD-82)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12932 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
771bc514c2
commit
f2d777f17b
99
bootstrap.sh
99
bootstrap.sh
|
@ -87,7 +87,7 @@ fi
|
|||
# output is multiline from 1.5 onwards
|
||||
|
||||
# Require libtool 1.4 or newer
|
||||
libtool=`${LIBDIR}/apr/build/PrintPath glibtool libtool libtool15 libtool14`
|
||||
libtool=${LIBTOOL:-`${LIBDIR}/apr/build/PrintPath glibtool libtool libtool15 libtool14`}
|
||||
lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
|
||||
if test -z "$lt_pversion"; then
|
||||
echo "bootstrap: libtool not found."
|
||||
|
@ -103,8 +103,11 @@ lt_status="good"
|
|||
if test -z "$1"; then a=0 ; else a=$1;fi
|
||||
if test -z "$2"; then b=0 ; else b=$2;fi
|
||||
if test -z "$3"; then c=0 ; else c=$3;fi
|
||||
lt_major=$a
|
||||
|
||||
if test "$a" -lt "2"; then
|
||||
if test "$a" -eq "2"; then
|
||||
lt_status="good"
|
||||
elif test "$a" -lt "2"; then
|
||||
if test "$b" -lt "5" -o "$b" = "5" -a "$c" -lt "14" ; then
|
||||
lt_status="bad"
|
||||
fi
|
||||
|
@ -121,6 +124,43 @@ echo " to build FreeSWITCH from SVN."
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# check libtoolize availability
|
||||
if [ -n "${LIBTOOL}" ]; then
|
||||
libtoolize=${LIBTOOLIZE:-`dirname "${libtool}"`/libtoolize}
|
||||
else
|
||||
libtoolize=${LIBTOOLIZE:-`${LIBDIR}/apr/build/PrintPath glibtoolize libtoolize15 libtoolize14 libtoolize`}
|
||||
fi
|
||||
if [ "x$libtoolize" = "x" ]; then
|
||||
echo "libtoolize not found in path"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "$libtoolize" ]; then
|
||||
echo "$libtoolize does not exist or ist not executable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# compare libtool and libtoolize version
|
||||
ltl_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
|
||||
ltl_version=`echo $ltl_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
|
||||
IFS=.; set $ltl_version; IFS=' '
|
||||
|
||||
if [ "x${lt_version}" != "x${ltl_version}" ]; then
|
||||
echo "$libtool and $libtoolize have different versions"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Info output
|
||||
#
|
||||
echo "Bootstrapping using:"
|
||||
echo " autoconf : ${AUTOCONF:-`which autoconf`}"
|
||||
echo " automake : ${AUTOMAKE:-`which automake`}"
|
||||
echo " aclocal : ${ACLOCAL:-`which aclocal`}"
|
||||
echo " libtool : ${libtool} (${lt_version})"
|
||||
echo " libtoolize: ${libtoolize}"
|
||||
echo
|
||||
|
||||
echo "Entering directory ${LIBDIR}/apr"
|
||||
cd ${LIBDIR}/apr
|
||||
|
||||
|
@ -144,13 +184,6 @@ cd ${LIBDIR}/apr
|
|||
# bootstrap: Build the support scripts needed to compile from a
|
||||
# checked-out version of the source code.
|
||||
|
||||
|
||||
libtoolize=`build/PrintPath glibtoolize libtoolize15 libtoolize14 libtoolize`
|
||||
if [ "x$libtoolize" = "x" ]; then
|
||||
echo "libtoolize not found in path"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the libtool helper files
|
||||
#
|
||||
# Note: we copy (rather than link) them to simplify distribution.
|
||||
|
@ -163,14 +196,23 @@ echo "Copying libtool helper files ..."
|
|||
# and libtool 1.4 by simply rerunning the bootstrap script.
|
||||
(cd build ; rm -f ltconfig ltmain.sh libtool.m4)
|
||||
|
||||
$libtoolize --copy --automake
|
||||
if ${libtoolize} -n --install 2>&1 >/dev/null ; then
|
||||
$libtoolize --force --copy --install
|
||||
else
|
||||
$libtoolize --force --copy
|
||||
fi
|
||||
|
||||
if [ -f libtool.m4 ]; then
|
||||
ltfile=`pwd`/libtool.m4
|
||||
else
|
||||
if [ $lt_major -eq 2 ]; then
|
||||
ltfindcmd="`sed -n \"/aclocaldir=/{s/.*=/echo /p;q;}\" < $libtoolize`"
|
||||
ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`/libtool.m4}
|
||||
else
|
||||
ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \
|
||||
< $libtoolize`"
|
||||
ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`}
|
||||
fi
|
||||
# Expecting the code above to be very portable, but just in case...
|
||||
if [ -z "$ltfile" -o ! -f "$ltfile" ]; then
|
||||
ltpath=`dirname $libtoolize`
|
||||
|
@ -196,19 +238,6 @@ fi
|
|||
# Clean up any leftovers
|
||||
rm -f aclocal.m4 libtool.m4
|
||||
|
||||
#
|
||||
# Generate the autoconf header and ./configure
|
||||
#
|
||||
echo "Creating include/arch/unix/apr_private.h.in ..."
|
||||
${AUTOHEADER:-autoheader}
|
||||
|
||||
echo "Creating configure ..."
|
||||
### do some work to toss config.cache?
|
||||
${AUTOCONF:-autoconf}
|
||||
|
||||
# Remove autoconf 2.5x's cache directory
|
||||
rm -rf autom4te*.cache
|
||||
|
||||
# fix for FreeBSD (at least):
|
||||
# libtool.m4 is in share/aclocal, while e.g. aclocal19 only looks in share/aclocal19
|
||||
# get aclocal's default directory and include the libtool.m4 directory via -I if
|
||||
|
@ -220,6 +249,24 @@ if [ -n "${aclocal_dir}" -a -n "${ltfile}" -a "`dirname ${ltfile}`" != "${acloca
|
|||
ACLOCAL_OPTS="-I `dirname ${ltfile}`"
|
||||
fi
|
||||
|
||||
### run aclocal
|
||||
echo "Re-creating aclocal.m4 ..."
|
||||
${ACLOCAL:-aclocal} ${ACLOCAL_OPTS}
|
||||
|
||||
### do some work to toss config.cache?
|
||||
echo "Creating configure ..."
|
||||
${AUTOCONF:-autoconf}
|
||||
|
||||
#
|
||||
# Generate the autoconf header
|
||||
#
|
||||
echo "Creating include/arch/unix/apr_private.h.in ..."
|
||||
${AUTOHEADER:-autoheader}
|
||||
|
||||
|
||||
# Remove autoconf 2.5x's cache directory
|
||||
rm -rf autom4te*.cache
|
||||
|
||||
echo "Entering directory ${LIBDIR}/apr-util"
|
||||
cd ${LIBDIR}/apr-util
|
||||
./buildconf
|
||||
|
@ -251,7 +298,11 @@ do
|
|||
#only run if AC_PROG_LIBTOOL is in configure.in/configure.ac
|
||||
if [ ! -z "${LTTEST}" -o "${LTTEST2}" ] ; then
|
||||
echo "Running libtoolize..."
|
||||
$libtoolize --force --copy ;
|
||||
if ${libtoolize} -n --install 2>&1 >/dev/null ; then
|
||||
$libtoolize --force --copy --install
|
||||
else
|
||||
$libtoolize --force --copy
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Creating configure"
|
||||
|
|
|
@ -10,7 +10,7 @@ SHELL=@SHELL@
|
|||
INSTALL=@INSTALL@
|
||||
GETLIB=@GETLIB@
|
||||
LIBTOOL=@LIBTOOL@
|
||||
LTINSTALL=$(LIBTOOL) --mode=install $(INSTALL)
|
||||
LTINSTALL=$(LIBTOOL) --quiet --mode=install $(INSTALL)
|
||||
LTUNINSTALL=$(LIBTOOL) --mode=uninstall rm -f
|
||||
CCLD = $(CC)
|
||||
CXXLD = $(CXX)
|
||||
|
@ -29,7 +29,7 @@ MODINSTDIR = @modinstdir@
|
|||
DYLD_LIBRARY_PATH=@libdir@:$DYLD_LIBRARY_PATH
|
||||
LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH
|
||||
OSARCH=`uname -s`
|
||||
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
|
||||
LIBTOOL_LIB_EXTEN = @LIBTOOL_LIB_EXTEN@
|
||||
SOLINK = @SOLINK@
|
||||
|
||||
LDFLAGS=@SWITCH_AM_LDFLAGS@ @LDFLAGS@ $(OUR_LDFLAGS)
|
||||
|
@ -39,11 +39,11 @@ ALL_CXXFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CXXFLAGS@ @CXXFLAGS@ -
|
|||
|
||||
COMPILE = $(CC) $(ALL_CFLAGS) $(DEFS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(COMPILE)
|
||||
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(ALL_CFLAGS) $(LDFLAGS) -o $@
|
||||
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(ALL_CFLAGS) $(LDFLAGS) -shared -module -avoid-version -rpath $(MODINSTDIR) -o $@
|
||||
|
||||
CXXCOMPILE = $(CXX) $(ALL_CXXFLAGS) $(DEFS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXXCOMPILE)
|
||||
CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(ALL_CXXFLAGS) $(LDFLAGS) -o $@
|
||||
CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(ALL_CXXFLAGS) $(LDFLAGS) -shared -module -avoid-version -rpath $(MODINSTDIR) -o $@
|
||||
|
||||
CSOURCEFILE=$(MODNAME).c
|
||||
CXXSOURCEFILE=$(MODNAME).cpp
|
||||
|
@ -81,7 +81,7 @@ distclean: Makefile
|
|||
extraclean: Makefile
|
||||
@$(RECURSE_MAKE) extraclean-modules || exit 1
|
||||
|
||||
all-modules: local_depend $(MODNAME).$(DYNAMIC_LIB_EXTEN) local_all Makefile
|
||||
all-modules: local_depend $(MODNAME).$(LIBTOOL_LIB_EXTEN) local_all Makefile
|
||||
depend-modules: local_depend
|
||||
clean-modules: local_clean mod_clean
|
||||
install-modules: all-modules depend_install local_install mod_install
|
||||
|
@ -107,27 +107,27 @@ LINK_OUTPUT_REDIR=> .libs/$(MODNAME).log || error="yes" ; \
|
|||
exit 1 ;\
|
||||
fi
|
||||
|
||||
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(LIBS) $(LOCAL_LIBADD) $(OUR_DEPS) $(LOCAL_OBJS) $(OUR_OBJS) $(SOURCEFILE) $(MODNAME).o
|
||||
$(MODNAME).$(LIBTOOL_LIB_EXTEN): $(LIBS) $(LOCAL_LIBADD) $(OUR_DEPS) $(LOCAL_OBJS) $(OUR_OBJS) $(SOURCEFILE) $(MODNAME).lo
|
||||
@echo Creating $@...
|
||||
@test -d .libs || mkdir .libs
|
||||
@error="";\
|
||||
if test -f $(CSOURCEFILE); then \
|
||||
$(LINK) $(SOLINK) $(MODNAME).o $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\
|
||||
$(LINK) $(SOLINK) $(MODNAME).lo $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\
|
||||
else \
|
||||
$(CXXLINK) $(SOLINK) $(MODNAME).o $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\
|
||||
$(CXXLINK) $(SOLINK) $(MODNAME).lo $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\
|
||||
fi;
|
||||
|
||||
mod_clean:
|
||||
@rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *.lo *~ .libs $(LOCAL_OBJS)
|
||||
@rm -fr *.$(LIBTOOL_LIB_EXTEN) *.o *.lo *~ .libs $(LOCAL_OBJS)
|
||||
|
||||
mod_install: $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(DYNAMIC_LIB_EXTEN)
|
||||
mod_install: $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(LIBTOOL_LIB_EXTEN)
|
||||
|
||||
$(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(DYNAMIC_LIB_EXTEN):$(MODNAME).$(DYNAMIC_LIB_EXTEN)
|
||||
$(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(LIBTOOL_LIB_EXTEN):$(MODNAME).$(LIBTOOL_LIB_EXTEN)
|
||||
@echo installing $<
|
||||
@$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(MODINSTDIR) >/dev/null
|
||||
@$(LTINSTALL) $(MODNAME).$(LIBTOOL_LIB_EXTEN) $(DESTDIR)$(MODINSTDIR) >/dev/null
|
||||
|
||||
mod_uninstall:
|
||||
@$(LTUNINSTALL) $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(DYNAMIC_LIB_EXTEN)
|
||||
@$(LTUNINSTALL) $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(LIBTOOL_LIB_EXTEN)
|
||||
|
||||
# define these in your makefile if you wish
|
||||
local_all local_depend local_clean depend_install local_install local_distclean local_extraclean local_uninstall:
|
||||
|
|
Loading…
Reference in New Issue