Commit ece261cd authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

merged with SExFIGI branch

parent 5ae55cd0
...@@ -9,11 +9,68 @@ ...@@ -9,11 +9,68 @@
* *
* Contents: log of changes made to the SExtractor source * Contents: log of changes made to the SExtractor source
* *
* Last modify: 14/07/2006 * Last modify: 17/01/2007
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
------------------------------------------------------------------------
r380 | bertin | 2007-01-17 17:52:49 +0100 (Wed, 17 Jan 2007) | 3 lines
Added options for compiling with icc (Intel compiler).
Pushed version number to 2.5.1.
------------------------------------------------------------------------
r365 | bertin | 2006-11-09 18:39:27 +0100 (Thu, 09 Nov 2006) | 2 lines
Undo previous changes (wrong repository!!).
------------------------------------------------------------------------
r364 | bertin | 2006-11-09 17:58:18 +0100 (Thu, 09 Nov 2006) | 2 lines
Added lmfit routines by Joachim Wuttke in the form of a library.
------------------------------------------------------------------------
r358 | bertin | 2006-10-29 21:04:25 +0100 (Sun, 29 Oct 2006) | 5 lines
Updated FITS library to the latest version.
Fixed some UCDs in output parameters.
Applied patch by Sergio Pascual for configuring the path to the XSL file.
Updated the BUGS section.
------------------------------------------------------------------------
r327 | bertin | 2006-08-16 18:06:49 +0200 (Wed, 16 Aug 2006) | 2 lines
Discard NaN pixels in non-weighted background measurements (as in SWarp).
------------------------------------------------------------------------
r305 | baillard | 2006-07-19 15:28:15 +0200 (Wed, 19 Jul 2006) | 2 lines
Change name
------------------------------------------------------------------------
r303 | baillard | 2006-07-19 15:05:48 +0200 (Wed, 19 Jul 2006) | 2 lines
Change names
------------------------------------------------------------------------
r295 | baillard | 2006-07-18 13:54:43 +0200 (Tue, 18 Jul 2006) | 2 lines
Move sextractor to public repository
------------------------------------------------------------------------
r290 | bertin | 2006-07-17 19:56:12 +0200 (Mon, 17 Jul 2006) | 4 lines
Doc: keyword list updated.
ChangeLog updated.
Back-propagated destructive byte-swapping bugfix in FITS library.
------------------------------------------------------------------------
r289 | bertin | 2006-07-14 20:25:09 +0200 (Fri, 14 Jul 2006) | 3 lines
Removed warnings in psf.c (P.Delorme's edits) using brute-force.
Switched ChangeLog to SVN format.
------------------------------------------------------------------------ ------------------------------------------------------------------------
r288 | bertin | 2006-07-14 20:13:39 +0200 (Fri, 14 Jul 2006) | 8 lines r288 | bertin | 2006-07-14 20:13:39 +0200 (Fri, 14 Jul 2006) | 8 lines
......
Dec 07: 2.7
- FITS I/O and astrometry layers updated (same as SWarp and SCAMP)
- Support for model-fitting
Jul 06: 2.5 Jul 06: 2.5
- Support for VOTable catalogs and metadata in output. - Support for VOTable catalogs and metadata in output.
......
# Main Makefile for SExtractor # Main Makefile for SExtractor
# Copyright (C) 2002-2005 Emmanuel Bertin. # Copyright (C) 2002-2008 Emmanuel Bertin.
AUTOMAKE_OPTIONS = foreign no-dependencies AUTOMAKE_OPTIONS = foreign no-dependencies
SUBDIRS = man src SUBDIRS = man src tests
dist_pkgdata_DATA = xsl/sextractor.xsl
EXTRA_DIST = config doc AUTHORS BUGS ChangeLog COPYING HISTORY \ EXTRA_DIST = config doc AUTHORS BUGS ChangeLog COPYING HISTORY \
INSTALL README THANKS \ INSTALL README THANKS \
acx_prog_cc_optim.m4 acx_atlas.m4 acx_prog_cc_optim.m4 \
RPM_ROOTDIR = /usr/src/RPM acx_urbi_resolve_dir.m4
RPM_ROOTDIR = `rpmbuild --nobuild -E %_topdir`
RPM_SRCDIR = $(RPM_ROOTDIR)/SOURCES RPM_SRCDIR = $(RPM_ROOTDIR)/SOURCES
dist-hook:
rm -rf `find $(distdir) -name .svn`
rpm: dist rpm: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR) cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
rpmbuild -ba --clean $(PACKAGE_NAME).spec $(PACKAGE_NAME)-mp.spec rpmbuild -ba --clean --nodeps $(PACKAGE_NAME).spec
rpm-icc: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
USE_ICC="1" rpmbuild -ba --clean --nodeps $(PACKAGE_NAME).spec
rpm-opteron: dist rpm-opteron: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR) cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \ TPXCC="gcc" TPXFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \
-march=opteron" rpmbuild -ba --target=x86_64 \ -march=opteron" \
--clean $(PACKAGE_NAME).spec TPXLDFLAGS="-static -shared-libgcc" \
TPXLIBS="-lfftw3 -llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=x86_64 --clean $(PACKAGE_NAME).spec
rpm-athlon: dist rpm-athlon: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR) cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall -m32 \ TPXCC="gcc" TPXFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \
-march=i686 -msse -mfpmath=sse -mtune=athlon" rpmbuild \ -m32 -march=i686 -msse -mfpmath=sse -mtune=athlon" \
-ba --target=i686 --clean $(PACKAGE_NAME).spec TPXLDFLAGS="-static -shared-libgcc" \
TPXLIBS="-L/usr/lib/ -lm -L/usr/local/lib/ -lfftw3 \
-llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=i686 --clean $(PACKAGE_NAME).spec
rpm-opteron-icc: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
TPXCC="icc" TPXFLAGS="-O3 -g -axWPT -ip -unroll" \
TPXLDFLAGS="-static -shared-libgcc" \
TPXLIBS="-lfftw3 -llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=x86_64 --clean --nodeps $(PACKAGE_NAME).spec
rpm-athlon-icc: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
TPXCC="icc32" TPXFLAGS="-O3 -g -axKWNPT -ip -unroll" \
TPXLDFLAGS="-static -shared-libgcc" \
TPXLIBS="-L/usr/local/lib/ -L/usr/lib/ -lfftw3 \
-llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=i686 --clean $(PACKAGE_NAME).spec
athlon: athlon:
$(MAKE) CFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall -m32 -march=i686 -msse -mfpmath=sse -mtune=athlon" LIBS="-lm" $(MAKE) CFLAGS="-O -g -pthread -funroll-loops -fomit-frame-pointer \
-Wall -m32 -march=i686 -msse -mfpmath=sse -mtune=athlon" \
LIBS="-L/usr/lib/ -lpthread -lm -L/usr/local/lib/ \
-lfftw3 -lfftw3_threads \
-llapack -lcblas -latlas -lm"
pentium-icc:
$(MAKE) CC="icc32" CFLAGS="-O3 -axKWNPT -ip -unroll -pthread" \
LIBS="-L/usr/lib/ -lpthread -lm -L/usr/local/lib/ -llapack \
-lcblas -latlas -lfftw3 -lfftw3_threads"
debug: icc:
$(MAKE) CFLAGS="-O3 -funroll-loops -fomit-frame-pointer -Wall -m32 -g" $(MAKE) CC="icc" CFLAGS="-O3 -g -axWPT -ip -unroll -pthread"
# Makefile.in generated by automake 1.9.6 from Makefile.am. # Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc. # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
...@@ -13,15 +13,12 @@ ...@@ -13,15 +13,12 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
...@@ -33,34 +30,51 @@ POST_INSTALL = : ...@@ -33,34 +30,51 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = . subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ DIST_COMMON = README $(am__configure_deps) $(dist_pkgdata_DATA) \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/sextractor-tpx.spec.in $(srcdir)/sextractor.spec.in \ $(srcdir)/config.h.in $(srcdir)/sextractor.spec.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \
THANKS autoconf/config.guess autoconf/config.sub \ THANKS autoconf/config.guess autoconf/config.sub \
autoconf/depcomp autoconf/install-sh autoconf/ltmain.sh \ autoconf/depcomp autoconf/install-sh autoconf/ltmain.sh \
autoconf/missing autoconf/mkinstalldirs autoconf/missing autoconf/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \ am__aclocal_m4_deps = $(top_srcdir)/acx_atlas.m4 \
$(top_srcdir)/acx_fftw.m4 $(top_srcdir)/acx_prog_cc_optim.m4 \
$(top_srcdir)/acx_pthread.m4 \
$(top_srcdir)/acx_urbi_resolve_dir.m4 \
$(top_srcdir)/configure.ac $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
CONFIG_HEADER = config.h CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = sextractor.spec sextractor-tpx.spec CONFIG_CLEAN_FILES = sextractor.spec
depcomp = depcomp =
am__depfiles_maybe = am__depfiles_maybe =
SOURCES = SOURCES =
DIST_SOURCES = DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \ html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \ install-dvi-recursive install-exec-recursive \
install-recursive installcheck-recursive installdirs-recursive \ install-html-recursive install-info-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \
uninstall-recursive installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(pkgdatadir)"
dist_pkgdataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(dist_pkgdata_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags ETAGS = etags
CTAGS = ctags CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
...@@ -76,9 +90,12 @@ GZIP_ENV = --best ...@@ -76,9 +90,12 @@ GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@ ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
ATLAS_LIB = @ATLAS_LIB@
ATLAS_LIBPATH = @ATLAS_LIBPATH@
AUTOCONF = @AUTOCONF@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@ AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@ AUTOMAKE = @AUTOMAKE@
...@@ -88,16 +105,27 @@ CCDEPMODE = @CCDEPMODE@ ...@@ -88,16 +105,27 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CPP = @CPP@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@ CYGPATH_W = @CYGPATH_W@
DATE2 = @DATE2@ DATE2 = @DATE2@
DATE3 = @DATE3@ DATE3 = @DATE3@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@ ECHO_T = @ECHO_T@
EGREP = @EGREP@ EGREP = @EGREP@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FFTW_ERROR = @FFTW_ERROR@
FFTW_LIBS = @FFTW_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
...@@ -105,8 +133,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ ...@@ -105,8 +133,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@ OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGER = @PACKAGER@ PACKAGER = @PACKAGER@
...@@ -116,51 +147,78 @@ PACKAGE_STRING = @PACKAGE_STRING@ ...@@ -116,51 +147,78 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@ ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_CXX = @ac_ct_CXX@
ac_ct_STRIP = @ac_ct_STRIP@ ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
am__tar = @am__tar@ am__tar = @am__tar@
am__untar = @am__untar@ am__untar = @am__untar@
bindir = @bindir@ bindir = @bindir@
build = @build@
build_alias = @build_alias@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@ datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@ host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@ includedir = @includedir@
infodir = @infodir@ infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@ sysconfdir = @sysconfdir@
target_alias = @target_alias@ target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Main Makefile for SExtractor # Main Makefile for SExtractor
# Copyright (C) 2002-2005 Emmanuel Bertin. # Copyright (C) 2002-2008 Emmanuel Bertin.
AUTOMAKE_OPTIONS = foreign no-dependencies AUTOMAKE_OPTIONS = foreign no-dependencies
SUBDIRS = man src SUBDIRS = man src tests
dist_pkgdata_DATA = xsl/sextractor.xsl
EXTRA_DIST = config doc AUTHORS BUGS ChangeLog COPYING HISTORY \ EXTRA_DIST = config doc AUTHORS BUGS ChangeLog COPYING HISTORY \
INSTALL README THANKS \ INSTALL README THANKS \
acx_prog_cc_optim.m4 acx_atlas.m4 acx_prog_cc_optim.m4 \
acx_urbi_resolve_dir.m4
RPM_ROOTDIR = /usr/src/RPM RPM_ROOTDIR = `rpmbuild --nobuild -E %_topdir`
RPM_SRCDIR = $(RPM_ROOTDIR)/SOURCES RPM_SRCDIR = $(RPM_ROOTDIR)/SOURCES
all: config.h all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive
...@@ -203,7 +261,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) ...@@ -203,7 +261,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
config.h: stamp-h1 config.h: stamp-h1
@if test ! -f $@; then \ @if test ! -f $@; then \
rm -f stamp-h1; \ rm -f stamp-h1; \
$(MAKE) stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
...@@ -218,9 +276,32 @@ distclean-hdr: ...@@ -218,9 +276,32 @@ distclean-hdr:
-rm -f config.h stamp-h1 -rm -f config.h stamp-h1
sextractor.spec: $(top_builddir)/config.status $(srcdir)/sextractor.spec.in sextractor.spec: $(top_builddir)/config.status $(srcdir)/sextractor.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@ cd $(top_builddir) && $(SHELL) ./config.status $@
sextractor-tpx.spec: $(top_builddir)/config.status $(srcdir)/sextractor-tpx.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool:
uninstall-info-am: -rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
$(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
uninstall-dist_pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
# This directory's subdirectories are mostly independent; you can cd # This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile. # into them and run `make' without going through this Makefile.
...@@ -253,8 +334,7 @@ $(RECURSIVE_TARGETS): ...@@ -253,8 +334,7 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail" fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \ $(RECURSIVE_CLEAN_TARGETS):
maintainer-clean-recursive:
@failcom='exit 1'; \ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \ for f in x $$MAKEFLAGS; do \
case $$f in \ case $$f in \
...@@ -298,8 +378,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ...@@ -298,8 +378,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) ' { files[$$0] = 1; } \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { for (i in files) print i; }'`; \ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique mkid -fID $$unique
tags: TAGS tags: TAGS
...@@ -324,8 +404,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ ...@@ -324,8 +404,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) ' { files[$$0] = 1; } \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { for (i in files) print i; }'`; \ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \ test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
...@@ -335,13 +415,12 @@ ctags: CTAGS ...@@ -335,13 +415,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \ tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) ' { files[$$0] = 1; } \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { for (i in files) print i; }'`; \ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique $$tags $$unique
...@@ -356,24 +435,22 @@ distclean-tags: ...@@ -356,24 +435,22 @@ distclean-tags:
distdir: $(DISTFILES) distdir: $(DISTFILES)
$(am__remove_distdir) $(am__remove_distdir)
mkdir $(distdir) test -d $(distdir) || mkdir $(distdir)
$(mkdir_p) $(distdir)/. $(distdir)/autoconf $(distdir)/man @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; \
list='$(DISTFILES)'; for file in $$list; do \ dist_files=`for file in $$list; do echo $$file; done | \
case $$file in \ sed -e "s|^$$srcdirstrip/||;t" \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ case $$dist_files in \
esac; \ */*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \ fi; \
...@@ -387,7 +464,7 @@ distdir: $(DISTFILES) ...@@ -387,7 +464,7 @@ distdir: $(DISTFILES)
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \ if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \ test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \ || exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \ distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
...@@ -395,14 +472,19 @@ distdir: $(DISTFILES) ...@@ -395,14 +472,19 @@ distdir: $(DISTFILES)
$(MAKE) $(AM_MAKEFLAGS) \ $(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \ top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \ distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \ distdir) \
|| exit 1; \ || exit 1; \
fi; \ fi; \
done done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir) || chmod -R a+r $(distdir)
dist-gzip: distdir dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
...@@ -412,6 +494,10 @@ dist-bzip2: distdir ...@@ -412,6 +494,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir) $(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir) $(am__remove_distdir)
...@@ -438,6 +524,8 @@ distcheck: dist ...@@ -438,6 +524,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
...@@ -477,7 +565,7 @@ distcheck: dist ...@@ -477,7 +565,7 @@ distcheck: dist
$(am__remove_distdir) $(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \ @(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck: distuninstallcheck:
@cd $(distuninstallcheck_dir) \ @cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
...@@ -498,9 +586,12 @@ distcleancheck: distclean ...@@ -498,9 +586,12 @@ distcleancheck: distclean
exit 1; } >&2 exit 1; } >&2
check-am: all-am check-am: all-am
check: check-recursive check: check-recursive
all-am: Makefile config.h all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive installdirs: installdirs-recursive
installdirs-am: installdirs-am:
for dir in "$(DESTDIR)$(pkgdatadir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive install: install-recursive
install-exec: install-exec-recursive install-exec: install-exec-recursive
install-data: install-data-recursive install-data: install-data-recursive
...@@ -527,12 +618,13 @@ maintainer-clean-generic: ...@@ -527,12 +618,13 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive clean: clean-recursive
clean-am: clean-generic mostlyclean-am clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile -rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive dvi: dvi-recursive
...@@ -544,14 +636,22 @@ info: info-recursive ...@@ -544,14 +636,22 @@ info: info-recursive
info-am: info-am:
install-data-am: install-data-am: install-dist_pkgdataDATA
install-dvi: install-dvi-recursive
install-exec-am: install-exec-am:
install-html: install-html-recursive
install-info: install-info-recursive install-info: install-info-recursive
install-man: install-man:
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-recursive maintainer-clean: maintainer-clean-recursive
...@@ -562,7 +662,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic ...@@ -562,7 +662,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive pdf: pdf-recursive
...@@ -572,45 +672,86 @@ ps: ps-recursive ...@@ -572,45 +672,86 @@ ps: ps-recursive
ps-am: ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-dist_pkgdataDATA
uninstall-info: uninstall-info-recursive .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-recursive ctags \ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ all all-am am--refresh check check-am clean clean-generic \
dist-tarZ dist-zip distcheck distclean distclean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
distclean-hdr distclean-recursive distclean-tags \ dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
distcleancheck distdir distuninstallcheck dvi dvi-am html \ distcheck distclean distclean-generic distclean-hdr \
html-am info info-am install install-am install-data \ distclean-libtool distclean-tags distcleancheck distdir \
install-data-am install-exec install-exec-am install-info \ distuninstallcheck dvi dvi-am html html-am info info-am \
install-info-am install-man install-strip installcheck \ install install-am install-data install-data-am \
installcheck-am installdirs installdirs-am maintainer-clean \ install-dist_pkgdataDATA install-dvi install-dvi-am \
maintainer-clean-generic maintainer-clean-recursive \ install-exec install-exec-am install-html install-html-am \
mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ install-info install-info-am install-man install-pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ install-pdf-am install-ps install-ps-am install-strip \
uninstall-info-am installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am \
uninstall-dist_pkgdataDATA
dist-hook:
rm -rf `find $(distdir) -name .svn`
rpm: dist rpm: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR) cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
rpmbuild -ba --clean $(PACKAGE_NAME).spec $(PACKAGE_NAME)-mp.spec rpmbuild -ba --clean --nodeps $(PACKAGE_NAME).spec
rpm-icc: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
USE_ICC="1" rpmbuild -ba --clean --nodeps $(PACKAGE_NAME).spec
rpm-opteron: dist rpm-opteron: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR) cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \ TPXCC="gcc" TPXFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \
-march=opteron" rpmbuild -ba --target=x86_64 \ -march=opteron" \
--clean $(PACKAGE_NAME).spec TPXLDFLAGS="-static -shared-libgcc" \
TPXLIBS="-lfftw3 -llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=x86_64 --clean $(PACKAGE_NAME).spec
rpm-athlon: dist rpm-athlon: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR) cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall -m32 \ TPXCC="gcc" TPXFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \
-march=i686 -msse -mfpmath=sse -mtune=athlon" rpmbuild \ -m32 -march=i686 -msse -mfpmath=sse -mtune=athlon" \
-ba --target=i686 --clean $(PACKAGE_NAME).spec TPXLDFLAGS="-static -shared-libgcc" \
athlon: TPXLIBS="-L/usr/lib/ -lm -L/usr/local/lib/ -lfftw3 \
$(MAKE) CFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall -m32 -march=i686 -msse -mfpmath=sse -mtune=athlon" LIBS="-lm" -llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=i686 --clean $(PACKAGE_NAME).spec
rpm-opteron-icc: dist
cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
TPXCC="icc" TPXFLAGS="-O3 -g -axWPT -ip -unroll" \
TPXLDFLAGS="-static -shared-libgcc" \
TPXLIBS="-lfftw3 -llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=x86_64 --clean --nodeps $(PACKAGE_NAME).spec
debug: rpm-athlon-icc: dist
$(MAKE) CFLAGS="-O3 -funroll-loops -fomit-frame-pointer -Wall -m32 -g" cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
TPXCC="icc32" TPXFLAGS="-O3 -g -axKWNPT -ip -unroll" \
TPXLDFLAGS="-static -shared-libgcc" \
TPXLIBS="-L/usr/local/lib/ -L/usr/lib/ -lfftw3 \
-llapack -lcblas -latlas -lm" \
rpmbuild -ba --target=i686 --clean $(PACKAGE_NAME).spec
athlon:
$(MAKE) CFLAGS="-O -g -pthread -funroll-loops -fomit-frame-pointer \
-Wall -m32 -march=i686 -msse -mfpmath=sse -mtune=athlon" \
LIBS="-L/usr/lib/ -lpthread -lm -L/usr/local/lib/ \
-lfftw3 -lfftw3_threads \
-llapack -lcblas -latlas -lm"
pentium-icc:
$(MAKE) CC="icc32" CFLAGS="-O3 -axKWNPT -ip -unroll -pthread" \
LIBS="-L/usr/lib/ -lpthread -lm -L/usr/local/lib/ -llapack \
-lcblas -latlas -lfftw3 -lfftw3_threads"
icc:
$(MAKE) CC="icc" CFLAGS="-O3 -g -axWPT -ip -unroll -pthread"
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:
...@@ -8,25 +8,10 @@ input image is a MEF. ...@@ -8,25 +8,10 @@ input image is a MEF.
- The (main) default config file can be dumped by typing "sex -d". Secondary - The (main) default config file can be dumped by typing "sex -d". Secondary
configuration files like default.param are still needed, though. configuration files like default.param are still needed, though.
In case of problems, questions or suggestions related to the software, The SExtractor homepage is
please don't hesitate to send a mail (preferably in english) to the http://terapix.iap.fr/soft/sextractor
official mailing list: In case of problems, questions or suggestions related to the software, please
sextractor@iap.fr refer to the TERAPIX forum:
These questions and answers to them are posted on the Web at: http://terapix.iap.fr/forum/
http://terapix.iap.fr/soft/sextractor/
In any case you can still reach me at bertin@iap.fr. I cannot garantee
that I will reply immediately, but I will try for sure to provide
an answer.
-----------
Notes:
- A version "sextractor-2.3.1_lanl" of SExtractor is available on
SourceForge thanks to Mark Galassi and Dan Starr:
http://sourceforge.net/projects/sextractor/
It is a reconditioned version of SExtractor 2.2.2. The LanL and the TERAPIX
(present one) versions follow two different development branches.
- Benne Holwerda <holwerda@stsci.edu> has written a SExtractor handbook and a
GUI which can be found in the doc/ subdirectory or at
http://www-int.stsci.edu/~holwerda/OldHomepage/se.html
Emmanuel Bertin. Emmanuel Bertin.
Stephane Arnouts <Stephane.Arnouts@oamp.fr> Stephane Arnouts <Stephane.Arnouts@oamp.fr>
Suggestions and extensive testing Suggestions and extensive testing
Pierre Astier <pierre.astier@in2p3.fr>
Suggestions and bug fixes
Eric Aubourg <Eric.Aubourg@cea.fr>
Hints about how to optimize a C code
Anthony Baillard <baillard@iap.fr>
Testing of model-fitting
Mark Calabretta <mcalabre@atnf.csiro.au> Mark Calabretta <mcalabre@atnf.csiro.au>
SExtractor makes use of his nice WCS library SExtractor makes use of his nice WCS library
Gerard Tissier <tissier@iap.fr>
Preliminary implementation of the VOTable output
Jean-Paul Kneib <kneib@omp.fr>
Ian Smail <Ian.Smail@durham.ac.uk>
Suggestions and spreading the software back in the early days!
Pascal Fouque <pfouque@eso.org> Pascal Fouque <pfouque@eso.org>
Suggestions and testing Suggestions and testing
Eric Aubourg <Eric.Aubourg@cea.fr> Delphine Hardin <hardin@in2p3.fr>
Hints about how to optimize a C code Suggestions and bug fixes
Ville Laurikari <vl@iki.fi>
For his VL_PROG_CC_WARNINGS (modified to ACX_PROG_CC_OPTIM)
Benne Holwerda <holwerda@stsci.edu> Benne Holwerda <holwerda@stsci.edu>
For making his cookbook available For making his cookbook available
ESO Jean-Paul Kneib <kneib@omp.fr>, Ian Smail <Ian.Smail@durham.ac.uk>
Financial support Suggestions and spreading the software back in the early days!
Ville Laurikari <vl@iki.fi>
For his VL_PROG_CC_WARNINGS (modified to ACX_PROG_CC_OPTIM)
Valerie de Lapparent <lapparen@iap.fr>
Suggestions and testing of model-fitting
Chiara Marmo <marmo@iap.fr>
For providing the VOTable to HTML XSLT filter and testing.
Joe Mohr <jmohr@illinois.edu>
Suggestions and testing
Gerard Tissier <tissier@iap.fr>
Preliminary implementation of the VOTable output
Joachim Wuttke <J.Wuttke@fz-juelich.de>
For his implementation of the Levenberg-Marquardt algorithm
Institut d'Astrophysique de Paris
University of Leiden
European Southern Observatory
University of Illinois
Financial and technical support
Too many people to list Too many people to list
Help in discovering bugs or bringing suggestions Help in discovering bugs or bringing suggestions
This source diff could not be displayed because it is too large. You can view the blob instead.
dnl @synopsis ACX_ATLAS([ATLAS_LIBDIR, ATLAS_INCDIR, ATLAS_PFLAG, [ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
dnl This macro figures out if the ATLAS library and header files
dnl are installed.
dnl You may wish to use these variables in your default LIBS:
dnl
dnl LIBS="$ATLAS_LIBS $LIBS"
dnl
dnl ACTION-IF-FOUND is a list of shell commands to run if BLAS/LAPACK
dnl is found (HAVE_ATLAS is defined first), and ACTION-IF-NOT-FOUND
dnl is a list of commands to run it if it is not found.
dnl
dnl @version $Id: acx_atlas.m4,v 1.0 2007/10/19 21:30:17 bertin Exp $
dnl @author Emmanuel Bertin <bertin@iap.fr>
AC_DEFUN([ACX_ATLAS], [
AC_REQUIRE([AC_CANONICAL_HOST])
dnl --------------------
dnl Search include files
dnl --------------------
acx_atlas_ok=no
if test x$2 = x; then
if test x$1 = x; then
AC_CHECK_HEADERS([cblas.h clapack.h],[acx_atlas_ok=yes])
if test x$acx_atlas_ok = xyes; then
AC_DEFINE(ATLAS_BLAS_H, "cblas.h", [BLAS header filename.])
AC_DEFINE(ATLAS_LAPACK_H, "clapack.h", [CLAPACK header filename.])
else
AC_CHECK_HEADERS([atlas/cblas.h atlas/clapack.h],[acx_atlas_ok=yes])
if test x$acx_atlas_ok = xyes; then
AC_DEFINE(ATLAS_BLAS_H, "atlas/cblas.h", [BLAS header filename.])
AC_DEFINE(ATLAS_LAPACK_H, "atlas/clapack.h", [CLAPACK header filename.])
else
atlas_def=/usr/local/atlas
AC_CHECK_HEADERS(
[$atlas_def/include/cblas.h $atlas_def/include/clapack.h],
[acx_atlas_ok=yes])
if test x$acx_atlas_ok = xyes; then
AC_DEFINE_UNQUOTED(ATLAS_BLAS_H, "$atlas_def/include/cblas.h",
[BLAS header filename.])
AC_DEFINE_UNQUOTED(ATLAS_LAPACK_H, "$atlas_def/include/clapack.h",
[CLAPACK header filename.])
else
atlas_def=/usr/atlas
AC_CHECK_HEADERS(
[$atlas_def/include/cblas.h $atlas_def/include/clapack.h],
[acx_atlas_ok=yes])
if test x$acx_atlas_ok = xyes; then
AC_DEFINE_UNQUOTED(ATLAS_BLAS_H, "$atlas_def/include/cblas.h",
[BLAS header filename.])
AC_DEFINE_UNQUOTED(ATLAS_LAPACK_H, "$atlas_def/include/clapack.h",
[CLAPACK header filename.])
else
ATLAS_ERROR="CBLAS/LAPack include files not found!"
fi
fi
fi
fi
else
AC_CHECK_HEADERS([$1/include/cblas.h $1/include/clapack.h],
[acx_atlas_ok=yes])
if test x$acx_atlas_ok = xyes; then
AC_DEFINE_UNQUOTED(ATLAS_BLAS_H, "$1/include/cblas.h",
[BLAS header filename.])
AC_DEFINE_UNQUOTED(ATLAS_LAPACK_H, "$1/include/clapack.h",
[CLAPACK header filename.])
else
AC_CHECK_HEADERS([cblas.h clapack.h],[acx_atlas_ok=yes])
if test x$acx_atlas_ok = xyes; then
AC_DEFINE_UNQUOTED(ATLAS_BLAS_H, "cblas.h",
[BLAS header filename.])
AC_DEFINE_UNQUOTED(ATLAS_LAPACK_H, "clapack.h",
[CLAPACK header filename.])
else
ATLAS_ERROR="CBLAS/LAPack include files not found in $1/include!"
fi
fi
fi
else
AC_CHECK_HEADERS([$2/cblas.h $2/clapack.h], [acx_atlas_ok=yes])
if test x$acx_atlas_ok = xyes; then
AC_DEFINE_UNQUOTED(ATLAS_BLAS_H, "$2/cblas.h",
[BLAS header filename.])
AC_DEFINE_UNQUOTED(ATLAS_LAPACK_H, "$2/clapack.h",
[CLAPACK header filename.])
else
ATLAS_ERROR="CBLAS/LAPack include files not found in $2!"
fi
fi
dnl --------------------
dnl Search library files
dnl --------------------
if test x$acx_atlas_ok = xyes; then
OLIBS="$LIBS"
LIBS=""
if test x$1 = x; then
AC_CHECK_LIB(lapack, [clapack_dpotrf],, [acx_atlas_ok=no],
[-lcblas -latlas -lm])
AC_CHECK_LIB(cblas, cblas_dgemm,, [acx_atlas_ok=no],
[-latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIBPATH=""
else
atlas_def=/usr/local/atlas
unset ac_cv_lib_lapack_clapack_dpotrf
unset ac_cv_lib_cblas_cblas_dgemm
acx_atlas_ok=yes
AC_CHECK_LIB(lapack, [clapack_dpotrf],, [acx_atlas_ok=no],
[-L$atlas_def/lib -lcblas -latlas -lm])
AC_CHECK_LIB(cblas, cblas_dgemm,, [acx_atlas_ok=no],
[-L$atlas_def/lib -latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIBPATH="-L$atlas_def/lib"
else
atlas_def=/usr/lib64/atlas
unset ac_cv_lib_lapack_clapack_dpotrf
unset ac_cv_lib_cblas_cblas_dgemm
acx_atlas_ok=yes
AC_CHECK_LIB(lapack, [clapack_dpotrf],, [acx_atlas_ok=no],
[-L$atlas_def -lcblas -latlas -lm])
AC_CHECK_LIB(cblas, cblas_dgemm,, [acx_atlas_ok=no],
[-L$atlas_def -latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIBPATH="-L$atlas_def"
else
atlas_def=/usr/lib/atlas
unset ac_cv_lib_lapack_clapack_dpotrf
unset ac_cv_lib_cblas_cblas_dgemm
acx_atlas_ok=yes
AC_CHECK_LIB(lapack, [clapack_dpotrf],, [acx_atlas_ok=no],
[-L$atlas_def -lcblas -latlas -lm])
AC_CHECK_LIB(cblas, cblas_dgemm,, [acx_atlas_ok=no],
[-L$atlas_def -latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIBPATH="-L$atlas_def"
else
atlas_def=/usr/atlas
unset ac_cv_lib_lapack_clapack_dpotrf
unset ac_cv_lib_cblas_cblas_dgemm
acx_atlas_ok=yes
AC_CHECK_LIB(lapack, [clapack_dpotrf],, [acx_atlas_ok=no],
[-L$atlas_def/lib -lcblas -latlas -lm])
AC_CHECK_LIB(cblas, cblas_dgemm,, [acx_atlas_ok=no],
[-L$atlas_def/lib -latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIBPATH="-L$atlas_def/lib"
else
ATLAS_ERROR="CBLAS/LAPack library files not found at usual locations!"
fi
fi
fi
fi
fi
else
AC_CHECK_LIB(lapack, [clapack_dpotrf],, [acx_atlas_ok=no],
[-L$1 -lcblas -latlas -lm])
AC_CHECK_LIB(cblas, cblas_dgemm,, [acx_atlas_ok=no],
[-L$1 -latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIBPATH="-L$1"
else
unset ac_cv_lib_lapack_clapack_dpotrf
unset ac_cv_lib_cblas_cblas_dgemm
acx_atlas_ok=yes
AC_CHECK_LIB(lapack, [clapack_dpotrf],, [acx_atlas_ok=no],
[-L$1/lib -lcblas -latlas -lm])
AC_CHECK_LIB(cblas, cblas_dgemm,, [acx_atlas_ok=no],
[-L$1/lib -latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIBPATH="-L$1/lib"
else
ATLAS_ERROR="CBLAS/LAPack library files not found in $1!"
fi
fi
fi
LIBS="$OLIBS"
fi
AC_SUBST(ATLAS_LIBPATH)
AC_SUBST(ATLAS_CFLAGS)
dnl -------------------------------------------------------------------------
dnl Finally, check MP version and execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND
dnl -------------------------------------------------------------------------
if test x"$acx_atlas_ok" = xyes; then
AC_DEFINE(HAVE_ATLAS,1,
[Define if you have the ATLAS libraries and header files.])
if test x$3 = xyes; then
dnl Check whether the multithreaded version of ATLAS is there too:
AC_CHECK_LIB(ptcblas, cblas_dgemm,, [acx_atlas_ok=no],
[$ATLAS_LIBPATH -lcblas -latlas -lm])
if test x$acx_atlas_ok = xyes; then
ATLAS_LIB="$ATLAS_LIBPATH -llapack -lptcblas -lcblas -latlas"
LIBS="$OLIBS"
AC_SUBST(ATLAS_LIB)
AC_DEFINE(HAVE_ATLAS_MP,1,
[Define if you have the parallel ATLAS libraries.])
$4
else
ATLAS_ERROR="CBLAS/LAPack was compiled without multithreading support!"
AC_SUBST(ATLAS_ERROR)
$5
fi
else
ATLAS_LIB="$ATLAS_LIBPATH -llapack -lcblas -latlas"
LIBS="$OLIBS"
AC_SUBST(ATLAS_LIB)
$4
fi
else
AC_SUBST(ATLAS_ERROR)
$5
fi
])dnl ACX_ATLAS
dnl @synopsis ACX_FFTW([FFTW_DIR, FFTW_INCDIR, FFTW_PFLAG, FFTW_FFLAG, [ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
dnl This macro figures out if the FFTW3 libraries and header
dnl files are installed.
dnl You may wish to use these variables in your default LIBS and CFLAGS:
dnl
dnl LIBS="$FFTW_LIBS $LIBS"
dnl
dnl ACTION-IF-FOUND is a list of shell commands to run if FFTW
dnl is found (HAVE_FFTWx are defined first), and ACTION-IF-NOT-FOUND
dnl is a list of commands to run it if it is not found.
dnl
dnl @version $Id: acx_fftw.m4,v 1.0 2008/08/28 21:30:17 bertin Exp $
dnl @author Emmanuel Bertin <bertin@iap.fr>
AC_DEFUN([ACX_FFTW], [
AC_REQUIRE([AC_CANONICAL_HOST])
dnl --------------------
dnl Search include files
dnl --------------------
acx_fftw_ok=no
if test x$2 = x; then
if test x$1 = x; then
AC_CHECK_HEADER(fftw3.h,[acx_fftw_ok=yes])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(FFTW_H, "fftw.h", [FFTW header filename.])
else
AC_CHECK_HEADER(fftw/fftw3.h,[acx_fftw_ok=yes])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(FFTW_H, "fftw/fftw3.h", [FFTW header filename.])
else
FFTW_ERROR="FFTW include files not found in default location!"
fi
fi
else
AC_CHECK_HEADER($1/include/fftw3.h,[acx_fftw_ok=yes])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(FFTW_H, "$1/include/fftw3.h", [FFTW header filename.])
else
AC_CHECK_HEADER(fftw3.h,[acx_fftw_ok=yes])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(FFTW_H, "fftw.h", [FFTW header filename.])
else
FFTW_ERROR="FFTW include files not found in $1/include!"
fi
fi
fi
else
AC_CHECK_HEADER($2/fftw3.h,[acx_fftw_ok=yes])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(FFTW_H, "$2/fftw3.h", [FFTW header filename.])
else
FFTW_ERROR="FFTW include files not found in $2!"
fi
fi
dnl --------------------
dnl Search library files
dnl --------------------
FFTW_LIBS=""
OLIBS="$LIBS"
LIBS=""
if test x$acx_fftw_ok = xyes; then
if test x$1 = x; then
if test x$4 = xyes; then
AC_CHECK_LIB(fftw3f, fftwf_execute, [acx_fftw_ok=yes],
[acx_fftw_ok=no], [-lm])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTWF,1,
[Define if you have the FFTW single precision libraries and header files.])
FFTW_LIBS="-lfftw3f"
else
FFTW_ERROR="FFTW single precision library files not found at usual locations!"
fi
else
AC_CHECK_LIB(fftw3, fftw_execute, [acx_fftw_ok=yes],
[acx_fftw_ok=no], [-lm])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTW,1,
[Define if you have the FFTW double precision libraries and header files.])
FFTW_LIBS="-lfftw3"
else
FFTW_ERROR="FFTW double precision library files not found at usual locations!"
fi
fi
if test x$acx_fftw_ok = xyes && test x$3 = xyes; then
if test x$4 = xyes; then
AC_CHECK_LIB(fftw3f_threads, fftwf_init_threads,
[acx_fftw_ok=yes], [acx_fftw_ok=no], [-lfftw3f -lm -lpthread])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTWFT,1,
[Define if you have the FFTW single precision multithreaded libraries and header files.])
FFTW_LIBS="-lfftw3f_threads -lfftw3f"
else
FFTW_ERROR="FFTW single precision library was compiled without multithreading support!"
fi
else
AC_CHECK_LIB(fftw3_threads, fftw_init_threads,
[acx_fftw_ok=yes], [acx_fftw_ok=no], [-lfftw3 -lm -lpthread])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTWT,1,
[Define if you have the FFTW double precision multithreaded libraries and header files.])
FFTW_LIBS="-lfftw3_threads -lfftw3"
else
FFTW_ERROR="FFTW double precision library was compiled without multithreading support!"
fi
fi
fi
else
dnl -------------------------
dnl Specific libdir specified
dnl -------------------------
if test x$4 = xyes; then
AC_CHECK_LIB(fftw3f, fftwf_execute, [acx_fftw_ok=yes],
[acx_fftw_ok=no], [-L$1 -lm])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTWF,1,
[Define if you have the FFTW single precision libraries and header files.])
FFTW_LIBS="-L$1 -lfftw3f"
else
FFTW_ERROR="FFTW single precision library files not found in $1!"
fi
else
AC_CHECK_LIB(fftw3, fftw_execute, [acx_fftw_ok=yes],
[acx_fftw_ok=no], [-L$1 -lm])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTW,1,
[Define if you have the FFTW double precision libraries and header files.])
FFTW_LIBS="-L$1 -lfftw3"
else
FFTW_ERROR="FFTW double precision library files not found in $1!"
fi
fi
if test x$acx_fftw_ok = xyes && test x$3 = xyes; then
if test x$4 = xyes; then
AC_CHECK_LIB(fftw3f_threads, fftwf_init_threads, [acx_fftw_ok=yes],
[acx_fftw_ok=no], [-L$1 -lfftw3f -lm -lpthread])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTWFT,1,
[Define if you have the FFTW single precision multithreaded libraries and header files.])
FFTW_LIBS="-L$1 -lfftw3f_threads -lfftw3f"
else
FFTW_ERROR="FFTW single precision library in $1 was compiled without multithreading support!"
fi
else
AC_CHECK_LIB(fftw3_threads, fftw_init_threads, [acx_fftw_ok=yes],
[acx_fftw_ok=no], [-L$1 -lfftw3 -lm -lpthread])
if test x$acx_fftw_ok = xyes; then
AC_DEFINE(HAVE_FFTWT,1,
[Define if you have the FFTW double precision multithreaded libraries and header files.])
FFTW_LIBS="-L$1 -lfftw3_threads -lfftw3"
else
FFTW_ERROR="FFTW double precision library in $1 was compiled without multithreading support!"
fi
fi
fi
fi
fi
LIBS="$OLIBS"
if test x$acx_fftw_ok = xyes; then
AC_SUBST(FFTW_LIBS)
$5
else
AC_SUBST(FFTW_ERROR)
$6
fi
])dnl ACX_FFTW
...@@ -8,7 +8,7 @@ dnl IRIX C compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 ...@@ -8,7 +8,7 @@ dnl IRIX C compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90
dnl (Unicos 10.0.0.8) C compiler. dnl (Unicos 10.0.0.8) C compiler.
dnl dnl
dnl This macro is a modification of Ville Laurikari's VL_PROG_CC_WARNINGS dnl This macro is a modification of Ville Laurikari's VL_PROG_CC_WARNINGS
dnl @version 1.0 (2002-04-15) dnl @version 1.2 (2008-10-01)
dnl @authors Emmanuel Bertin <bertin@iap.fr> Ville Laurikari <vl@iki.fi> dnl @authors Emmanuel Bertin <bertin@iap.fr> Ville Laurikari <vl@iki.fi>
dnl dnl
AC_DEFUN([ACX_PROG_CC_OPTIM], [ AC_DEFUN([ACX_PROG_CC_OPTIM], [
...@@ -19,10 +19,6 @@ AC_DEFUN([ACX_PROG_CC_OPTIM], [ ...@@ -19,10 +19,6 @@ AC_DEFUN([ACX_PROG_CC_OPTIM], [
int main(int argc, char **argv) { return 0; } int main(int argc, char **argv) { return 0; }
EOF EOF
dnl GCC
if test "$GCC" = "yes"; then
prog_cc_optim_flags="-O -funroll-loops -fomit-frame-pointer -Wall -g"
dnl Most compilers print some kind of a version string with some command dnl Most compilers print some kind of a version string with some command
dnl line options (often "-V"). The version string should be checked dnl line options (often "-V"). The version string should be checked
dnl before doing a test compilation run with compiler-specific flags. dnl before doing a test compilation run with compiler-specific flags.
...@@ -32,56 +28,85 @@ EOF ...@@ -32,56 +28,85 @@ EOF
dnl erratic things when invoked with flags meant for a different dnl erratic things when invoked with flags meant for a different
dnl compiler. dnl compiler.
dnl INTEL C 64bits compiler
if $CC -V 2>&1 | grep -i "Intel(R) 64" > /dev/null 2>&1 &&
$CC -c -O conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then
prog_cc_optim_flags="-O3 -axWPTS -ip -no-prec-div -unroll"
prog_ld_optim_flags="-static-intel"
dnl INTEL C 32bits compiler
elif $CC -V 2>&1 | grep -i "Intel(R)" > /dev/null 2>&1 &&
$CC -c -O conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then
prog_cc_optim_flags="-O -axKWNPTS -ip -no-prec-div"
prog_ld_optim_flags="-static-intel"
dnl GCC
elif test "$GCC" = "yes"; then
prog_cc_optim_flags="-O3 -g -funroll-loops -fomit-frame-pointer -Wall"
prog_ld_optim_flags=""
dnl Solaris C compiler dnl Solaris C compiler
elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 && elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
$CC -c -O conftest.c > /dev/null 2>&1 && $CC -c -O conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then test -f conftest.o; then
prog_cc_optim_flags="-O" prog_cc_optim_flags="-O"
prog_ld_optim_flags=""
dnl Digital Unix/Compaq C compiler dnl Digital Unix/Compaq C compiler
elif ($CC -V 2>&1 | grep -i "Digital UNIX Compiler"> /dev/null 2>&1 || elif ($CC -V 2>&1 | grep -i "Digital UNIX Compiler"> /dev/null 2>&1 ||
$CC -V 2>&1 | grep -i "Compaq C"> /dev/null 2>&1) && $CC -V 2>&1 | grep -i "Compaq C"> /dev/null 2>&1) &&
$CC -c -fast conftest.c > /dev/null 2>&1 && $CC -c -fast conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then test -f conftest.o; then
prog_cc_optim_flags="-fast -tune host" prog_cc_optim_flags="-fast -tune host"
prog_ld_optim_flags=""
dnl C for AIX Compiler dnl C for AIX Compiler
elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 && elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
$CC -c -qinfo=all -O2 conftest.c > /dev/null 2>&1 && $CC -c -qinfo=all -O2 conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then test -f conftest.o; then
prog_cc_optim_flags="-O2" prog_cc_optim_flags="-O2"
prog_ld_optim_flags=""
dnl IRIX C compiler dnl IRIX C compiler
elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 && elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
$CC -c -fullwarn -O3 conftest.c > /dev/null 2>&1 && $CC -c -fullwarn -O3 conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then test -f conftest.o; then
prog_cc_optim_flags="-O3" prog_cc_optim_flags="-O3"
prog_ld_optim_flags=""
dnl HP-UX C compiler dnl HP-UX C compiler
elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 && elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
$CC -c -Aa +O3 conftest.c > /dev/null 2>&1 && $CC -c -Aa +O3 conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then test -f conftest.o; then
prog_cc_optim_flags="+O3" prog_cc_optim_flags="+O3"
prog_ld_optim_flags=""
dnl The NEC SX-5 (Super-UX 10) C compiler dnl The NEC SX-5 (Super-UX 10) C compiler
elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 && elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
$CC -c -Xc -O conftest.c > /dev/null 2>&1 && $CC -c -Xc -O conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then test -f conftest.o; then
prog_cc_optim_flags="-O" prog_cc_optim_flags="-O"
prog_ld_optim_flags=""
dnl The Cray C compiler (Unicos) dnl The Cray C compiler (Unicos)
elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 && elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
$CC -c -h conform -O3 conftest.c > /dev/null 2>&1 && $CC -c -h conform -O3 conftest.c > /dev/null 2>&1 &&
test -f conftest.o; then test -f conftest.o; then
prog_cc_optim_flags="-O3" prog_cc_optim_flags="-O3"
prog_ld_optim_flags=""
fi fi
rm -f conftest.* rm -f conftest.*
fi fi
if test -n "$prog_cc_optim_flags"; then if test -n "$prog_cc_optim_flags"; then
CFLAGS="$CFLAGS $prog_cc_optim_flags" CFLAGS="$CFLAGS $prog_cc_optim_flags"
LDFLAGS="$LDFLAGS $prog_ld_optim_flags"
else else
prog_cc_optim_flags="unknown" prog_cc_optim_flags=""
prog_ld_optim_flags=""
fi fi
]) ])
])dnl ])dnl
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
dnl
dnl This macro figures out how to build C programs using POSIX
dnl threads. It sets the PTHREAD_LIBS output variable to the threads
dnl library and linker flags, and the PTHREAD_CFLAGS output variable
dnl to any special C compiler flags that are needed. (The user can also
dnl force certain compiler flags/libs to be tested by setting these
dnl environment variables.)
dnl
dnl Also sets PTHREAD_CC to any special C compiler that is needed for
dnl multi-threaded programs (defaults to the value of CC otherwise).
dnl (This is necessary on AIX to use the special cc_r compiler alias.)
dnl
dnl If you are only building threads programs, you may wish to
dnl use these variables in your default LIBS, CFLAGS, and CC:
dnl
dnl LIBS="$PTHREAD_LIBS $LIBS"
dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
dnl CC="$PTHREAD_CC"
dnl
dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE
dnl to that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
dnl
dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands
dnl to run it if it is not found. If ACTION-IF-FOUND is not specified,
dnl the default action will define HAVE_PTHREAD.
dnl
dnl Please let the authors know if this macro fails on any platform,
dnl or if you have any other suggestions or comments. This macro was
dnl based on work by SGJ on autoconf scripts for FFTW (www.fftw.org)
dnl (with help from M. Frigo), as well as ac_pthread and hb_pthread
dnl macros posted by AFC to the autoconf macro repository. We are also
dnl grateful for the helpful feedback of numerous users.
dnl
dnl @version $Id: acx_pthread.m4,v 1.4 2001/03/16 08:40:17 simons Exp $
dnl @author Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro Forero Cuervo <bachue@bachue.com>
dnl modified by E.Bertin <bertin@iap.fr> (ordering of flags and deactivated
dnl pthread.h check) 2002/04/25
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
acx_pthread_ok=no
# First, check if the POSIX threads header, pthread.h, is available.
# If it isn't, don't bother looking for the threads libraries.
# AC_CHECK_HEADER(pthread.h, , acx_pthread_ok=noheader)
AC_CHECK_HEADER(pthread.h, , acx_pthread_ok=no)
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all.
acx_pthread_flags="pthreads none -Kthread -kthread lthread pthread -pthread -pthreads -mthreads --thread-safe -mt"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthread or
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: threads are created detached by default
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
AC_MSG_CHECKING([for joinable pthread attribute])
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_JOINABLE;],
ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
if test x"$ok" = xunknown; then
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_UNDETACHED;],
ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
fi
if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
[Define to the necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_RESULT(${ok})
if test x"$ok" = xunknown; then
AC_MSG_WARN([we do not know how to create joinable pthreads])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
*solaris* | alpha*-osf*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
])dnl ACX_PTHREAD
# URBI_RESOLVE_DIR_PREPARE
# ------------------------
# Define urbi_resolve_dir.
m4_defun([URBI_RESOLVE_DIR_PREPARE],
[# PATH urbi_resolve_dir(DIR)
# --------------------------
# Return the DIR with all inner variables expanded.
urbi_resolve_dir ()
{
ac_$0_dir=$[]1
ac_$0_res=
ac_$0_prefix_NONE=
ac_$0_exec_prefix_NONE=
test "x$prefix" = xNONE &&
ac_$0_exec_prefix_NONE=yes &&
prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE &&
ac_$0_exec_prefix_NONE=yes &&
exec_prefix=$prefix
while true
do
eval ac_$0_res="$ac_$0_dir"
if test x"$ac_$0_dir" == x"$ac_$0_res"; then
break
fi
ac_$0_dir=$ac_$0_res
done
test "$ac_$0_prefix_NONE" && prefix=NONE
test "$ac_$0_exec_prefix_NONE" && exec_prefix=NONE
echo "$ac_$0_res"
}
])
# PATH URBI_RESOLVE_DIR(DIR)
# --------------------------
# Return the DIR with all inner variables expanded.
AC_DEFUN([URBI_RESOLVE_DIR],
[AC_REQUIRE([URBI_RESOLVE_DIR_PREPARE])dnl
urbi_resolve_dir '$1'[]dnl
])
## Local Variables:
## mode: autoconf
## End:
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
timestamp='2001-09-04' timestamp='2008-01-08'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
...@@ -17,15 +18,18 @@ timestamp='2001-09-04' ...@@ -17,15 +18,18 @@ timestamp='2001-09-04'
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>. # Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
# #
# This script attempts to guess a canonical system name similar to # This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and # config.sub. If it succeeds, it prints the system name on stdout, and
...@@ -52,8 +56,8 @@ version="\ ...@@ -52,8 +56,8 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
Free Software Foundation, Inc. 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -65,11 +69,11 @@ Try \`$me --help' for more information." ...@@ -65,11 +69,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do while test $# -gt 0 ; do
case $1 in case $1 in
--time-stamp | --time* | -t ) --time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;; echo "$timestamp" ; exit ;;
--version | -v ) --version | -v )
echo "$version" ; exit 0 ;; echo "$version" ; exit ;;
--help | --h* | -h ) --help | --h* | -h )
echo "$usage"; exit 0 ;; echo "$usage"; exit ;;
-- ) # Stop option processing -- ) # Stop option processing
shift; break ;; shift; break ;;
- ) # Use stdin as input. - ) # Use stdin as input.
...@@ -87,30 +91,42 @@ if test $# != 0; then ...@@ -87,30 +91,42 @@ if test $# != 0; then
exit 1 exit 1
fi fi
trap 'exit 1' 1 2 15
dummy=dummy-$$ # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated. # use `HOST_CC' if defined, but it is deprecated.
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in # Portable tmp directory creation inspired by the Autoconf team.
,,) echo "int dummy(){}" > $dummy.c ;
for c in cc gcc c89 ; do set_cc_for_build='
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
if test $? = 0 ; then trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ; CC_FOR_BUILD="$c"; break ;
fi ; fi ;
done ; done ;
rm -f $dummy.c $dummy.o $dummy.rel ;
if test x"$CC_FOR_BUILD" = x ; then if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ; CC_FOR_BUILD=no_compiler_found ;
fi fi
;; ;;
,,*) CC_FOR_BUILD=$CC ;; ,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac' esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24) # (ghazi@noc.rutgers.edu 1994-08-24)
...@@ -127,29 +143,31 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown ...@@ -127,29 +143,31 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*) *:NetBSD:*:*)
# Netbsd (nbsd) targets should (where applicable) match one or # NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old # switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward # object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the # compatibility and a consistent mechanism for selecting the
# object file format. # object file format.
# Determine the machine/vendor (is the vendor relevant). #
case "${UNAME_MACHINE}" in # Note: NetBSD doesn't particularly care about the vendor
amiga) machine=m68k-unknown ;; # portion of the name. We always set it to "unknown".
arm32) machine=arm-unknown ;; sysctl="sysctl -n hw.machine_arch"
atari*) machine=m68k-atari ;; UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
sun3*) machine=m68k-sun ;; /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
mac68k) machine=m68k-apple ;; case "${UNAME_MACHINE_ARCH}" in
macppc) machine=powerpc-apple ;; armeb) machine=armeb-unknown ;;
hp3[0-9][05]) machine=m68k-hp ;; arm*) machine=arm-unknown ;;
ibmrt|romp-ibm) machine=romp-ibm ;; sh3el) machine=shl-unknown ;;
*) machine=${UNAME_MACHINE}-unknown ;; sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac esac
# The Operating System including object format, if it has switched # The Operating System including object format, if it has switched
# to ELF recently, or will in the future. # to ELF recently, or will in the future.
case "${UNAME_MACHINE}" in case "${UNAME_MACHINE_ARCH}" in
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null | grep __ELF__ >/dev/null
...@@ -166,120 +184,128 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ...@@ -166,120 +184,128 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;; ;;
esac esac
# The OS release # The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form: # contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}" echo "${machine}-${os}${release}"
exit 0 ;; exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*) alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi ;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version. # A Vn.n version is a released version.
# A Tn.n version is a released field test version. # A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
.data exit ;;
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
eval $set_cc_for_build
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
2-1307)
UNAME_MACHINE="alphaev68"
;;
esac
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*) Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead # Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model? # of the specific Alpha model?
echo alpha-pc-interix echo alpha-pc-interix
exit 0 ;; exit ;;
21064:Windows_NT:50:3) 21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5 echo alpha-dec-winnt3.5
exit 0 ;; exit ;;
Amiga*:UNIX_System_V:4.0:*) Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4 echo m68k-unknown-sysv4
exit 0;; exit ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:[Aa]miga[Oo][Ss]:*:*) *:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;; exit ;;
arc64:OpenBSD:*:*) *:[Mm]orph[Oo][Ss]:*:*)
echo mips64el-unknown-openbsd${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-morphos
exit 0 ;; exit ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hkmips:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OS/390:*:*) *:OS/390:*:*)
echo i370-ibm-openedition echo i370-ibm-openedition
exit 0 ;; exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE} echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;; exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp echo hppa1.1-hitachi-hiuxmpp
exit 0;; exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then if test "`(/bin/universe) 2>/dev/null`" = att ; then
...@@ -287,25 +313,32 @@ EOF ...@@ -287,25 +313,32 @@ EOF
else else
echo pyramid-pyramid-bsd echo pyramid-pyramid-bsd
fi fi
exit 0 ;; exit ;;
NILE*:*:*:dcosx) NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4 echo pyramid-pyramid-svr4
exit 0 ;; exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
sun4H:SunOS:5.*:*) sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;; exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;; exit ;;
i86pc:SunOS:5.*:*) i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;; exit ;;
sun4*:SunOS:6*:*) sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize # According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but # SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4. # it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;; exit ;;
sun4*:SunOS:*:*) sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in case "`/usr/bin/arch -k`" in
Series*|S4*) Series*|S4*)
...@@ -314,12 +347,12 @@ EOF ...@@ -314,12 +347,12 @@ EOF
esac esac
# Japanese Language versions have a version number like `4.1.3-JL'. # Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;; exit ;;
sun3*:SunOS:*:*) sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE} echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;; exit ;;
sun*:*:4.2BSD:*) sun*:*:4.2BSD:*)
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in case "`/bin/arch`" in
sun3) sun3)
...@@ -329,16 +362,10 @@ EOF ...@@ -329,16 +362,10 @@ EOF
echo sparc-sun-sunos${UNAME_RELEASE} echo sparc-sun-sunos${UNAME_RELEASE}
;; ;;
esac esac
exit 0 ;; exit ;;
aushp:SunOS:*:*) aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE} echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;; exit ;;
sparc*:NetBSD:*)
echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name # The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not # can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor # "atarist" or "atariste" at least should have a processor
...@@ -349,49 +376,40 @@ EOF ...@@ -349,49 +376,40 @@ EOF
# be no problem. # be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;; exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;; exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;; exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE} echo m68k-milan-mint${UNAME_RELEASE}
exit 0 ;; exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE} echo m68k-hades-mint${UNAME_RELEASE}
exit 0 ;; exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE} echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;; exit ;;
sun3*:OpenBSD:*:*) m68k:machten:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-apple-machten${UNAME_RELEASE}
exit 0 ;; exit ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*) powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE} echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;; exit ;;
RISC*:Mach:*:*) RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3 echo mips-dec-mach_bsd4.3
exit 0 ;; exit ;;
RISC*:ULTRIX:*:*) RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE} echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;; exit ;;
VAX*:ULTRIX*:*:*) VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE} echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;; exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*) 2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE} echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;; exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos) mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c sed 's/^ //' << EOF >$dummy.c
...@@ -415,27 +433,33 @@ EOF ...@@ -415,27 +433,33 @@ EOF
exit (-1); exit (-1);
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy \ $CC_FOR_BUILD -o $dummy $dummy.c &&
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
&& rm -f $dummy.c $dummy && exit 0 SYSTEM_NAME=`$dummy $dummyarg` &&
rm -f $dummy.c $dummy { echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE} echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;; exit ;;
Motorola:PowerMAX_OS:*:*) Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax echo powerpc-motorola-powermax
exit 0 ;; exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*) Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix echo powerpc-harris-powerunix
exit 0 ;; exit ;;
m88k:CX/UX:7*:*) m88k:CX/UX:7*:*)
echo m88k-harris-cxux7 echo m88k-harris-cxux7
exit 0 ;; exit ;;
m88k:*:4*:R4*) m88k:*:4*:R4*)
echo m88k-motorola-sysv4 echo m88k-motorola-sysv4
exit 0 ;; exit ;;
m88k:*:3*:R3*) m88k:*:3*:R3*)
echo m88k-motorola-sysv3 echo m88k-motorola-sysv3
exit 0 ;; exit ;;
AViiON:dgux:*:*) AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures # DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`/usr/bin/uname -p`
...@@ -451,29 +475,29 @@ EOF ...@@ -451,29 +475,29 @@ EOF
else else
echo i586-dg-dgux${UNAME_RELEASE} echo i586-dg-dgux${UNAME_RELEASE}
fi fi
exit 0 ;; exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3) M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3 echo m88k-dolphin-sysv3
exit 0 ;; exit ;;
M88*:*:R3*:*) M88*:*:R3*:*)
# Delta 88k system running SVR3 # Delta 88k system running SVR3
echo m88k-motorola-sysv3 echo m88k-motorola-sysv3
exit 0 ;; exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3 echo m88k-tektronix-sysv3
exit 0 ;; exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd echo m68k-tektronix-bsd
exit 0 ;; exit ;;
*:IRIX*:*:*) *:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;; exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*) i*86:AIX:*:*)
echo i386-ibm-aix echo i386-ibm-aix
exit 0 ;; exit ;;
ia64:AIX:*:*) ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel` IBM_REV=`/usr/bin/oslevel`
...@@ -481,7 +505,7 @@ EOF ...@@ -481,7 +505,7 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;; exit ;;
*:AIX:2:3) *:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build eval $set_cc_for_build
...@@ -496,17 +520,20 @@ EOF ...@@ -496,17 +520,20 @@ EOF
exit(0); exit(0);
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
rm -f $dummy.c $dummy then
echo rs6000-ibm-aix3.2.5 echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4 echo rs6000-ibm-aix3.2.4
else else
echo rs6000-ibm-aix3.2 echo rs6000-ibm-aix3.2
fi fi
exit 0 ;; exit ;;
*:AIX:*:[45]) *:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000 IBM_ARCH=rs6000
else else
...@@ -518,38 +545,36 @@ EOF ...@@ -518,38 +545,36 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV} echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;; exit ;;
*:AIX:*:*) *:AIX:*:*)
echo rs6000-ibm-aix echo rs6000-ibm-aix
exit 0 ;; exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*) ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4 echo romp-ibm-bsd4.4
exit 0 ;; exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3 exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*) *:BOSX:*:*)
echo rs6000-bull-bosx echo rs6000-bull-bosx
exit 0 ;; exit ;;
DPX/2?00:B.O.S.:*:*) DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3 echo m68k-bull-sysv3
exit 0 ;; exit ;;
9000/[34]??:4.3bsd:1.*:*) 9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd echo m68k-hp-bsd
exit 0 ;; exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4 echo m68k-hp-bsd4.4
exit 0 ;; exit ;;
9000/[34678]??:HP-UX:*:*) 9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;; 9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;; 9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9]) 9000/[678][0-9][0-9])
case "${HPUX_REV}" in if [ -x /usr/bin/getconf ]; then
11.[0-9][0-9]) sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
...@@ -558,13 +583,13 @@ EOF ...@@ -558,13 +583,13 @@ EOF
case "${sc_kernel_bits}" in case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;; 32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;; 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;; esac ;;
esac esac
fi ;; fi
esac if [ "${HP_ARCH}" = "" ]; then
if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build
eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE #define _HPUX_SOURCE
#include <stdlib.h> #include <stdlib.h>
...@@ -597,17 +622,37 @@ EOF ...@@ -597,17 +622,37 @@ EOF
exit (0); exit (0);
} }
EOF EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi test -z "$HP_ARCH" && HP_ARCH=hppa
rm -f $dummy.c $dummy fi ;;
fi ;;
esac esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV} echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;; exit ;;
ia64:HP-UX:*:*) ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV} echo ia64-hp-hpux${HPUX_REV}
exit 0 ;; exit ;;
3050*:HI-UX:*:*) 3050*:HI-UX:*:*)
eval $set_cc_for_build eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c sed 's/^ //' << EOF >$dummy.c
...@@ -635,158 +680,247 @@ EOF ...@@ -635,158 +680,247 @@ EOF
exit (0); exit (0);
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
rm -f $dummy.c $dummy { echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2 echo unknown-hitachi-hiuxwe2
exit 0 ;; exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd echo hppa1.1-hp-bsd
exit 0 ;; exit ;;
9000/8??:4.3bsd:*:*) 9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd echo hppa1.0-hp-bsd
exit 0 ;; exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix echo hppa1.0-hp-mpeix
exit 0 ;; exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf echo hppa1.1-hp-osf
exit 0 ;; exit ;;
hp8??:OSF1:*:*) hp8??:OSF1:*:*)
echo hppa1.0-hp-osf echo hppa1.0-hp-osf
exit 0 ;; exit ;;
i*86:OSF1:*:*) i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk echo ${UNAME_MACHINE}-unknown-osf1mk
else else
echo ${UNAME_MACHINE}-unknown-osf1 echo ${UNAME_MACHINE}-unknown-osf1
fi fi
exit 0 ;; exit ;;
parisc*:Lites*:*:*) parisc*:Lites*:*:*)
echo hppa1.1-hp-lites echo hppa1.1-hp-lites
exit 0 ;; exit ;;
hppa*:OpenBSD:*:*)
echo hppa-unknown-openbsd
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd echo c1-convex-bsd
exit 0 ;; exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc if getsysinfo -f scalar_acc
then echo c32-convex-bsd then echo c32-convex-bsd
else echo c2-convex-bsd else echo c2-convex-bsd
fi fi
exit 0 ;; exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd echo c34-convex-bsd
exit 0 ;; exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd echo c38-convex-bsd
exit 0 ;; exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd echo c4-convex-bsd
exit 0 ;; exit ;;
CRAY*X-MP:*:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*) CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit ;;
CRAY*[A-Z]90:*:*:*) CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/' -e 's/\.[^.]*$/.X/'
exit 0 ;; exit ;;
CRAY*TS:*:*:*) CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit ;;
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*) CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit ;;
CRAY*SV1:*:*:*) CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit ;;
CRAY-2:*:*:*) *:UNICOS/mp:*:*)
echo cray2-cray-unicos echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;; exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;; exit ;;
hp300:OpenBSD:*:*) 5000:UNIX_System_V:4.*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
exit 0 ;; FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;; exit ;;
sparc*:BSD/OS:*:*) sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE} echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;; exit ;;
*:BSD/OS:*:*) *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;; exit ;;
*:FreeBSD:*:*) *:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` case ${UNAME_MACHINE} in
exit 0 ;; pc98)
*:OpenBSD:*:*) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` amd64)
exit 0 ;; echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*) i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;; exit ;;
i*:MINGW*:*) *:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32 echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;; exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*) i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32 echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;; exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386? # UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix echo i586-pc-interix
exit 0 ;; exit ;;
i*:UWIN*:*) i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;; exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*) p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin echo powerpcle-unknown-cygwin
exit 0 ;; exit ;;
prep*:SunOS:5.*:*) prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;; exit ;;
*:GNU:*:*) *:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;; exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
exit 0 ;; exit ;;
arm*:Linux:*:*) arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit ;;
ia64:Linux:*:*) ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*) m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit ;;
mips:Linux:*:*) mips:Linux:*:*)
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in eval $set_cc_for_build
big) echo mips-unknown-linux-gnu && exit 0 ;; sed 's/^ //' << EOF >$dummy.c
little) echo mipsel-unknown-linux-gnu && exit 0 ;; #undef CPU
esac #undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;; ;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*) ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu echo powerpc-unknown-linux-gnu
exit 0 ;; exit ;;
ppc64:Linux:*:*) ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu echo powerpc64-unknown-linux-gnu
exit 0 ;; exit ;;
alpha:Linux:*:*) alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;; EV5) UNAME_MACHINE=alphaev5 ;;
...@@ -800,7 +934,7 @@ EOF ...@@ -800,7 +934,7 @@ EOF
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;; exit ;;
parisc:Linux:*:* | hppa:Linux:*:*) parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level # Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
...@@ -808,27 +942,37 @@ EOF ...@@ -808,27 +942,37 @@ EOF
PA8*) echo hppa2.0-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;;
esac esac
exit 0 ;; exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*) parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu echo hppa64-unknown-linux-gnu
exit 0 ;; exit ;;
s390:Linux:*:* | s390x:Linux:*:*) s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;; exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*) sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*) sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;; exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu echo x86_64-unknown-linux-gnu
exit 0 ;; exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*) i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so # The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent # first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path. # problems with other programs or directories called `ld' in the path.
ld_supported_targets=`cd /; ld --help 2>&1 \ # Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d | sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g s/[ ][ ]*/ /g
s/.*supported targets: *// s/.*supported targets: *//
...@@ -840,52 +984,58 @@ EOF ...@@ -840,52 +984,58 @@ EOF
;; ;;
a.out-i386-linux) a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout" echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0 ;; exit ;;
coff-i386) coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff" echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;; exit ;;
"") "")
# Either a pre-BFD a.out linker (linux-gnuoldld) or # Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help. # one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld" echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit 0 ;; exit ;;
esac esac
# Determine whether the default compiler is a.out or elf # Determine whether the default compiler is a.out or elf
eval $set_cc_for_build eval $set_cc_for_build
cat >$dummy.c <<EOF sed 's/^ //' << EOF >$dummy.c
#include <features.h> #include <features.h>
#ifdef __cplusplus #ifdef __ELF__
#include <stdio.h> /* for printf() prototype */ # ifdef __GLIBC__
int main (int argc, char *argv[]) { # if __GLIBC__ >= 2
#else LIBC=gnu
int main (argc, argv) int argc; char *argv[]; { # else
#endif LIBC=gnulibc1
#ifdef __ELF__ # endif
# ifdef __GLIBC__ # else
# if __GLIBC__ >= 2 LIBC=gnulibc1
printf ("%s-pc-linux-gnu\n", argv[1]); # endif
# else #else
printf ("%s-pc-linux-gnulibc1\n", argv[1]); #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# endif LIBC=gnu
# else #else
printf ("%s-pc-linux-gnulibc1\n", argv[1]); LIBC=gnuaout
# endif #endif
#else #endif
printf ("%s-pc-linux-gnuaout\n", argv[1]); #ifdef __dietlibc__
#endif LIBC=dietlibc
return 0; #endif
}
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
rm -f $dummy.c $dummy /^LIBC/{
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
}
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;; ;;
i*86:DYNIX/ptx:4*:*) i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both # earlier versions are messed up and put the nodename in both
# sysname and nodename. # sysname and nodename.
echo i386-sequent-sysv4 echo i386-sequent-sysv4
exit 0 ;; exit ;;
i*86:UNIX_SV:4.2MP:2.*) i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version # Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2... # number series starting with 2...
...@@ -893,7 +1043,27 @@ EOF ...@@ -893,7 +1043,27 @@ EOF
# I just have to hope. -- rms. # I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it. # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;; exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
...@@ -901,99 +1071,100 @@ EOF ...@@ -901,99 +1071,100 @@ EOF
else else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi fi
exit 0 ;; exit ;;
i*86:*:5:[78]*) i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;; *486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;; *Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit 0 ;; exit ;;
i*86:*:3.2:*) i*86:*:3.2:*)
if test -f /usr/options/cb.name; then if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586 && UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686 && UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686 && UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else else
echo ${UNAME_MACHINE}-pc-sysv32 echo ${UNAME_MACHINE}-pc-sysv32
fi fi
exit 0 ;; exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*) pc:*:*:*)
# Left here for compatibility: # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386. # the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp echo i386-pc-msdosdjgpp
exit 0 ;; exit ;;
Intel:Mach:3*:*) Intel:Mach:3*:*)
echo i386-pc-mach3 echo i386-pc-mach3
exit 0 ;; exit ;;
paragon:*:*:*) paragon:*:*:*)
echo i860-intel-osf1 echo i860-intel-osf1
exit 0 ;; exit ;;
i860:*:4.*:*) # i860-SVR4 i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered. else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi fi
exit 0 ;; exit ;;
mini*:CTIX:SYS*5:*) mini*:CTIX:SYS*5:*)
# "miniframe" # "miniframe"
echo m68010-convergent-sysv echo m68010-convergent-sysv
exit 0 ;; exit ;;
M68*:*:R3V[567]*:*) mc68k:UNIX:SYSTEM5:3.51m)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; echo m68k-convergent-sysv
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL='' OS_REL=''
test -r /etc/.relid \ test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;; && { echo i486-ncr-sysv4; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE} echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;; exit ;;
mc68030:UNIX_System_V:4.*:*) mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4 echo m68k-atari-sysv4
exit 0 ;; exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*) TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE} echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;; exit ;;
rs6000:LynxOS:2.*:*) rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE} echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;; exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE} echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;; exit ;;
SM[BE]S:UNIX_SV:*:*) SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE} echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;; exit ;;
RM*:ReliantUNIX-*:*:*) RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4 echo mips-sni-sysv4
exit 0 ;; exit ;;
RM*:SINIX-*:*:*) RM*:SINIX-*:*:*)
echo mips-sni-sysv4 echo mips-sni-sysv4
exit 0 ;; exit ;;
*:SINIX-*:*:*) *:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null` UNAME_MACHINE=`(uname -p) 2>/dev/null`
...@@ -1001,82 +1172,107 @@ EOF ...@@ -1001,82 +1172,107 @@ EOF
else else
echo ns32k-sni-sysv echo ns32k-sni-sysv
fi fi
exit 0 ;; exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV> # says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4 echo i586-unisys-sysv4
exit 0 ;; exit ;;
*:UNIX_System_V:4*:FTX*) *:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>. # From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm # How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4 echo hppa1.1-stratus-sysv4
exit 0 ;; exit ;;
*:*:*:FTX*) *:*:*:FTX*)
# From seanf@swdc.stratus.com. # From seanf@swdc.stratus.com.
echo i860-stratus-sysv4 echo i860-stratus-sysv4
exit 0 ;; exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*) *:VOS:*:*)
# From Paul.Green@stratus.com. # From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos echo hppa1.1-stratus-vos
exit 0 ;; exit ;;
mc68*:A/UX:*:*) mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE} echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;; exit ;;
news*:NEWS-OS:6*:*) news*:NEWS-OS:6*:*)
echo mips-sony-newsos6 echo mips-sony-newsos6
exit 0 ;; exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE} echo mips-nec-sysv${UNAME_RELEASE}
else else
echo mips-unknown-sysv${UNAME_RELEASE} echo mips-unknown-sysv${UNAME_RELEASE}
fi fi
exit 0 ;; exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos echo powerpc-be-beos
exit 0 ;; exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos echo powerpc-apple-beos
exit 0 ;; exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos echo i586-pc-beos
exit 0 ;; exit ;;
SX-4:SUPER-UX:*:*) SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE} echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;; exit ;;
SX-5:SUPER-UX:*:*) SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE} echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;; exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*) Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE} echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;; exit ;;
*:Rhapsody:*:*) *:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;; exit ;;
*:Darwin:*:*) *:Darwin:*:*)
echo `uname -p`-apple-darwin${UNAME_RELEASE} UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
exit 0 ;; case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*) *:procnto*:*:* | *:QNX:[0123456789]*:*)
if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc UNAME_MACHINE=pc
fi fi
echo `uname -p`-${UNAME_MACHINE}-nto-qnx echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit 0 ;; exit ;;
*:QNX:*:4*) *:QNX:*:4*)
echo i386-pc-qnx echo i386-pc-qnx
exit 0 ;; exit ;;
NSR-[KW]:NONSTOP_KERNEL:*:*) NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE} echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;; exit ;;
*:NonStop-UX:*:*) *:NonStop-UX:*:*)
echo mips-compaq-nonstopux echo mips-compaq-nonstopux
exit 0 ;; exit ;;
BS2000:POSIX*:*:*) BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv echo bs2000-siemens-sysv
exit 0 ;; exit ;;
DS/*:UNIX_System_V:*:*) DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;; exit ;;
*:Plan9:*:*) *:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386 # "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86 # is converted to i386 for consistency with other x86
...@@ -1087,36 +1283,47 @@ EOF ...@@ -1087,36 +1283,47 @@ EOF
UNAME_MACHINE="$cputype" UNAME_MACHINE="$cputype"
fi fi
echo ${UNAME_MACHINE}-unknown-plan9 echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;; exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*) *:TOPS-10:*:*)
echo pdp10-unknown-tops10 echo pdp10-unknown-tops10
exit 0 ;; exit ;;
*:TENEX:*:*) *:TENEX:*:*)
echo pdp10-unknown-tenex echo pdp10-unknown-tenex
exit 0 ;; exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20 echo pdp10-dec-tops20
exit 0 ;; exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20 echo pdp10-xkl-tops20
exit 0 ;; exit ;;
*:TOPS-20:*:*) *:TOPS-20:*:*)
echo pdp10-unknown-tops20 echo pdp10-unknown-tops20
exit 0 ;; exit ;;
*:ITS:*:*) *:ITS:*:*)
echo pdp10-unknown-its echo pdp10-unknown-its
exit 0 ;; exit ;;
i*86:XTS-300:*:STOP) SEI:*:*:SEIUX)
echo ${UNAME_MACHINE}-unknown-stop echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;; exit ;;
i*86:atheos:*:*) *:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-atheos echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;; exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
esac esac
#echo '(No uname command or uname output not recognized.)' 1>&2 #echo '(No uname command or uname output not recognized.)' 1>&2
...@@ -1148,7 +1355,7 @@ main () ...@@ -1148,7 +1355,7 @@ main ()
#endif #endif
#if defined (__arm) && defined (__acorn) && defined (__unix) #if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0); printf ("arm-acorn-riscix\n"); exit (0);
#endif #endif
#if defined (hp300) && !defined (hpux) #if defined (hp300) && !defined (hpux)
...@@ -1237,12 +1444,12 @@ main () ...@@ -1237,12 +1444,12 @@ main ()
} }
EOF EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
rm -f $dummy.c $dummy { echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment. # Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1) # Convex versions that predate uname can use getsysinfo(1)
...@@ -1251,22 +1458,22 @@ then ...@@ -1251,22 +1458,22 @@ then
case `getsysinfo -f cpu_type` in case `getsysinfo -f cpu_type` in
c1*) c1*)
echo c1-convex-bsd echo c1-convex-bsd
exit 0 ;; exit ;;
c2*) c2*)
if getsysinfo -f scalar_acc if getsysinfo -f scalar_acc
then echo c32-convex-bsd then echo c32-convex-bsd
else echo c2-convex-bsd else echo c2-convex-bsd
fi fi
exit 0 ;; exit ;;
c34*) c34*)
echo c34-convex-bsd echo c34-convex-bsd
exit 0 ;; exit ;;
c38*) c38*)
echo c38-convex-bsd echo c38-convex-bsd
exit 0 ;; exit ;;
c4*) c4*)
echo c4-convex-bsd echo c4-convex-bsd
exit 0 ;; exit ;;
esac esac
fi fi
...@@ -1277,7 +1484,9 @@ This script, last modified $timestamp, has failed to recognize ...@@ -1277,7 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you the operating system you are using. It is advised that you
download the most up to date version of the config scripts from download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run ($0) is already up to date, please If the version you run ($0) is already up to date, please
send the following data and any information you think might be send the following data and any information you think might be
......
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
timestamp='2001-09-07' timestamp='2008-01-16'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
...@@ -21,15 +22,17 @@ timestamp='2001-09-07' ...@@ -21,15 +22,17 @@ timestamp='2001-09-07'
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# Boston, MA 02111-1307, USA. # 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
...@@ -69,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>." ...@@ -69,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
Free Software Foundation, Inc. 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -82,11 +85,11 @@ Try \`$me --help' for more information." ...@@ -82,11 +85,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do while test $# -gt 0 ; do
case $1 in case $1 in
--time-stamp | --time* | -t ) --time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;; echo "$timestamp" ; exit ;;
--version | -v ) --version | -v )
echo "$version" ; exit 0 ;; echo "$version" ; exit ;;
--help | --h* | -h ) --help | --h* | -h )
echo "$usage"; exit 0 ;; echo "$usage"; exit ;;
-- ) # Stop option processing -- ) # Stop option processing
shift; break ;; shift; break ;;
- ) # Use stdin as input. - ) # Use stdin as input.
...@@ -98,7 +101,7 @@ while test $# -gt 0 ; do ...@@ -98,7 +101,7 @@ while test $# -gt 0 ; do
*local*) *local*)
# First pass through any local machine types. # First pass through any local machine types.
echo $1 echo $1
exit 0;; exit ;;
* ) * )
break ;; break ;;
...@@ -117,7 +120,9 @@ esac ...@@ -117,7 +120,9 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
...@@ -143,7 +148,7 @@ case $os in ...@@ -143,7 +148,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis) -apple | -axis | -knuth | -cray)
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
...@@ -168,6 +173,10 @@ case $os in ...@@ -168,6 +173,10 @@ case $os in
-hiux*) -hiux*)
os=-hiuxwe2 os=-hiuxwe2
;; ;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5) -sco5)
os=-sco3.2v5 os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
...@@ -184,6 +193,10 @@ case $os in ...@@ -184,6 +193,10 @@ case $os in
# Don't forget version if it is 3.2v4 or newer. # Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*) -sco*)
os=-sco3.2v2 os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
...@@ -226,32 +239,53 @@ case $basic_machine in ...@@ -226,32 +239,53 @@ case $basic_machine in
1750a | 580 \ 1750a | 580 \
| a29k \ | a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \ | c4x | clipper \
| d10v | d30v | dsp16xx \ | d10v | d30v | dlx | dsp16xx \
| fr30 \ | fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \ | i370 | i860 | i960 | ia64 \
| m32r | m68000 | m68k | m88k | mcore \ | ip2k | iq2000 \
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | m32c | m32r | m32rle | m68000 | m68k | m88k \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \ | maxq | mb | microblaze | mcore | mep \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mips | mipsbe | mipseb | mipsel | mipsle \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mips16 \
| mipsisa32 \ | mips64 | mips64el \
| mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \ | mn10200 | mn10300 \
| mt \
| msp430 \
| nios | nios2 \
| ns16k | ns32k \ | ns16k | ns32k \
| openrisc \ | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \ | pyramid \
| s390 | s390x \ | score \
| sh | sh[34] | sh[34]eb | shbe | shle \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | sh64 | sh64le \
| stormy16 | strongarm \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| tahoe | thumb | tic80 | tron \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| v850 \ | spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \ | we32k \
| x86 | xscale \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k) | z8k)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
...@@ -262,6 +296,9 @@ case $basic_machine in ...@@ -262,6 +296,9 @@ case $basic_machine in
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;; ;;
ms1)
basic_machine=mt-unknown
;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
...@@ -278,41 +315,68 @@ case $basic_machine in ...@@ -278,41 +315,68 @@ case $basic_machine in
580-* \ 580-* \
| a29k-* \ | a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alphapca5[67]-* | arc-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| arm-* | armbe-* | armle-* | armv*-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| bs2000-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \ | avr-* | avr32-* \
| clipper-* | cray2-* | cydra-* \ | bfin-* | bs2000-* \
| d10v-* | d30v-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \ | elxsi-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \ | h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \ | i*86-* | i860-* | i960-* | ia64-* \
| m32r-* \ | ip2k-* | iq2000-* \
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ | m32c-* | m32r-* | m32rle-* \
| m88110-* | m88k-* | mcore-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | m88110-* | m88k-* | maxq-* | mcore-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mips16-* \
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | mips64-* | mips64el-* \
| mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \ | pyramid-* \
| romp-* | rs6000-* \ | romp-* | rs6000-* \
| s390-* | s390x-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ | sparclite-* \
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| v850-* | vax-* \ | tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa*-* \
| ymp-* \ | ymp-* \
| z8k-*) | z8k-*)
;; ;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
386bsd) 386bsd)
...@@ -329,6 +393,9 @@ case $basic_machine in ...@@ -329,6 +393,9 @@ case $basic_machine in
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
;; ;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k) adobe68k)
basic_machine=m68010-adobe basic_machine=m68010-adobe
os=-scout os=-scout
...@@ -343,6 +410,12 @@ case $basic_machine in ...@@ -343,6 +410,12 @@ case $basic_machine in
basic_machine=a29k-none basic_machine=a29k-none
os=-bsd os=-bsd
;; ;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl) amdahl)
basic_machine=580-amdahl basic_machine=580-amdahl
os=-sysv os=-sysv
...@@ -374,6 +447,18 @@ case $basic_machine in ...@@ -374,6 +447,18 @@ case $basic_machine in
basic_machine=ns32k-sequent basic_machine=ns32k-sequent
os=-dynix os=-dynix
;; ;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
convex-c1) convex-c1)
basic_machine=c1-convex basic_machine=c1-convex
os=-bsd os=-bsd
...@@ -394,30 +479,45 @@ case $basic_machine in ...@@ -394,30 +479,45 @@ case $basic_machine in
basic_machine=c38-convex basic_machine=c38-convex
os=-bsd os=-bsd
;; ;;
cray | ymp) cray | j90)
basic_machine=ymp-cray basic_machine=j90-cray
os=-unicos os=-unicos
;; ;;
cray2) craynv)
basic_machine=cray2-cray basic_machine=craynv-cray
os=-unicos os=-unicosmp
;; ;;
[cjt]90) cr16)
basic_machine=${basic_machine}-cray basic_machine=cr16-unknown
os=-unicos os=-elf
;; ;;
crds | unos) crds | unos)
basic_machine=m68k-crds basic_machine=m68k-crds
;; ;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*) cris | cris-* | etrax*)
basic_machine=cris-axis basic_machine=cris-axis
;; ;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*) da30 | da30-*)
basic_machine=m68k-da30 basic_machine=m68k-da30
;; ;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec basic_machine=mips-dec
;; ;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \ delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola) | 3300-motorola | delta-motorola)
basic_machine=m68k-motorola basic_machine=m68k-motorola
...@@ -426,6 +526,10 @@ case $basic_machine in ...@@ -426,6 +526,10 @@ case $basic_machine in
basic_machine=m88k-motorola basic_machine=m88k-motorola
os=-sysv3 os=-sysv3
;; ;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*) dpx20 | dpx20-*)
basic_machine=rs6000-bull basic_machine=rs6000-bull
os=-bosx os=-bosx
...@@ -576,6 +680,14 @@ case $basic_machine in ...@@ -576,6 +680,14 @@ case $basic_machine in
basic_machine=m68k-isi basic_machine=m68k-isi
os=-sysv os=-sysv
;; ;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*) m88k-omron*)
basic_machine=m88k-omron basic_machine=m88k-omron
;; ;;
...@@ -591,6 +703,10 @@ case $basic_machine in ...@@ -591,6 +703,10 @@ case $basic_machine in
basic_machine=i386-pc basic_machine=i386-pc
os=-mingw32 os=-mingw32
;; ;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe) miniframe)
basic_machine=m68000-convergent basic_machine=m68000-convergent
;; ;;
...@@ -598,32 +714,27 @@ case $basic_machine in ...@@ -598,32 +714,27 @@ case $basic_machine in
basic_machine=m68k-atari basic_machine=m68k-atari
os=-mint os=-mint
;; ;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux-gnu
;;
mips3*-*) mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;; ;;
mips3*) mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;; ;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor) monitor)
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
os=-coff os=-coff
;; ;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos) msdos)
basic_machine=i386-pc basic_machine=i386-pc
os=-msdos os=-msdos
;; ;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
mvs) mvs)
basic_machine=i370-ibm basic_machine=i370-ibm
os=-mvs os=-mvs
...@@ -699,6 +810,13 @@ case $basic_machine in ...@@ -699,6 +810,13 @@ case $basic_machine in
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
;; ;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000) OSE68000 | ose68000)
basic_machine=m68000-ericsson basic_machine=m68000-ericsson
os=-ose os=-ose
...@@ -715,55 +833,75 @@ case $basic_machine in ...@@ -715,55 +833,75 @@ case $basic_machine in
basic_machine=i860-intel basic_machine=i860-intel
os=-osf os=-osf
;; ;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd) pbd)
basic_machine=sparc-tti basic_machine=sparc-tti
;; ;;
pbb) pbb)
basic_machine=m68k-tti basic_machine=m68k-tti
;; ;;
pc532 | pc532-*) pc532 | pc532-*)
basic_machine=ns32k-pc532 basic_machine=ns32k-pc532
;; ;;
pentium | p5 | k5 | k6 | nexgen) pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc basic_machine=i586-pc
;; ;;
pentiumpro | p6 | 6x86 | athlon) pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentiumii | pentium2) pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentium-* | p5-* | k5-* | k6-* | nexgen-*) pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-* | athlon-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-*) pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn) pn)
basic_machine=pn-gould basic_machine=pn-gould
;; ;;
power) basic_machine=power-ibm power) basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc) basic_machine=powerpc-unknown
;; ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
;; ;;
ppcle-* | powerpclittle-*) ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64) basic_machine=powerpc64-unknown ppc64) basic_machine=powerpc64-unknown
;; ;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little) ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown basic_machine=powerpc64le-unknown
;; ;;
ppc64le-* | powerpc64little-*) ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
...@@ -774,6 +912,10 @@ case $basic_machine in ...@@ -774,6 +912,10 @@ case $basic_machine in
basic_machine=i586-unknown basic_machine=i586-unknown
os=-pw32 os=-pw32
;; ;;
rdos)
basic_machine=i386-pc
os=-rdos
;;
rom68k) rom68k)
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
os=-coff os=-coff
...@@ -784,10 +926,30 @@ case $basic_machine in ...@@ -784,10 +926,30 @@ case $basic_machine in
rtpc | rtpc-*) rtpc | rtpc-*)
basic_machine=romp-ibm basic_machine=romp-ibm
;; ;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200) sa29200)
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
;; ;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent) sequent)
basic_machine=i386-sequent basic_machine=i386-sequent
;; ;;
...@@ -795,7 +957,13 @@ case $basic_machine in ...@@ -795,7 +957,13 @@ case $basic_machine in
basic_machine=sh-hitachi basic_machine=sh-hitachi
os=-hms os=-hms
;; ;;
sparclite-wrs) sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs basic_machine=sparclite-wrs
os=-vxworks os=-vxworks
;; ;;
...@@ -862,22 +1030,46 @@ case $basic_machine in ...@@ -862,22 +1030,46 @@ case $basic_machine in
os=-dynix os=-dynix
;; ;;
t3e) t3e)
basic_machine=t3e-cray basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos os=-unicos
;; ;;
tic54x | c54x*) tic54x | c54x*)
basic_machine=tic54x-unknown basic_machine=tic54x-unknown
os=-coff os=-coff
;; ;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tile*)
basic_machine=tile-unknown
os=-linux-gnu
;;
tx39) tx39)
basic_machine=mipstx39-unknown basic_machine=mipstx39-unknown
;; ;;
tx39el) tx39el)
basic_machine=mipstx39el-unknown basic_machine=mipstx39el-unknown
;; ;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32) tower | tower-32)
basic_machine=m68k-ncr basic_machine=m68k-ncr
;; ;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k) udi29k)
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
...@@ -899,8 +1091,8 @@ case $basic_machine in ...@@ -899,8 +1091,8 @@ case $basic_machine in
os=-vms os=-vms
;; ;;
vpp*|vx|vx-*) vpp*|vx|vx-*)
basic_machine=f301-fujitsu basic_machine=f301-fujitsu
;; ;;
vxworks960) vxworks960)
basic_machine=i960-wrs basic_machine=i960-wrs
os=-vxworks os=-vxworks
...@@ -921,17 +1113,17 @@ case $basic_machine in ...@@ -921,17 +1113,17 @@ case $basic_machine in
basic_machine=hppa1.1-winbond basic_machine=hppa1.1-winbond
os=-proelf os=-proelf
;; ;;
windows32) xbox)
basic_machine=i386-pc basic_machine=i686-pc
os=-windows32-msvcrt os=-mingw32
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;; ;;
xps | xps100) xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff) z8k-*-coff)
basic_machine=z8k-unknown basic_machine=z8k-unknown
os=-sim os=-sim
...@@ -952,16 +1144,12 @@ case $basic_machine in ...@@ -952,16 +1144,12 @@ case $basic_machine in
op60c) op60c)
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
;; ;;
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp) romp)
basic_machine=romp-ibm basic_machine=romp-ibm
;; ;;
mmix)
basic_machine=mmix-knuth
;;
rs6000) rs6000)
basic_machine=rs6000-ibm basic_machine=rs6000-ibm
;; ;;
...@@ -978,13 +1166,13 @@ case $basic_machine in ...@@ -978,13 +1166,13 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh3 | sh4 | sh3eb | sh4eb) sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sparc | sparcv9 | sparcv9b) sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
cydra) cydra)
basic_machine=cydra-cydrome basic_machine=cydra-cydrome
;; ;;
orion) orion)
...@@ -999,10 +1187,6 @@ case $basic_machine in ...@@ -999,10 +1187,6 @@ case $basic_machine in
pmac | pmac-mpw) pmac | pmac-mpw)
basic_machine=powerpc-apple basic_machine=powerpc-apple
;; ;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*-unknown) *-unknown)
# Make sure to match an already-canonicalized machine name. # Make sure to match an already-canonicalized machine name.
;; ;;
...@@ -1058,17 +1242,23 @@ case $os in ...@@ -1058,17 +1242,23 @@ case $os in
| -aos* \ | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \ | -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos*) | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
...@@ -1080,16 +1270,21 @@ case $os in ...@@ -1080,16 +1270,21 @@ case $os in
;; ;;
esac esac
;; ;;
-nto-qnx*)
;;
-nto*) -nto*)
os=-nto-qnx os=`echo $os | sed -e 's|nto|nto-qnx|'`
;; ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;; ;;
-mac*) -mac*)
os=`echo $os | sed -e 's|mac|macos|'` os=`echo $os | sed -e 's|mac|macos|'`
;; ;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*) -linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'` os=`echo $os | sed -e 's|linux|linux-gnu|'`
;; ;;
...@@ -1102,6 +1297,9 @@ case $os in ...@@ -1102,6 +1297,9 @@ case $os in
-opened*) -opened*)
os=-openedition os=-openedition
;; ;;
-os400*)
os=-os400
;;
-wince*) -wince*)
os=-wince os=-wince
;; ;;
...@@ -1120,14 +1318,23 @@ case $os in ...@@ -1120,14 +1318,23 @@ case $os in
-acis*) -acis*)
os=-aos os=-aos
;; ;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd) -386bsd)
os=-bsd os=-bsd
;; ;;
-ctix* | -uts*) -ctix* | -uts*)
os=-sysv os=-sysv
;; ;;
-nova*)
os=-rtmk-nova
;;
-ns2 ) -ns2 )
os=-nextstep2 os=-nextstep2
;; ;;
-nsk*) -nsk*)
os=-nsk os=-nsk
...@@ -1139,6 +1346,9 @@ case $os in ...@@ -1139,6 +1346,9 @@ case $os in
-sinix*) -sinix*)
os=-sysv4 os=-sysv4
;; ;;
-tpf*)
os=-tpf
;;
-triton*) -triton*)
os=-sysv3 os=-sysv3
;; ;;
...@@ -1166,8 +1376,17 @@ case $os in ...@@ -1166,8 +1376,17 @@ case $os in
-xenix) -xenix)
os=-xenix os=-xenix
;; ;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;; ;;
-none) -none)
;; ;;
...@@ -1191,6 +1410,12 @@ else ...@@ -1191,6 +1410,12 @@ else
# system, and we'll never get to this point. # system, and we'll never get to this point.
case $basic_machine in case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn) *-acorn)
os=-riscix1.2 os=-riscix1.2
;; ;;
...@@ -1200,10 +1425,14 @@ case $basic_machine in ...@@ -1200,10 +1425,14 @@ case $basic_machine in
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*) pdp10-*)
os=-tops20 os=-tops20
;; ;;
pdp11-*) pdp11-*)
os=-none os=-none
;; ;;
*-dec | vax-*) *-dec | vax-*)
...@@ -1224,12 +1453,18 @@ case $basic_machine in ...@@ -1224,12 +1453,18 @@ case $basic_machine in
m68*-cisco) m68*-cisco)
os=-aout os=-aout
;; ;;
mep-*)
os=-elf
;;
mips*-cisco) mips*-cisco)
os=-elf os=-elf
;; ;;
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os. *-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3 os=-sysv3
;; ;;
...@@ -1239,9 +1474,15 @@ case $basic_machine in ...@@ -1239,9 +1474,15 @@ case $basic_machine in
*-be) *-be)
os=-beos os=-beos
;; ;;
*-haiku)
os=-haiku
;;
*-ibm) *-ibm)
os=-aix os=-aix
;; ;;
*-knuth)
os=-mmixware
;;
*-wec) *-wec)
os=-proelf os=-proelf
;; ;;
...@@ -1293,19 +1534,19 @@ case $basic_machine in ...@@ -1293,19 +1534,19 @@ case $basic_machine in
*-next) *-next)
os=-nextstep3 os=-nextstep3
;; ;;
*-gould) *-gould)
os=-sysv os=-sysv
;; ;;
*-highlevel) *-highlevel)
os=-bsd os=-bsd
;; ;;
*-encore) *-encore)
os=-bsd os=-bsd
;; ;;
*-sgi) *-sgi)
os=-irix os=-irix
;; ;;
*-siemens) *-siemens)
os=-sysv4 os=-sysv4
;; ;;
*-masscomp) *-masscomp)
...@@ -1374,10 +1615,16 @@ case $basic_machine in ...@@ -1374,10 +1615,16 @@ case $basic_machine in
-mvs* | -opened*) -mvs* | -opened*)
vendor=ibm vendor=ibm
;; ;;
-os400*)
vendor=ibm
;;
-ptx*) -ptx*)
vendor=sequent vendor=sequent
;; ;;
-vxsim* | -vxworks*) -tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs vendor=wrs
;; ;;
-aux*) -aux*)
...@@ -1401,7 +1648,7 @@ case $basic_machine in ...@@ -1401,7 +1648,7 @@ case $basic_machine in
esac esac
echo $basic_machine$os echo $basic_machine$os
exit 0 exit
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
......
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
scriptversion=2007-03-29.01
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -15,8 +18,8 @@ ...@@ -15,8 +18,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02111-1307, USA. # 02110-1301, USA.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -25,22 +28,45 @@ ...@@ -25,22 +28,45 @@
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2 echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1 exit 1
fi fi
# `libtool' can also be set to `yes' or `no'.
if test -z "$depfile"; then
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
dir=`echo "$object" | sed 's,/.*$,/,'`
if test "$dir" = "$object"; then
dir=
fi
# FIXME: should be _deps on DOS.
depfile="$dir.deps/$base"
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
...@@ -66,7 +92,20 @@ gcc3) ...@@ -66,7 +92,20 @@ gcc3)
## gcc 3 implements dependency tracking that does exactly what ## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm. ## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile" ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -eq 0; then :
else else
...@@ -172,31 +211,43 @@ sgi) ...@@ -172,31 +211,43 @@ sgi)
aix) aix)
# The C for AIX Compiler uses -M and outputs the dependencies # The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory. # in a .u file. In older versions, this file always lives in the
# Also, the AIX compiler puts `$object:' at the start of each line; # current directory. Also, the AIX compiler puts `$object:' at the
# $object doesn't have directory information. # start of each line; $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` # Version 6 uses the directory in both cases.
tmpdepfile="$stripped.u" dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
outname="$stripped.o" test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M "$@" -Wc,-M
else else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M "$@" -M
fi fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -eq 0; then :
else else
rm -f "$tmpdepfile" rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat exit $stat
fi fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'. # Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to # Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'. # `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" # That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else else
# The sourcefile does not contain any dependencies, so just # The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile # store a dummy comment line, to avoid errors with the Makefile
...@@ -206,38 +257,136 @@ aix) ...@@ -206,38 +257,136 @@ aix)
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64) tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side # The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too. # dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected. # Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
base=`echo "$object" | sed -e 's/\.o$//' -e 's/\.lo$//'`
tmpdepfile1="$base.o.d"
tmpdepfile2="$base.d"
if test "$libtool" = yes; then if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD "$@" -Wc,-MD
else else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD "$@" -MD
fi fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -eq 0; then :
else else
rm -f "$tmpdepfile1" "$tmpdepfile2" rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat exit $stat
fi fi
if test -f "$tmpdepfile1"; then for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
tmpdepfile="$tmpdepfile1" do
else test -f "$tmpdepfile" && break
tmpdepfile="$tmpdepfile2" done
fi
if test -f "$tmpdepfile"; then if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the []. # That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else else
echo "#dummy" > "$depfile" echo "#dummy" > "$depfile"
fi fi
...@@ -250,34 +399,42 @@ tru64) ...@@ -250,34 +399,42 @@ tru64)
dashmstdout) dashmstdout)
# Important note: in order to support this mode, a compiler *must* # Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o, # always write the preprocessed file to stdout, regardless of -o.
# because we must use -o when running libtool. "$@" || exit $?
test -z "$dashmflag" && dashmflag=-M
( IFS=" " # Remove the call to Libtool.
case " $* " in if test "$libtool" = yes; then
*" --mode=compile "*) # this is libtool, let us make it quiet while test $1 != '--mode=compile'; do
for arg shift
do # cycle over the arguments done
case "$arg" in shift
"--mode=compile") fi
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet # Remove `-o $object'.
shift # fnord IFS=" "
;; for arg
esac do
set fnord "$@" "$arg" case $arg in
shift # fnord -o)
shift # "$arg" shift
done ;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;; ;;
esac esac
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" done
) &
proc=$! test -z "$dashmflag" && dashmflag=-M
"$@" # Require at least two characters before searching for `:'
stat=$? # in the target name. This is to cope with DOS-style filenames:
wait "$proc" # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
if test "$stat" != 0; then exit $stat; fi "$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile" cat < "$tmpdepfile" > "$depfile"
tr ' ' ' tr ' ' '
...@@ -295,33 +452,37 @@ dashXmstdout) ...@@ -295,33 +452,37 @@ dashXmstdout)
;; ;;
makedepend) makedepend)
# X makedepend "$@" || exit $?
( # Remove any Libtool call
shift if test "$libtool" = yes; then
cleared=no while test $1 != '--mode=compile'; do
for arg in "$@"; do shift
case $cleared in no)
set ""; shift
cleared=yes
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift;;
-*)
;;
*)
set fnord "$@" "$arg"; shift;;
esac
done done
obj_suffix="`echo $object | sed 's/^.*\././'`" shift
touch "$tmpdepfile" fi
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" # X makedepend
) & shift
proc=$! cleared=no
"$@" for arg in "$@"; do
stat=$? case $cleared in
wait "$proc" no)
if test "$stat" != 0; then exit $stat; fi set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile" rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile" cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' ' sed '1,2d' "$tmpdepfile" | tr ' ' '
...@@ -334,35 +495,40 @@ makedepend) ...@@ -334,35 +495,40 @@ makedepend)
cpp) cpp)
# Important note: in order to support this mode, a compiler *must* # Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o, # always write the preprocessed file to stdout.
# because we must use -o when running libtool. "$@" || exit $?
( IFS=" "
case " $* " in # Remove the call to Libtool.
*" --mode=compile "*) if test "$libtool" = yes; then
for arg while test $1 != '--mode=compile'; do
do # cycle over the arguments shift
case $arg in done
"--mode=compile") shift
# insert --quiet before "--mode=compile" fi
set fnord "$@" --quiet
shift # fnord # Remove `-o $object'.
;; IFS=" "
esac for arg
set fnord "$@" "$arg" do
shift # fnord case $arg in
shift # "$arg" -o)
done shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;; ;;
esac esac
"$@" -E | done
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile" sed '$ s: \\$::' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile" cat < "$tmpdepfile" >> "$depfile"
...@@ -372,49 +538,27 @@ cpp) ...@@ -372,49 +538,27 @@ cpp)
msvisualcpp) msvisualcpp)
# Important note: in order to support this mode, a compiler *must* # Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o, # always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool. # because we must use -o when running libtool.
( IFS=" " "$@" || exit $?
case " $* " in IFS=" "
*" --mode=compile "*) for arg
for arg do
do # cycle over the arguments case "$arg" in
case $arg in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@" set fnord "$@"
shift shift
shift shift
;; ;;
*) *)
set fnord "$@" "$arg" set fnord "$@" "$arg"
shift shift
shift shift
;; ;;
esac esac
done done
"$@" -E | "$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
...@@ -434,3 +578,12 @@ none) ...@@ -434,3 +578,12 @@ none)
esac esac
exit 0 exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
#!/bin/sh #!/bin/sh
#
# install - install a program, script, or datafile # install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# #
# Copyright 1991 by the Massachusetts Institute of Technology # Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
# #
# Permission to use, copy, modify, distribute, and sell this software and its #
# documentation for any purpose is hereby granted without fee, provided that # FSF changes to this file are in the public domain.
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
# #
# Calling this script install-sh is preferred over install.sh, to prevent # Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it # `make' implicit rules from creating a file called install from it
# when there is no Makefile. # when there is no Makefile.
# #
# This script is compatible with the BSD install script, but was written # This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction # from scratch.
# shared with many OS's install programs.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script # set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it. # Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}" doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else else
: doit_exec=$doit
fi fi
if [ x"$dir_arg" != x ]; then # Put in absolute file names if you don't have them in your path;
dst=$src # or use environment vars.
src=""
chgrpprog=${CHGRPPROG-chgrp}
if [ -d $dst ]; then chmodprog=${CHMODPROG-chmod}
instcmd=: chownprog=${CHOWNPROG-chown}
chmodcmd="" cmpprog=${CMPPROG-cmp}
else cpprog=${CPPROG-cp}
instcmd=$mkdirprog mkdirprog=${MKDIRPROG-mkdir}
fi mvprog=${MVPROG-mv}
else rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command src=
# might cause directories to be created, which would be especially bad dst=
# if $src (and thus $dsttmp) contains '*'. dir_arg=
dst_arg=
if [ -f $src -o -d $src ] copy_on_change=false
then no_target_directory=
:
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system usage="\
# does not like double slashes in filenames, you may need to add some logic Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
if [ -d $dst ] In the 1st form, copy SRCFILE to DSTFILE.
then In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
dst="$dst"/`basename $src` In the 4th, create DIRECTORIES.
else
:
fi
fi
## this sed command emulates the dirname command Options:
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` --help display this help and exit.
--version display version info and exit.
# Make sure that the destination directory exists. -c (ignored)
# this part is taken from Noah Friedman's mkinstalldirs script -C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
# Skip lots of stat calls in the usual case. Environment variables override the default commands:
if [ ! -d "$dstdir" ]; then CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
defaultIFS=' RMPROG STRIPPROG
' "
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}" while test $# -ne 0; do
# Some sh's can't handle IFS=/ for some reason. case $1 in
IFS='%' -c) ;;
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp='' -C) copy_on_change=true;;
while [ $# -ne 0 ] ; do -d) dir_arg=true;;
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ; -g) chgrpcmd="$chgrpprog $2"
then shift;;
$mkdirprog "${pathcomp}"
else
:
fi
pathcomp="${pathcomp}/" --help) echo "$usage"; exit $?;;
done
fi
if [ x"$dir_arg" != x ] -m) mode=$2
then case $mode in
$doit $instcmd $dst && *' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && -o) chowncmd="$chownprog $2"
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && shift;;
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
# If we're going to rename the final executable, determine the name now. -s) stripcmd=$stripprog;;
if [ x"$transformarg" = x ] -t) dst_arg=$2
then shift;;
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename -T) no_target_directory=true;;
if [ x"$dstfile" = x ] --version) echo "$0 $scriptversion"; exit $?;;
then
dstfile=`basename $dst`
else
:
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$# --) shift
break;;
# Move or copy the file name to the temp name -*) echo "$0: invalid option: $1" >&2
exit 1;;
$doit $instcmd $src $dsttmp && *) break;;
esac
trap "rm -f ${dsttmp}" 0 && shift
done
# and set any options; do chmod last to preserve setuid bits if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
# If any of these fail, we abort the whole thing. If we want to if test $# -eq 0; then
# ignore errors from any of these, just make sure not to ignore if test -z "$dir_arg"; then
# errors from the above "$doit $instcmd $src $dsttmp" command. echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if test -z "$dir_arg"; then
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && trap '(exit $?); exit' 1 2 13 15
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
# Now rename the file to the real destination. for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
$doit $rmcmd -f $dstdir/$dstfile && # If destination is a directory, append the input filename; won't work
$doit $mvcmd $dsttmp $dstdir/$dstfile # if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
fi && posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
exit 0 # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
# ltmain.sh - Provide generalized library-building support services. # ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure. # NOTE: Changing this file will not affect anything until you rerun configure.
# #
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
# Free Software Foundation, Inc. # 2007 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -17,13 +17,49 @@ ...@@ -17,13 +17,49 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
basename="s,^.*/,,g"
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
# is ksh but when the shell is invoked as "sh" and the current value of
# the _XPG environment variable is not equal to 1 (one), the special
# positional parameter $0, within a function call, is the name of the
# function.
progpath="$0"
# The name of this program:
progname=`echo "$progpath" | $SED $basename`
modename="$progname"
# Global variables:
EXIT_SUCCESS=0
EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5.24
TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# Check that we have a working $echo. # Check that we have a working $echo.
if test "X$1" = X--no-reexec; then if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue. # Discard the --no-reexec flag, and continue.
...@@ -36,7 +72,7 @@ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then ...@@ -36,7 +72,7 @@ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
: :
else else
# Restart under the correct shell, and then maybe $echo will work. # Restart under the correct shell, and then maybe $echo will work.
exec $SHELL "$0" --no-reexec ${1+"$@"} exec $SHELL "$progpath" --no-reexec ${1+"$@"}
fi fi
if test "X$1" = X--fallback-echo; then if test "X$1" = X--fallback-echo; then
...@@ -45,19 +81,9 @@ if test "X$1" = X--fallback-echo; then ...@@ -45,19 +81,9 @@ if test "X$1" = X--fallback-echo; then
cat <<EOF cat <<EOF
$* $*
EOF EOF
exit 0 exit $EXIT_SUCCESS
fi fi
# The name of this program.
progname=`$echo "$0" | sed 's%^.*/%%'`
modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.4.2
TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)"
default_mode= default_mode=
help="Try \`$progname --help' for more information." help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%" magic="%%%MAGIC variable%%%"
...@@ -67,30 +93,44 @@ rm="rm -f" ...@@ -67,30 +93,44 @@ rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies # Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings. # metacharacters that are still active within double-quoted strings.
Xsed='sed -e 1s/^X//' Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
SP2NL='tr \040 \012' # test EBCDIC or ASCII
NL2SP='tr \015\012 \040\040' case `echo X|tr X '\101'` in
A) # ASCII based system
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
SP2NL='tr \040 \012'
NL2SP='tr \015\012 \040\040'
;;
*) # EBCDIC based system
SP2NL='tr \100 \n'
NL2SP='tr \r\n \100\100'
;;
esac
# NLS nuisances. # NLS nuisances.
# Only set LANG and LC_ALL to C if already set. # Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand # These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO). # e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode. # We save the old values to restore during execute mode.
if test "${LC_ALL+set}" = set; then for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL do
fi eval "if test \"\${$lt_var+set}\" = set; then
if test "${LANG+set}" = set; then save_$lt_var=\$$lt_var
save_LANG="$LANG"; LANG=C; export LANG $lt_var=C
fi export $lt_var
fi"
done
# Make sure IFS has a sensible default # Make sure IFS has a sensible default
: ${IFS=" "} lt_nl='
'
IFS=" $lt_nl"
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
echo "$modename: not configured to build any kind of library" 1>&2 $echo "$modename: not configured to build any kind of library" 1>&2
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Global variables. # Global variables.
...@@ -102,11 +142,286 @@ run= ...@@ -102,11 +142,286 @@ run=
show="$echo" show="$echo"
show_help= show_help=
execute_dlfiles= execute_dlfiles=
duplicate_deps=no
preserve_args=
lo2o="s/\\.lo\$/.${objext}/" lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/" o2lo="s/\\.${objext}\$/.lo/"
extracted_archives=
extracted_serial=0
#####################################
# Shell function definitions:
# This seems to be the best place for them
# func_mktempdir [string]
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible. If
# given, STRING is the basename for that directory.
func_mktempdir ()
{
my_template="${TMPDIR-/tmp}/${1-$progname}"
if test "$run" = ":"; then
# Return a directory name, but don't create it in dry-run mode
my_tmpdir="${my_template}-$$"
else
# If mktemp works, use that first and foremost
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
if test ! -d "$my_tmpdir"; then
# Failing that, at least try and use $RANDOM to avoid a race
my_tmpdir="${my_template}-${RANDOM-0}$$"
save_mktempdir_umask=`umask`
umask 0077
$mkdir "$my_tmpdir"
umask $save_mktempdir_umask
fi
# If we're not in dry-run mode, bomb out on failure
test -d "$my_tmpdir" || {
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
exit $EXIT_FAILURE
}
fi
$echo "X$my_tmpdir" | $Xsed
}
# func_win32_libid arg
# return the library type of file 'arg'
#
# Need a lot of goo to handle *both* DLLs and import libs
# Has to be a shell function in order to 'eat' the argument
# that is supplied when $file_magic_command is called.
func_win32_libid ()
{
win32_libid_type="unknown"
win32_fileres=`file -L $1 2>/dev/null`
case $win32_fileres in
*ar\ archive\ import\ library*) # definitely import
win32_libid_type="x86 archive import"
;;
*ar\ archive*) # could be an import, or static
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
win32_nmres=`eval $NM -f posix -A $1 | \
$SED -n -e '1,100{
/ I /{
s,.*,import,
p
q
}
}'`
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
esac
fi
;;
*DLL*)
win32_libid_type="x86 DLL"
;;
*executable*) # but shell scripts are "executable" too...
case $win32_fileres in
*MS\ Windows\ PE\ Intel*)
win32_libid_type="x86 DLL"
;;
esac
;;
esac
$echo $win32_libid_type
}
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
CC_quoted="$CC_quoted $arg"
done
case $@ in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
CC_quoted="$CC_quoted $arg"
done
case "$@ " in
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;;
esac
fi
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
$echo "$modename: unable to infer tagged configuration"
$echo "$modename: specify a tag with \`--tag'" 1>&2
exit $EXIT_FAILURE
# else
# $echo "$modename: using $tagname tagged configuration"
fi
;;
esac
fi
}
# func_extract_an_archive dir oldlib
func_extract_an_archive ()
{
f_ex_an_ar_dir="$1"; shift
f_ex_an_ar_oldlib="$1"
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
exit $EXIT_FAILURE
fi
}
# func_extract_archives gentop oldlib ...
func_extract_archives ()
{
my_gentop="$1"; shift
my_oldlibs=${1+"$@"}
my_oldobjs=""
my_xlib=""
my_xabs=""
my_xdir=""
my_status=""
$show "${rm}r $my_gentop"
$run ${rm}r "$my_gentop"
$show "$mkdir $my_gentop"
$run $mkdir "$my_gentop"
my_status=$?
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
exit $my_status
fi
for my_xlib in $my_oldlibs; do
# Extract the objects.
case $my_xlib in
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
my_xlib_u=$my_xlib
while :; do
case " $extracted_archives " in
*" $my_xlib_u "*)
extracted_serial=`expr $extracted_serial + 1`
my_xlib_u=lt$extracted_serial-$my_xlib ;;
*) break ;;
esac
done
extracted_archives="$extracted_archives $my_xlib_u"
my_xdir="$my_gentop/$my_xlib_u"
$show "${rm}r $my_xdir"
$run ${rm}r "$my_xdir"
$show "$mkdir $my_xdir"
$run $mkdir "$my_xdir"
exit_status=$?
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
exit $exit_status
fi
case $host in
*-darwin*)
$show "Extracting $my_xabs"
# Do not bother doing anything if just a dry run
if test -z "$run"; then
darwin_orig_dir=`pwd`
cd $my_xdir || exit $?
darwin_archive=$my_xabs
darwin_curdir=`pwd`
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
if test -n "$darwin_arches"; then
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
darwin_arch=
$show "$darwin_base_archive has multiple architectures $darwin_arches"
for darwin_arch in $darwin_arches ; do
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
cd "$darwin_curdir"
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
done # $darwin_arches
## Okay now we have a bunch of thin objects, gotta fatten them up :)
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
lipo -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
${rm}r unfat-$$
cd "$darwin_orig_dir"
else
cd "$darwin_orig_dir"
func_extract_an_archive "$my_xdir" "$my_xabs"
fi # $darwin_arches
fi # $run
;;
*)
func_extract_an_archive "$my_xdir" "$my_xabs"
;;
esac
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
func_extract_archives_result="$my_oldobjs"
}
# End of Shell function definitions
#####################################
# Darwin sucks
eval std_shrext=\"$shrext_cmds\"
disable_libs=no
# Parse our command line options once, thoroughly. # Parse our command line options once, thoroughly.
while test $# -gt 0 while test "$#" -gt 0
do do
arg="$1" arg="$1"
shift shift
...@@ -122,6 +437,34 @@ do ...@@ -122,6 +437,34 @@ do
execute_dlfiles) execute_dlfiles)
execute_dlfiles="$execute_dlfiles $arg" execute_dlfiles="$execute_dlfiles $arg"
;; ;;
tag)
tagname="$arg"
preserve_args="${preserve_args}=$arg"
# Check whether tagname contains only valid characters
case $tagname in
*[!-_A-Za-z0-9,/]*)
$echo "$progname: invalid tag name: $tagname" 1>&2
exit $EXIT_FAILURE
;;
esac
case $tagname in
CC)
# Don't test for the "default" C tag, as we know, it's there, but
# not specially marked.
;;
*)
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
taglist="$taglist $tagname"
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
else
$echo "$progname: ignoring unknown tag $tagname" 1>&2
fi
;;
esac
;;
*) *)
eval "$prev=\$arg" eval "$prev=\$arg"
;; ;;
...@@ -139,18 +482,28 @@ do ...@@ -139,18 +482,28 @@ do
;; ;;
--version) --version)
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" echo "\
exit 0 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit $?
;; ;;
--config) --config)
sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
exit 0 # Now print the configurations for the tags.
for tagname in $taglist; do
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
done
exit $?
;; ;;
--debug) --debug)
echo "$progname: enabling shell trace mode" $echo "$progname: enabling shell trace mode"
set -x set -x
preserve_args="$preserve_args $arg"
;; ;;
--dry-run | -n) --dry-run | -n)
...@@ -158,18 +511,18 @@ do ...@@ -158,18 +511,18 @@ do
;; ;;
--features) --features)
echo "host: $host" $echo "host: $host"
if test "$build_libtool_libs" = yes; then if test "$build_libtool_libs" = yes; then
echo "enable shared libraries" $echo "enable shared libraries"
else else
echo "disable shared libraries" $echo "disable shared libraries"
fi fi
if test "$build_old_libs" = yes; then if test "$build_old_libs" = yes; then
echo "enable static libraries" $echo "enable static libraries"
else else
echo "disable static libraries" $echo "disable static libraries"
fi fi
exit 0 exit $?
;; ;;
--finish) mode="finish" ;; --finish) mode="finish" ;;
...@@ -181,6 +534,19 @@ do ...@@ -181,6 +534,19 @@ do
--quiet | --silent) --quiet | --silent)
show=: show=:
preserve_args="$preserve_args $arg"
;;
--tag)
prevopt="--tag"
prev=tag
preserve_args="$preserve_args --tag"
;;
--tag=*)
set tag "$optarg" ${1+"$@"}
shift
prev=tag
preserve_args="$preserve_args --tag"
;; ;;
-dlopen) -dlopen)
...@@ -191,7 +557,7 @@ do ...@@ -191,7 +557,7 @@ do
-*) -*)
$echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$modename: unrecognized option \`$arg'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
*) *)
...@@ -204,19 +570,20 @@ done ...@@ -204,19 +570,20 @@ done
if test -n "$prevopt"; then if test -n "$prevopt"; then
$echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Mandrake: (gc) It's bad to link C++ code with GCC, so we need to use the compiler name if provided case $disable_libs in
if test "$mode" = link && test -n "$archive_cmds" && test -x "/usr/bin/perl"; then no)
case $nonopt in ;;
*cc | *++ | gcc* | *-gcc* | egcs*) shared)
archive_cmds=`echo $archive_cmds | perl -pe 's/^\S+\s+//'` build_libtool_libs=no
archive_cmds="$nonopt $archive_cmds" build_old_libs=yes
archive_expsym_cmds=`echo $archive_expsym_cmds | perl -pe 's/^\S+\s+//'` ;;
archive_expsym_cmds="$nonopt $archive_expsym_cmds" static)
esac build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
fi ;;
esac
# If this variable is set in any of the actions, the command in it # If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being # will be execed at the end. This prevents here-documents from being
...@@ -227,8 +594,10 @@ if test -z "$show_help"; then ...@@ -227,8 +594,10 @@ if test -z "$show_help"; then
# Infer the operation mode. # Infer the operation mode.
if test -z "$mode"; then if test -z "$mode"; then
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
case $nonopt in case $nonopt in
*cc | *++ | gcc* | *-gcc*) *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
mode=link mode=link
for arg for arg
do do
...@@ -269,7 +638,7 @@ if test -z "$show_help"; then ...@@ -269,7 +638,7 @@ if test -z "$show_help"; then
if test -n "$execute_dlfiles" && test "$mode" != execute; then if test -n "$execute_dlfiles" && test "$mode" != execute; then
$echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Change the help message to a mode-specific one. # Change the help message to a mode-specific one.
...@@ -283,158 +652,127 @@ if test -z "$show_help"; then ...@@ -283,158 +652,127 @@ if test -z "$show_help"; then
modename="$modename: compile" modename="$modename: compile"
# Get the compilation command and the source file. # Get the compilation command and the source file.
base_compile= base_compile=
prev= srcfile="$nonopt" # always keep a non-empty value in "srcfile"
lastarg= suppress_opt=yes
srcfile="$nonopt"
suppress_output= suppress_output=
arg_mode=normal
libobj=
later=
user_target=no
for arg for arg
do do
case $prev in case $arg_mode in
"") ;; arg )
xcompiler) # do not "continue". Instead, add this to base_compile
# Aesthetically quote the previous argument. lastarg="$arg"
prev= arg_mode=normal
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` ;;
case $arg in
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
# Add the previous argument to base_compile. target )
if test -z "$base_compile"; then libobj="$arg"
base_compile="$lastarg" arg_mode=normal
else
base_compile="$base_compile $lastarg"
fi
continue continue
;; ;;
esac
# Accept any command-line options. normal )
case $arg in # Accept any command-line options.
-o) case $arg in
if test "$user_target" != "no"; then -o)
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 if test -n "$libobj" ; then
exit 1 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
fi exit $EXIT_FAILURE
user_target=next fi
;; arg_mode=target
continue
;;
-static) -static | -prefer-pic | -prefer-non-pic)
build_old_libs=yes later="$later $arg"
continue continue
;; ;;
-prefer-pic) -no-suppress)
pic_mode=yes suppress_opt=no
continue continue
;; ;;
-prefer-non-pic) -Xcompiler)
pic_mode=no arg_mode=arg # the next one goes into the "base_compile" arg list
continue continue # The current "srcfile" will either be retained or
;; ;; # replaced later. I would guess that would be a bug.
-Xcompiler) -Wc,*)
prev=xcompiler args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
continue lastarg=
;; save_ifs="$IFS"; IFS=','
for arg in $args; do
IFS="$save_ifs"
-Wc,*) # Double-quote args containing other shell metacharacters.
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` # Many Bourne shells cannot handle close brackets correctly
lastarg= # in scan sets, so we specify it separately.
save_ifs="$IFS"; IFS=',' case $arg in
for arg in $args; do *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
lastarg="$lastarg $arg"
done
IFS="$save_ifs" IFS="$save_ifs"
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
# Double-quote args containing other shell metacharacters. # Add the arguments to base_compile.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
lastarg="$lastarg $arg"
done
IFS="$save_ifs"
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
# Add the arguments to base_compile.
if test -z "$base_compile"; then
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg" base_compile="$base_compile $lastarg"
fi continue
continue ;;
;;
esac
case $user_target in * )
next) # Accept the current argument as the source file.
# The next one is the -o target name # The previous "srcfile" becomes the current argument.
user_target=yes #
continue lastarg="$srcfile"
;; srcfile="$arg"
yes) ;;
# We got the output file esac # case $arg
user_target=set
libobj="$arg"
continue
;; ;;
esac esac # case $arg_mode
# Accept the current argument as the source file.
lastarg="$srcfile"
srcfile="$arg"
# Aesthetically quote the previous argument. # Aesthetically quote the previous argument.
# Backslashify any backslashes, double quotes, and dollar signs.
# These are the only characters that are still specially
# interpreted inside of double-quoted scrings.
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
case $lastarg in
# Double-quote args containing other shell metacharacters. # Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly # Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately. # in scan sets, and some SunOS ksh mistreat backslash-escaping
case $lastarg in # in scan sets (worked around with variable expansion),
# and furthermore cannot handle '|' '&' '(' ')' in scan sets
# at all, so we specify them separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
lastarg="\"$lastarg\"" lastarg="\"$lastarg\""
;; ;;
esac esac
# Add the previous argument to base_compile. base_compile="$base_compile $lastarg"
if test -z "$base_compile"; then done # for arg
base_compile="$lastarg"
else
base_compile="$base_compile $lastarg"
fi
done
case $user_target in case $arg_mode in
set) arg)
$echo "$modename: you must specify an argument for -Xcompile"
exit $EXIT_FAILURE
;; ;;
no) target)
# Get the name of the library object. $echo "$modename: you must specify a target with \`-o'" 1>&2
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` exit $EXIT_FAILURE
;; ;;
*) *)
$echo "$modename: you must specify a target with \`-o'" 1>&2 # Get the name of the library object.
exit 1 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;; ;;
esac esac
# Recognize several different file suffixes. # Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo # If the user specifies -o file.o, it is replaced with file.lo
xform='[cCFSfmso]' xform='[cCFSifmso]'
case $libobj in case $libobj in
*.ada) xform=ada ;; *.ada) xform=ada ;;
*.adb) xform=adb ;; *.adb) xform=adb ;;
...@@ -442,10 +780,14 @@ if test -z "$show_help"; then ...@@ -442,10 +780,14 @@ if test -z "$show_help"; then
*.asm) xform=asm ;; *.asm) xform=asm ;;
*.c++) xform=c++ ;; *.c++) xform=c++ ;;
*.cc) xform=cc ;; *.cc) xform=cc ;;
*.ii) xform=ii ;;
*.class) xform=class ;;
*.cpp) xform=cpp ;; *.cpp) xform=cpp ;;
*.cxx) xform=cxx ;; *.cxx) xform=cxx ;;
*.f90) xform=f90 ;; *.[fF][09]?) xform=[fF][09]. ;;
*.for) xform=for ;; *.for) xform=for ;;
*.java) xform=java ;;
*.obj) xform=obj ;;
esac esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
...@@ -454,25 +796,63 @@ if test -z "$show_help"; then ...@@ -454,25 +796,63 @@ if test -z "$show_help"; then
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*) *)
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
func_infer_tag $base_compile
for arg in $later; do
case $arg in
-static)
build_old_libs=yes
continue
;;
-prefer-pic)
pic_mode=yes
continue
;;
-prefer-non-pic)
pic_mode=no
continue
;;
esac
done
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
case $qlibobj in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
qlibobj="\"$qlibobj\"" ;;
esac
test "X$libobj" != "X$qlibobj" \
&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir=
else
xdir=$xdir/
fi
lobj=${xdir}$objdir/$objname
if test -z "$base_compile"; then if test -z "$base_compile"; then
$echo "$modename: you must specify a compilation command" 1>&2 $echo "$modename: you must specify a compilation command" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Delete any leftover library objects. # Delete any leftover library objects.
if test "$build_old_libs" = yes; then if test "$build_old_libs" = yes; then
removelist="$obj $libobj" removelist="$obj $lobj $libobj ${libobj}T"
else else
removelist="$libobj" removelist="$lobj $libobj ${libobj}T"
fi fi
$run $rm $removelist $run $rm $removelist
trap "$run $rm $removelist; exit 1" 1 2 15 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types # On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in case $host_os in
...@@ -491,8 +871,9 @@ if test -z "$show_help"; then ...@@ -491,8 +871,9 @@ if test -z "$show_help"; then
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock" lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile" removelist="$removelist $output_obj $lockfile"
trap "$run $rm $removelist; exit 1" 1 2 15 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
else else
output_obj=
need_locks=no need_locks=no
lockfile= lockfile=
fi fi
...@@ -500,13 +881,13 @@ if test -z "$show_help"; then ...@@ -500,13 +881,13 @@ if test -z "$show_help"; then
# Lock this critical section if it is needed # Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file # We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then if test "$need_locks" = yes; then
until $run ln "$0" "$lockfile" 2>/dev/null; do until $run ln "$progpath" "$lockfile" 2>/dev/null; do
$show "Waiting for $lockfile to be removed" $show "Waiting for $lockfile to be removed"
sleep 2 sleep 2
done done
elif test "$need_locks" = warn; then elif test "$need_locks" = warn; then
if test -f "$lockfile"; then if test -f "$lockfile"; then
echo "\ $echo "\
*** ERROR, $lockfile exists and contains: *** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null` `cat $lockfile 2>/dev/null`
...@@ -518,14 +899,33 @@ avoid parallel builds (make -j) in this platform, or get a better ...@@ -518,14 +899,33 @@ avoid parallel builds (make -j) in this platform, or get a better
compiler." compiler."
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
echo $srcfile > "$lockfile" $echo "$srcfile" > "$lockfile"
fi fi
if test -n "$fix_srcfile_path"; then if test -n "$fix_srcfile_path"; then
eval srcfile=\"$fix_srcfile_path\" eval srcfile=\"$fix_srcfile_path\"
fi fi
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
case $qsrcfile in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
qsrcfile="\"$qsrcfile\"" ;;
esac
$run $rm "$libobj" "${libobj}T"
# Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
test -z "$run" && cat > ${libobj}T <<EOF
# $libobj - a libtool object file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# Name of the PIC object.
EOF
# Only build a PIC object if we are building libtool libraries. # Only build a PIC object if we are building libtool libraries.
if test "$build_libtool_libs" = yes; then if test "$build_libtool_libs" = yes; then
...@@ -533,53 +933,38 @@ compiler." ...@@ -533,53 +933,38 @@ compiler."
fbsd_hideous_sh_bug=$base_compile fbsd_hideous_sh_bug=$base_compile
if test "$pic_mode" != no; then if test "$pic_mode" != no; then
# All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $qsrcfile $pic_flag"
command="$base_compile $srcfile $pic_flag -DPIC"
else else
# Don't build PIC code # Don't build PIC code
command="$base_compile $srcfile" command="$base_compile $qsrcfile"
fi fi
if test "$build_old_libs" = yes; then
lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$libobj"; then
dir="$objdir"
else
dir="$dir/$objdir"
fi
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
if test -d "$dir"; then if test ! -d "${xdir}$objdir"; then
$show "$rm $libobj" $show "$mkdir ${xdir}$objdir"
$run $rm $libobj $run $mkdir ${xdir}$objdir
else exit_status=$?
$show "$mkdir $dir" if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
$run $mkdir $dir exit $exit_status
status=$?
if test $status -ne 0 && test ! -d $dir; then
exit $status
fi
fi fi
fi fi
if test "$compiler_o_lo" = yes; then
output_obj="$libobj" if test -z "$output_obj"; then
command="$command -o $output_obj" # Place PIC objects in $objdir
elif test "$compiler_c_o" = yes; then command="$command -o $lobj"
output_obj="$obj"
command="$command -o $output_obj"
fi fi
$run $rm "$output_obj" $run $rm "$lobj" "$output_obj"
$show "$command" $show "$command"
if $run eval "$command"; then : if $run eval "$command"; then :
else else
test -n "$output_obj" && $run $rm $removelist test -n "$output_obj" && $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
if test "$need_locks" = warn && if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
echo "\ $echo "\
*** ERROR, $lockfile contains: *** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null` `cat $lockfile 2>/dev/null`
...@@ -594,13 +979,13 @@ avoid parallel builds (make -j) in this platform, or get a better ...@@ -594,13 +979,13 @@ avoid parallel builds (make -j) in this platform, or get a better
compiler." compiler."
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
# Just move the object if needed, then go on to compile the next one # Just move the object if needed, then go on to compile the next one
if test x"$output_obj" != x"$libobj"; then if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
$show "$mv $output_obj $libobj" $show "$mv $output_obj $lobj"
if $run $mv $output_obj $libobj; then : if $run $mv $output_obj $lobj; then :
else else
error=$? error=$?
$run $rm $removelist $run $rm $removelist
...@@ -608,77 +993,50 @@ compiler." ...@@ -608,77 +993,50 @@ compiler."
fi fi
fi fi
# If we have no pic_flag, then copy the object into place and finish. # Append the name of the PIC object to the libtool object file.
if (test -z "$pic_flag" || test "$pic_mode" != default) && test -z "$run" && cat >> ${libobj}T <<EOF
test "$build_old_libs" = yes; then pic_object='$objdir/$objname'
# Rename the .lo from within objdir to obj
if test -f $obj; then
$show $rm $obj
$run $rm $obj
fi
$show "$mv $libobj $obj" EOF
if $run $mv $libobj $obj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` # Allow error messages only from the first compilation.
if test "X$xdir" = "X$obj"; then if test "$suppress_opt" = yes; then
xdir="." suppress_output=' >/dev/null 2>&1'
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
# Now arrange that obj and lo_libobj become the same file
$show "(cd $xdir && $LN_S $baseobj $libobj)"
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
$run $rm "$lockfile"
fi
exit 0
else
error=$?
$run $rm $removelist
exit $error
fi
fi fi
else
# No PIC object so indicate it doesn't exist in the libtool
# object file.
test -z "$run" && cat >> ${libobj}T <<EOF
pic_object=none
# Allow error messages only from the first compilation. EOF
suppress_output=' >/dev/null 2>&1'
fi fi
# Only build a position-dependent object if we build old libraries. # Only build a position-dependent object if we build old libraries.
if test "$build_old_libs" = yes; then if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then if test "$pic_mode" != yes; then
# Don't build PIC code # Don't build PIC code
command="$base_compile $srcfile" command="$base_compile $qsrcfile"
else else
# All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $qsrcfile $pic_flag"
command="$base_compile $srcfile $pic_flag -DPIC"
fi fi
if test "$compiler_c_o" = yes; then if test "$compiler_c_o" = yes; then
command="$command -o $obj" command="$command -o $obj"
output_obj="$obj"
fi fi
# Suppress compiler output if we already did a PIC compilation. # Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output" command="$command$suppress_output"
$run $rm "$output_obj" $run $rm "$obj" "$output_obj"
$show "$command" $show "$command"
if $run eval "$command"; then : if $run eval "$command"; then :
else else
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
if test "$need_locks" = warn && if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
echo "\ $echo "\
*** ERROR, $lockfile contains: *** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null` `cat $lockfile 2>/dev/null`
...@@ -693,11 +1051,11 @@ avoid parallel builds (make -j) in this platform, or get a better ...@@ -693,11 +1051,11 @@ avoid parallel builds (make -j) in this platform, or get a better
compiler." compiler."
$run $rm $removelist $run $rm $removelist
exit 1 exit $EXIT_FAILURE
fi fi
# Just move the object if needed # Just move the object if needed
if test x"$output_obj" != x"$obj"; then if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
$show "$mv $output_obj $obj" $show "$mv $output_obj $obj"
if $run $mv $output_obj $obj; then : if $run $mv $output_obj $obj; then :
else else
...@@ -707,29 +1065,31 @@ compiler." ...@@ -707,29 +1065,31 @@ compiler."
fi fi
fi fi
# Create an invalid libtool object if no PIC, so that we do not # Append the name of the non-PIC object the libtool object file.
# accidentally link it into a program. # Only append if the libtool object file exists.
if test "$build_libtool_libs" != yes; then test -z "$run" && cat >> ${libobj}T <<EOF
$show "echo timestamp > $libobj" # Name of the non-PIC object.
$run eval "echo timestamp > \$libobj" || exit $? non_pic_object='$objname'
else
# Move the .lo from within objdir EOF
$show "$mv $libobj $lo_libobj" else
if $run $mv $libobj $lo_libobj; then : # Append the name of the non-PIC object the libtool object file.
else # Only append if the libtool object file exists.
error=$? test -z "$run" && cat >> ${libobj}T <<EOF
$run $rm $removelist # Name of the non-PIC object.
exit $error non_pic_object=none
fi
fi EOF
fi fi
$run $mv "${libobj}T" "${libobj}"
# Unlock the critical section if it was locked # Unlock the critical section if it was locked
if test "$need_locks" != no; then if test "$need_locks" != no; then
$run $rm "$lockfile" $run $rm "$lockfile"
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
# libtool link mode # libtool link mode
...@@ -740,7 +1100,7 @@ compiler." ...@@ -740,7 +1100,7 @@ compiler."
# It is impossible to link a dll without this setting, and # It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out # we shouldn't force the makefile maintainer to figure out
# which system we are compiling for in order to pass an extra # which system we are compiling for in order to pass an extra
# flag for every libtool invokation. # flag for every libtool invocation.
# allow_undefined=no # allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying # FIXME: Unfortunately, there are problems with the above when trying
...@@ -755,6 +1115,7 @@ compiler." ...@@ -755,6 +1115,7 @@ compiler."
;; ;;
esac esac
libtool_args="$nonopt" libtool_args="$nonopt"
base_compile="$nonopt $@"
compile_command="$nonopt" compile_command="$nonopt"
finalize_command="$nonopt" finalize_command="$nonopt"
...@@ -785,6 +1146,9 @@ compiler." ...@@ -785,6 +1146,9 @@ compiler."
module=no module=no
no_install=no no_install=no
objs= objs=
non_pic_objects=
notinst_path= # paths that contain not-installed libtool libraries
precious_files_regex=
prefer_static_libs=no prefer_static_libs=no
preload=no preload=no
prev= prev=
...@@ -796,27 +1160,40 @@ compiler." ...@@ -796,27 +1160,40 @@ compiler."
temp_rpath= temp_rpath=
thread_safe=no thread_safe=no
vinfo= vinfo=
vinfo_number=no
func_infer_tag $base_compile
# We need to know -static, to get the right output filenames. # We need to know -static, to get the right output filenames.
for arg for arg
do do
case $arg in case $arg in
-all-static | -static) -all-static | -static | -static-libtool-libs)
if test "X$arg" = "X-all-static"; then case $arg in
-all-static)
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi fi
if test -n "$link_static_flag"; then if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static dlopen_self=$dlopen_self_static
fi fi
else prefer_static_libs=yes
;;
-static)
if test -z "$pic_flag" && test -n "$link_static_flag"; then if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static dlopen_self=$dlopen_self_static
fi fi
fi prefer_static_libs=built
;;
-static-libtool-libs)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
;;
esac
build_libtool_libs=no build_libtool_libs=no
build_old_libs=yes build_old_libs=yes
prefer_static_libs=yes
break break
;; ;;
esac esac
...@@ -826,7 +1203,7 @@ compiler." ...@@ -826,7 +1203,7 @@ compiler."
test -n "$old_archive_from_new_cmds" && build_old_libs=yes test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way. # Go through the arguments, transforming them on the way.
while test $# -gt 0; do while test "$#" -gt 0; do
arg="$1" arg="$1"
shift shift
case $arg in case $arg in
...@@ -891,7 +1268,7 @@ compiler." ...@@ -891,7 +1268,7 @@ compiler."
export_symbols="$arg" export_symbols="$arg"
if test ! -f "$arg"; then if test ! -f "$arg"; then
$echo "$modename: symbol file \`$arg' does not exist" $echo "$modename: symbol file \`$arg' does not exist"
exit 1 exit $EXIT_FAILURE
fi fi
prev= prev=
continue continue
...@@ -901,23 +1278,140 @@ compiler." ...@@ -901,23 +1278,140 @@ compiler."
prev= prev=
continue continue
;; ;;
inst_prefix) inst_prefix)
inst_prefix_dir="$arg" inst_prefix_dir="$arg"
prev= prev=
continue continue
;; ;;
precious_regex)
precious_files_regex="$arg"
prev=
continue
;;
release) release)
release="-$arg" release="-$arg"
prev= prev=
continue continue
;; ;;
objectlist)
if test -f "$arg"; then
save_arg=$arg
moreargs=
for fil in `cat $save_arg`
do
# moreargs="$moreargs $fil"
arg=$fil
# A libtool-controlled object.
# Check to see that this really is a libtool object.
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
pic_object=
non_pic_object=
# Read the .lo file
# If there is no directory component, then add one.
case $arg in
*/* | *\\*) . $arg ;;
*) . ./$arg ;;
esac
if test -z "$pic_object" || \
test -z "$non_pic_object" ||
test "$pic_object" = none && \
test "$non_pic_object" = none; then
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
exit $EXIT_FAILURE
fi
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
pic_object="$xdir$pic_object"
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
libobjs="$libobjs $pic_object"
arg="$pic_object"
fi
# Non-PIC object.
if test "$non_pic_object" != none; then
# Prepend the subdirectory the object is found in.
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
non_pic_objects="$non_pic_objects $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
non_pic_object="$pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
if test -z "$run"; then
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
exit $EXIT_FAILURE
else
# Dry-run case.
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
libobjs="$libobjs $pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
fi
fi
done
else
$echo "$modename: link input file \`$save_arg' does not exist"
exit $EXIT_FAILURE
fi
arg=$save_arg
prev=
continue
;;
rpath | xrpath) rpath | xrpath)
# We need an absolute path. # We need an absolute path.
case $arg in case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;; [\\/]* | [A-Za-z]:[\\/]*) ;;
*) *)
$echo "$modename: only absolute run-paths are allowed" 1>&2 $echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
if test "$prev" = rpath; then if test "$prev" = rpath; then
...@@ -949,13 +1443,33 @@ compiler." ...@@ -949,13 +1443,33 @@ compiler."
finalize_command="$finalize_command $wl$qarg" finalize_command="$finalize_command $wl$qarg"
continue continue
;; ;;
xcclinker)
linker_flags="$linker_flags $qarg"
compiler_flags="$compiler_flags $qarg"
prev=
compile_command="$compile_command $qarg"
finalize_command="$finalize_command $qarg"
continue
;;
shrext)
shrext_cmds="$arg"
prev=
continue
;;
darwin_framework|darwin_framework_skip)
test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
prev=
continue
;;
*) *)
eval "$prev=\"\$arg\"" eval "$prev=\"\$arg\""
prev= prev=
continue continue
;; ;;
esac esac
fi # test -n $prev fi # test -n "$prev"
prevarg="$arg" prevarg="$arg"
...@@ -997,7 +1511,7 @@ compiler." ...@@ -997,7 +1511,7 @@ compiler."
-export-symbols | -export-symbols-regex) -export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: more than one -exported-symbols argument is not allowed" $echo "$modename: more than one -exported-symbols argument is not allowed"
exit 1 exit $EXIT_FAILURE
fi fi
if test "X$arg" = "X-export-symbols"; then if test "X$arg" = "X-export-symbols"; then
prev=expsyms prev=expsyms
...@@ -1007,6 +1521,18 @@ compiler." ...@@ -1007,6 +1521,18 @@ compiler."
continue continue
;; ;;
-framework|-arch|-isysroot)
case " $CC " in
*" ${arg} ${1} "* | *" ${arg} ${1} "*)
prev=darwin_framework_skip ;;
*) compiler_flags="$compiler_flags $arg"
prev=darwin_framework ;;
esac
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
continue
;;
-inst-prefix-dir) -inst-prefix-dir)
prev=inst_prefix prev=inst_prefix
continue continue
...@@ -1016,7 +1542,7 @@ compiler." ...@@ -1016,7 +1542,7 @@ compiler."
# so, if we see these flags be careful not to treat them like -L # so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*) -L[A-Z][A-Z]*:*)
case $with_gcc/$host in case $with_gcc/$host in
no/*-*-irix*) no/*-*-irix* | /*-*-irix*)
compile_command="$compile_command $arg" compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg" finalize_command="$finalize_command $arg"
;; ;;
...@@ -1033,7 +1559,8 @@ compiler." ...@@ -1033,7 +1559,8 @@ compiler."
absdir=`cd "$dir" && pwd` absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1 absdir="$dir"
notinst_path="$notinst_path $dir"
fi fi
dir="$absdir" dir="$absdir"
;; ;;
...@@ -1047,10 +1574,15 @@ compiler." ...@@ -1047,10 +1574,15 @@ compiler."
esac esac
case $host in case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
case :$dllsearchpath: in case :$dllsearchpath: in
*":$dir:"*) ;; *":$dir:"*) ;;
*) dllsearchpath="$dllsearchpath:$dir";; *) dllsearchpath="$dllsearchpath:$dir";;
esac esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
*) dllsearchpath="$dllsearchpath:$testbindir";;
esac
;; ;;
esac esac
continue continue
...@@ -1059,36 +1591,99 @@ compiler." ...@@ -1059,36 +1591,99 @@ compiler."
-l*) -l*)
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
case $host in case $host in
*-*-cygwin* | *-*-pw32* | *-*-beos*) *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
# These systems don't actually have a C or math library (as such) # These systems don't actually have a C or math library (as such)
continue continue
;; ;;
*-*-mingw* | *-*-os2*) *-*-os2*)
# These systems don't actually have a C library (as such) # These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue test "X$arg" = "X-lc" && continue
;; ;;
*-*-openbsd*) *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc due to us having libc/libc_r. # Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue test "X$arg" = "X-lc" && continue
;; ;;
esac *-*-rhapsody* | *-*-darwin1.[012])
elif test "X$arg" = "X-lc_r"; then # Rhapsody C and math libraries are in the System framework
case $host in deplibs="$deplibs -framework System"
*-*-openbsd*)
# Do not include libc_r directly, use -pthread flag.
continue continue
;; ;;
*-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
test "X$arg" = "X-lc" && continue
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
test "X$arg" = "X-lc" && continue
;;
esac esac
elif test "X$arg" = "X-lc_r"; then
case $host in
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
esac
fi fi
deplibs="$deplibs $arg" deplibs="$deplibs $arg"
continue continue
;; ;;
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
-model)
compile_command="$compile_command $arg"
compiler_flags="$compiler_flags $arg"
finalize_command="$finalize_command $arg"
prev=xcompiler
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
compiler_flags="$compiler_flags $arg"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
continue
;;
-module) -module)
module=yes module=yes
continue continue
;; ;;
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
# -r[0-9][0-9]* specifies the processor on the SGI compiler
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
# +DA*, +DD* enable 64-bit mode on the HP compiler
# -q* pass through compiler args for the IBM compiler
# -m* pass through architecture-specific compiler args for GCC
# -m*, -t[45]*, -txscale* pass through architecture-specific
# compiler args for GCC
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
# -F/path gives path to uninstalled frameworks, gcc on darwin
# @file GCC response files
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
compiler_flags="$compiler_flags $arg"
continue
;;
-shrext)
prev=shrext
continue
;;
-no-fast-install) -no-fast-install)
fast_install=no fast_install=no
continue continue
...@@ -1096,9 +1691,9 @@ compiler." ...@@ -1096,9 +1691,9 @@ compiler."
-no-install) -no-install)
case $host in case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
# The PATH hackery in wrapper scripts is required on Windows # The PATH hackery in wrapper scripts is required on Windows
# in order for the loader to find any dlls it needs. # and Darwin in order for the loader to find any dlls it needs.
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no fast_install=no
...@@ -1113,8 +1708,18 @@ compiler." ...@@ -1113,8 +1708,18 @@ compiler."
continue continue
;; ;;
-objectlist)
prev=objectlist
continue
;;
-o) prev=output ;; -o) prev=output ;;
-precious-files-regex)
prev=precious_regex
continue
;;
-release) -release)
prev=release prev=release
continue continue
...@@ -1137,7 +1742,7 @@ compiler." ...@@ -1137,7 +1742,7 @@ compiler."
[\\/]* | [A-Za-z]:[\\/]*) ;; [\\/]* | [A-Za-z]:[\\/]*) ;;
*) *)
$echo "$modename: only absolute run-paths are allowed" 1>&2 $echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
case "$xrpath " in case "$xrpath " in
...@@ -1147,7 +1752,7 @@ compiler." ...@@ -1147,7 +1752,7 @@ compiler."
continue continue
;; ;;
-static) -static | -static-libtool-libs)
# The effects of -static are defined in a previous loop. # The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that # We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects # didn't have a PIC flag, but the assumption that the effects
...@@ -1165,6 +1770,11 @@ compiler." ...@@ -1165,6 +1770,11 @@ compiler."
prev=vinfo prev=vinfo
continue continue
;; ;;
-version-number)
prev=vinfo
vinfo_number=yes
continue
;;
-Wc,*) -Wc,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
...@@ -1213,6 +1823,11 @@ compiler." ...@@ -1213,6 +1823,11 @@ compiler."
continue continue
;; ;;
-XCClinker)
prev=xcclinker
continue
;;
# Some other compiler flag. # Some other compiler flag.
-* | +*) -* | +*)
# Unknown arguments in both finalize_command and compile_command need # Unknown arguments in both finalize_command and compile_command need
...@@ -1225,29 +1840,106 @@ compiler." ...@@ -1225,29 +1840,106 @@ compiler."
esac esac
;; ;;
*.lo | *.$objext) *.$objext)
# A library or standard object. # A standard object.
if test "$prev" = dlfiles; then objs="$objs $arg"
# This file was specified with -dlopen. ;;
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $arg"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
if test "$prev" = dlprefiles; then *.lo)
# Preload the old-style object. # A libtool-controlled object.
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
prev= # Check to see that this really is a libtool object.
else if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
pic_object=
non_pic_object=
# Read the .lo file
# If there is no directory component, then add one.
case $arg in case $arg in
*.lo) libobjs="$libobjs $arg" ;; */* | *\\*) . $arg ;;
*) objs="$objs $arg" ;; *) . ./$arg ;;
esac esac
if test -z "$pic_object" || \
test -z "$non_pic_object" ||
test "$pic_object" = none && \
test "$non_pic_object" = none; then
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
exit $EXIT_FAILURE
fi
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
pic_object="$xdir$pic_object"
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
libobjs="$libobjs $pic_object"
arg="$pic_object"
fi
# Non-PIC object.
if test "$non_pic_object" != none; then
# Prepend the subdirectory the object is found in.
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
non_pic_objects="$non_pic_objects $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
non_pic_object="$pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
if test -z "$run"; then
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
exit $EXIT_FAILURE
else
# Dry-run case.
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
libobjs="$libobjs $pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
fi
fi fi
;; ;;
...@@ -1298,7 +1990,7 @@ compiler." ...@@ -1298,7 +1990,7 @@ compiler."
if test -n "$prev"; then if test -n "$prev"; then
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
...@@ -1307,6 +1999,7 @@ compiler." ...@@ -1307,6 +1999,7 @@ compiler."
finalize_command="$finalize_command $arg" finalize_command="$finalize_command $arg"
fi fi
oldlibs=
# calculate the name of the file, without its directory # calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs" libobjs_save="$libobjs"
...@@ -1330,9 +2023,9 @@ compiler." ...@@ -1330,9 +2023,9 @@ compiler."
if test ! -d "$output_objdir"; then if test ! -d "$output_objdir"; then
$show "$mkdir $output_objdir" $show "$mkdir $output_objdir"
$run $mkdir $output_objdir $run $mkdir $output_objdir
status=$? exit_status=$?
if test "$status" -ne 0 && test ! -d "$output_objdir"; then if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
exit $status exit $exit_status
fi fi
fi fi
...@@ -1341,7 +2034,7 @@ compiler." ...@@ -1341,7 +2034,7 @@ compiler."
"") "")
$echo "$modename: you must specify an output file" 1>&2 $echo "$modename: you must specify an output file" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
*.$libext) linkmode=oldlib ;; *.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;; *.lo | *.$objext) linkmode=obj ;;
...@@ -1349,7 +2042,17 @@ compiler." ...@@ -1349,7 +2042,17 @@ compiler."
*) linkmode=prog ;; # Anything else should be a program. *) linkmode=prog ;; # Anything else should be a program.
esac esac
case $host in
*cygwin* | *mingw* | *pw32*)
# don't eliminate duplications in $postdeps and $predeps
duplicate_compiler_generated_deps=yes
;;
*)
duplicate_compiler_generated_deps=$duplicate_deps
;;
esac
specialdeplibs= specialdeplibs=
libs= libs=
# Find all interdependent deplibs by searching for libraries # Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la) # that are linked more than once (e.g. -la -lb -la)
...@@ -1369,7 +2072,7 @@ compiler." ...@@ -1369,7 +2072,7 @@ compiler."
# $postdeps and mark them as special (i.e., whose duplicates are # $postdeps and mark them as special (i.e., whose duplicates are
# not to be eliminated). # not to be eliminated).
pre_post_deps= pre_post_deps=
if test "X$duplicate_deps" = "Xyes" ; then if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
for pre_post_dep in $predeps $postdeps; do for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in case "$pre_post_deps " in
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
...@@ -1385,7 +2088,6 @@ compiler." ...@@ -1385,7 +2088,6 @@ compiler."
newlib_search_path= newlib_search_path=
need_relink=no # whether we're linking any uninstalled libtool libraries need_relink=no # whether we're linking any uninstalled libtool libraries
notinst_deplibs= # not-installed libtool libraries notinst_deplibs= # not-installed libtool libraries
notinst_path= # paths that contain not-installed libtool libraries
case $linkmode in case $linkmode in
lib) lib)
passes="conv link" passes="conv link"
...@@ -1394,7 +2096,7 @@ compiler." ...@@ -1394,7 +2096,7 @@ compiler."
*.la) ;; *.la) ;;
*) *)
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
done done
...@@ -1411,39 +2113,55 @@ compiler." ...@@ -1411,39 +2113,55 @@ compiler."
;; ;;
esac esac
for pass in $passes; do for pass in $passes; do
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan"; then
libs="$deplibs"
deplibs=
fi
if test "$linkmode" = prog; then if test "$linkmode" = prog; then
# Determine which files to process
case $pass in case $pass in
dlopen) dlopen) libs="$dlfiles" ;;
libs="$dlfiles"
save_deplibs="$deplibs" # Collect dlpreopened libraries
deplibs=
;;
dlpreopen) libs="$dlprefiles" ;; dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac esac
fi fi
if test "$pass" = dlopen; then
# Collect dlpreopened libraries
save_deplibs="$deplibs"
deplibs=
fi
for deplib in $libs; do for deplib in $libs; do
lib= lib=
found=no found=no
case $deplib in case $deplib in
-l*) -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
if test "$linkmode" = oldlib && test "$linkmode" = obj; then if test "$linkmode,$pass" = "prog,link"; then
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 compile_deplibs="$deplib $compile_deplibs"
continue finalize_deplibs="$deplib $finalize_deplibs"
else
compiler_flags="$compiler_flags $deplib"
fi fi
if test "$pass" = conv; then continue
deplibs="$deplib $deplibs" ;;
-l*)
if test "$linkmode" != lib && test "$linkmode" != prog; then
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
continue continue
fi fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
# Search the libtool library for search_ext in .la $std_shrext .so .a; do
lib="$searchdir/lib${name}.la" # Search the libtool library
if test -f "$lib"; then lib="$searchdir/lib${name}${search_ext}"
found=yes if test -f "$lib"; then
break if test "$search_ext" = ".la"; then
fi found=yes
else
found=no
fi
break 2
fi
done
done done
if test "$found" != yes; then if test "$found" != yes; then
# deplib doesn't seem to be a libtool library # deplib doesn't seem to be a libtool library
...@@ -1455,6 +2173,42 @@ compiler." ...@@ -1455,6 +2173,42 @@ compiler."
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi fi
continue continue
else # deplib is a libtool library
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
# We need to do some special things here, and not later.
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $deplib "*)
if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
library_names=
old_library=
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
for l in $old_library $library_names; do
ll="$l"
done
if test "X$ll" = "X$old_library" ; then # only static version available
found=no
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
lib=$ladir/$old_library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
fi
;;
*) ;;
esac
fi
fi fi
;; # -l ;; # -l
-L*) -L*)
...@@ -1472,14 +2226,14 @@ compiler." ...@@ -1472,14 +2226,14 @@ compiler."
fi fi
if test "$pass" = scan; then if test "$pass" = scan; then
deplibs="$deplib $deplibs" deplibs="$deplib $deplibs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
else else
compile_deplibs="$deplib $compile_deplibs" compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs" finalize_deplibs="$deplib $finalize_deplibs"
fi fi
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;; ;;
*) *)
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
;; ;;
esac # linkmode esac # linkmode
continue continue
...@@ -1504,16 +2258,33 @@ compiler." ...@@ -1504,16 +2258,33 @@ compiler."
fi fi
case $linkmode in case $linkmode in
lib) lib)
if test "$deplibs_check_method" != pass_all; then valid_a_lib=no
echo case $deplibs_check_method in
echo "*** Warning: This library needs some functionality provided by $deplib." match_pattern*)
echo "*** I have the capability to make that library automatically link in when" set dummy $deplibs_check_method
echo "*** you link to this library. But I can only do this if you have a" match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
echo "*** shared version of the library, which you do not appear to have." if eval $echo \"$deplib\" 2>/dev/null \
| $SED 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
valid_a_lib=yes
fi
;;
pass_all)
valid_a_lib=yes
;;
esac
if test "$valid_a_lib" != yes; then
$echo
$echo "*** Warning: Trying to link with static lib archive $deplib."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which you do not appear to have"
$echo "*** because the file extensions .$libext of this argument makes me believe"
$echo "*** that it is just a static archive that I should not used here."
else else
echo $echo
echo "*** Warning: Linking the shared library $output against the" $echo "*** Warning: Linking the shared library $output against the"
echo "*** static library $deplib is not portable!" $echo "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs" deplibs="$deplib $deplibs"
fi fi
continue continue
...@@ -1530,14 +2301,18 @@ compiler." ...@@ -1530,14 +2301,18 @@ compiler."
esac # linkmode esac # linkmode
;; # *.$libext ;; # *.$libext
*.lo | *.$objext) *.lo | *.$objext)
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then if test "$pass" = conv; then
# If there is no dlopen support or we're linking statically, deplibs="$deplib $deplibs"
# we need to preload. elif test "$linkmode" = prog; then
newdlprefiles="$newdlprefiles $deplib" if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
compile_deplibs="$deplib $compile_deplibs" # If there is no dlopen support or we're linking statically,
finalize_deplibs="$deplib $finalize_deplibs" # we need to preload.
else newdlprefiles="$newdlprefiles $deplib"
newdlfiles="$newdlfiles $deplib" compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
newdlfiles="$newdlfiles $deplib"
fi
fi fi
continue continue
;; ;;
...@@ -1548,15 +2323,15 @@ compiler." ...@@ -1548,15 +2323,15 @@ compiler."
esac # case $deplib esac # case $deplib
if test "$found" = yes || test -f "$lib"; then : if test "$found" = yes || test -f "$lib"; then :
else else
$echo "$modename: cannot find the library \`$lib'" 1>&2 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
...@@ -1569,8 +2344,11 @@ compiler." ...@@ -1569,8 +2344,11 @@ compiler."
library_names= library_names=
old_library= old_library=
# If the library was installed with an old release of libtool, # If the library was installed with an old release of libtool,
# it will not redefine variable installed. # it will not redefine variables installed, or shouldnotlink
installed=yes installed=yes
shouldnotlink=no
avoidtemprpath=
# Read the .la file # Read the .la file
case $lib in case $lib in
...@@ -1580,8 +2358,7 @@ compiler." ...@@ -1580,8 +2358,7 @@ compiler."
if test "$linkmode,$pass" = "lib,link" || if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" || test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" = oldlib && test "$linkmode" = obj; }; then { test "$linkmode" != prog && test "$linkmode" != lib; }; then
# Add dl[pre]opened files of deplib
test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi fi
...@@ -1592,7 +2369,7 @@ compiler." ...@@ -1592,7 +2369,7 @@ compiler."
if test -z "$libdir"; then if test -z "$libdir"; then
if test -z "$old_library"; then if test -z "$old_library"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# It is a libtool convenience library, so add in its objects. # It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library" convenience="$convenience $ladir/$objdir/$old_library"
...@@ -1609,11 +2386,12 @@ compiler." ...@@ -1609,11 +2386,12 @@ compiler."
done done
elif test "$linkmode" != prog && test "$linkmode" != lib; then elif test "$linkmode" != prog && test "$linkmode" != lib; then
$echo "$modename: \`$lib' is not a convenience library" 1>&2 $echo "$modename: \`$lib' is not a convenience library" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
continue continue
fi # $pass = conv fi # $pass = conv
# Get the name of the library we link against. # Get the name of the library we link against.
linklib= linklib=
for l in $old_library $library_names; do for l in $old_library $library_names; do
...@@ -1621,19 +2399,23 @@ compiler." ...@@ -1621,19 +2399,23 @@ compiler."
done done
if test -z "$linklib"; then if test -z "$linklib"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# This library was specified with -dlopen. # This library was specified with -dlopen.
if test "$pass" = dlopen; then if test "$pass" = dlopen; then
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no; then
# If there is no dlname, no dlopen support or we're linking # If there is no dlname, no dlopen support or we're linking
# statically, we need to preload. # statically, we need to preload. We also need to preload any
dlprefiles="$dlprefiles $lib" # dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
dlprefiles="$dlprefiles $lib $dependency_libs"
else else
newdlfiles="$newdlfiles $lib" newdlfiles="$newdlfiles $lib"
fi fi
...@@ -1665,11 +2447,19 @@ compiler." ...@@ -1665,11 +2447,19 @@ compiler."
dir="$libdir" dir="$libdir"
absdir="$libdir" absdir="$libdir"
fi fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else else
dir="$ladir/$objdir" if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
absdir="$abs_ladir/$objdir" dir="$ladir"
# Remove this search path later absdir="$abs_ladir"
notinst_path="$notinst_path $abs_ladir" # Remove this search path later
notinst_path="$notinst_path $abs_ladir"
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
fi
fi # $installed = yes fi # $installed = yes
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
...@@ -1677,7 +2467,7 @@ compiler." ...@@ -1677,7 +2467,7 @@ compiler."
if test "$pass" = dlpreopen; then if test "$pass" = dlpreopen; then
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Prefer using a static library (so that no silly _DYNAMIC symbols # Prefer using a static library (so that no silly _DYNAMIC symbols
# are required to link). # are required to link).
...@@ -1699,11 +2489,12 @@ compiler." ...@@ -1699,11 +2489,12 @@ compiler."
compile_deplibs="$dir/$old_library $compile_deplibs" compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs"
else else
deplibs="$lib $deplibs" deplibs="$lib $deplibs" # used for prog,scan pass
fi fi
continue continue
fi fi
if test "$linkmode" = prog && test "$pass" != link; then if test "$linkmode" = prog && test "$pass" != link; then
newlib_search_path="$newlib_search_path $ladir" newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs" deplibs="$lib $deplibs"
...@@ -1737,13 +2528,21 @@ compiler." ...@@ -1737,13 +2528,21 @@ compiler."
continue continue
fi # $linkmode = prog... fi # $linkmode = prog...
link_static=no # Whether the deplib will be linked statically if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" && if test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then { { test "$prefer_static_libs" = no ||
# Link against this shared library test "$prefer_static_libs,$installed" = "built,yes"; } ||
test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath " in
*" $dir "*) ;;
*" $absdir "*) ;;
*) temp_rpath="$temp_rpath $absdir" ;;
esac
fi
if test "$linkmode,$pass" = "prog,link" ||
{ test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
# Hardcode the library path. # Hardcode the library path.
# Skip directories that are in the system default run-time # Skip directories that are in the system default run-time
# search path. # search path.
...@@ -1765,17 +2564,6 @@ compiler." ...@@ -1765,17 +2564,6 @@ compiler."
esac esac
;; ;;
esac esac
if test "$linkmode" = prog; then
# We need to hardcode the library path
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath " in
*" $dir "*) ;;
*" $absdir "*) ;;
*) temp_rpath="$temp_rpath $dir" ;;
esac
fi
fi
fi # $linkmode,$pass = prog,link... fi # $linkmode,$pass = prog,link...
if test "$alldeplibs" = yes && if test "$alldeplibs" = yes &&
...@@ -1785,11 +2573,56 @@ compiler." ...@@ -1785,11 +2573,56 @@ compiler."
# We only need to search for static libraries # We only need to search for static libraries
continue continue
fi fi
fi
link_static=no # Whether the deplib will be linked statically
use_static_libs=$prefer_static_libs
if test "$use_static_libs" = built && test "$installed" = yes ; then
use_static_libs=no
fi
if test -n "$library_names" &&
{ test "$use_static_libs" = no || test -z "$old_library"; }; then
if test "$installed" = no; then if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib" notinst_deplibs="$notinst_deplibs $lib"
need_relink=yes need_relink=yes
fi fi
# This is a shared library
# Warn about portability, can't link against -module's on
# some systems (darwin)
if test "$shouldnotlink" = yes && test "$pass" = link ; then
$echo
if test "$linkmode" = prog; then
$echo "*** Warning: Linking the executable $output against the loadable module"
else
$echo "*** Warning: Linking the shared library $output against the loadable module"
fi
$echo "*** $linklib is not portable!"
fi
if test "$linkmode" = lib &&
test "$hardcode_into_libs" = yes; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
fi
if test -n "$old_archive_from_expsyms_cmds"; then if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname # figure out the soname
...@@ -1803,7 +2636,7 @@ compiler." ...@@ -1803,7 +2636,7 @@ compiler."
elif test -n "$soname_spec"; then elif test -n "$soname_spec"; then
# bleh windows # bleh windows
case $host in case $host in
*cygwin*) *cygwin* | mingw*)
major=`expr $current - $age` major=`expr $current - $age`
versuffix="-$major" versuffix="-$major"
;; ;;
...@@ -1815,17 +2648,18 @@ compiler." ...@@ -1815,17 +2648,18 @@ compiler."
# Make a new name for the extract_expsyms_cmds to use # Make a new name for the extract_expsyms_cmds to use
soroot="$soname" soroot="$soname"
soname=`echo $soroot | sed -e 's/^.*\///'` soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now # If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then : if test -f "$output_objdir/$soname-def"; then :
else else
$show "extracting exported symbol list from \`$soname'" $show "extracting exported symbol list from \`$soname'"
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
eval cmds=\"$extract_expsyms_cmds\" cmds=$extract_expsyms_cmds
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -1836,9 +2670,10 @@ compiler." ...@@ -1836,9 +2670,10 @@ compiler."
if test -f "$output_objdir/$newlib"; then :; else if test -f "$output_objdir/$newlib"; then :; else
$show "generating import library for \`$soname'" $show "generating import library for \`$soname'"
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
eval cmds=\"$old_archive_from_expsyms_cmds\" cmds=$old_archive_from_expsyms_cmds
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -1858,6 +2693,26 @@ compiler." ...@@ -1858,6 +2693,26 @@ compiler."
immediate | unsupported) immediate | unsupported)
if test "$hardcode_direct" = no; then if test "$hardcode_direct" = no; then
add="$dir/$linklib" add="$dir/$linklib"
case $host in
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
*-*-sysv4*uw2*) add_dir="-L$dir" ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
*-*-unixware7*) add_dir="-L$dir" ;;
*-*-darwin* )
# if the lib is a module then we can not link against
# it, someone is ignoring the new warnings I added
if /usr/bin/file -L $add 2> /dev/null |
$EGREP ": [^:]* bundle" >/dev/null ; then
$echo "** Warning, lib $linklib is a module, not a shared library"
if test -z "$old_library" ; then
$echo
$echo "** And there doesn't seem to be a static archive available"
$echo "** The link will probably fail, sorry"
else
add="$dir/$old_library"
fi
fi
esac
elif test "$hardcode_minus_L" = no; then elif test "$hardcode_minus_L" = no; then
case $host in case $host in
*-*-sunos*) add_shlibpath="$dir" ;; *-*-sunos*) add_shlibpath="$dir" ;;
...@@ -1876,6 +2731,14 @@ compiler." ...@@ -1876,6 +2731,14 @@ compiler."
add="$dir/$linklib" add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir" add_dir="-L$dir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
fi
add="-l$name" add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then elif test "$hardcode_shlibpath_var" = yes; then
add_shlibpath="$dir" add_shlibpath="$dir"
...@@ -1889,7 +2752,7 @@ compiler." ...@@ -1889,7 +2752,7 @@ compiler."
if test "$lib_linked" != yes; then if test "$lib_linked" != yes; then
$echo "$modename: configuration error: unsupported hardcode properties" $echo "$modename: configuration error: unsupported hardcode properties"
exit 1 exit $EXIT_FAILURE
fi fi
if test -n "$add_shlibpath"; then if test -n "$add_shlibpath"; then
...@@ -1917,7 +2780,6 @@ compiler." ...@@ -1917,7 +2780,6 @@ compiler."
if test "$linkmode" = prog || test "$mode" = relink; then if test "$linkmode" = prog || test "$mode" = relink; then
add_shlibpath= add_shlibpath=
add_prefix_dir=
add_dir= add_dir=
add= add=
# Finalize command for both is simple: just hardcode it. # Finalize command for both is simple: just hardcode it.
...@@ -1932,42 +2794,36 @@ compiler." ...@@ -1932,42 +2794,36 @@ compiler."
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac esac
add="-l$name" add="-l$name"
elif test "$hardcode_automatic" = yes; then
if test -n "$inst_prefix_dir" &&
test -f "$inst_prefix_dir$libdir/$linklib" ; then
add="$inst_prefix_dir$libdir/$linklib"
else
add="$libdir/$linklib"
fi
else else
# We cannot seem to hardcode it, guess we'll fake it. # We cannot seem to hardcode it, guess we'll fake it.
add_dir="-L$libdir" add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
fi
add="-l$name" add="-l$name"
fi fi
if test -n "$inst_prefix_dir"; then
case "$libdir" in
[\\/]*)
add_prefix_dir="-L$inst_prefix_dir$libdir"
;;
esac
fi
# add_prefix_dir must be appended instead, otherwise it can
# possibly be overrided by any hardcoded -L/... path in deplibs
if test "$linkmode" = prog; then if test "$linkmode" = prog; then
test -n "$add_prefix_dir" && finalize_deplibs="$finalize_deplibs $add_prefix_dir"
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else else
test -n "$add_prefix_dir" && deplibs="$deplibs $add_prefix_dir"
test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs" test -n "$add" && deplibs="$add $deplibs"
fi fi
fi fi
elif test "$linkmode" = prog; then elif test "$linkmode" = prog; then
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
# Try to link the static library
# Here we assume that one of hardcode_direct or hardcode_minus_L # Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and # is not unsupported. This is valid on all known static and
# shared platforms. # shared platforms.
...@@ -1987,20 +2843,21 @@ compiler." ...@@ -1987,20 +2843,21 @@ compiler."
# Just print a warning and add the library to dependency_libs so # Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library. # that the program can be linked against the static library.
echo $echo
echo "*** Warning: This library needs some functionality provided by $lib." $echo "*** Warning: This system can not link to static lib archive $lib."
echo "*** I have the capability to make that library automatically link in when" $echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a" $echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have." $echo "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then if test "$module" = yes; then
echo "*** Therefore, libtool will create a static module, that should work " $echo "*** But as you try to build a module library, libtool will still create "
echo "*** as long as the dlopening application is linked with the -dlopen flag." $echo "*** a static module, that should work as long as the dlopening application"
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then if test -z "$global_symbol_pipe"; then
echo $echo
echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless." $echo "*** not find such a program. So, this module is probably useless."
echo "*** \`nm' from GNU binutils and a full rebuild may help." $echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi fi
if test "$build_old_libs" = no; then if test "$build_old_libs" = no; then
build_libtool_libs=module build_libtool_libs=module
...@@ -2010,8 +2867,6 @@ compiler." ...@@ -2010,8 +2867,6 @@ compiler."
fi fi
fi fi
else else
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
deplibs="$dir/$old_library $deplibs" deplibs="$dir/$old_library $deplibs"
link_static=yes link_static=yes
fi fi
...@@ -2019,7 +2874,8 @@ compiler." ...@@ -2019,7 +2874,8 @@ compiler."
if test "$linkmode" = lib; then if test "$linkmode" = lib; then
if test -n "$dependency_libs" && if test -n "$dependency_libs" &&
{ test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
test "$link_static" = yes; }; then test "$link_static" = yes; }; then
# Extract -R from dependency_libs # Extract -R from dependency_libs
temp_deplibs= temp_deplibs=
...@@ -2071,29 +2927,75 @@ compiler." ...@@ -2071,29 +2927,75 @@ compiler."
;; ;;
esac esac
if grep "^installed=no" $deplib > /dev/null; then if grep "^installed=no" $deplib > /dev/null; then
path="-L$absdir/$objdir" path="$absdir/$objdir"
else else
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test "$absdir" != "$libdir"; then if test "$absdir" != "$libdir"; then
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
fi fi
path="-L$absdir" path="$absdir"
fi fi
depdepl=
case $host in
*-*-darwin*)
# we do not want to link against static libs,
# but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
if test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
fi
# do not add paths which are already there
case " $newlib_search_path " in
*" $path "*) ;;
*) newlib_search_path="$newlib_search_path $path";;
esac
fi
path=""
;;
*)
path="-L$path"
;;
esac
;;
-l*)
case $host in
*-*-darwin*)
# Again, we only want to link against shared libraries
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
for tmp in $newlib_search_path ; do
if test -f "$tmp/lib$tmp_libs.dylib" ; then
eval depdepl="$tmp/lib$tmp_libs.dylib"
break
fi
done
path=""
;;
*) continue ;;
esac
;; ;;
*) continue ;; *) continue ;;
esac esac
case " $deplibs " in case " $deplibs " in
*" $path "*) ;; *" $path "*) ;;
*) deplibs="$deplibs $path" ;; *) deplibs="$path $deplibs" ;;
esac
case " $deplibs " in
*" $depdepl "*) ;;
*) deplibs="$depdepl $deplibs" ;;
esac esac
done done
fi # link_all_deplibs != no fi # link_all_deplibs != no
fi # linkmode = lib fi # linkmode = lib
done # for deplib in $libs done # for deplib in $libs
dependency_libs="$newdependency_libs"
if test "$pass" = dlpreopen; then if test "$pass" = dlpreopen; then
# Link the dlpreopened libraries before other libraries # Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do for deplib in $save_deplibs; do
...@@ -2101,7 +3003,6 @@ compiler." ...@@ -2101,7 +3003,6 @@ compiler."
done done
fi fi
if test "$pass" != dlopen; then if test "$pass" != dlopen; then
test "$pass" != scan && dependency_libs="$newdependency_libs"
if test "$pass" != conv; then if test "$pass" != conv; then
# Make sure lib_search_path contains only unique directories. # Make sure lib_search_path contains only unique directories.
lib_search_path= lib_search_path=
...@@ -2124,9 +3025,30 @@ compiler." ...@@ -2124,9 +3025,30 @@ compiler."
eval tmp_libs=\"\$$var\" eval tmp_libs=\"\$$var\"
new_libs= new_libs=
for deplib in $tmp_libs; do for deplib in $tmp_libs; do
# FIXME: Pedantically, this is the right thing to do, so
# that some nasty dependency loop isn't accidentally
# broken:
#new_libs="$deplib $new_libs"
# Pragmatically, this seems to cause very few problems in
# practice:
case $deplib in case $deplib in
-L*) new_libs="$deplib $new_libs" ;; -L*) new_libs="$deplib $new_libs" ;;
-R*) ;;
*) *)
# And here is the reason: when a library appears more
# than once as an explicit dependence of a library, or
# is implicitly linked in more than once by the
# compiler, it is considered special, and multiple
# occurrences thereof are not removed. Compare this
# with having the same library being listed as a
# dependency of multiple other libraries: in this case,
# we know (pedantically, we assume) the library does not
# need to be listed more than once, so we keep only the
# last copy. This is not always right, but it is rare
# enough that we require users that really mean to play
# such unportable linking tricks to link the library
# using -Wl,-lname, so that libtool does not consider it
# for duplicate removal.
case " $specialdeplibs " in case " $specialdeplibs " in
*" $deplib "*) new_libs="$deplib $new_libs" ;; *" $deplib "*) new_libs="$deplib $new_libs" ;;
*) *)
...@@ -2154,11 +3076,20 @@ compiler." ...@@ -2154,11 +3076,20 @@ compiler."
eval $var=\"$tmp_libs\" eval $var=\"$tmp_libs\"
done # for var done # for var
fi fi
if test "$pass" = "conv" && # Last step: remove runtime libs from dependency_libs
{ test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then # (they stay in deplibs)
libs="$deplibs" # reset libs tmp_libs=
deplibs= for i in $dependency_libs ; do
fi case " $predeps $postdeps $compiler_lib_search_path " in
*" $i "*)
i=""
;;
esac
if test -n "$i" ; then
tmp_libs="$tmp_libs $i"
fi
done
dependency_libs=$tmp_libs
done # for pass done # for pass
if test "$linkmode" = prog; then if test "$linkmode" = prog; then
dlfiles="$newdlfiles" dlfiles="$newdlfiles"
...@@ -2167,6 +3098,10 @@ compiler." ...@@ -2167,6 +3098,10 @@ compiler."
case $linkmode in case $linkmode in
oldlib) oldlib)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
fi
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
fi fi
...@@ -2180,7 +3115,7 @@ compiler." ...@@ -2180,7 +3115,7 @@ compiler."
fi fi
if test -n "$vinfo"; then if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
fi fi
if test -n "$release"; then if test -n "$release"; then
...@@ -2202,17 +3137,19 @@ compiler." ...@@ -2202,17 +3137,19 @@ compiler."
case $outputname in case $outputname in
lib*) lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\" eval libname=\"$libname_spec\"
;; ;;
*) *)
if test "$module" = no; then if test "$module" = no; then
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test "$need_lib_prefix" != no; then if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required # Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\" eval libname=\"$libname_spec\"
else else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
...@@ -2223,11 +3160,11 @@ compiler." ...@@ -2223,11 +3160,11 @@ compiler."
if test -n "$objs"; then if test -n "$objs"; then
if test "$deplibs_check_method" != pass_all; then if test "$deplibs_check_method" != pass_all; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
exit 1 exit $EXIT_FAILURE
else else
echo $echo
echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** Warning: Linking the shared library $output against the non-libtool"
echo "*** objects $objs is not portable!" $echo "*** objects $objs is not portable!"
libobjs="$libobjs $objs" libobjs="$libobjs $objs"
fi fi
fi fi
...@@ -2246,14 +3183,16 @@ compiler." ...@@ -2246,14 +3183,16 @@ compiler."
if test -z "$rpath"; then if test -z "$rpath"; then
if test "$build_libtool_libs" = yes; then if test "$build_libtool_libs" = yes; then
# Building a libtool convenience library. # Building a libtool convenience library.
libext=al # Some compilers have problems with a `.al' extension so
# convenience libraries should have the same extension an
# archive normally would.
oldlibs="$output_objdir/$libname.$libext $oldlibs" oldlibs="$output_objdir/$libname.$libext $oldlibs"
build_libtool_libs=convenience build_libtool_libs=convenience
build_old_libs=yes build_old_libs=yes
fi fi
if test -n "$vinfo"; then if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
fi fi
if test -n "$release"; then if test -n "$release"; then
...@@ -2269,45 +3208,83 @@ compiler." ...@@ -2269,45 +3208,83 @@ compiler."
if test -n "$8"; then if test -n "$8"; then
$echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$modename: too many parameters to \`-version-info'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
current="$2" # convert absolute version numbers to libtool ages
revision="$3" # this retains compatibility with .la files and attempts
age="$4" # to make the code below a bit more comprehensible
case $vinfo_number in
yes)
number_major="$2"
number_minor="$3"
number_revision="$4"
#
# There are really only two kinds -- those that
# use the current revision as the major version
# and those that subtract age and use age as
# a minor version. But, then there is irix
# which has an extra 1 added just for fun
#
case $version_type in
darwin|linux|osf|windows|none)
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_revision"
;;
freebsd-aout|freebsd-elf|sunos)
current="$number_major"
revision="$number_minor"
age="0"
;;
irix|nonstopux)
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_minor"
lt_irix_increment=no
;;
esac
;;
no)
current="$2"
revision="$3"
age="$4"
;;
esac
# Check that each of the things are valid numbers. # Check that each of the things are valid numbers.
case $current in case $current in
[0-9]*) ;; 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*) *)
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
case $revision in case $revision in
[0-9]*) ;; 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*) *)
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
case $age in case $age in
[0-9]*) ;; 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*) *)
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
if test "$age" -gt "$current"; then if test "$age" -gt "$current"; then
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Calculate the version variables. # Calculate the version variables.
...@@ -2324,6 +3301,7 @@ compiler." ...@@ -2324,6 +3301,7 @@ compiler."
versuffix="$major.$age.$revision" versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options... # Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1` minor_current=`expr $current + 1`
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;; ;;
...@@ -2337,16 +3315,24 @@ compiler." ...@@ -2337,16 +3315,24 @@ compiler."
versuffix=".$current"; versuffix=".$current";
;; ;;
irix) irix | nonstopux)
major=`expr $current - $age + 1` if test "X$lt_irix_increment" = "Xno"; then
verstring="sgi$major.$revision" major=`expr $current - $age`
else
major=`expr $current - $age + 1`
fi
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
verstring="$verstring_prefix$major.$revision"
# Add in all the interfaces that we are compatible with. # Add in all the interfaces that we are compatible with.
loop=$revision loop=$revision
while test "$loop" -ne 0; do while test "$loop" -ne 0; do
iface=`expr $revision - $loop` iface=`expr $revision - $loop`
loop=`expr $loop - 1` loop=`expr $loop - 1`
verstring="sgi$major.$iface:$verstring" verstring="$verstring_prefix$major.$iface:$verstring"
done done
# Before this point, $major must not contain `.'. # Before this point, $major must not contain `.'.
...@@ -2360,7 +3346,7 @@ compiler." ...@@ -2360,7 +3346,7 @@ compiler."
;; ;;
osf) osf)
major=`expr $current - $age` major=.`expr $current - $age`
versuffix=".$current.$age.$revision" versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision" verstring="$current.$age.$revision"
...@@ -2390,20 +3376,19 @@ compiler." ...@@ -2390,20 +3376,19 @@ compiler."
*) *)
$echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "$modename: unknown library version type \`$version_type'" 1>&2
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
# Clear the version info if we defaulted, and they specified a release. # Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then if test -z "$vinfo" && test -n "$release"; then
major= major=
verstring="0.0"
case $version_type in case $version_type in
darwin) darwin)
# we can't check for "0.0" in archive_cmds due to quoting # we can't check for "0.0" in archive_cmds due to quoting
# problems, so we reset it completely # problems, so we reset it completely
verstring="" verstring=
;; ;;
*) *)
verstring="0.0" verstring="0.0"
...@@ -2437,9 +3422,30 @@ compiler." ...@@ -2437,9 +3422,30 @@ compiler."
fi fi
if test "$mode" != relink; then if test "$mode" != relink; then
# Remove our outputs. # Remove our outputs, but don't remove object files since they
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" # may have been created when compiling PIC objects.
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* removelist=
tempremovelist=`$echo "$output_objdir/*"`
for p in $tempremovelist; do
case $p in
*.$objext)
;;
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
if test "X$precious_files_regex" != "X"; then
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
then
continue
fi
fi
removelist="$removelist $p"
;;
*) ;;
esac
done
if test -n "$removelist"; then
$show "${rm}r $removelist"
$run ${rm}r $removelist
fi
fi fi
# Now set the variables for building old libraries. # Now set the variables for building old libraries.
...@@ -2451,11 +3457,11 @@ compiler." ...@@ -2451,11 +3457,11 @@ compiler."
fi fi
# Eliminate all temporary directories. # Eliminate all temporary directories.
for path in $notinst_path; do #for path in $notinst_path; do
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
done #done
if test -n "$xrpath"; then if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them. # If the user specified any rpath flags, then add them.
...@@ -2505,10 +3511,16 @@ compiler." ...@@ -2505,10 +3511,16 @@ compiler."
*-*-netbsd*) *-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed. # Don't link with libc until the a.out ld.so is fixed.
;; ;;
*-*-openbsd*) *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc due to us having libc/libc_r. # Do not include libc due to us having libc/libc_r.
;; ;;
*) *-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
;;
*)
# Add libc to deplibs on all other systems if necessary. # Add libc to deplibs on all other systems if necessary.
if test "$build_libtool_need_lc" = "yes"; then if test "$build_libtool_need_lc" = "yes"; then
deplibs="$deplibs -lc" deplibs="$deplibs -lc"
...@@ -2537,7 +3549,7 @@ compiler." ...@@ -2537,7 +3549,7 @@ compiler."
# This might be a little naive. We might want to check # This might be a little naive. We might want to check
# whether the library exists or not. But this is on # whether the library exists or not. But this is on
# osf3 & osf4 and I'm not really sure... Just # osf3 & osf4 and I'm not really sure... Just
# implementing what was already the behaviour. # implementing what was already the behavior.
newdeplibs=$deplibs newdeplibs=$deplibs
;; ;;
test_compile) test_compile)
...@@ -2550,64 +3562,85 @@ compiler." ...@@ -2550,64 +3562,85 @@ compiler."
int main() { return 0; } int main() { return 0; }
EOF EOF
$rm conftest $rm conftest
$CC -o conftest conftest.c $deplibs if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
if test "$?" -eq 0 ; then
ldd_output=`ldd conftest` ldd_output=`ldd conftest`
for i in $deplibs; do for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`" name=`expr $i : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument. # If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then if test "$name" != "" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
deplib_matches=`eval \\$echo \"$library_names_spec\"` case " $predeps $postdeps " in
set dummy $deplib_matches *" $i "*)
deplib_match=$2 newdeplibs="$newdeplibs $i"
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then i=""
newdeplibs="$newdeplibs $i" ;;
else esac
droppeddeps=yes fi
echo if test -n "$i" ; then
echo "*** Warning: This library needs some functionality provided by $i." libname=`eval \\$echo \"$libname_spec\"`
echo "*** I have the capability to make that library automatically link in when" deplib_matches=`eval \\$echo \"$library_names_spec\"`
echo "*** you link to this library. But I can only do this if you have a" set dummy $deplib_matches
echo "*** shared version of the library, which you do not appear to have." deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
$echo
$echo "*** Warning: dynamic linker does not accept needed library $i."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which I believe you do not have"
$echo "*** because a test_compile did reveal that the linker did not use it for"
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
fi
fi fi
else else
newdeplibs="$newdeplibs $i" newdeplibs="$newdeplibs $i"
fi fi
done done
else else
# Error occured in the first compile. Let's try to salvage the situation: # Error occurred in the first compile. Let's try to salvage
# Compile a seperate program for each library. # the situation: Compile a separate program for each library.
for i in $deplibs; do for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`" name=`expr $i : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument. # If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then if test "$name" != "" && test "$name" != "0"; then
$rm conftest $rm conftest
$CC -o conftest conftest.c $i if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
# Did it work?
if test "$?" -eq 0 ; then
ldd_output=`ldd conftest` ldd_output=`ldd conftest`
libname=`eval \\$echo \"$libname_spec\"` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
deplib_matches=`eval \\$echo \"$library_names_spec\"` case " $predeps $postdeps " in
set dummy $deplib_matches *" $i "*)
deplib_match=$2 newdeplibs="$newdeplibs $i"
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then i=""
newdeplibs="$newdeplibs $i" ;;
else esac
droppeddeps=yes fi
echo if test -n "$i" ; then
echo "*** Warning: This library needs some functionality provided by $i." libname=`eval \\$echo \"$libname_spec\"`
echo "*** I have the capability to make that library automatically link in when" deplib_matches=`eval \\$echo \"$library_names_spec\"`
echo "*** you link to this library. But I can only do this if you have a" set dummy $deplib_matches
echo "*** shared version of the library, which you do not appear to have." deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
$echo
$echo "*** Warning: dynamic linker does not accept needed library $i."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which you do not appear to have"
$echo "*** because a test_compile did reveal that the linker did not use this one"
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
fi
fi fi
else else
droppeddeps=yes droppeddeps=yes
echo $echo
echo "*** Warning! Library $i is needed by this library but I was not able to" $echo "*** Warning! Library $i is needed by this library but I was not able to"
echo "*** make it link in! You will probably need to install it or some" $echo "*** make it link in! You will probably need to install it or some"
echo "*** library that it depends on before this library will be fully" $echo "*** library that it depends on before this library will be fully"
echo "*** functional. Installing it before continuing would be even better." $echo "*** functional. Installing it before continuing would be even better."
fi fi
else else
newdeplibs="$newdeplibs $i" newdeplibs="$newdeplibs $i"
...@@ -2619,13 +3652,22 @@ EOF ...@@ -2619,13 +3652,22 @@ EOF
set dummy $deplibs_check_method set dummy $deplibs_check_method
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`" name=`expr $a_deplib : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument. # If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then if test "$name" != "" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do case " $predeps $postdeps " in
potential_libs=`ls $i/$libname[.-]* 2>/dev/null` *" $a_deplib "*)
for potent_lib in $potential_libs; do newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
# Follow soft links. # Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null \ if ls -lLd "$potent_lib" 2>/dev/null \
| grep " -> " >/dev/null; then | grep " -> " >/dev/null; then
...@@ -2638,35 +3680,36 @@ EOF ...@@ -2638,35 +3680,36 @@ EOF
# but so what? # but so what?
potlib="$potent_lib" potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | sed 's/.* -> //'` potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac esac
done done
# It is ok to link against an archive when
# building a shared library.
if $AR -t $potlib > /dev/null 2>&1; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
| sed 10q \ | ${SED} 10q \
| egrep "$file_magic_regex" > /dev/null; then | $EGREP "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib" newdeplibs="$newdeplibs $a_deplib"
a_deplib="" a_deplib=""
break 2 break 2
fi fi
done done
done done
fi
if test -n "$a_deplib" ; then if test -n "$a_deplib" ; then
droppeddeps=yes droppeddeps=yes
echo $echo
echo "*** Warning: This library needs some functionality provided by $a_deplib." $echo "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when" $echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a" $echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have." $echo "*** shared version of the library, which you do not appear to have"
$echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$echo "*** with $libname but no candidates were found. (...for file magic test)"
else
$echo "*** with $libname and none of the candidates passed a file format test"
$echo "*** using a file magic. Last file checked: $potlib"
fi
fi fi
else else
# Add a -L argument. # Add a -L argument.
...@@ -2678,29 +3721,47 @@ EOF ...@@ -2678,29 +3721,47 @@ EOF
set dummy $deplibs_check_method set dummy $deplibs_check_method
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`" name=`expr $a_deplib : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument. # If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do case " $predeps $postdeps " in
potential_libs=`ls $i/$libname[.-]* 2>/dev/null` *" $a_deplib "*)
for potent_lib in $potential_libs; do newdeplibs="$newdeplibs $a_deplib"
if eval echo \"$potent_lib\" 2>/dev/null \ a_deplib=""
| sed 10q \ ;;
| egrep "$match_pattern_regex" > /dev/null; then esac
newdeplibs="$newdeplibs $a_deplib" fi
a_deplib="" if test -n "$a_deplib" ; then
break 2 libname=`eval \\$echo \"$libname_spec\"`
fi for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check above in file_magic test
if eval $echo \"$potent_lib\" 2>/dev/null \
| ${SED} 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done done
done fi
if test -n "$a_deplib" ; then if test -n "$a_deplib" ; then
droppeddeps=yes droppeddeps=yes
echo $echo
echo "*** Warning: This library needs some functionality provided by $a_deplib." $echo "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when" $echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a" $echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have." $echo "*** shared version of the library, which you do not appear to have"
$echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
else
$echo "*** with $libname and none of the candidates passed a file format test"
$echo "*** using a regex pattern. Last file checked: $potlib"
fi
fi fi
else else
# Add a -L argument. # Add a -L argument.
...@@ -2710,16 +3771,23 @@ EOF ...@@ -2710,16 +3771,23 @@ EOF
;; ;;
none | unknown | *) none | unknown | *)
newdeplibs="" newdeplibs=""
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | -e 's/ -[LR][^ ]*//g'`
grep . >/dev/null; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
echo for i in $predeps $postdeps ; do
# can't use Xsed below, because $i might contain '/'
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
done
fi
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
| grep . >/dev/null; then
$echo
if test "X$deplibs_check_method" = "Xnone"; then if test "X$deplibs_check_method" = "Xnone"; then
echo "*** Warning: inter-library dependencies are not supported in this platform." $echo "*** Warning: inter-library dependencies are not supported in this platform."
else else
echo "*** Warning: inter-library dependencies are not known to be supported." $echo "*** Warning: inter-library dependencies are not known to be supported."
fi fi
echo "*** All declared inter-library dependencies are being dropped." $echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes droppeddeps=yes
fi fi
;; ;;
...@@ -2739,17 +3807,17 @@ EOF ...@@ -2739,17 +3807,17 @@ EOF
if test "$droppeddeps" = yes; then if test "$droppeddeps" = yes; then
if test "$module" = yes; then if test "$module" = yes; then
echo $echo
echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** Warning: libtool could not satisfy all declared inter-library"
echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** dependencies of module $libname. Therefore, libtool will create"
echo "*** a static module, that should work as long as the dlopening" $echo "*** a static module, that should work as long as the dlopening"
echo "*** application is linked with the -dlopen flag." $echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then if test -z "$global_symbol_pipe"; then
echo $echo
echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless." $echo "*** not find such a program. So, this module is probably useless."
echo "*** \`nm' from GNU binutils and a full rebuild may help." $echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi fi
if test "$build_old_libs" = no; then if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext" oldlibs="$output_objdir/$libname.$libext"
...@@ -2759,16 +3827,16 @@ EOF ...@@ -2759,16 +3827,16 @@ EOF
build_libtool_libs=no build_libtool_libs=no
fi fi
else else
echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library" $echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it." $echo "*** or is declared to -dlopen it."
if test "$allow_undefined" = no; then if test "$allow_undefined" = no; then
echo $echo
echo "*** Since this library must not contain undefined symbols," $echo "*** Since this library must not contain undefined symbols,"
echo "*** because either the platform does not support them or" $echo "*** because either the platform does not support them or"
echo "*** it was explicitly requested with -no-undefined," $echo "*** it was explicitly requested with -no-undefined,"
echo "*** libtool will only create a static version of it." $echo "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext" oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module build_libtool_libs=module
...@@ -2783,6 +3851,35 @@ EOF ...@@ -2783,6 +3851,35 @@ EOF
deplibs=$newdeplibs deplibs=$newdeplibs
fi fi
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=
for path in $notinst_path; do
case " $new_libs " in
*" -L$path/$objdir "*) ;;
*)
case " $deplibs " in
*" -L$path/$objdir "*)
new_libs="$new_libs -L$path/$objdir" ;;
esac
;;
esac
done
for deplib in $deplibs; do
case $deplib in
-L*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$new_libs $deplib" ;;
esac
;;
*) new_libs="$new_libs $deplib" ;;
esac
done
deplibs="$new_libs"
# All the library-specific variables (install_libdir is set above). # All the library-specific variables (install_libdir is set above).
library_names= library_names=
old_library= old_library=
...@@ -2826,7 +3923,14 @@ EOF ...@@ -2826,7 +3923,14 @@ EOF
if test -n "$hardcode_libdir_separator" && if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs" libdir="$hardcode_libdirs"
eval dep_rpath=\"$hardcode_libdir_flag_spec\" if test -n "$hardcode_libdir_flag_spec_ld"; then
case $archive_cmds in
*\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
*) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
esac
else
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
fi fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var. # We should set the runpath_var.
...@@ -2846,6 +3950,7 @@ EOF ...@@ -2846,6 +3950,7 @@ EOF
fi fi
# Get the real and link names of the library. # Get the real and link names of the library.
eval shared_ext=\"$shrext_cmds\"
eval library_names=\"$library_names_spec\" eval library_names=\"$library_names_spec\"
set dummy $library_names set dummy $library_names
realname="$2" realname="$2"
...@@ -2856,31 +3961,17 @@ EOF ...@@ -2856,31 +3961,17 @@ EOF
else else
soname="$realname" soname="$realname"
fi fi
test -z "$dlname" && dlname=$soname if test -z "$dlname"; then
dlname=$soname
fi
lib="$output_objdir/$realname" lib="$output_objdir/$realname"
linknames=
for link for link
do do
linknames="$linknames $link" linknames="$linknames $link"
done done
# Ensure that we have .o objects for linkers which dislike .lo
# (e.g. aix) in case we are running --disable-static
for obj in $libobjs; do
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
if test ! -f $xdir/$oldobj; then
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
fi
done
# Use standard objects if they are pic # Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
...@@ -2890,17 +3981,29 @@ EOF ...@@ -2890,17 +3981,29 @@ EOF
$show "generating symbol list for \`$libname.la'" $show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp" export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols $run $rm $export_symbols
eval cmds=\"$export_symbols_cmds\" cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
$show "$cmd" eval cmd=\"$cmd\"
$run eval "$cmd" || exit $? if len=`expr "X$cmd" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
$show "$cmd"
$run eval "$cmd" || exit $?
skipped_export=false
else
# The command line is too long to execute in one step.
$show "using reloadable object file for export list..."
skipped_export=:
# Break out early, otherwise skipped_export may be
# set to false by a later but shorter cmd.
break
fi
done done
IFS="$save_ifs" IFS="$save_ifs"
if test -n "$export_symbols_regex"; then if test -n "$export_symbols_regex"; then
$show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
$run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
$show "$mv \"${export_symbols}T\" \"$export_symbols\"" $show "$mv \"${export_symbols}T\" \"$export_symbols\""
$run eval '$mv "${export_symbols}T" "$export_symbols"' $run eval '$mv "${export_symbols}T" "$export_symbols"'
fi fi
...@@ -2911,74 +4014,210 @@ EOF ...@@ -2911,74 +4014,210 @@ EOF
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
fi fi
tmp_deplibs=
for test_deplib in $deplibs; do
case " $convenience " in
*" $test_deplib "*) ;;
*)
tmp_deplibs="$tmp_deplibs $test_deplib"
;;
esac
done
deplibs="$tmp_deplibs"
if test -n "$convenience"; then if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then if test -n "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\" eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
else else
gentop="$output_objdir/${outputname}x" gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop" generated="$generated $gentop"
for xlib in $convenience; do func_extract_archives $gentop $convenience
# Extract the objects. libobjs="$libobjs $func_extract_archives_result"
case $xlib in fi
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; fi
*) xabs=`pwd`"/$xlib" ;;
esac if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` eval flag=\"$thread_safe_flag_spec\"
xdir="$gentop/$xlib" linker_flags="$linker_flags $flag"
fi
$show "${rm}r $xdir"
$run ${rm}r "$xdir" # Make a backup of the uninstalled library when relinking
$show "mkdir $xdir" if test "$mode" = relink; then
$run mkdir "$xdir" $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
status=$? fi
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status # Do each of the archive commands.
fi if test "$module" = yes && test -n "$module_cmds" ; then
$show "(cd $xdir && $AR x $xabs)" if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $? eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
else
eval test_cmds=\"$module_cmds\"
cmds=$module_cmds
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval test_cmds=\"$archive_expsym_cmds\"
cmds=$archive_expsym_cmds
else
eval test_cmds=\"$archive_cmds\"
cmds=$archive_cmds
fi
fi
if test "X$skipped_export" != "X:" &&
len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
:
else
# The command line is too long to link in one step, link piecewise.
$echo "creating reloadable object files..."
# Save the value of $output and $libobjs because we want to
# use them later. If we have whole_archive_flag_spec, we
# want to use save_libobjs as it was before
# whole_archive_flag_spec was expanded, because we can't
# assume the linker understands whole_archive_flag_spec.
# This may have to be revisited, in case too many
# convenience libraries get linked in and end up exceeding
# the spec.
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
fi
save_output=$output
output_la=`$echo "X$output" | $Xsed -e "$basename"`
# Clear the reloadable object creation command queue and
# initialize k to one.
test_cmds=
concat_cmds=
objlist=
delfiles=
last_robj=
k=1
output=$output_objdir/$output_la-${k}.$objext
# Loop over the list of objects to be linked.
for obj in $save_libobjs
do
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
if test "X$objlist" = X ||
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
test "$len" -le "$max_cmd_len"; }; then
objlist="$objlist $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
if test "$k" -eq 1 ; then
# The first file doesn't have a previous command to add.
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
else
# All subsequent reloadable object files will link in
# the last one created.
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
fi
last_robj=$output_objdir/$output_la-${k}.$objext
k=`expr $k + 1`
output=$output_objdir/$output_la-${k}.$objext
objlist=$obj
len=1
fi
done
# Handle the remaining objects by creating one last
# reloadable object file. All subsequent reloadable object
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
if ${skipped_export-false}; then
$show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols
libobjs=$output
# Append the command to create the export file.
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
fi
# Set up a command to remove the reloadable object files
# after they are used.
i=0
while test "$i" -lt "$k"
do
i=`expr $i + 1`
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
done
$echo "creating a temporary reloadable object file: $output"
# Loop through the commands generated above and execute them.
save_ifs="$IFS"; IFS='~'
for cmd in $concat_cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
libobjs=$output
# Restore the value of output.
output=$save_output
libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
done eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
fi fi
fi # Expand the library linking commands again to reset the
# value of $libobjs for piecewise linking.
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
linker_flags="$linker_flags $flag"
fi
# Make a backup of the uninstalled library when relinking # Do each of the archive commands.
if test "$mode" = relink; then if test "$module" = yes && test -n "$module_cmds" ; then
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
fi cmds=$module_expsym_cmds
else
cmds=$module_cmds
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
cmds=$archive_expsym_cmds
else
cmds=$archive_cmds
fi
fi
# Do each of the archive commands. # Append the command to remove the reloadable object files
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then # to the just-reset $cmds.
eval cmds=\"$archive_expsym_cmds\" eval cmds=\"\$cmds~\$rm $delfiles\"
else
eval cmds=\"$archive_cmds\"
fi fi
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
fi
exit $lt_exit
}
done done
IFS="$save_ifs" IFS="$save_ifs"
# Restore the uninstalled library and exit # Restore the uninstalled library and exit
if test "$mode" = relink; then if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
exit 0
if test -n "$convenience"; then
if test -z "$whole_archive_flag_spec"; then
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
fi
fi
exit $EXIT_SUCCESS
fi fi
# Create links to the real library. # Create links to the real library.
...@@ -3026,7 +4265,7 @@ EOF ...@@ -3026,7 +4265,7 @@ EOF
*.lo) *.lo)
if test -n "$objs$old_deplibs"; then if test -n "$objs$old_deplibs"; then
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
libobj="$output" libobj="$output"
obj=`$echo "X$output" | $Xsed -e "$lo2o"` obj=`$echo "X$output" | $Xsed -e "$lo2o"`
...@@ -3047,46 +4286,20 @@ EOF ...@@ -3047,46 +4286,20 @@ EOF
reload_conv_objs= reload_conv_objs=
gentop= gentop=
# reload_cmds runs $LD directly, so let us get rid of # reload_cmds runs $LD directly, so let us get rid of
# -Wl from whole_archive_flag_spec # -Wl from whole_archive_flag_spec and hope we can get by with
# turning comma into space..
wl= wl=
if test -n "$convenience"; then if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then if test -n "$whole_archive_flag_spec"; then
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
else else
gentop="$output_objdir/${obj}x" gentop="$output_objdir/${obj}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop" generated="$generated $gentop"
for xlib in $convenience; do func_extract_archives $gentop $convenience
# Extract the objects. reload_conv_objs="$reload_objs $func_extract_archives_result"
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
done
fi fi
fi fi
...@@ -3094,10 +4307,11 @@ EOF ...@@ -3094,10 +4307,11 @@ EOF
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj" output="$obj"
eval cmds=\"$reload_cmds\" cmds=$reload_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -3110,7 +4324,7 @@ EOF ...@@ -3110,7 +4324,7 @@ EOF
$run ${rm}r $gentop $run ${rm}r $gentop
fi fi
exit 0 exit $EXIT_SUCCESS
fi fi
if test "$build_libtool_libs" != yes; then if test "$build_libtool_libs" != yes; then
...@@ -3121,37 +4335,24 @@ EOF ...@@ -3121,37 +4335,24 @@ EOF
# Create an invalid libtool object if no PIC, so that we don't # Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program. # accidentally link it into a program.
$show "echo timestamp > $libobj" # $show "echo timestamp > $libobj"
$run eval "echo timestamp > $libobj" || exit $? # $run eval "echo timestamp > $libobj" || exit $?
exit 0 exit $EXIT_SUCCESS
fi fi
if test -n "$pic_flag" || test "$pic_mode" != default; then if test -n "$pic_flag" || test "$pic_mode" != default; then
# Only do commands if we really have different PIC objects. # Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs" reload_objs="$libobjs $reload_conv_objs"
output="$libobj" output="$libobj"
eval cmds=\"$reload_cmds\" cmds=$reload_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
IFS="$save_ifs" IFS="$save_ifs"
else
# Just create a symlink.
$show $rm $libobj
$run $rm $libobj
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$libobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
fi fi
if test -n "$gentop"; then if test -n "$gentop"; then
...@@ -3159,12 +4360,12 @@ EOF ...@@ -3159,12 +4360,12 @@ EOF
$run ${rm}r $gentop $run ${rm}r $gentop
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
prog) prog)
case $host in case $host in
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac esac
if test -n "$vinfo"; then if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
...@@ -3189,6 +4390,45 @@ EOF ...@@ -3189,6 +4390,45 @@ EOF
;; ;;
esac esac
case $host in
*darwin*)
# Don't allow lazy linking, it breaks C++ global constructors
if test "$tagname" = CXX ; then
compile_command="$compile_command ${wl}-bind_at_load"
finalize_command="$finalize_command ${wl}-bind_at_load"
fi
;;
esac
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=
for path in $notinst_path; do
case " $new_libs " in
*" -L$path/$objdir "*) ;;
*)
case " $compile_deplibs " in
*" -L$path/$objdir "*)
new_libs="$new_libs -L$path/$objdir" ;;
esac
;;
esac
done
for deplib in $compile_deplibs; do
case $deplib in
-L*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$new_libs $deplib" ;;
esac
;;
*) new_libs="$new_libs $deplib" ;;
esac
done
compile_deplibs="$new_libs"
compile_command="$compile_command $compile_deplibs" compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs" finalize_command="$finalize_command $finalize_deplibs"
...@@ -3233,10 +4473,15 @@ EOF ...@@ -3233,10 +4473,15 @@ EOF
fi fi
case $host in case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
case :$dllsearchpath: in case :$dllsearchpath: in
*":$libdir:"*) ;; *":$libdir:"*) ;;
*) dllsearchpath="$dllsearchpath:$libdir";; *) dllsearchpath="$dllsearchpath:$libdir";;
esac esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
*) dllsearchpath="$dllsearchpath:$testbindir";;
esac
;; ;;
esac esac
done done
...@@ -3339,31 +4584,43 @@ extern \"C\" { ...@@ -3339,31 +4584,43 @@ extern \"C\" {
done done
if test -n "$exclude_expsyms"; then if test -n "$exclude_expsyms"; then
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"' $run eval '$mv "$nlist"T "$nlist"'
fi fi
if test -n "$export_symbols_regex"; then if test -n "$export_symbols_regex"; then
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"' $run eval '$mv "$nlist"T "$nlist"'
fi fi
# Prepare the list of exported symbols # Prepare the list of exported symbols
if test -z "$export_symbols"; then if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp" export_symbols="$output_objdir/$outputname.exp"
$run $rm $export_symbols $run $rm $export_symbols
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
*cygwin* | *mingw* )
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
;;
esac
else else
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"' $run eval 'mv "$nlist"T "$nlist"'
case $host in
*cygwin* | *mingw* )
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
;;
esac
fi fi
fi fi
for arg in $dlprefiles; do for arg in $dlprefiles; do
$show "extracting global C symbols from \`$arg'" $show "extracting global C symbols from \`$arg'"
name=`echo "$arg" | sed -e 's%^.*/%%'` name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
$run eval 'echo ": $name " >> "$nlist"' $run eval '$echo ": $name " >> "$nlist"'
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done done
...@@ -3372,12 +4629,18 @@ extern \"C\" { ...@@ -3372,12 +4629,18 @@ extern \"C\" {
test -f "$nlist" || : > "$nlist" test -f "$nlist" || : > "$nlist"
if test -n "$exclude_expsyms"; then if test -n "$exclude_expsyms"; then
egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
$mv "$nlist"T "$nlist" $mv "$nlist"T "$nlist"
fi fi
# Try sorting and uniquifying the output. # Try sorting and uniquifying the output.
if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then if grep -v "^: " < "$nlist" |
if sort -k 3 </dev/null >/dev/null 2>&1; then
sort -k 3
else
sort +2
fi |
uniq > "$nlist"S; then
: :
else else
grep -v "^: " < "$nlist" > "$nlist"S grep -v "^: " < "$nlist" > "$nlist"S
...@@ -3386,7 +4649,7 @@ extern \"C\" { ...@@ -3386,7 +4649,7 @@ extern \"C\" {
if test -f "$nlist"S; then if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
else else
echo '/* NONE */' >> "$output_objdir/$dlsyms" $echo '/* NONE */' >> "$output_objdir/$dlsyms"
fi fi
$echo >> "$output_objdir/$dlsyms" "\ $echo >> "$output_objdir/$dlsyms" "\
...@@ -3401,7 +4664,26 @@ extern \"C\" { ...@@ -3401,7 +4664,26 @@ extern \"C\" {
#endif #endif
/* The mapping between symbol names and symbols. */ /* The mapping between symbol names and symbols. */
"
case $host in
*cygwin* | *mingw* )
$echo >> "$output_objdir/$dlsyms" "\
/* DATA imports from DLLs on WIN32 can't be const, because
runtime relocations are performed -- see ld's documentation
on pseudo-relocs */
struct {
"
;;
* )
$echo >> "$output_objdir/$dlsyms" "\
const struct { const struct {
"
;;
esac
$echo >> "$output_objdir/$dlsyms" "\
const char *name; const char *name;
lt_ptr address; lt_ptr address;
} }
...@@ -3438,30 +4720,43 @@ static const void *lt_preloaded_setup() { ...@@ -3438,30 +4720,43 @@ static const void *lt_preloaded_setup() {
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in case "$compile_command " in
*" -static "*) ;; *" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
esac;; esac;;
*-*-hpux*) *-*-hpux*)
case "$compile_command " in case "$compile_command " in
*" -static "*) ;; *" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC";; *) pic_flag_for_symtable=" $pic_flag";;
esac esac
esac esac
# Now compile the dynamic symbol file. # Now compile the dynamic symbol file.
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files. # Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
# Transform the symbol file into the correct name. # Transform the symbol file into the correct name.
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` case $host in
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` *cygwin* | *mingw* )
if test -f "$output_objdir/${outputname}.def" ; then
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
else
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
fi
;;
* )
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
;;
esac
;; ;;
*) *)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
else else
...@@ -3470,19 +4765,19 @@ static const void *lt_preloaded_setup() { ...@@ -3470,19 +4765,19 @@ static const void *lt_preloaded_setup() {
# really was required. # really was required.
# Nullify the symbol file. # Nullify the symbol file.
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
fi fi
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification. # Replace the output file specification.
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
link_command="$compile_command$compile_rpath" link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now. # We have no uninstalled library dependencies, so finalize right now.
$show "$link_command" $show "$link_command"
$run eval "$link_command" $run eval "$link_command"
status=$? exit_status=$?
# Delete the generated files. # Delete the generated files.
if test -n "$dlsyms"; then if test -n "$dlsyms"; then
...@@ -3490,7 +4785,7 @@ static const void *lt_preloaded_setup() { ...@@ -3490,7 +4785,7 @@ static const void *lt_preloaded_setup() {
$run $rm "$output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}"
fi fi
exit $status exit $exit_status
fi fi
if test -n "$shlibpath_var"; then if test -n "$shlibpath_var"; then
...@@ -3549,7 +4844,7 @@ static const void *lt_preloaded_setup() { ...@@ -3549,7 +4844,7 @@ static const void *lt_preloaded_setup() {
# Link the executable and exit # Link the executable and exit
$show "$link_command" $show "$link_command"
$run eval "$link_command" || exit $? $run eval "$link_command" || exit $?
exit 0 exit $EXIT_SUCCESS
fi fi
if test "$hardcode_action" = relink; then if test "$hardcode_action" = relink; then
...@@ -3563,7 +4858,7 @@ static const void *lt_preloaded_setup() { ...@@ -3563,7 +4858,7 @@ static const void *lt_preloaded_setup() {
if test "$fast_install" != no; then if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath" link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then if test "$fast_install" = yes; then
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
else else
# fast_install is set to needless # fast_install is set to needless
relink_command= relink_command=
...@@ -3600,14 +4895,14 @@ static const void *lt_preloaded_setup() { ...@@ -3600,14 +4895,14 @@ static const void *lt_preloaded_setup() {
fi fi
done done
relink_command="(cd `pwd`; $relink_command)" relink_command="(cd `pwd`; $relink_command)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
fi fi
# Quote $echo for shipping. # Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
case $0 in case $progpath in
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
*) qecho="$SHELL `pwd`/$0 --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
esac esac
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
else else
...@@ -3619,15 +4914,376 @@ static const void *lt_preloaded_setup() { ...@@ -3619,15 +4914,376 @@ static const void *lt_preloaded_setup() {
# win32 will think the script is a binary if it has # win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here. # a .exe suffix, so we strip it off here.
case $output in case $output in
*.exe) output=`echo $output|sed 's,.exe$,,'` ;; *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
esac esac
# test for cygwin because mv fails w/o .exe extensions # test for cygwin because mv fails w/o .exe extensions
case $host in case $host in
*cygwin*) exeext=.exe ;; *cygwin*)
exeext=.exe
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
*) exeext= ;; *) exeext= ;;
esac esac
$rm $output case $host in
trap "$rm $output; exit 1" 1 2 15 *cygwin* | *mingw* )
output_name=`basename $output`
output_path=`dirname $output`
cwrappersource="$output_path/$objdir/lt-$output_name.c"
cwrapper="$output_path/$output_name.exe"
$rm $cwrappersource $cwrapper
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
cat > $cwrappersource <<EOF
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
The $output program cannot be directly executed until all the libtool
libraries that it depends on are installed.
This wrapper executable should never be moved out of the build directory.
If it is, it will not operate correctly.
Currently, it simply execs the wrapper *script* "/bin/sh $output",
but could eventually absorb all of the scripts functionality and
exec $objdir/$outputname directly.
*/
EOF
cat >> $cwrappersource<<"EOF"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <malloc.h>
#include <stdarg.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <sys/stat.h>
#if defined(PATH_MAX)
# define LT_PATHMAX PATH_MAX
#elif defined(MAXPATHLEN)
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
#endif
#ifndef DIR_SEPARATOR
# define DIR_SEPARATOR '/'
# define PATH_SEPARATOR ':'
#endif
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
defined (__OS2__)
# define HAVE_DOS_BASED_FILE_SYSTEM
# ifndef DIR_SEPARATOR_2
# define DIR_SEPARATOR_2 '\\'
# endif
# ifndef PATH_SEPARATOR_2
# define PATH_SEPARATOR_2 ';'
# endif
#endif
#ifndef DIR_SEPARATOR_2
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */
# define IS_DIR_SEPARATOR(ch) \
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */
#ifndef PATH_SEPARATOR_2
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
#else /* PATH_SEPARATOR_2 */
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
#endif /* PATH_SEPARATOR_2 */
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
if (stale) { free ((void *) stale); stale = 0; } \
} while (0)
/* -DDEBUG is fairly common in CFLAGS. */
#undef DEBUG
#if defined DEBUGWRAPPER
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
#else
# define DEBUG(format, ...)
#endif
const char *program_name = NULL;
void * xmalloc (size_t num);
char * xstrdup (const char *string);
const char * base_name (const char *name);
char * find_executable(const char *wrapper);
int check_executable(const char *path);
char * strendzap(char *str, const char *pat);
void lt_fatal (const char *message, ...);
int
main (int argc, char *argv[])
{
char **newargz;
int i;
program_name = (char *) xstrdup (base_name (argv[0]));
DEBUG("(main) argv[0] : %s\n",argv[0]);
DEBUG("(main) program_name : %s\n",program_name);
newargz = XMALLOC(char *, argc+2);
EOF
cat >> $cwrappersource <<EOF
newargz[0] = (char *) xstrdup("$SHELL");
EOF
cat >> $cwrappersource <<"EOF"
newargz[1] = find_executable(argv[0]);
if (newargz[1] == NULL)
lt_fatal("Couldn't find %s", argv[0]);
DEBUG("(main) found exe at : %s\n",newargz[1]);
/* we know the script has the same name, without the .exe */
/* so make sure newargz[1] doesn't end in .exe */
strendzap(newargz[1],".exe");
for (i = 1; i < argc; i++)
newargz[i+1] = xstrdup(argv[i]);
newargz[argc+1] = NULL;
for (i=0; i<argc+1; i++)
{
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
;
}
EOF
case $host_os in
mingw*)
cat >> $cwrappersource <<EOF
execv("$SHELL",(char const **)newargz);
EOF
;;
*)
cat >> $cwrappersource <<EOF
execv("$SHELL",newargz);
EOF
;;
esac
cat >> $cwrappersource <<"EOF"
return 127;
}
void *
xmalloc (size_t num)
{
void * p = (void *) malloc (num);
if (!p)
lt_fatal ("Memory exhausted");
return p;
}
char *
xstrdup (const char *string)
{
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
;
}
const char *
base_name (const char *name)
{
const char *base;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over the disk name in MSDOS pathnames. */
if (isalpha ((unsigned char)name[0]) && name[1] == ':')
name += 2;
#endif
for (base = name; *name; name++)
if (IS_DIR_SEPARATOR (*name))
base = name + 1;
return base;
}
int
check_executable(const char * path)
{
struct stat st;
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
if ((!path) || (!*path))
return 0;
if ((stat (path, &st) >= 0) &&
(
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
#if defined (S_IXOTH)
((st.st_mode & S_IXOTH) == S_IXOTH) ||
#endif
#if defined (S_IXGRP)
((st.st_mode & S_IXGRP) == S_IXGRP) ||
#endif
((st.st_mode & S_IXUSR) == S_IXUSR))
)
return 1;
else
return 0;
}
/* Searches for the full path of the wrapper. Returns
newly allocated full path name if found, NULL otherwise */
char *
find_executable (const char* wrapper)
{
int has_slash = 0;
const char* p;
const char* p_next;
/* static buffer for getcwd */
char tmp[LT_PATHMAX + 1];
int tmp_len;
char* concat_name;
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
if ((wrapper == NULL) || (*wrapper == '\0'))
return NULL;
/* Absolute path? */
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
{
concat_name = xstrdup (wrapper);
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
}
else
{
#endif
if (IS_DIR_SEPARATOR (wrapper[0]))
{
concat_name = xstrdup (wrapper);
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
}
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
}
#endif
for (p = wrapper; *p; p++)
if (*p == '/')
{
has_slash = 1;
break;
}
if (!has_slash)
{
/* no slashes; search PATH */
const char* path = getenv ("PATH");
if (path != NULL)
{
for (p = path; *p; p = p_next)
{
const char* q;
size_t p_len;
for (q = p; *q; q++)
if (IS_PATH_SEPARATOR(*q))
break;
p_len = q - p;
p_next = (*q == '\0' ? q : q + 1);
if (p_len == 0)
{
/* empty path: current directory */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal ("getcwd failed");
tmp_len = strlen(tmp);
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
concat_name[tmp_len] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
}
else
{
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, p, p_len);
concat_name[p_len] = '/';
strcpy (concat_name + p_len + 1, wrapper);
}
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
}
}
/* not found in PATH; assume curdir */
}
/* Relative path | not found in path: prepend cwd */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal ("getcwd failed");
tmp_len = strlen(tmp);
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
concat_name[tmp_len] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
if (check_executable(concat_name))
return concat_name;
XFREE(concat_name);
return NULL;
}
char *
strendzap(char *str, const char *pat)
{
size_t len, patlen;
assert(str != NULL);
assert(pat != NULL);
len = strlen(str);
patlen = strlen(pat);
if (patlen <= len)
{
str += len - patlen;
if (strcmp(str, pat) == 0)
*str = '\0';
}
return str;
}
static void
lt_error_core (int exit_status, const char * mode,
const char * message, va_list ap)
{
fprintf (stderr, "%s: %s: ", program_name, mode);
vfprintf (stderr, message, ap);
fprintf (stderr, ".\n");
if (exit_status >= 0)
exit (exit_status);
}
void
lt_fatal (const char *message, ...)
{
va_list ap;
va_start (ap, message);
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
va_end (ap);
}
EOF
# we should really use a build-platform specific compiler
# here, but OTOH, the wrappers (shell script and this C one)
# are only useful if you want to execute the "real" binary.
# Since the "real" binary is built for $host, then this
# wrapper might as well be built for $host, too.
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
;;
esac
$rm $output
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
$echo > $output "\ $echo > $output "\
#! $SHELL #! $SHELL
...@@ -3643,12 +5299,26 @@ static const void *lt_preloaded_setup() { ...@@ -3643,12 +5299,26 @@ static const void *lt_preloaded_setup() {
# Sed substitution that helps us do robust quoting. It backslashifies # Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings. # metacharacters that are still active within double-quoted strings.
Xsed='sed -e 1s/^X//' Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst' sed_quote_subst='$sed_quote_subst'
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set. # if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command=\"$relink_command\" relink_command=\"$relink_command\"
...@@ -3681,7 +5351,7 @@ else ...@@ -3681,7 +5351,7 @@ else
test \"x\$thisdir\" = \"x\$file\" && thisdir=. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir. # Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do while test -n \"\$file\"; do
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
...@@ -3694,7 +5364,7 @@ else ...@@ -3694,7 +5364,7 @@ else
fi fi
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
done done
# Try to get the absolute directory name. # Try to get the absolute directory name.
...@@ -3703,12 +5373,12 @@ else ...@@ -3703,12 +5373,12 @@ else
" "
if test "$fast_install" = yes; then if test "$fast_install" = yes; then
echo >> $output "\ $echo >> $output "\
program=lt-'$outputname'$exeext program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\" progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\ if test ! -f \"\$progdir/\$program\" || \\
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\" file=\"\$\$-\$program\"
...@@ -3719,7 +5389,7 @@ else ...@@ -3719,7 +5389,7 @@ else
$rm \"\$progdir/\$file\" $rm \"\$progdir/\$file\"
fi" fi"
echo >> $output "\ $echo >> $output "\
# relink executable if necessary # relink executable if necessary
if test -n \"\$relink_command\"; then if test -n \"\$relink_command\"; then
...@@ -3727,7 +5397,7 @@ else ...@@ -3727,7 +5397,7 @@ else
else else
$echo \"\$relink_command_output\" >&2 $echo \"\$relink_command_output\" >&2
$rm \"\$progdir/\$file\" $rm \"\$progdir/\$file\"
exit 1 exit $EXIT_FAILURE
fi fi
fi fi
...@@ -3737,13 +5407,13 @@ else ...@@ -3737,13 +5407,13 @@ else
$rm \"\$progdir/\$file\" $rm \"\$progdir/\$file\"
fi" fi"
else else
echo >> $output "\ $echo >> $output "\
program='$outputname' program='$outputname'
progdir=\"\$thisdir/$objdir\" progdir=\"\$thisdir/$objdir\"
" "
fi fi
echo >> $output "\ $echo >> $output "\
if test -f \"\$progdir/\$program\"; then" if test -f \"\$progdir/\$program\"; then"
...@@ -3774,47 +5444,35 @@ else ...@@ -3774,47 +5444,35 @@ else
# Run the actual program with our arguments. # Run the actual program with our arguments.
" "
case $host in case $host in
# win32 systems need to use the prog path for dll
# lookup to work
*-*-cygwin* | *-*-pw32*)
$echo >> $output "\
exec \$progdir/\$program \${1+\"\$@\"}
"
;;
# Backslashes separate directories on plain windows # Backslashes separate directories on plain windows
*-*-mingw | *-*-os2*) *-*-mingw | *-*-os2*)
$echo >> $output "\ $echo >> $output "\
exec \$progdir\\\\\$program \${1+\"\$@\"} exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
" "
;; ;;
*) *)
$echo >> $output "\ $echo >> $output "\
# Export the path to the program. exec \"\$progdir/\$program\" \${1+\"\$@\"}
PATH=\"\$progdir:\$PATH\"
export PATH
exec \$program \${1+\"\$@\"}
" "
;; ;;
esac esac
$echo >> $output "\ $echo >> $output "\
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" \$echo \"\$0: cannot exec \$program \$*\"
exit 1 exit $EXIT_FAILURE
fi fi
else else
# The program doesn't exist. # The program doesn't exist.
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
\$echo \"This script is just a wrapper for \$program.\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2
echo \"See the $PACKAGE documentation for more information.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
fi\ fi\
" "
chmod +x $output chmod +x $output
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
esac esac
...@@ -3830,74 +5488,130 @@ fi\ ...@@ -3830,74 +5488,130 @@ fi\
oldobjs="$libobjs_save" oldobjs="$libobjs_save"
build_libtool_libs=no build_libtool_libs=no
else else
oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` oldobjs="$old_deplibs $non_pic_objects"
fi fi
addlibs="$old_convenience" addlibs="$old_convenience"
fi fi
if test -n "$addlibs"; then if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x" gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "mkdir $gentop"
$run mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop" generated="$generated $gentop"
# Add in members from convenience archives. func_extract_archives $gentop $addlibs
for xlib in $addlibs; do oldobjs="$oldobjs $func_extract_archives_result"
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "mkdir $xdir"
$run mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
done
fi fi
# Do each command in the archive commands. # Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\" cmds=$old_archive_from_new_cmds
else else
# Ensure that we have .o objects in place in case we decided # POSIX demands no paths to be encoded in archives. We have
# not to build a shared library, and have fallen back to building # to avoid creating archives with duplicate basenames if we
# static libs even though --disable-static was passed! # might have to extract them afterwards, e.g., when creating a
for oldobj in $oldobjs; do # static archive out of a convenience library, or when linking
if test ! -f $oldobj; then # the entirety of a libtool archive into another (currently
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` # not supported by libtool).
if test "X$xdir" = "X$oldobj"; then if (for obj in $oldobjs
xdir="." do
else $echo "X$obj" | $Xsed -e 's%^.*/%%'
xdir="$xdir" done | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "copying selected object files to avoid basename conflicts..."
if test -z "$gentop"; then
gentop="$output_objdir/${outputname}x"
generated="$generated $gentop"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "$mkdir $gentop"
$run $mkdir "$gentop"
exit_status=$?
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
exit $exit_status
fi fi
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
fi fi
done
save_oldobjs=$oldobjs
oldobjs=
counter=1
for obj in $save_oldobjs
do
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
case " $oldobjs " in
" ") oldobjs=$obj ;;
*[\ /]"$objbase "*)
while :; do
# Make sure we don't pick an alternate name that also
# overlaps.
newobj=lt$counter-$objbase
counter=`expr $counter + 1`
case " $oldobjs " in
*[\ /]"$newobj "*) ;;
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
esac
done
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
$run ln "$obj" "$gentop/$newobj" ||
$run cp "$obj" "$gentop/$newobj"
oldobjs="$oldobjs $gentop/$newobj"
;;
*) oldobjs="$oldobjs $obj" ;;
esac
done
fi
eval cmds=\"$old_archive_cmds\" eval cmds=\"$old_archive_cmds\"
if len=`expr "X$cmds" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cmds=$old_archive_cmds
else
# the command line is too long to link in one step, link in parts
$echo "using piecewise archive linking..."
save_RANLIB=$RANLIB
RANLIB=:
objlist=
concat_cmds=
save_oldobjs=$oldobjs
# Is there a better way of finding the last object in the list?
for obj in $save_oldobjs
do
last_oldobj=$obj
done
for obj in $save_oldobjs
do
oldobjs="$objlist $obj"
objlist="$objlist $obj"
eval test_cmds=\"$old_archive_cmds\"
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
test "$len" -le "$max_cmd_len"; then
:
else
# the above command should be used before it gets too long
oldobjs=$objlist
if test "$obj" = "$last_oldobj" ; then
RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
objlist=
fi
done
RANLIB=$save_RANLIB
oldobjs=$objlist
if test "X$oldobjs" = "X" ; then
eval cmds=\"\$concat_cmds\"
else
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
fi
fi
fi fi
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
eval cmd=\"$cmd\"
IFS="$save_ifs" IFS="$save_ifs"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
...@@ -3929,8 +5643,12 @@ fi\ ...@@ -3929,8 +5643,12 @@ fi\
fi fi
done done
# Quote the link command for shipping. # Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
# Only create the output if not a dry run. # Only create the output if not a dry run.
if test -z "$run"; then if test -z "$run"; then
...@@ -3946,10 +5664,10 @@ fi\ ...@@ -3946,10 +5664,10 @@ fi\
case $deplib in case $deplib in
*.la) *.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
newdependency_libs="$newdependency_libs $libdir/$name" newdependency_libs="$newdependency_libs $libdir/$name"
;; ;;
...@@ -3960,10 +5678,10 @@ fi\ ...@@ -3960,10 +5678,10 @@ fi\
newdlfiles= newdlfiles=
for lib in $dlfiles; do for lib in $dlfiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
newdlfiles="$newdlfiles $libdir/$name" newdlfiles="$newdlfiles $libdir/$name"
done done
...@@ -3971,20 +5689,39 @@ fi\ ...@@ -3971,20 +5689,39 @@ fi\
newdlprefiles= newdlprefiles=
for lib in $dlprefiles; do for lib in $dlprefiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
newdlprefiles="$newdlprefiles $libdir/$name" newdlprefiles="$newdlprefiles $libdir/$name"
done done
dlprefiles="$newdlprefiles" dlprefiles="$newdlprefiles"
else
newdlfiles=
for lib in $dlfiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlfiles="$newdlfiles $abs"
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlprefiles="$newdlprefiles $abs"
done
dlprefiles="$newdlprefiles"
fi fi
$rm $output $rm $output
# place dlname in correct position for cygwin # place dlname in correct position for cygwin
tdlname=$dlname tdlname=$dlname
case $host,$output,$installed,$module,$dlname in case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac esac
$echo > $output "\ $echo > $output "\
# $outputname - a libtool library file # $outputname - a libtool library file
...@@ -4013,6 +5750,9 @@ revision=$revision ...@@ -4013,6 +5750,9 @@ revision=$revision
# Is this an already installed library? # Is this an already installed library?
installed=$installed installed=$installed
# Should we warn about portability when linking against -modules?
shouldnotlink=$module
# Files to dlopen/dlpreopen # Files to dlopen/dlpreopen
dlopen='$dlfiles' dlopen='$dlfiles'
dlpreopen='$dlprefiles' dlpreopen='$dlprefiles'
...@@ -4032,7 +5772,7 @@ relink_command=\"$relink_command\"" ...@@ -4032,7 +5772,7 @@ relink_command=\"$relink_command\""
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
;; ;;
esac esac
exit 0 exit $EXIT_SUCCESS
;; ;;
# libtool install mode # libtool install mode
...@@ -4043,11 +5783,11 @@ relink_command=\"$relink_command\"" ...@@ -4043,11 +5783,11 @@ relink_command=\"$relink_command\""
# install_prog (especially on Windows NT). # install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
# Allow the use of GNU shtool's install command. # Allow the use of GNU shtool's install command.
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then $echo "X$nonopt" | grep shtool > /dev/null; then
# Aesthetically quote it. # Aesthetically quote it.
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
case $arg in case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\"" arg="\"$arg\""
;; ;;
esac esac
...@@ -4056,14 +5796,14 @@ relink_command=\"$relink_command\"" ...@@ -4056,14 +5796,14 @@ relink_command=\"$relink_command\""
shift shift
else else
install_prog= install_prog=
arg="$nonopt" arg=$nonopt
fi fi
# The real first argument should be the name of the installation program. # The real first argument should be the name of the installation program.
# Aesthetically quote it. # Aesthetically quote it.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\"" arg="\"$arg\""
;; ;;
esac esac
...@@ -4081,28 +5821,31 @@ relink_command=\"$relink_command\"" ...@@ -4081,28 +5821,31 @@ relink_command=\"$relink_command\""
do do
if test -n "$dest"; then if test -n "$dest"; then
files="$files $dest" files="$files $dest"
dest="$arg" dest=$arg
continue continue
fi fi
case $arg in case $arg in
-d) isdir=yes ;; -d) isdir=yes ;;
-f) prev="-f" ;; -f)
-g) prev="-g" ;; case " $install_prog " in
-m) prev="-m" ;; *[\\\ /]cp\ *) ;;
-o) prev="-o" ;; *) prev=$arg ;;
esac
;;
-g | -m | -o) prev=$arg ;;
-s) -s)
stripme=" -s" stripme=" -s"
continue continue
;; ;;
-*) ;; -*)
;;
*) *)
# If the previous option needed an argument, then skip it. # If the previous option needed an argument, then skip it.
if test -n "$prev"; then if test -n "$prev"; then
prev= prev=
else else
dest="$arg" dest=$arg
continue continue
fi fi
;; ;;
...@@ -4111,7 +5854,7 @@ relink_command=\"$relink_command\"" ...@@ -4111,7 +5854,7 @@ relink_command=\"$relink_command\""
# Aesthetically quote the argument. # Aesthetically quote the argument.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\"" arg="\"$arg\""
;; ;;
esac esac
...@@ -4121,13 +5864,13 @@ relink_command=\"$relink_command\"" ...@@ -4121,13 +5864,13 @@ relink_command=\"$relink_command\""
if test -z "$install_prog"; then if test -z "$install_prog"; then
$echo "$modename: you must specify an install program" 1>&2 $echo "$modename: you must specify an install program" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -n "$prev"; then if test -n "$prev"; then
$echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$modename: the \`$prev' option requires an argument" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -z "$files"; then if test -z "$files"; then
...@@ -4137,7 +5880,7 @@ relink_command=\"$relink_command\"" ...@@ -4137,7 +5880,7 @@ relink_command=\"$relink_command\""
$echo "$modename: you must specify a destination" 1>&2 $echo "$modename: you must specify a destination" 1>&2
fi fi
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Strip any trailing slash from the destination. # Strip any trailing slash from the destination.
...@@ -4158,7 +5901,7 @@ relink_command=\"$relink_command\"" ...@@ -4158,7 +5901,7 @@ relink_command=\"$relink_command\""
if test "$#" -gt 2; then if test "$#" -gt 2; then
$echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$modename: \`$dest' is not a directory" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
fi fi
case $destdir in case $destdir in
...@@ -4170,7 +5913,7 @@ relink_command=\"$relink_command\"" ...@@ -4170,7 +5913,7 @@ relink_command=\"$relink_command\""
*) *)
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
done done
...@@ -4195,11 +5938,11 @@ relink_command=\"$relink_command\"" ...@@ -4195,11 +5938,11 @@ relink_command=\"$relink_command\""
*.la) *.la)
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
library_names= library_names=
...@@ -4231,21 +5974,24 @@ relink_command=\"$relink_command\"" ...@@ -4231,21 +5974,24 @@ relink_command=\"$relink_command\""
if test -n "$relink_command"; then if test -n "$relink_command"; then
# Determine the prefix the user has applied to our future dir. # Determine the prefix the user has applied to our future dir.
inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
# Don't allow the user to place us outside of our expected # Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that # location b/c this prevents finding dependent libraries that
# are installed to the same prefix. # are installed to the same prefix.
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
if test "$inst_prefix_dir" = "$destdir"; then if test "$inst_prefix_dir" = "$destdir"; then
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
if test -n "$inst_prefix_dir"; then if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command. # Stick the inst_prefix_dir data into the link command.
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
else else
relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
fi fi
$echo "$modename: warning: relinking \`$file'" 1>&2 $echo "$modename: warning: relinking \`$file'" 1>&2
...@@ -4253,7 +5999,7 @@ relink_command=\"$relink_command\"" ...@@ -4253,7 +5999,7 @@ relink_command=\"$relink_command\""
if $run eval "$relink_command"; then : if $run eval "$relink_command"; then :
else else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
continue exit $EXIT_FAILURE
fi fi
fi fi
...@@ -4277,23 +6023,36 @@ relink_command=\"$relink_command\"" ...@@ -4277,23 +6023,36 @@ relink_command=\"$relink_command\""
if test "$#" -gt 0; then if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones. # Delete the old symlinks, and create new ones.
# Try `ln -sf' first, because the `ln' binary might depend on
# the symlink we replace! Solaris /bin/ln does not understand -f,
# so we also need to try rm && ln -s.
for linkname for linkname
do do
if test "$linkname" != "$realname"; then if test "$linkname" != "$realname"; then
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
fi fi
done done
fi fi
# Do each command in the postinstall commands. # Do each command in the postinstall commands.
lib="$destdir/$realname" lib="$destdir/$realname"
eval cmds=\"$postinstall_cmds\" cmds=$postinstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
fi
exit $lt_exit
}
done done
IFS="$save_ifs" IFS="$save_ifs"
fi fi
...@@ -4331,7 +6090,7 @@ relink_command=\"$relink_command\"" ...@@ -4331,7 +6090,7 @@ relink_command=\"$relink_command\""
*) *)
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
...@@ -4349,7 +6108,7 @@ relink_command=\"$relink_command\"" ...@@ -4349,7 +6108,7 @@ relink_command=\"$relink_command\""
$show "$install_prog $staticobj $staticdest" $show "$install_prog $staticobj $staticdest"
$run eval "$install_prog \$staticobj \$staticdest" || exit $? $run eval "$install_prog \$staticobj \$staticdest" || exit $?
fi fi
exit 0 exit $EXIT_SUCCESS
;; ;;
*) *)
...@@ -4361,21 +6120,47 @@ relink_command=\"$relink_command\"" ...@@ -4361,21 +6120,47 @@ relink_command=\"$relink_command\""
destfile="$destdir/$destfile" destfile="$destdir/$destfile"
fi fi
# If the file is missing, and there is a .exe on the end, strip it
# because it is most likely a libtool script we actually want to
# install
stripped_ext=""
case $file in
*.exe)
if test ! -f "$file"; then
file=`$echo $file|${SED} 's,.exe$,,'`
stripped_ext=".exe"
fi
;;
esac
# Do a test to see if this is really a libtool program. # Do a test to see if this is really a libtool program.
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then case $host in
*cygwin*|*mingw*)
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
;;
*)
wrapper=$file
;;
esac
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
notinst_deplibs= notinst_deplibs=
relink_command= relink_command=
# Note that it is not necessary on cygwin/mingw to append a dot to
# foo even if both foo and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)! Also, sourcing
# `FILE.' does not work on cygwin managed mounts.
#
# If there is no directory component, then add one. # If there is no directory component, then add one.
case $file in case $wrapper in
*/* | *\\*) . $file ;; */* | *\\*) . ${wrapper} ;;
*) . ./$file ;; *) . ./${wrapper} ;;
esac esac
# Check the variables that should have been set. # Check the variables that should have been set.
if test -z "$notinst_deplibs"; then if test -z "$notinst_deplibs"; then
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
finalize=yes finalize=yes
...@@ -4397,31 +6182,25 @@ relink_command=\"$relink_command\"" ...@@ -4397,31 +6182,25 @@ relink_command=\"$relink_command\""
done done
relink_command= relink_command=
# Note that it is not necessary on cygwin/mingw to append a dot to
# foo even if both foo and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)! Also, sourcing
# `FILE.' does not work on cygwin managed mounts.
#
# If there is no directory component, then add one. # If there is no directory component, then add one.
case $file in case $wrapper in
*/* | *\\*) . $file ;; */* | *\\*) . ${wrapper} ;;
*) . ./$file ;; *) . ./${wrapper} ;;
esac esac
outputname= outputname=
if test "$fast_install" = no && test -n "$relink_command"; then if test "$fast_install" = no && test -n "$relink_command"; then
if test "$finalize" = yes && test -z "$run"; then if test "$finalize" = yes && test -z "$run"; then
tmpdir="/tmp" tmpdir=`func_mktempdir`
test -n "$TMPDIR" && tmpdir="$TMPDIR" file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
if test $? = 0 ; then :
else
tmpdir="$tmpdir/libtool-$$"
fi
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
else
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
continue
fi
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file" outputname="$tmpdir/$file"
# Replace the output file specification. # Replace the output file specification.
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
$show "$relink_command" $show "$relink_command"
if $run eval "$relink_command"; then : if $run eval "$relink_command"; then :
...@@ -4436,14 +6215,14 @@ relink_command=\"$relink_command\"" ...@@ -4436,14 +6215,14 @@ relink_command=\"$relink_command\""
fi fi
else else
# Install the binary that we compiled earlier. # Install the binary that we compiled earlier.
file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
fi fi
fi fi
# remove .exe since cygwin /usr/bin/install will append another # remove .exe since cygwin /usr/bin/install will append another
# one anyways # one anyway
case $install_prog,$host in case $install_prog,$host in
/usr/bin/install*,*cygwin*) */usr/bin/install*,*cygwin*)
case $file:$destfile in case $file:$destfile in
*.exe:*.exe) *.exe:*.exe)
# this is ok # this is ok
...@@ -4452,7 +6231,7 @@ relink_command=\"$relink_command\"" ...@@ -4452,7 +6231,7 @@ relink_command=\"$relink_command\""
destfile=$destfile.exe destfile=$destfile.exe
;; ;;
*:*.exe) *:*.exe)
destfile=`echo $destfile | sed -e 's,.exe$,,'` destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
;; ;;
esac esac
;; ;;
...@@ -4473,16 +6252,17 @@ relink_command=\"$relink_command\"" ...@@ -4473,16 +6252,17 @@ relink_command=\"$relink_command\""
$show "$install_prog $file $oldlib" $show "$install_prog $file $oldlib"
$run eval "$install_prog \$file \$oldlib" || exit $? $run eval "$install_prog \$file \$oldlib" || exit $?
if test -n "$stripme" && test -n "$striplib"; then if test -n "$stripme" && test -n "$old_striplib"; then
$show "$old_striplib $oldlib" $show "$old_striplib $oldlib"
$run eval "$old_striplib $oldlib" || exit $? $run eval "$old_striplib $oldlib" || exit $?
fi fi
# Do each command in the postinstall commands. # Do each command in the postinstall commands.
eval cmds=\"$old_postinstall_cmds\" cmds=$old_postinstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
...@@ -4496,9 +6276,9 @@ relink_command=\"$relink_command\"" ...@@ -4496,9 +6276,9 @@ relink_command=\"$relink_command\""
if test -n "$current_libdirs"; then if test -n "$current_libdirs"; then
# Maybe just do a dry run. # Maybe just do a dry run.
test -n "$run" && current_libdirs=" -n$current_libdirs" test -n "$run" && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL $0 --finish$current_libdirs' exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
else else
exit 0 exit $EXIT_SUCCESS
fi fi
;; ;;
...@@ -4517,10 +6297,11 @@ relink_command=\"$relink_command\"" ...@@ -4517,10 +6297,11 @@ relink_command=\"$relink_command\""
for libdir in $libdirs; do for libdir in $libdirs; do
if test -n "$finish_cmds"; then if test -n "$finish_cmds"; then
# Do each command in the finish commands. # Do each command in the finish commands.
eval cmds=\"$finish_cmds\" cmds=$finish_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || admincmds="$admincmds $run eval "$cmd" || admincmds="$admincmds
$cmd" $cmd"
...@@ -4537,43 +6318,43 @@ relink_command=\"$relink_command\"" ...@@ -4537,43 +6318,43 @@ relink_command=\"$relink_command\""
fi fi
# Exit here if they wanted silent mode. # Exit here if they wanted silent mode.
test "$show" = : && exit 0 test "$show" = : && exit $EXIT_SUCCESS
echo "----------------------------------------------------------------------" $echo "X----------------------------------------------------------------------" | $Xsed
echo "Libraries have been installed in:" $echo "Libraries have been installed in:"
for libdir in $libdirs; do for libdir in $libdirs; do
echo " $libdir" $echo " $libdir"
done done
echo $echo
echo "If you ever happen to want to link against installed libraries" $echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "in a given directory, LIBDIR, you must either use libtool, and"
echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
echo "flag during linking and do at least one of the following:" $echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then if test -n "$shlibpath_var"; then
echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
echo " during execution" $echo " during execution"
fi fi
if test -n "$runpath_var"; then if test -n "$runpath_var"; then
echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " - add LIBDIR to the \`$runpath_var' environment variable"
echo " during linking" $echo " during linking"
fi fi
if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\" eval flag=\"$hardcode_libdir_flag_spec\"
echo " - use the \`$flag' linker flag" $echo " - use the \`$flag' linker flag"
fi fi
if test -n "$admincmds"; then if test -n "$admincmds"; then
echo " - have your system administrator run these commands:$admincmds" $echo " - have your system administrator run these commands:$admincmds"
fi fi
if test -f /etc/ld.so.conf; then if test -f /etc/ld.so.conf; then
echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
fi fi
echo $echo
echo "See any operating system documentation about shared libraries for" $echo "See any operating system documentation about shared libraries for"
echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "more information, such as the ld(1) and ld.so(8) manual pages."
echo "----------------------------------------------------------------------" $echo "X----------------------------------------------------------------------" | $Xsed
exit 0 exit $EXIT_SUCCESS
;; ;;
# libtool execute mode # libtool execute mode
...@@ -4585,7 +6366,7 @@ relink_command=\"$relink_command\"" ...@@ -4585,7 +6366,7 @@ relink_command=\"$relink_command\""
if test -z "$cmd"; then if test -z "$cmd"; then
$echo "$modename: you must specify a COMMAND" 1>&2 $echo "$modename: you must specify a COMMAND" 1>&2
$echo "$help" $echo "$help"
exit 1 exit $EXIT_FAILURE
fi fi
# Handle -dlopen flags immediately. # Handle -dlopen flags immediately.
...@@ -4593,18 +6374,18 @@ relink_command=\"$relink_command\"" ...@@ -4593,18 +6374,18 @@ relink_command=\"$relink_command\""
if test ! -f "$file"; then if test ! -f "$file"; then
$echo "$modename: \`$file' is not a file" 1>&2 $echo "$modename: \`$file' is not a file" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
dir= dir=
case $file in case $file in
*.la) *.la)
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
# Read the libtool library. # Read the libtool library.
...@@ -4630,8 +6411,10 @@ relink_command=\"$relink_command\"" ...@@ -4630,8 +6411,10 @@ relink_command=\"$relink_command\""
if test -f "$dir/$objdir/$dlname"; then if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir" dir="$dir/$objdir"
else else
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 if test ! -f "$dir/$dlname"; then
exit 1 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
exit $EXIT_FAILURE
fi
fi fi
;; ;;
...@@ -4671,7 +6454,7 @@ relink_command=\"$relink_command\"" ...@@ -4671,7 +6454,7 @@ relink_command=\"$relink_command\""
-*) ;; -*) ;;
*) *)
# Do a test to see if this is really a libtool program. # Do a test to see if this is really a libtool program.
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# If there is no directory component, then add one. # If there is no directory component, then add one.
case $file in case $file in
*/* | *\\*) . $file ;; */* | *\\*) . $file ;;
...@@ -4694,13 +6477,13 @@ relink_command=\"$relink_command\"" ...@@ -4694,13 +6477,13 @@ relink_command=\"$relink_command\""
eval "export $shlibpath_var" eval "export $shlibpath_var"
fi fi
# Restore saved enviroment variables # Restore saved environment variables
if test "${save_LC_ALL+set}" = set; then for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
LC_ALL="$save_LC_ALL"; export LC_ALL do
fi eval "if test \"\${save_$lt_var+set}\" = set; then
if test "${save_LANG+set}" = set; then $lt_var=\$save_$lt_var; export $lt_var
LANG="$save_LANG"; export LANG fi"
fi done
# Now prepare to actually exec the command. # Now prepare to actually exec the command.
exec_cmd="\$cmd$args" exec_cmd="\$cmd$args"
...@@ -4711,7 +6494,7 @@ relink_command=\"$relink_command\"" ...@@ -4711,7 +6494,7 @@ relink_command=\"$relink_command\""
$echo "export $shlibpath_var" $echo "export $shlibpath_var"
fi fi
$echo "$cmd$args" $echo "$cmd$args"
exit 0 exit $EXIT_SUCCESS
fi fi
;; ;;
...@@ -4739,18 +6522,19 @@ relink_command=\"$relink_command\"" ...@@ -4739,18 +6522,19 @@ relink_command=\"$relink_command\""
if test -z "$rm"; then if test -z "$rm"; then
$echo "$modename: you must specify an RM program" 1>&2 $echo "$modename: you must specify an RM program" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
rmdirs= rmdirs=
origobjdir="$objdir"
for file in $files; do for file in $files; do
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$file"; then if test "X$dir" = "X$file"; then
dir=. dir=.
objdir="$objdir" objdir="$origobjdir"
else else
objdir="$dir/$objdir" objdir="$dir/$origobjdir"
fi fi
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
test "$mode" = uninstall && objdir="$dir" test "$mode" = uninstall && objdir="$dir"
...@@ -4780,7 +6564,7 @@ relink_command=\"$relink_command\"" ...@@ -4780,7 +6564,7 @@ relink_command=\"$relink_command\""
case $name in case $name in
*.la) *.la)
# Possibly a libtool archive, so verify it. # Possibly a libtool archive, so verify it.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
. $dir/$name . $dir/$name
# Delete the libtool libraries and symlinks. # Delete the libtool libraries and symlinks.
...@@ -4788,15 +6572,24 @@ relink_command=\"$relink_command\"" ...@@ -4788,15 +6572,24 @@ relink_command=\"$relink_command\""
rmfiles="$rmfiles $objdir/$n" rmfiles="$rmfiles $objdir/$n"
done done
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
if test "$mode" = uninstall; then case "$mode" in
clean)
case " $library_names " in
# " " in the beginning catches empty $dlname
*" $dlname "*) ;;
*) rmfiles="$rmfiles $objdir/$dlname" ;;
esac
test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
;;
uninstall)
if test -n "$library_names"; then if test -n "$library_names"; then
# Do each command in the postuninstall commands. # Do each command in the postuninstall commands.
eval cmds=\"$postuninstall_cmds\" cmds=$postuninstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" $run eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then if test "$?" -ne 0 && test "$rmforce" != yes; then
...@@ -4808,10 +6601,11 @@ relink_command=\"$relink_command\"" ...@@ -4808,10 +6601,11 @@ relink_command=\"$relink_command\""
if test -n "$old_library"; then if test -n "$old_library"; then
# Do each command in the old_postuninstall commands. # Do each command in the old_postuninstall commands.
eval cmds=\"$old_postuninstall_cmds\" cmds=$old_postuninstall_cmds
save_ifs="$IFS"; IFS='~' save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" $run eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then if test "$?" -ne 0 && test "$rmforce" != yes; then
...@@ -4821,27 +6615,58 @@ relink_command=\"$relink_command\"" ...@@ -4821,27 +6615,58 @@ relink_command=\"$relink_command\""
IFS="$save_ifs" IFS="$save_ifs"
fi fi
# FIXME: should reinstall the best remaining shared library. # FIXME: should reinstall the best remaining shared library.
fi ;;
esac
fi fi
;; ;;
*.lo) *.lo)
if test "$build_old_libs" = yes; then # Possibly a libtool object, so verify it.
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
rmfiles="$rmfiles $dir/$oldobj"
# Read the .lo file
. $dir/$name
# Add PIC object to the list of files to remove.
if test -n "$pic_object" \
&& test "$pic_object" != none; then
rmfiles="$rmfiles $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
if test -n "$non_pic_object" \
&& test "$non_pic_object" != none; then
rmfiles="$rmfiles $dir/$non_pic_object"
fi
fi fi
;; ;;
*) *)
# Do a test to see if this is a libtool program. if test "$mode" = clean ; then
if test "$mode" = clean && noexename=$name
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then case $file in
relink_command= *.exe)
. $dir/$file file=`$echo $file|${SED} 's,.exe$,,'`
noexename=`$echo $name|${SED} 's,.exe$,,'`
# $file with .exe has already been added to rmfiles,
# add $file without .exe
rmfiles="$rmfiles $file"
;;
esac
# Do a test to see if this is a libtool program.
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
relink_command=
. $dir/$noexename
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" # note $name still contains .exe if it was in $file originally
if test "$fast_install" = yes && test -n "$relink_command"; then # as does the version of $file that was added into $rmfiles
rmfiles="$rmfiles $objdir/lt-$name" rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
rmfiles="$rmfiles $objdir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
fi
fi fi
fi fi
;; ;;
...@@ -4849,6 +6674,7 @@ relink_command=\"$relink_command\"" ...@@ -4849,6 +6674,7 @@ relink_command=\"$relink_command\""
$show "$rm $rmfiles" $show "$rm $rmfiles"
$run $rm $rmfiles || exit_status=1 $run $rm $rmfiles || exit_status=1
done done
objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files # Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do for dir in $rmdirs; do
...@@ -4864,20 +6690,20 @@ relink_command=\"$relink_command\"" ...@@ -4864,20 +6690,20 @@ relink_command=\"$relink_command\""
"") "")
$echo "$modename: you must specify a MODE" 1>&2 $echo "$modename: you must specify a MODE" 1>&2
$echo "$generic_help" 1>&2 $echo "$generic_help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
if test -z "$exec_cmd"; then if test -z "$exec_cmd"; then
$echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$generic_help" 1>&2 $echo "$generic_help" 1>&2
exit 1 exit $EXIT_FAILURE
fi fi
fi # test -z "$show_help" fi # test -z "$show_help"
if test -n "$exec_cmd"; then if test -n "$exec_cmd"; then
eval exec $exec_cmd eval exec $exec_cmd
exit 1 exit $EXIT_FAILURE
fi fi
# We need to display help for each of the modes. # We need to display help for each of the modes.
...@@ -4896,6 +6722,7 @@ Provide generalized library-building support services. ...@@ -4896,6 +6722,7 @@ Provide generalized library-building support services.
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
--quiet same as \`--silent' --quiet same as \`--silent'
--silent don't print informational messages --silent don't print informational messages
--tag=TAG use configuration variables from tag TAG
--version print version information --version print version information
MODE must be one of the following: MODE must be one of the following:
...@@ -4909,8 +6736,10 @@ MODE must be one of the following: ...@@ -4909,8 +6736,10 @@ MODE must be one of the following:
uninstall remove libraries from an installed directory uninstall remove libraries from an installed directory
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
a more detailed description of MODE." a more detailed description of MODE.
exit 0
Report bugs to <bug-libtool@gnu.org>."
exit $EXIT_SUCCESS
;; ;;
clean) clean)
...@@ -5011,9 +6840,9 @@ The following components of LINK-COMMAND are treated specially: ...@@ -5011,9 +6840,9 @@ The following components of LINK-COMMAND are treated specially:
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE -export-symbols SYMFILE
try to export only the symbols listed in SYMFILE try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX -export-symbols-regex REGEX
try to export only the symbols matching REGEX try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries -LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME -lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened -module build a library that can dlopened
...@@ -5021,12 +6850,17 @@ The following components of LINK-COMMAND are treated specially: ...@@ -5021,12 +6850,17 @@ The following components of LINK-COMMAND are treated specially:
-no-install link a not-installable executable -no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols -no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-objectlist FILE Use a list of object files found in FILE to specify objects
-precious-files-regex REGEX
don't remove output files matching REGEX
-release RELEASE specify package release information -release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR -rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-static do not do any dynamic linking of libtool libraries -static do not do any dynamic linking of uninstalled libtool libraries
-static-libtool-libs
do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]] -version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0] specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored. All other options (arguments beginning with \`-') are ignored.
...@@ -5062,14 +6896,33 @@ Otherwise, only FILE itself is deleted using RM." ...@@ -5062,14 +6896,33 @@ Otherwise, only FILE itself is deleted using RM."
*) *)
$echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$help" 1>&2 $echo "$help" 1>&2
exit 1 exit $EXIT_FAILURE
;; ;;
esac esac
echo $echo
$echo "Try \`$modename --help' for more information about other modes." $echo "Try \`$modename --help' for more information about other modes."
exit 0 exit $?
# The TAGs below are defined such that we never get into a situation
# in which we disable both kinds of libraries. Given conflicting
# choices, we go for a static library, that is the most portable,
# since we can't tell whether shared libraries were disabled because
# the user asked for that or because the platform doesn't support
# them. This is particularly important on AIX, because we don't
# support having both static and shared libraries enabled at the same
# time on that platform, so we default to a shared-only configuration.
# If a disable-shared tag is given, we'll fallback to a static-only
# configuration. But we'll never go from static-only to shared-only.
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
disable_libs=shared
# ### END LIBTOOL TAG CONFIG: disable-shared
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
disable_libs=static
# ### END LIBTOOL TAG CONFIG: disable-static
# Local Variables: # Local Variables:
# mode:shell-script # mode:shell-script
......
#! /bin/sh #! /bin/sh
# Common stub for a few missing GNU programs while installing. # Common stub for a few missing GNU programs while installing.
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -15,8 +19,8 @@ ...@@ -15,8 +19,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02111-1307, USA. # 02110-1301, USA.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -29,6 +33,8 @@ if test $# -eq 0; then ...@@ -29,6 +33,8 @@ if test $# -eq 0; then
fi fi
run=: run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the # In the cases where this matters, `missing' is being run in the
# srcdir already. # srcdir already.
...@@ -38,18 +44,24 @@ else ...@@ -38,18 +44,24 @@ else
configure_ac=configure.in configure_ac=configure.in
fi fi
case "$1" in msg="missing on your system"
case $1 in
--run) --run)
# Try to run requested program, and just exit if it succeeds. # Try to run requested program, and just exit if it succeeds.
run= run=
shift shift
"$@" && exit 0 "$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;; ;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help) -h|--h|--he|--hel|--help)
echo "\ echo "\
...@@ -67,6 +79,7 @@ Supported PROGRAM values: ...@@ -67,6 +79,7 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4' aclocal touch file \`aclocal.m4'
autoconf touch file \`configure' autoconf touch file \`configure'
autoheader touch file \`config.h.in' autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch] bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c flex create \`lex.yy.c', if possible, from existing .c
...@@ -74,11 +87,15 @@ Supported PROGRAM values: ...@@ -74,11 +87,15 @@ Supported PROGRAM values:
lex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]" yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;; ;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version) -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.4 - GNU automake" echo "missing $scriptversion (GNU Automake)"
exit $?
;; ;;
-*) -*)
...@@ -87,14 +104,44 @@ Supported PROGRAM values: ...@@ -87,14 +104,44 @@ Supported PROGRAM values:
exit 1 exit 1
;; ;;
aclocal*) esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed. # We have it, but it failed.
exit 1 exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $1 in
aclocal*)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site." any GNU archive site."
...@@ -102,13 +149,8 @@ WARNING: \`$1' is missing on your system. You should only need it if ...@@ -102,13 +149,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;; ;;
autoconf) autoconf)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site." archive site."
...@@ -116,13 +158,8 @@ WARNING: \`$1' is missing on your system. You should only need it if ...@@ -116,13 +158,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;; ;;
autoheader) autoheader)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site." from any GNU archive site."
...@@ -130,7 +167,7 @@ WARNING: \`$1' is missing on your system. You should only need it if ...@@ -130,7 +167,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
test -z "$files" && files="config.h" test -z "$files" && files="config.h"
touch_files= touch_files=
for f in $files; do for f in $files; do
case "$f" in case $f in
*:*) touch_files="$touch_files "`echo "$f" | *:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;; sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";; *) touch_files="$touch_files $f.in";;
...@@ -140,13 +177,8 @@ WARNING: \`$1' is missing on your system. You should only need it if ...@@ -140,13 +177,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;; ;;
automake*) automake*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages. You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site." Grab them from any GNU archive site."
...@@ -156,20 +188,15 @@ WARNING: \`$1' is missing on your system. You should only need it if ...@@ -156,20 +188,15 @@ WARNING: \`$1' is missing on your system. You should only need it if
;; ;;
autom4te) autom4te)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your WARNING: \`$1' is needed, but is $msg.
system. You might have modified some files without having the You might have modified some files without having the
proper tools for further handling them. proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU You can get \`$1' as part of \`Autoconf' from any GNU
archive site." archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then if test -f "$file"; then
touch $file touch $file
else else
...@@ -185,74 +212,67 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your ...@@ -185,74 +212,67 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
bison|yacc) bison|yacc)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site." \`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then if test $# -ne 1; then
eval LASTARG="\${$#}" eval LASTARG="\${$#}"
case "$LASTARG" in case $LASTARG in
*.y) *.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c cp "$SRCFILE" y.tab.c
fi fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h cp "$SRCFILE" y.tab.h
fi fi
;; ;;
esac esac
fi fi
if [ ! -f y.tab.h ]; then if test ! -f y.tab.h; then
echo >y.tab.h echo >y.tab.h
fi fi
if [ ! -f y.tab.c ]; then if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c echo 'main() { return 0; }' >y.tab.c
fi fi
;; ;;
lex|flex) lex|flex)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site." \`Flex' from any GNU archive site."
rm -f lex.yy.c rm -f lex.yy.c
if [ $# -ne 1 ]; then if test $# -ne 1; then
eval LASTARG="\${$#}" eval LASTARG="\${$#}"
case "$LASTARG" in case $LASTARG in
*.l) *.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c cp "$SRCFILE" lex.yy.c
fi fi
;; ;;
esac esac
fi fi
if [ ! -f lex.yy.c ]; then if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c echo 'main() { return 0; }' >lex.yy.c
fi fi
;; ;;
help2man) help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take \`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site." effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` file=`echo "$*" | sed -n "$sed_output"`
if test -z "$file"; then test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` if test -f "$file"; then
fi
if [ -f "$file" ]; then
touch $file touch $file
else else
test -z "$file" || exec >$file test -z "$file" || exec >$file
...@@ -262,54 +282,58 @@ WARNING: \`$1' is missing on your system. You should only need it if ...@@ -262,54 +282,58 @@ WARNING: \`$1' is missing on your system. You should only need it if
;; ;;
makeinfo) makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX, call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site." the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` # The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` # ... or it is the one specified with @setfilename ...
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file touch $file
;; ;;
tar) tar)
shift shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part. # We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error # Look for gnutar/gtar before invocation to avoid ugly error
# messages. # messages.
if (gnutar --version > /dev/null 2>&1); then if (gnutar --version > /dev/null 2>&1); then
gnutar ${1+"$@"} && exit 0 gnutar "$@" && exit 0
fi fi
if (gtar --version > /dev/null 2>&1); then if (gtar --version > /dev/null 2>&1); then
gtar ${1+"$@"} && exit 0 gtar "$@" && exit 0
fi fi
firstarg="$1" firstarg="$1"
if shift; then if shift; then
case "$firstarg" in case $firstarg in
*o*) *o*)
firstarg=`echo "$firstarg" | sed s/o//` firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" ${1+"$@"} && exit 0 tar "$firstarg" "$@" && exit 0
;; ;;
esac esac
case "$firstarg" in case $firstarg in
*h*) *h*)
firstarg=`echo "$firstarg" | sed s/h//` firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" ${1+"$@"} && exit 0 tar "$firstarg" "$@" && exit 0
;; ;;
esac esac
fi fi
...@@ -323,10 +347,10 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments. ...@@ -323,10 +347,10 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
*) *)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your WARNING: \`$1' is needed, and is $msg.
system. You might have modified some files without having the You might have modified some files without having the
proper tools for further handling them. Check the \`README' file, proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program." some other package would contain this missing \`$1' program."
exit 1 exit 1
...@@ -334,3 +358,10 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your ...@@ -334,3 +358,10 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
esac esac
exit 0 exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
/* config.h.in. Generated from configure.ac by autoheader. */ /* config.h.in. Generated from configure.ac by autoheader. */
/* BLAS header filename. */
#undef ATLAS_BLAS_H
/* CLAPACK header filename. */
#undef ATLAS_LAPACK_H
/* Archive creation date */ /* Archive creation date */
#undef DATE #undef DATE
/* FFTW header filename. */
#undef FFTW_H
/* Define to 1 if you have the `atexit' function. */ /* Define to 1 if you have the `atexit' function. */
#undef HAVE_ATEXIT #undef HAVE_ATEXIT
/* Define if you have the ATLAS libraries and header files. */
#undef HAVE_ATLAS
/* Define to 1 if you have the <atlas/cblas.h> header file. */
#undef HAVE_ATLAS_CBLAS_H
/* Define to 1 if you have the <atlas/clapack.h> header file. */
#undef HAVE_ATLAS_CLAPACK_H
/* Define if you have the parallel ATLAS libraries. */
#undef HAVE_ATLAS_MP
/* Define to 1 if you have the <cblas.h> header file. */
#undef HAVE_CBLAS_H
/* Define to 1 if you have the <clapack.h> header file. */
#undef HAVE_CLAPACK_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <fcntl.h> header file. */ /* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H
/* Define if you have the FFTW double precision libraries and header files. */
#undef HAVE_FFTW
/* Define if you have the FFTW single precision libraries and header files. */
#undef HAVE_FFTWF
/* Define if you have the FFTW single precision multithreaded libraries and
header files. */
#undef HAVE_FFTWFT
/* Define if you have the FFTW double precision multithreaded libraries and
header files. */
#undef HAVE_FFTWT
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO #undef HAVE_FSEEKO
...@@ -21,15 +65,23 @@ ...@@ -21,15 +65,23 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
/* Define to 1 if you have the `cblas' library (-lcblas). */
#undef HAVE_LIBCBLAS
/* Define to 1 if you have the `lapack' library (-llapack). */
#undef HAVE_LIBLAPACK
/* Define to 1 if you have the `m' library (-lm). */ /* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM #undef HAVE_LIBM
/* Define to 1 if you have the `ptcblas' library (-lptcblas). */
#undef HAVE_LIBPTCBLAS
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H #undef HAVE_LIMITS_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and /* Define to 1 if you have the `logf' function. */
to 0 otherwise. */ #undef HAVE_LOGF
#undef HAVE_MALLOC
/* Define to 1 if you have the <malloc.h> header file. */ /* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H #undef HAVE_MALLOC_H
...@@ -55,6 +107,12 @@ ...@@ -55,6 +107,12 @@
/* Define to 1 if you have the `munmap' function. */ /* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP #undef HAVE_MUNMAP
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
/* Define to 1 if you have the `sincos' function. */
#undef HAVE_SINCOS
/* Define to 1 if `stat' has the bug that it succeeds when given the /* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */ zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG #undef HAVE_STAT_EMPTY_STRING_BUG
...@@ -111,6 +169,10 @@ ...@@ -111,6 +169,10 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
/* Define to the necessary symbol if this constant uses a non-standard name on
your system. */
#undef PTHREAD_CREATE_JOINABLE
/* Define as the return type of signal handlers (`int' or `void'). */ /* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE #undef RETSIGTYPE
...@@ -123,9 +185,15 @@ ...@@ -123,9 +185,15 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ /* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME #undef TM_IN_SYS_TIME
/* Triggers multhreading */
#undef USE_THREADS
/* Version number of package */ /* Version number of package */
#undef VERSION #undef VERSION
/* Default URL of the XSLT filter */
#undef XSL_URL
/* Number of bits in a file offset, on hosts where this is settable. */ /* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS #undef _FILE_OFFSET_BITS
...@@ -141,13 +209,10 @@ ...@@ -141,13 +209,10 @@
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t #undef gid_t
/* Define to rpl_malloc if the replacement function should be used. */ /* Define to `long int' if <sys/types.h> does not define. */
#undef malloc
/* Define to `long' if <sys/types.h> does not define. */
#undef off_t #undef off_t
/* Define to `unsigned' if <sys/types.h> does not define. */ /* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t #undef size_t
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment