From 4e60ef3003fad8a7ff3bd9f3f8bda0966efa20f9 Mon Sep 17 00:00:00 2001 From: "Eric J. Korpela" Date: Tue, 13 Jan 2009 23:06:02 +0000 Subject: [PATCH] - STILL WORK TO BE DONE TO GET locale STUFF INSTALLED PROPERLY!!! - Update to libtool 1.5.24 - build environment: Major automake changes that I've been warning about for some time. - Now uses libtool to build libraries. - Builds separate boinc_fcgi and sched_fcgi libraries for use with FCGI server components. - New macro "BOINC_CHECK_LIB_WITH" that executes a "AC_CHECK_LIB" on a library only if --with-libname[=DIR] is specified on the configure command line. This is to allow inclusion of libraries when the ssl, gtk, wxWidgets, or other configuration is incorrect for static libraries. - Added a lot of "--with-*" for some libraries that might be required for static builds. - The sea directory has been moved to packages/generic. Changes to sea and the associated scripts might be required to better make use of the staging mechanism and shared libraries. - Fixed includes of boinc_fcgi.h in many files. - Fixed places where FCGI_FILE needs to be used implicitly. - Fixed missing define of _SC_PAGESIZE on hosts that define only _SC_PAGE_SIZE. - Moved build of boinc_cmd (and source file) from lib to client svn path=/trunk/boinc/; revision=16904 --- Makefile.am | 12 +- Makefile.incl | 42 +- api/Makefile.am | 66 +- apps/Makefile.am | 18 +- checkin_notes | 79 + client/Makefile.am | 52 +- {lib => client}/boinc_cmd.cpp | 0 client/hostinfo_unix.cpp | 5 + clientgui/Makefile.am | 32 +- config.guess | 687 ++++---- config.sub | 244 ++- configure.ac | 484 ++++-- doc/manpages/Makefile.am | 6 +- lib/Makefile.am | 158 +- lib/cert_sig.cpp | 13 +- lib/crypt.h | 9 +- lib/diagnostics.cpp | 9 + lib/msg_log.h | 3 + lib/prefs.cpp | 8 + ltmain.sh | 1453 +++++++++++------ m4/boinc_check_lib_with.m4 | 31 + m4/boinc_gtk.m4 | 40 + m4/boinc_wxwidgets.m4 | 25 +- m4/check_ssl.m4 | 87 +- m4/libcurl.m4 | 41 +- m4/sah_check_lib.m4 | 177 +- {sea => packages/generic/sea}/Makefile.am | 60 +- .../generic/sea}/boincmgr.16x16.png | Bin .../generic/sea}/boincmgr.32x32.png | Bin .../generic/sea}/boincmgr.48x48.png | Bin {sea => packages/generic/sea}/insecure.sh | 0 {sea => packages/generic/sea}/make-sea.sh | 0 {sea => packages/generic/sea}/make-tar.sh | 0 .../generic/sea}/make-tar_debug.sh | 0 {sea => packages/generic/sea}/secure.sh | 0 samples/example_app/Makefile | 2 + sched/Makefile.am | 199 ++- sched/edf_sim.cpp | 25 +- sched/file_upload_handler.cpp | 7 +- sched/handle_request.cpp | 9 +- sched/main.cpp | 1 + sched/sched_assign.cpp | 8 + sched/sched_msgs.cpp | 4 + sched/sched_msgs.h | 2 +- sched/sched_send.cpp | 1 + sched/sched_shmem.cpp | 7 +- sched/sched_shmem.h | 4 + tools/Makefile.am | 19 +- tools/backend_lib.cpp | 11 +- zip/Makefile.am | 35 +- 50 files changed, 2765 insertions(+), 1410 deletions(-) rename {lib => client}/boinc_cmd.cpp (100%) create mode 100644 m4/boinc_check_lib_with.m4 create mode 100644 m4/boinc_gtk.m4 rename {sea => packages/generic/sea}/Makefile.am (53%) rename {sea => packages/generic/sea}/boincmgr.16x16.png (100%) rename {sea => packages/generic/sea}/boincmgr.32x32.png (100%) rename {sea => packages/generic/sea}/boincmgr.48x48.png (100%) rename {sea => packages/generic/sea}/insecure.sh (100%) rename {sea => packages/generic/sea}/make-sea.sh (100%) rename {sea => packages/generic/sea}/make-tar.sh (100%) rename {sea => packages/generic/sea}/make-tar_debug.sh (100%) rename {sea => packages/generic/sea}/secure.sh (100%) diff --git a/Makefile.am b/Makefile.am index a8a6e2c1f7..a7888aa82d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,10 +3,14 @@ AUTOMAKE_OPTIONS = foreign +include Makefile.incl + ## make sure rebuilding uses the right aclocal-switches ACLOCAL_AMFLAGS = -I m4 -API_SUBDIRS = api lib zip +if ENABLE_LIBRARIES + API_SUBDIRS = api lib zip +endif if ENABLE_SERVER SERVER_SUBDIRS = db test py sched apps tools samples/example_app @@ -16,8 +20,8 @@ if ENABLE_CLIENT CLIENT_SUBDIRS = client client/scripts endif -if BUILD_CLIENTGUI - CLIENTGUI_SUBDIRS = clientgui clientgui/res locale +if ENABLE_MANAGER + CLIENTGUI_SUBDIRS = clientgui clientgui/res locale endif # ORDER MATTERS below. One must build dependencies FIRST, then things @@ -33,9 +37,11 @@ EXTRA_DIST = \ stripchart \ INSTALL +if INSTALL_HEADERS pkginclude_HEADERS = \ config.h \ version.h +endif # Add a stage target for staging a distribution diff --git a/Makefile.incl b/Makefile.incl index c1ab71265f..fcf38094b9 100644 --- a/Makefile.incl +++ b/Makefile.incl @@ -3,6 +3,11 @@ # Note: MYSQL_CFLAGS and MYSQL_LIBS set by configure from mysql_config +# ignore any LIBS set by configure +LIBS= + +LIBBOINC_VERSION = @LIBBOINC_VERSION@ + MYSQL_LIBS = @MYSQL_LIBS@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ @@ -10,6 +15,8 @@ PTHREAD_LIBS = @PTHREAD_LIBS@ RSA_LIBS = -lcrypto +AM_LIBTOOLFLAGS = + AM_CPPFLAGS = \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/api \ @@ -17,19 +24,36 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/client \ -I$(top_srcdir)/tools \ -I$(top_srcdir)/sched \ - -I$(top_srcdir)/lib/mac + -I$(top_srcdir)/lib/mac \ + $(PTHREAD_CFLAGS) + +AM_CFLAGS = + +AM_CXXFLAGS = + +AM_LDFLAGS = + # dependencies to make sure libs gets compiled before # programs linking to them: -LIBSCHED = $(top_builddir)/sched/libsched.a +LIBSCHED = $(top_builddir)/sched/libsched.la $(LIBSCHED): - cd $(top_builddir)/sched; ${MAKE} libsched.a - -LIBBOINC = $(top_builddir)/lib/libboinc.a + cd $(top_builddir)/sched; ${MAKE} libsched.la +LIBSCHED_FCGI = $(top_builddir)/sched/libsched_fcgi.la +$(LIBSCHED_FCGI): + cd $(top_builddir)/sched; ${MAKE} libsched_fcgi.la +LIBBOINC = $(top_builddir)/lib/libboinc.la $(LIBBOINC): - cd $(top_builddir)/lib; ${MAKE} libboinc.a - -LIBAPI = = $(top_builddir)/api/libboinc_api.a + cd $(top_builddir)/lib; ${MAKE} libboinc.la +LIBBOINC_FCGI = $(top_builddir)/lib/libboinc_fcgi.la +$(LIBBOINC_FCGI): + cd $(top_builddir)/lib; ${MAKE} libboinc_fcgi.la +LIBAPI = $(top_builddir)/api/libboinc_api.la $(LIBAPI): - cd $(top_builddir)/api; ${MAKE} libboinc_api.a + cd $(top_builddir)/api; ${MAKE} libboinc_api.la + +SERVERLIBS = $(LIBSCHED) $(LIBBOINC) $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS) +SERVERLIBS_FCGI = $(LIBSCHED_FCGI) $(LIBBOINC_FCGI) -lfcgi $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS) +APPLIBS = $(LIBAPI) $(LIBBOINC) + diff --git a/api/Makefile.am b/api/Makefile.am index 55b314ca75..4b23fe50cf 100644 --- a/api/Makefile.am +++ b/api/Makefile.am @@ -3,23 +3,22 @@ include $(top_srcdir)/Makefile.incl -AM_CFLAGS = @GLUT_CFLAGS@ -AM_LDFLAGS = @GLUT_LIBS@ +if ENABLE_LIBRARIES # stuff linked into both main app and graphics app api_files= \ - boinc_api.cpp \ - reduce_main.cpp \ + boinc_api.cpp \ + reduce_main.cpp \ graphics2_util.cpp # stuff linked into graphics app graphics2_files = \ - gutil.cpp \ - gutil_text.cpp \ - reduce_lib.cpp \ - texfont.cpp \ - texture.cpp \ - txf_util.cpp \ + gutil.cpp \ + gutil_text.cpp \ + reduce_lib.cpp \ + texfont.cpp \ + texture.cpp \ + txf_util.cpp \ graphics2.cpp \ graphics2_unix.cpp @@ -31,30 +30,53 @@ endif EXTRA_DIST = *.h if BUILD_GRAPHICS_API -graphics_libs = \ - libboinc_graphics2.a -else -graphics_libs = +AM_CFLAGS += @GLUT_CFLAGS@ endif -lib_LIBRARIES = libboinc_api.a $(graphics_libs) - -libboinc_api_a_SOURCES = $(api_files) - -libboinc_graphics2_a_SOURCES = $(graphics2_files) -libboinc_graphics2_a_CPPFLAGS = -I$(top_srcdir)/lib +lib_LTLIBRARIES = libboinc_api.la +libboinc_api_la_SOURCES = $(api_files) +libboinc_api_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +if BUILD_GRAPHICS_API +lib_LTLIBRARIES += libboinc_graphics2.la +libboinc_graphics2_la_SOURCES = $(graphics2_files) +libboinc_graphics2_la_CPPFLAGS = -I$(top_srcdir)/lib +libboinc_graphics2_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +endif #BUILD_GRAPHICS_API +if INSTALL_HEADERS ## install only headers that are meant for exporting the API !! pkginclude_HEADERS = \ boinc_api.h \ graphics2.h \ gutil.h +endif ## INSTALL_HEADERS +if BUILD_STATIC_LIBS +all_local = libboinc_api.a +if BUILD_GRAPHICS_API +all_local += libboinc_graphics2.a +endif +endif + +all-local: $(all_local) + +libboinc_api.a: libboinc_api.la + rm -f libboinc_api.a + ln .libs/libboinc_api.a + +libboinc_graphics2.a: libboinc_graphics2.la + rm -f libboinc_graphics2.a + ln .libs/libboinc_graphics2.a + + +endif ## ENABLE_LIBRARIES .PHONY: EXTRA_PROGRAMS = api_app api_test -api_app_SOURCES = api_app.cpp boinc_api.cpp ../lib/parse.cpp -api_test_SOURCES = boinc_api.cpp api_test.cpp ../lib/parse.cpp +api_app_SOURCES = api_app.cpp ../lib/parse.cpp +api_app_LDADD = $(LIBAPI) +api_test_SOURCES = api_test.cpp ../lib/parse.cpp +api_test_LDADD = $(LIBAPI) diff --git a/apps/Makefile.am b/apps/Makefile.am index 2399594853..ad5c0a44b1 100644 --- a/apps/Makefile.am +++ b/apps/Makefile.am @@ -5,9 +5,17 @@ include $(top_srcdir)/Makefile.incl bin_PROGRAMS = upper_case concat 1sec -LDADD = $(top_builddir)/api/libboinc_api.a $(LIBBOINC) $(PTHREAD_LIBS) -AM_CXXFLAGS = $(MYSQL_CFLAGS) +upper_case_SOURCES = upper_case.cpp +upper_case_CXXFLAGS = $(PTHREAD_CFLAGS) +upper_case_LDFLAGS = -static-libtool-libs +upper_case_LDADD = $(APPLIBS) -upper_case_SOURCES = upper_case.cpp -concat_SOURCES = concat.cpp -1sec_SOURCES = 1sec.cpp +concat_SOURCES = concat.cpp +concat_CXXFLAGS = $(PTHREAD_CFLAGS) +concat_LDFLAGS = -static-libtool-libs +concat_LDADD = $(APPLIBS) + +1sec_SOURCES = 1sec.cpp +1sec_CFLAGS = $(PTHREAD_CFLAGS) +1sec_LDFLAGS = -static-libtool-libs +1sec_LDADD = $(APPLIBS) diff --git a/checkin_notes b/checkin_notes index 9d4ffeddec..6966d14231 100644 --- a/checkin_notes +++ b/checkin_notes @@ -280,3 +280,82 @@ David 13 Jan 2009 lib/ gui_rpc_client_ops.cpp gui_rpc_client.h + +Eric 13 Jan 2009 + - STILL WORK TO BE DONE TO GET locale STUFF INSTALLED PROPERLY!!! + - Update to libtool 1.5.24 + - build environment: Major automake changes that I've been warning about + for some time. + - Now uses libtool to build libraries. + - Builds separate boinc_fcgi and sched_fcgi libraries for use with + FCGI server components. + - New macro "BOINC_CHECK_LIB_WITH" that executes a "AC_CHECK_LIB" on + a library only if --with-libname[=DIR] is specified on the configure + command line. This is to allow inclusion of libraries when the + ssl, gtk, wxWidgets, or other configuration is incorrect for static + libraries. + - Added a lot of "--with-*" for some libraries that might be required for + static builds. + - The sea directory has been moved to packages/generic. Changes to sea + and the associated scripts might be required to better make use of the + staging mechanism and shared libraries. + - Fixed includes of boinc_fcgi.h in many files. + - Fixed places where FCGI_FILE needs to be used implicitly. + - Fixed missing define of _SC_PAGESIZE on hosts that define only + _SC_PAGE_SIZE. + - Moved build of boinc_cmd (and source file) from lib to client + + + ltmain.sh + config.guess + config.sub + Makefile.incl + m4/ + sah_check_lib.m4 + check_ssl.m4 + boinc_gtk.m4 (new) + boinc_check_lib_with.m4 (new) + libcurl.m4 + boinc_wxwidgets.m4 + sea/ (moved to packages/generic/sea) + packages/ (new) + generic/ (new) + sea/ (new) + Makefile.am + client/ + Makefile.am + hostinfo_unix.cpp + sched/ + edf_sim.cpp + sched_shmem.h + sched_msgs.h + sched_msgs.cpp + sched_send.cpp + handle_resuest.cpp + file_upload_handler.cpp + main.cpp + sched_assign.cpp + Makefile.am + lib/ + boinc_cmd.cpp (moved to client) + diagnostics.cpp + prefs.cpp + msg_log.h + cert_sig.cpp + Makefile.am + zip/ + Makefile.am + samples/ + example_app/ + Makefile + api/ + Makefile.am + clientgui/ + Makefile.am + tools/ + backend_lib.cpp + Makefile.am + doc/ + manpages/ + Makefile.am + diff --git a/client/Makefile.am b/client/Makefile.am index 894da1081d..6ad5c89d8d 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -3,19 +3,23 @@ include $(top_srcdir)/Makefile.incl -# (for a while we used "-static -static-libgcc" on linux, but this is obsolete -# now) -#STATIC_FLAGS=@STATIC_FLAGS@ +if ENABLE_CLIENT_RELEASE + AM_LDFLAGS += -static-libtool-libs +endif -client-bin: @CLIENT_BIN_FILENAME@ - -LIBS += @CLIENTLIBS@ +LIBS += $(CLIENTLIBS) if OS_DARWIN LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa endif -bin_PROGRAMS = boinc_client switcher +bin_PROGRAMS = boinc_client switcher boinccmd + +boinccmd_SOURCES = boinc_cmd.cpp +boinccmd_DEPENDENCIES = $(LIBBOINC) +boinccmd_CPPFLAGS = $(AM_CPPFLAGS) +boinccmd_LDFLAGS = $(AM_LDFLAGS) -L../lib +boinccmd_LDADD = $(LIBBOINC) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS) boinc_client_SOURCES = \ acct_mgr.cpp \ @@ -54,32 +58,34 @@ boinc_client_SOURCES = \ main.cpp \ net_stats.cpp \ pers_file_xfer.cpp \ - rr_sim.cpp \ + rr_sim.cpp \ sandbox.cpp \ scheduler_op.cpp \ time_stats.cpp \ whetstone.cpp \ work_fetch.cpp -boinc_client_DEPENDENCIES = -boinc_client_CPPFLAGS = -O3 -fomit-frame-pointer -fforce-addr -ffast-math $(AM_CPPFLAGS) -boinc_client_LDFLAGS = -static-libgcc -boinc_client_LDADD = $(LIBBOINC) $(PTHREAD_LIBS) +boinc_client_DEPENDENCIES = $(LIBBOINC) +boinc_client_CPPFLAGS = $(AM_CPPFLAGS) +boinc_client_LDFLAGS = $(AM_LDFLAGS) -L../lib +boinc_client_LDADD = $(LIBBOINC) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS) boinc_clientdir = $(bindir) -boinc_client_DATA = ../curl/ca-bundle.crt switcher_SOURCES = switcher.cpp -all-local: client-bin +## since we are using libtool we need some magic to get boinc and boinc_client +## to both be installed properly. The next two rules do that... +all-local: boinc -# make a hard link to the client name. -@CLIENT_BIN_FILENAME@: boinc_client - rm -f $@ - rm -f $@.unmodified - cp $? $@.unmodified - @LN@ $? $@ - @STRIP@ $@ +boinc: boinc_client + rm -f boinc .libs/boinc + ln boinc_client boinc + if test -f .libs/boinc_client ; then ln .libs/boinc_client .libs/boinc ; fi + +install-exec-hook: + rm -f $(DESTDIR)$(exec_prefix)/bin/boinc + ln $(DESTDIR)$(exec_prefix)/bin/boinc_client $(DESTDIR)$(exec_prefix)/bin/boinc ## these source files need to be specified because no rule uses them. @@ -87,7 +93,3 @@ EXTRA_DIST = *.h \ mac \ translation \ win - -clean-local: - rm -f @CLIENT_BIN_FILENAME@ - rm -f @CLIENT_BIN_FILENAME@.unmodified diff --git a/lib/boinc_cmd.cpp b/client/boinc_cmd.cpp similarity index 100% rename from lib/boinc_cmd.cpp rename to client/boinc_cmd.cpp diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index ca72c534d9..7bc9b11492 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -140,6 +140,11 @@ NXEventHandle gEventHandle = NULL; #include #endif +// Some OS define _SC_PAGE_SIZE instead of _SC_PAGESIZE +#if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE) +#define _SC_PAGESIZE _SC_PAGE_SIZE +#endif + // The following is intended to be true both on Linux // and Debian GNU/kFreeBSD (see trac #521) // diff --git a/clientgui/Makefile.am b/clientgui/Makefile.am index e902e2a234..90b0d54101 100644 --- a/clientgui/Makefile.am +++ b/clientgui/Makefile.am @@ -3,8 +3,9 @@ include $(top_srcdir)/Makefile.incl -LIBS += @CLIENTLIBS@ - +if ENABLE_CLIENT_RELEASE + AM_LDFLAGS += -static-libtool-libs +endif if OS_DARWIN LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa -framework Security @@ -15,17 +16,17 @@ if OS_DARWIN mac/Mac_GUI.cpp\ mac/browser_safari.mm - mac_headers = mac/*.h + mac_headers = mac/*.h else mac_headers = mac_sources = endif -bin_PROGRAMS = boinc_gui +bin_PROGRAMS = boincmgr # keep the following alphabetic -boinc_gui_SOURCES = \ +boincmgr_SOURCES = \ AccountInfoPage.cpp \ AccountManagerInfoPage.cpp \ AccountManagerProcessingPage.cpp \ @@ -105,28 +106,13 @@ EXTRA_DIST = *.h \ ../lib/error_numbers.h \ locale $(mac_headers) -boinc_gui_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(CLIENTGUIFLAGS) -boinc_gui_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(CLIENTGUIFLAGS) -boinc_gui_LDADD = $(LIBBOINC) $(CLIENTGUILIBS) - -all-local: client_gui-bin -client_gui-bin: @CLIENT_GUI_BIN_FILENAME@ +boincmgr_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(CLIENTGUIFLAGS) +boincmgr_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(CLIENTGUIFLAGS) +boincmgr_LDADD = $(LIBBOINC) $(CLIENTGUILIBS) $(BOINC_EXTRA_LIBS) $(CLIENTLIBS) win_config.h: $(top_srcdir)/config.h grep '#define.*BOINC.*VERSION' $^ > $@ version: win_config.h -# make a hard link to the client name. -@CLIENT_GUI_BIN_FILENAME@: boinc_gui - rm -f $@ - rm -f $@.unmodified - cp $? $@.unmodified - @LN@ $? $@ - @STRIP@ $@ - -clean-local: - rm -f @CLIENT_GUI_BIN_FILENAME@ - rm -f @CLIENT_GUI_BIN_FILENAME@.unmodified - .PHONY: version diff --git a/config.guess b/config.guess index ef66e9de97..951383e355 100755 --- a/config.guess +++ b/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2003-06-17' +timestamp='2007-05-17' # 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 @@ -17,13 +18,15 @@ timestamp='2003-06-17' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -53,7 +56,7 @@ version="\ GNU config.guess ($timestamp) 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, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -66,11 +69,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -104,7 +107,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 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 -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$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 ; } ; @@ -123,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in ;; ,,*) CC_FOR_BUILD=$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. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -136,13 +139,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -## for Red Hat Linux -##if test -f /etc/redhat-release ; then -## VENDOR=redhat ; -##else - VENDOR= ; -##fi - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -165,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -203,50 +200,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-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 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + 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:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) 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 @@ -284,42 +263,49 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac + # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; Alpha\ *:Windows_NT*:*) # 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 # of the specific Alpha model? echo alpha-pc-interix - exit 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) 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]*:*) 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:*:*) echo hppa1.1-hitachi-hiuxmpp - exit 0;; + exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -327,32 +313,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + 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 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) + exit ;; + i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -361,10 +347,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -376,10 +362,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -390,37 +376,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -444,32 +433,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -485,29 +475,29 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) 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. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -515,7 +505,7 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -530,14 +520,18 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit 0 ;; + exit ;; *:AIX:*:[45]) 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 @@ -551,28 +545,28 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 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:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -634,9 +628,19 @@ EOF esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + 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 @@ -644,11 +648,11 @@ EOF fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -676,150 +680,182 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + 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:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + 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*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) + exit ;; + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - 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 ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # 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 # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) + # the GNU system 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:*:*) echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; + exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit 0 ;; + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -836,8 +872,12 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + 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 @@ -855,15 +895,22 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + 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:*:*) - echo powerpc-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + echo powerpc-unknown-linux-gnu + exit ;; ppc64:Linux:*:*) - echo powerpc64-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + echo powerpc64-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -877,7 +924,7 @@ EOF objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -885,25 +932,31 @@ EOF PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit 0 ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit 0 ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-ibm-linux + exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) - echo x86_64-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + echo x86_64-unknown-linux-gnu + exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # 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 @@ -921,15 +974,15 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; + exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; + exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -946,23 +999,33 @@ EOF LIBC=gnulibc1 # endif #else - #ifdef __INTEL_COMPILER + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + 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*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 - exit 0 ;; + exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -970,24 +1033,27 @@ EOF # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. 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 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; + 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 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -995,15 +1061,16 @@ EOF else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit 0 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*: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) + 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='' test -r /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 \ - && 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 \ - && 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:*) /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*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1095,68 +1162,81 @@ EOF else echo ns32k-sni-sysv fi - exit 0 ;; + exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit 0 ;; + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + 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:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1164,22 +1244,25 @@ EOF UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1190,28 +1273,47 @@ EOF UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + 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 #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1243,7 +1345,7 @@ main () #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1332,11 +1434,12 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } # 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) @@ -1345,22 +1448,22 @@ then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi @@ -1371,7 +1474,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you 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 send the following data and any information you think might be diff --git a/config.sub b/config.sub index e5c474df94..c060f44833 100755 --- a/config.sub +++ b/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2003-06-18' +timestamp='2007-04-29' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,14 +22,15 @@ timestamp='2003-06-18' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, 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 # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -70,7 +72,7 @@ Report bugs and patches to ." version="\ 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, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -83,11 +85,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +101,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,7 +120,9 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + 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 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -144,7 +148,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) + -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; @@ -169,6 +173,10 @@ case $os in -hiux*) os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -185,6 +193,10 @@ case $os in # Don't forget version if it is 3.2v4 or newer. 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*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -228,14 +240,17 @@ case $basic_machine in | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | ip2k \ - | m32r | m68000 | m68k | m88k | mcore \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -244,28 +259,33 @@ case $basic_machine in | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ - | openrisc | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | s390 | s390x \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -276,6 +296,9 @@ case $basic_machine in ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -295,20 +318,20 @@ case $basic_machine in | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ + | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ - | m32r-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -317,31 +340,36 @@ case $basic_machine in | 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-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | s390-* | s390x-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; @@ -361,6 +389,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + abacus) + basic_machine=abacus-unknown + ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -378,6 +409,9 @@ case $basic_machine in amd64) basic_machine=x86_64-pc ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -437,12 +471,27 @@ case $basic_machine in basic_machine=j90-cray os=-unicos ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; crds | unos) basic_machine=m68k-crds ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -465,6 +514,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -630,6 +683,10 @@ case $basic_machine in basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; @@ -643,10 +700,6 @@ case $basic_machine in mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -659,6 +712,9 @@ case $basic_machine in basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm os=-mvs @@ -727,10 +783,6 @@ case $basic_machine in np1) basic_machine=np1-gould ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -738,9 +790,12 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson @@ -767,6 +822,12 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -823,6 +884,10 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -833,6 +898,12 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; sa29200) basic_machine=a29k-amd os=-udi @@ -843,6 +914,10 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; sei) basic_machine=mips-sei os=-seiux @@ -854,6 +929,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -956,6 +1034,10 @@ case $basic_machine in tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -999,6 +1081,10 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1029,6 +1115,9 @@ case $basic_machine in romp) basic_machine=romp-ibm ;; + mmix) + basic_machine=mmix-knuth + ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1045,13 +1134,10 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1124,19 +1210,23 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1154,12 +1244,15 @@ case $os in os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -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*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1172,6 +1265,9 @@ case $os in -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1193,6 +1289,9 @@ case $os in -atheos*) os=-atheos ;; + -syllable*) + os=-syllable + ;; -386bsd) os=-bsd ;; @@ -1215,6 +1314,9 @@ case $os in -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1251,6 +1353,9 @@ case $os in -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; -none) ;; *) @@ -1273,6 +1378,12 @@ else # system, and we'll never get to this point. case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1282,8 +1393,8 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1310,6 +1421,9 @@ case $basic_machine in m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; @@ -1328,9 +1442,15 @@ case $basic_machine in *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; + *-knuth) + os=-mmixware + ;; *-wec) os=-proelf ;; @@ -1463,9 +1583,15 @@ case $basic_machine in -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; @@ -1490,7 +1616,7 @@ case $basic_machine in esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/configure.ac b/configure.ac index 76dfca26ee..8c598289f9 100644 --- a/configure.ac +++ b/configure.ac @@ -2,9 +2,6 @@ dnl -*- autoconf -*- dnl $Id$ -dnl NOTE: on milkyway.ssl and jill.ssl , need autoconf/automake et al from quarls -dnl directory; the _autosetup script does this. - dnl not sure exactly what the minimum version is (but 2.13 wont work) AC_PREREQ(2.57) @@ -13,48 +10,166 @@ AC_INIT(BOINC, 6.7.0) LIBBOINC_VERSION=`echo ${PACKAGE_VERSION} | sed 's/\./:/g'` AC_SUBST([LIBBOINC_VERSION]) +AC_CANONICAL_TARGET -AC_ARG_ENABLE(debug, - AS_HELP_STRING([--enable-debug], - [enable tracing and debugging flags for all components]), - [enable_debug="$enableval"], - []) +dnl generate .tar.gz, .tar.bz2, .zip +dnl AM_INIT_AUTOMAKE(dist-bzip2 dist-zip) +AM_INIT_AUTOMAKE(dist-zip) -AC_ARG_ENABLE(unicode, - AS_HELP_STRING([--enable-unicode], - [enable building the manager with unicode support]), - [enable_unicode="$enableval"], - []) +AC_CONFIG_SRCDIR(lib/shmem.cpp) + +AC_REVISION([$Revision$]) +REV=`echo '$Revision$' | awk "{print $2}"` +RDATE=`date '+%Y.%m.%d'` +if test -d .svn ; then + REV=`svn info | grep Revision | awk '{print $2}'` + RDATE=`svn info | grep "Last Changed Date:" | awk '{print $4}' | sed 's/-/./g'` +fi +AC_SUBST(REV) +AC_SUBST(RDATE) + +dnl turn dependency tracking on by default +if test x${enable_dependency_tracking} != xno ; then + enable_dependency_tracking=yes +fi + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_CPP +AC_PROG_MAKE_SET +SAH_LINKS +AM_PROG_CC_C_O + +m4_divert_once([HELP_ENABLE], + AS_HELP_STRING([BOINC Default enable values], [--enable-server --enable-client --enable-libraries --enable-manager: builds server, client, and libraries])) AC_ARG_ENABLE(server, AS_HELP_STRING([--disable-server], [disable building the scheduling server]), - [], + [enable_server=no], [enable_server=yes]) +AC_ARG_ENABLE(fcgi, + AS_HELP_STRING([--disable-fcgi], + [disable building fcgi libraries or server components]), + [enable_fcgi=no], + [enable_fcgi=yes]) + AC_ARG_ENABLE(client, AS_HELP_STRING([--disable-client], [disable building the client]), - [], + [enable_client=no], [enable_client=yes]) -m4_divert_once([HELP_ENABLE], - AS_HELP_STRING([], [Default: --enable-server --enable-client: - builds both server and client])) +AC_ARG_ENABLE(manager, + AS_HELP_STRING([--disable-manager], + [disable building the boinc manager gui]), + [enable_manager=no], + [enable_manager=yes]) -if test "${enable_server}" = yes ; then - if test "${enable_client}" = yes ; then - configured_to_build='server & client' - else - configured_to_build='server only' - fi -else - if test "${enable_client}" = yes ; then - configured_to_build='client only' - else - configured_to_build='libraries only' - fi +AC_ARG_ENABLE(libraries, + AS_HELP_STRING([--disable-libraries], + [disable building the boinc client and server libraries]), + [enable_libraries=no], + [enable_libraries=yes]) + +AC_ARG_ENABLE(install-headers, + AS_HELP_STRING([--disable-install-headers], + [if building libraries do not install the boinc library + header files]), + [enable_install_headers=no], + [enable_install_headers=yes]) + +AC_ARG_ENABLE(pkg-libs, + AS_HELP_STRING([--enable-pkg-libs], + [Builds and installs components that would be present in a + boinc-libs package. This is a synonym for --disable-server + --disable-client --enable-libraries --disable-static + --disable-install-headers --disable-manager]), + [ + enable_libraries=yes + enable_server=no + enable_client=no + enable_manager=no + enable_install_headers=no + enable_static=no + ], + []) + +AC_ARG_ENABLE(pkg-devel, + AS_HELP_STRING([--enable-pkg-devel], + [Builds and installs components that would be present in a + boinc-devel package. This is a synonym for --disable-server + --disable-client --enable-libraries --enable-install-headers + --disable-manger]), + [ + enable_libraries=yes + enable_server=no + enable_client=no + enable_manager=no + enable_install_headers=yes + ], + []) + +AC_ARG_ENABLE(pkg-client, + AS_HELP_STRING([--enable-pkg-client], + [Builds and installs components that would be present in a + boinc-client package. This is a synonym for --disable-server + --enable-client --disable-libraries --disable-manager + ]), + [ + enable_libraries=no + enable_server=no + enable_client=yes + enable_manager=no + enable_install_headers=no + ], + []) + +AC_ARG_ENABLE(pkg-manager, + AS_HELP_STRING([--enable-pkg-manager], + [Builds and installs components that would be present in a boinc-manager package. This is a synonym for --disable-server --disable-client --disable-libraries --enable-manager + ]), + [ + enable_libraries=no + enable_server=no + enable_client=no + enable_manager=yes + enable_install_headers=no + ], + []) + + +BOINC_SET_COMPILE_FLAGS + +configured_to_build= + +if test x$enable_client = xyes ; then + configured_to_build="client" fi +if test x$enable_manager = xyes ; then + configured_to_build="${configured_to_build} manager" +fi +if test x$enable_libraries = xyes ; then + configured_to_build="${configured_to_build} libraries" +fi +if test x$enable_server = xyes ; then + configured_to_build="${configured_to_build} server" +fi + +if test -z "${configured_to_build}" ; then + AC_MSG_ERROR([ +================================================================================ +ERROR: I have been told to build nothing. + + Please remove one of the --disable commands from your + configure command line. + +================================================================================ + ]) +fi + dnl ====================================================================== dnl some vodoo required for building portable client-binary (client, clientgui) @@ -66,7 +181,33 @@ AC_ARG_ENABLE([client-release], (On GNU/Linux you might need to use gcc-3.0 for this to produce a binary that works for glibc <= 2.2 systems. => use CC=gcc-3.0 and CXX=g++-3.0) (Default = no)]), - [enable_client_release=yes;disable_static_linkage=no], + [ + enable_client_release=yes + disable_static_linkage=no + AC_MSG_WARN([ +================================================================================ +WARNING: You have requested a statically linked release build. + + This option is not recommended for personal use or for building + an application for distribution via a package management system. + It probably wont work unless you have built your own static curl + and wxWidgets libraries that have minimal dependencies. You may + also need to edit Makefiles manually in order for linking to work. + + It is far better to use dynamic linkage, which can resolve most + library interdependencies at run time. + + When the executable fails to link, and you can identify the missing + library, you can edit the Makefile to add it, or if there is a --with + option to configure, use it. + + This is not easy. It is not supported. You have been warned. +================================================================================ + ]) + echo Pausing 10 seconds... + sleep 10 + ] + , [enable_client_release=no;disable_static_linkage=yes]) @@ -79,13 +220,6 @@ fi echo "--- Configuring BOINC AC_PACKAGE_VERSION (${build_state}) ---" echo "--- Build Components: (${configured_to_build}) ---" -AC_CANONICAL_TARGET - -dnl generate .tar.gz, .tar.bz2, .zip -dnl AM_INIT_AUTOMAKE(dist-bzip2 dist-zip) -AM_INIT_AUTOMAKE(dist-zip) - -AC_CONFIG_SRCDIR(lib/shmem.cpp) AC_COPYRIGHT([ Berkeley Open Infrastructure for Network Computing @@ -108,8 +242,6 @@ or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ]) -AC_REVISION([$Revision$]) - AC_DEFUN([KC_STRIP_LEADING_ZEROS],[m4_bregexp([$*],[^0*\(..*\)],\1)]) AC_DEFUN([BOINC_SET_VERSION],[dnl @@ -141,14 +273,6 @@ AC_SUBST([TOP_SOURCE_DIR], [`(cd \`dirname "$0"\` && pwd)`]) ## such as automatic reconfiguring on changes in Makefile.am's and configure.ac ## AM_MAINTAINER_MODE -dnl Checks for programs. -AC_PROG_CC -AC_PROG_CXX -AC_PROG_CPP -AC_PROG_MAKE_SET -AC_PROG_RANLIB -SAH_LINKS -AM_PROG_CC_C_O dnl Check for docbook2x-man, which we use to create the manpages in dnl doc/manpages, and set the conditional HAVE_DOCBOOK2X_MAN to build @@ -171,12 +295,12 @@ AC_SUBST(OBJC) OBJCFLAGS="-ObjC" AC_SUBST(OBJCFLAGS) +dnl LT_INIT AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_SUBST(PICFLAGS,${lt_prog_compiler_pic}) - SAH_OPTION_BITNESS dnl Determine the BOINC platform given the target arch-platform-os. @@ -195,14 +319,15 @@ dnl Find the extensions used on shared and static libraries on this system SAH_LIBEXT SAH_DLLEXT +dnl THIS IS UNNECESSARY. THE COMPILER SHOULD SET THESE dnl enable debug mode on all components using standard debug flags -if test "${enable_debug}" = yes; then - CXXFLAGS="$CXXFLAGS -DDEBUG -D_DEBUG" - CFLAGS="$CFLAGS -DDEBUG -D_DEBUG" - - AC_SUBST(CXXFLAGS) - AC_SUBST(CFLAGS) -fi +dnl if test "${enable_debug}" = yes; then + dnl CXXFLAGS="$CXXFLAGS -DDEBUG -D_DEBUG" + dnl CFLAGS="$CFLAGS -DDEBUG -D_DEBUG" +dnl + dnl AC_SUBST(CXXFLAGS) + dnl AC_SUBST(CFLAGS) +dnl fi if test "${enable_server}" = yes; then AC_CHECK_MYSQL @@ -229,9 +354,7 @@ dnl installed everywhere should be linked statically when building portable dnl binaries. Put libraries that should be linked statically on every platform dnl in the STATIC_LIB_LIST variable before calling SAH_CHECK_LIB. (Note: Only dnl the '*' wildcard is supported). -STATIC_LIB_LIST="stdc++* gcc gcc_s gcc_eh atk* gtk* gdk* gmodule* gthread* gobject* -glib* pango* cairo* wx* tiff* jpeg* png* Xi glut socket z expat* krb5support -freetype fontconfig* resolv* idn" +STATIC_LIB_LIST="stdc++* gcc gcc_s gcc_eh atk* gtk* gdk* gmodule* gthread* gobject* glib* pango* cairo* wx* tiff* jpeg* png* Xi glut socket z expat* krb5support freetype fontconfig* resolv* idn c_nonshared gpg* gss* gnutls sasl2" dnl We'll store these libs in a separate variable BOINC_EXTRA_LIBS for later dnl post-processing instead of the default-action, which would append @@ -251,6 +374,9 @@ esac dnl m4/boinc_getsockopt.m4 BOINC_GETSOCKOPT_TYPE +dnl m4/boinc_check_fcgi.m4 +BOINC_CHECK_FCGI + dnl ---------- libcurl (m4/libcurl.m4) ------------------------------ if test "${enable_client}" = yes; then @@ -274,10 +400,9 @@ ERROR: could not find (recent enough) development-libs for libcurl. ]) else ## add libcurl et al. to the list of statically linked libs - STATIC_LIB_LIST="${STATIC_LIB_LIST} curl idn crypto ssl krb5 k5crypto gssapi_krb5 com_err resolv" + STATIC_LIB_LIST="${STATIC_LIB_LIST} curl idn ssh2 crypto ssl krb5 k5crypto gssapi_krb5 com_err resolv lber ldap socket nsl z rt gcrypt gpg-error" CPPFLAGS="${CPPFLAGS} ${LIBCURL_CPPFLAGS}" CURL_LIB_PATHS=`echo $LIBCURL | sed 's/[^[a-zA-Z]]*-l[^ ]*//g'` - LDFLAGS="$CURL_LIB_PATHS $LDFLAGS" if test "${enable_debug}" = yes; then echo "LIBCURL = ${LIBCURL}" @@ -285,6 +410,7 @@ ERROR: could not find (recent enough) development-libs for libcurl. echo "CURL_LIB_PATHS = ${CURL_LIB_PATHS}" echo "LDFLAGS = ${LDFLAGS}" fi + BOINC_EXTRA_LIBS="${BOINC_EXTRA_LIBS} ${LIBCURL}" fi @@ -316,17 +442,33 @@ SAH_CHECK_LIB([z], [gzopen], [BOINC_EXTRA_LIBS="${BOINC_EXTRA_LIBS} ${sah_lib_last}"]) SAH_CHECK_LIB([cups], [md5_finish], [BOINC_EXTRA_LIBS="${BOINC_EXTRA_LIBS} ${sah_lib_last}"]) -SAH_CHECK_LIB([curl], [curl_easy_init], - [BOINC_EXTRA_LIBS="${BOINC_EXTRA_LIBS} ${LIBCURL}"],, [${LIBCURL}]) LIBS=${SAVELIBS_AAF} dnl check for pthread ACX_PTHREAD(AC_DEFINE(HAVE_PTHREAD,1, [Have pthread])) -CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" -CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -LIBS="$PTHREAD_LIBS $LIBS" +dnl There are better ways to do this. +dnl CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" +dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +dnl LIBS="$PTHREAD_LIBS $LIBS" +# find the install directories in case we need them. +if test "x${prefix}" = "xNONE" -o -z "${prefix}" ; then + prefix="${ac_default_prefix}" +fi +if test "x${exec_prefix}" = "xNONE" -o -z "${exec_prefix}" ; then + exec_prefix="${prefix}" +fi +if test "x${bindir}" = "xNONE" -o -z "${bindir}" ; then + bindir="${exec_prefix}/bin" +fi +if test "x${libdir}" = "xNONE" -o -z "${libdir}" ; then + bindir="${exec_prefix}/lib" +fi + +AC_DEFINE_UNQUOTED(BOINC_PREFIX,"`eval echo ${prefix}`",[Directory tree where BOINC will be installed]) +AC_DEFINE_UNQUOTED(BOINC_EXECPREFIX,"`eval echo ${bindir}`",[Directory where BOINC executables will be installed]) +AC_DEFINE_UNQUOTED(BOINC_LIBDIR,"`eval echo ${libdir}`",[Directory where BOINC libraries will be installed]) dnl ---------- decide wether to build the graphical boinc-api libs or not dnl check for X11 @@ -338,8 +480,8 @@ AX_CHECK_GL AX_CHECK_GLU dnl check for glut and prerequesites to the glut-test: libXmu and libXi -AC_CHECK_LIB([Xmu], [main], [have_Xmu="yes"], [have_Xmu="no"]) -AC_CHECK_LIB([Xi], [main], [have_Xi="yes"], [have_Xi="no"]) +AC_CHECK_LIB([Xmu], [fopen], [have_Xmu="yes"], [have_Xmu="no"]) +AC_CHECK_LIB([Xi], [fopen], [have_Xi="yes"], [have_Xi="no"]) AX_CHECK_GLUT if test "X${no_x}" != "Xyes" -a "$no_glut" = yes; then @@ -421,7 +563,7 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_TYPE_SIGNAL -AC_CHECK_HEADERS(windows.h arpa/inet.h dirent.h fcntl.h inttypes.h stdint.h malloc.h alloca.h memory.h netdb.h netinet/in.h netinet/tcp.h signal.h strings.h sys/auxv.h sys/file.h sys/ipc.h sys/mount.h sys/param.h sys/resource.h sys/select.h sys/shm.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/swap.h sys/sysctl.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h) +AC_CHECK_HEADERS(windows.h arpa/inet.h dirent.h grp.h fcntl.h inttypes.h stdint.h malloc.h alloca.h memory.h netdb.h netinet/in.h netinet/tcp.h signal.h strings.h sys/auxv.h sys/file.h sys/ipc.h sys/mount.h sys/param.h sys/resource.h sys/select.h sys/shm.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/swap.h sys/sysctl.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h ieeefp.h setjmp.h) dnl Unfortunately on some 32 bit systems there is a problem with wx-widgets dnl configuring itself for largefile support. On these systems largefile @@ -448,7 +590,11 @@ AC_LANG_POP dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_VPRINTF -AC_CHECK_FUNCS(alloca _alloca setpriority strlcpy strlcat strcasestr sigaction getutent setutent getisax strdup strdupa daemon stat64 putenv setenv) +AC_FUNC_ALLOCA +if test "${ac_cv_func_alloca_works}" = "yes" ; then + ac_cv_func_alloca="yes" +fi +AC_CHECK_FUNCS(alloca _alloca __builtin_alloca setpriority strlcpy strlcat strcasestr sigaction getutent setutent getisax strdup strdupa daemon stat64 putenv setenv unsetenv) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -482,77 +628,15 @@ if test -e "/proc/meminfo"; then fi dnl ---------- wxWidgets -------------------------------------------------- - -AM_OPTIONS_WXCONFIG - -dnl check for wxWidgets - -if test "${enable_client_release}" = yes ; then - if test "${enable_debug}" = yes ; then - if test "${enable_unicode}" = yes ; then - echo 'Portable client-build: checking for debug unicode wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --static=yes --unicode=yes --debug=yes) - else - echo 'Portable client-build: checking for debug wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --static=yes --unicode=no --debug=yes) - fi - else - if test "${enable_unicode}" = yes ; then - echo 'Portable client-build: checking for unicode wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --static=yes --unicode=yes --debug=no) - else - echo 'Portable client-build: checking for wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --static=yes --unicode=no --debug=no) - fi - fi -else - if test "${enable_debug}" = yes ; then - if test "${enable_unicode}" = yes ; then - echo 'checking for debug unicode wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --unicode=yes --debug=yes) - else - echo 'checking for debug wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --unicode=no --debug=yes) - fi - else - if test "${enable_unicode}" = yes ; then - echo 'checking for unicode wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --unicode=yes --debug=no) - else - echo 'checking for wx-libs ...' - AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], --unicode=no --debug=no) - fi - fi +if test "${enable_manager}" = yes ; then + BOINC_OPTIONS_WXWIDGETS([2.6.0]) + if test "$enable_release_client" = yes -a "$disable_static_linkage" = no + then + BOINC_CHECK_GTK + fi fi -if ( test "${enable_client}" = yes ) && ( test "$wxWin" != 1 ); then - AC_MSG_WARN([ -================================================================================ -WARNING: A suitable installation of wxWidgets could not be found - ==> building client without clientgui. - - If you add wxWidgets to your system, then this configure script will also - configure your system to build the BOINC graphical client (clientgui). - - If wxWidgets is installed on your system, please check that wx-config is - in the path, that the directory where wxWidgets libraries are installed - (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH (or equivalent), - and that wxWidgets version is 2.6.0 or above. Currently wxWidgets version - 2.6.0 (gtk based) is known to work with boinc_gui under Linux. You can - use wx-config --version to find what version you have currently installed. - - NOTE: if building a portable client-release, you need the *static* version - of the wx-libs installed! - - You can get wxWidgets by following the DOWNLOAD link at: - http://www.wxwindows.org/ -================================================================================ - ]) -fi - -AM_CONDITIONAL(BUILD_CLIENTGUI, [ test "$wxWin" = 1 -a "${enable_client}" = yes ]) - dnl -------------------------------------------------------------------------------- dnl Heres another way to set up host-specific stuff @@ -567,11 +651,15 @@ AM_CONDITIONAL(OS_LINUX, [echo $host_os | grep '^linux' > /dev/null]) dnl In case anyone wants to try building the windows code using mingw! AM_CONDITIONAL(OS_WIN32_MINGW, [echo $host_os | grep '^mingw' > /dev/null]) +dnl Whether to build fcgi components +AM_CONDITIONAL(ENABLE_FCGI,[test "${enable_fcgi}" = yes]) + dnl tell automake about whether to build client and/or server AM_CONDITIONAL(ENABLE_SERVER, [test "${enable_server}" = yes]) AM_CONDITIONAL(ENABLE_CLIENT, [test "${enable_client}" = yes]) - - +AM_CONDITIONAL(ENABLE_MANAGER, [ test "x${ac_cv_have_wxwidgets}" = xyes -a "${enable_manager}" = yes ]) +AM_CONDITIONAL(ENABLE_LIBRARIES, [test "${enable_libraries}" = yes]) +AM_CONDITIONAL(INSTALL_HEADERS, [test "${enable_install_headers}" = yes]) dnl ====================================================================== dnl some more vodoo required for building portable client-binary (client, clientgui) @@ -579,56 +667,59 @@ dnl ====================================================================== CLIENTLIBS= -SAH_CHECK_LIB([c],[atexit], [ - AC_DEFINE([HAVE_LIBC],[1],[Define to 1 if you have the c library]) - CLIENTLIBS="${CLIENTLIBS} ${sah_lib_last}"]) - echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 -SAH_CHECK_LIB([gcc_eh],[_Unwind_Resume],[ - AC_DEFINE([HAVE_LIBGCC_EH],[1],[Define to 1 if you have the gcc_eh library]) - CLIENTLIBS="${CLIENTLIBS} ${sah_lib_last}"]) - echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 -SAH_CHECK_LIB([stdc++],[sscanf],[ - AC_DEFINE([HAVE_LIBSTDC__],[1],[Define to 1 if you have the stdc++ library]) - CLIENTLIBS="${CLIENTLIBS} ${sah_lib_last}"]) - echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 -SAH_CHECK_LIB([gcc],[sscanf], [ - AC_DEFINE([HAVE_LIBGCC],[1],[Define to 1 if you have the gcc library]) - CLIENTLIBS="${CLIENTLIBS} ${sah_lib_last}" ]) - echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 SAH_CHECK_LIB([m],[sin], [ AC_DEFINE([HAVE_LIBM],[1],[Define to 1 if you have the math library]) - CLIENTLIBS="${CLIENTLIBS} ${sah_lib_last}"]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) + echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 +SAH_CHECK_LIB([c],[atexit], [ + AC_DEFINE([HAVE_LIBC],[1],[Define to 1 if you have the c library]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 SAH_CHECK_LIB([pthread],[pthread_join],[ AC_DEFINE([HAVE_LIBPTHREAD],[1],[Define to 1 if you have the pthread library]) - CLIENTLIBS="${CLIENTLIBS} ${sah_lib_last}"]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 +if test x${ac_cv_cxx_compiler_gnu} != xno ; then + SAH_CHECK_LIB([gcc_eh],[_Unwind_Resume],[ + AC_DEFINE([HAVE_LIBGCC_EH],[1],[Define to 1 if you have the gcc_eh library]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) + echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 + SAH_CHECK_LIB([gcc],[sscanf], [ + AC_DEFINE([HAVE_LIBGCC],[1],[Define to 1 if you have the gcc library]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) + echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 + SAH_CHECK_LIB([c_nonshared],[fopen],[ + AC_DEFINE([HAVE_LIBC_NONSHARED],[1],[Define to 1 if you have the c_nonshared library]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) + echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 + SAH_CHECK_LIB([stdc++],[sscanf],[ + AC_DEFINE([HAVE_LIBSTDC__],[1],[Define to 1 if you have the stdc++ library]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) + echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 +fi SAH_CHECK_LIB([wsock32],[fopen],[ AC_DEFINE([HAVE_LIBWSOCK32],[1],[Define to 1 if you have the wsock32 library]) - CLIENTLIBS="${CLIENTLIBS} ${sah_lib_last}"]) + CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 - if ( test "${disable_static_linkage}" != yes ) && ( test "${enable_client_release}" = yes ); then + echo "----------" + echo "NOTE: Building portable client binaries" + echo "----------" + +if test x$ac_cv_cxx_compiler_gnu != xno ; then SAH_CHECK_LDFLAG([-nodefaultlibs],[CLIENTLIBS="-nodefaultlibs ${CLIENTLIBS}"]) echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 SAH_CHECK_LDFLAG([-lSystemStubs],[LIBS="${LIBS} -lSystemStubs"]) echo DEBUG: LIBS=${LIBS} >&5 - - echo "----------" - echo "NOTE: Building portable client binaries" - echo "----------" - - SAH_CHECK_LDFLAG([-nodefaultlibs],[CLIENTLIBS="-nodefaultlibs ${CLIENTLIBS}"]) - echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 - - SAH_CHECK_LDFLAG([-lSystemStubs],[LIBS="${LIBS} -lSystemStubs"]) - echo DEBUG: LIBS=${LIBS} >&5 +fi fi +AM_CONDITIONAL([ENABLE_CLIENT_RELEASE],[ ( test "${disable_static_linkage}" != yes ) && ( test "${enable_client_release}" = yes ) ]) +AM_CONDITIONAL([BUILD_STATIC_LIBS],[test "x${enable_static}" != xno]) AC_SUBST(CLIENTLIBS) @@ -639,10 +730,21 @@ if test "${enable_debug}" = yes; then CLIENTGUIFLAGS="${CLIENTGUIFLAGS} -D_DEBUG -DDEBUG" fi -CLIENTGUILIBS=${WX_LIBS} +AC_ARG_ENABLE(wx-debug, + AS_HELP_STRING([--enable-wx-debug], + [ use wxWidgets debug libraries ]), + [enable_wx_debug="yes" + AC_DEFINE(USE_WX_DEBUG,[1],[Define to 1 to use the wxWidgets debug libraries]) + ], + [enable_wx_debug="no"]) + +CLIENTGUILIBS="${WX_LIBS} ${GTK_LIBS}" if test "${enable_client_release}" = "yes" ; then - SAH_STATICIZE_LDFLAGS([${WX_LIBS_STATIC}],[CLIENTGUILIBS]) + if test "x${WX_LIBS_STATIC}" = "x" ; then + WX_LIBS_STATIC="${WX_LIBS}" + fi + SAH_STATICIZE_LDFLAGS([${WX_LIBS_STATIC} ${GTK_LIBS}],[CLIENTGUILIBS]) SAH_STATICIZE_LDFLAGS([${GLUT_LIBS}],[GLUT_LIBS]) SAH_STATICIZE_LDFLAGS([${BOINC_EXTRA_LIBS}],[BOINC_EXTRA_LIBS]) @@ -653,15 +755,43 @@ if test "${enable_client_release}" = "yes" ; then CPPFLAGS="$CPPFLAGS -D__NO_CTYPE" fi -## prepend BOINC_EXTRA_LIBS (mangled or not) to LIBS for standard linking -LIBS="${BOINC_EXTRA_LIBS} $LIBS" - +AC_SUBST(BOINC_EXTRA_LIBS) AC_SUBST(CLIENTGUIFLAGS) AC_SUBST(CLIENTGUILIBS) dnl ====================================================================== +dnl Oh! the joys of standards! +WHOAMI=`which logname` +if test -z "${WHOAMI}" -o -z "`${WHOAMI} 2>/dev/null`" ; then + WHOAMI=`which whoami` +fi +if test -z "${WHOAMI}" ; then + who am i 2>/dev/null && WHOAMI="who am i | awk '{print $1}'" +fi +if test -z "${WHOAMI}" -a -x "/usr/ucb/ps" ; then + WHOAMI="/usr/ucb/ps u $$ | tail -1 | awk '{print $1}'" +fi +if test -z "${WHOAMI}" ; then + WHOAMI="ps u $$ | tail -1 | awk '{print $1}'" +fi + + +dnl Some info about the person compiling used for making some packages. +LOGNAME=`${WHOAMI}` +FULLNAME=`grep ^${LOGNAME}: /etc/passwd | awk -F: '{print $5}'` +if test -z "${FULLNAME}" ; then + FULLNAME=`ypcat passwd 2>/dev/null | grep ^${LOGNAME}: | awk -F: '{print $5}'` +fi +if test -z "${FULLNAME}" ; then + FULLNAME=`nidump passwd / 2>/dev/null | grep ^${LOGNAME}: | awk -F: '{print $5}'` +fi +if test -z "${FULLNAME}" ; then + FULLNAME=$LOGNAME +fi +AC_SUBST(LOGNAME) +AC_SUBST(FULLNAME) AC_CONFIG_FILES([ - ./version.h + version.h api/Makefile apps/Makefile clientgui/Makefile @@ -683,7 +813,7 @@ AC_CONFIG_FILES([ py/Makefile sched/boinc_path_config.py:py/Boinc/boinc_path_config.py.in sched/Makefile - sea/Makefile + packages/generic/sea/Makefile test/boinc_path_config.py:py/Boinc/boinc_path_config.py.in test/Makefile test/version.inc diff --git a/doc/manpages/Makefile.am b/doc/manpages/Makefile.am index a5742eb058..6af7629880 100644 --- a/doc/manpages/Makefile.am +++ b/doc/manpages/Makefile.am @@ -8,7 +8,7 @@ if ENABLE_CLIENT CLIENT_MANS = boinc.1 boinccmd.1 endif -if BUILD_CLIENTGUI +if ENABLE_MANAGER CLIENTGUI_MANS = boincmgr.1 endif @@ -18,7 +18,9 @@ endif man_MANS = $(CLIENT_MANS) $(CLIENTGUI_MANS) $(SERVER_MANS) -%.1: %.xml +SUFFIXES = .xml .1 + +.xml.1: $(DOCBOOK2X_MAN) $< all-local: $(man_MANS) diff --git a/lib/Makefile.am b/lib/Makefile.am index 7fccd06db3..3e78ff9c6b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,60 +3,24 @@ include $(top_srcdir)/Makefile.incl -#if HAVE_NSL -nslprogs=boinc_cmd$(EXEEXT) -#endif +bin_PROGRAMS = -bin_PROGRAMS = crypt_prog$(EXEEXT) $(nslprogs) +# Stuff needed for server builds goes here. +if ENABLE_SERVER -EXTRA_PROGRAMS = md5_test$(EXEEXT) shmem_test$(EXEEXT) msg_test$(EXEEXT) +bin_PROGRAMS += crypt_prog -all-local: client-bin - -client-bin: @CLIENT_CMD_BIN_FILENAME@ - -boinc_cmd_SOURCES = \ - boinc_cmd.cpp \ - gui_rpc_client.h - -boinc_cmd_LDADD = $(lib_LIBRARIES) $(PTHREAD_LIBS) - -# make a hard link to the client name. -@CLIENT_CMD_BIN_FILENAME@: boinc_cmd$(EXEEXT) - rm -f $@ - rm -f $@.unmodified - cp $? $@.unmodified - @LN@ $? $@ - @STRIP@ $@ - -lib_LIBRARIES = libboinc.a -EXTRA_DIST = *.h *.cpp - -if OS_DARWIN -mac_sources = \ - mac/dyld_gdb.h \ - mac/mac_backtrace.cpp \ - mac/mac_backtrace.h \ - mac/QBacktrace.c \ - mac/QBacktrace.h \ - mac/QCrashReport.c \ - mac/QCrashReport.h \ - mac/QMachOImage.c \ - mac/QMachOImage.h \ - mac/QMachOImageList.c \ - mac/QMachOImageList.h \ - mac/QSymbols.c \ - mac/QSymbols.h \ - mac/QTaskMemory.c \ - mac/QTaskMemory.h -else -mac_sources = endif +# end of "if ENABLE_SERVER" -libboinc_a_SOURCES = \ + +if ENABLE_LIBRARIES + +generic_sources = \ app_ipc.cpp \ base64.cpp \ - cert_sig.cpp \ + boinc_fcgi.cpp \ + cert_sig.cpp \ coproc.cpp \ crypt.cpp \ diagnostics.cpp \ @@ -65,7 +29,7 @@ libboinc_a_SOURCES = \ gui_rpc_client_ops.cpp \ gui_rpc_client_print.cpp \ hostinfo.cpp \ - mac_address.cpp \ + mac_address.cpp \ md5.c \ md5_file.cpp \ mem_usage.cpp \ @@ -81,13 +45,38 @@ libboinc_a_SOURCES = \ str_util.cpp \ util.cpp \ unix_util.cpp \ - $(mac_sources) + synch.cpp +if OS_DARWIN +mac_sources = \ + mac/mac_backtrace.cpp \ + mac/QBacktrace.c \ + mac/QCrashReport.c \ + mac/QMachOImage.c \ + mac/QMachOImageList.c \ + mac/QSymbols.c \ + mac/QTaskMemory.c +mac_headers = \ + mac/dyld_gdb.h \ + mac/mac_backtrace.h \ + mac/QBacktrace.h \ + mac/QCrashReport.h \ + mac/QMachOImage.h \ + mac/QMachOImageList.h \ + mac/QSymbols.h \ + mac/QTaskMemory.h +else +mac_sources = +mac_headers = +endif + + +if INSTALL_HEADERS pkginclude_HEADERS = \ app_ipc.h \ - boinc_win.h \ boinc_fcgi.h \ - common_defs.h \ + boinc_win.h \ + common_defs.h \ coproc.h \ crypt.h \ diagnostics.h \ @@ -104,15 +93,62 @@ pkginclude_HEADERS = \ proxy_info.h \ std_fixes.h \ str_util.h \ - util.h + synch.h \ + util.h \ + $(mac_headers) +endif -md5_test_SOURCES = md5_test.cpp md5.c md5_file.cpp -shmem_test_SOURCES = shmem_test.cpp shmem.cpp -msg_test_SOURCES = msg_test.cpp msg_queue.cpp -crypt_prog_SOURCES = crypt_prog.cpp crypt.cpp md5.c md5_file.cpp filesys.cpp -crypt_prog_DEPENDENCIES = -crypt_prog_LDADD = $(lib_LIBRARIES) $(RSA_LIBS) $(PTHREAD_LIBS) +lib_LTLIBRARIES = libboinc.la +libboinc_la_SOURCES = $(generic_sources) $(mac_sources) +libboinc_la_CFLAGS = $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) +libboinc_la_CXXFLAGS = $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) +libboinc_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +libboinc_la_LIBADD = + +if ENABLE_FCGI +lib_LTLIBRARIES += libboinc_fcgi.la +libboinc_fcgi_la_SOURCES = $(generic_sources) $(mac_sources) +libboinc_fcgi_la_CFLAGS = -D_USING_FCGI_ $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) +libboinc_fcgi_la_CXXFLAGS = -D_USING_FCGI_ $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) +libboinc_fcgi_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +libboinc_fcgi_la_LIBADD = +endif +# end of "if ENABLE_FCGI" + +if BUILD_STATIC_LIBS +all_local = libboinc.a +if ENABLE_FCGI +all_local += libboinc_fcgi.a +endif +endif + +all-local: $(all_local) + +libboinc.a: libboinc.la + rm -f libboinc.a + ln .libs/libboinc.a + +libboinc_fcgi.a: libboinc_fcgi.la + rm -f libboinc_fcgi.a + ln .libs/libboinc_fcgi.a + +endif +# end of "if ENABLE_LIBRARIES" + +EXTRA_PROGRAMS = md5_test shmem_test msg_test + +EXTRA_DIST = *.h *.cpp + +md5_test_SOURCES = md5_test.cpp +md5_test_CXXFLAGS = $(PTHREAD_CFLAGS) +md5_test_LDADD = $(LIBBOINC) +shmem_test_SOURCES = shmem_test.cpp +shmem_test_CXXFLAGS = $(PTHREAD_CFLAGS) +shmem_test_LDADD = $(LIBBOINC) +msg_test_SOURCES = msg_test.cpp +msg_test_CXXFLAGS = $(PTHREAD_CFLAGS) +msg_test_LDADD = $(LIBBOINC) +crypt_prog_SOURCES = crypt_prog.cpp +crypt_prog_CXXFLAGS = $(PTHREAD_CFLAGS) +crypt_prog_LDADD = $(LIBBOINC) $(SSL_LIBS) -clean-local: - rm -f @CLIENT_CMD_BIN_FILENAME@ - rm -f @CLIENT_CMD_BIN_FILENAME@.unmodified diff --git a/lib/cert_sig.cpp b/lib/cert_sig.cpp index 3401383a27..2565576353 100644 --- a/lib/cert_sig.cpp +++ b/lib/cert_sig.cpp @@ -15,6 +15,12 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . +#include "config.h" +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#else +#include +#endif #include "miofile.h" #include "error_numbers.h" #include "cert_sig.h" @@ -127,10 +133,13 @@ int CERT_SIGS::parse_miofile_embed(MIOFILE &mf) { } int CERT_SIGS::parse_file(const char* filename) { - FILE* f; int retval; - f = fopen(filename, "r"); +#ifndef _USING_FCGI_ + FILE *f = fopen(filename, "r"); +#else + FCGI_FILE *f = FCGI::fopen(filename, "r"); +#endif if (!f) return ERR_FOPEN; MIOFILE mf; diff --git a/lib/crypt.h b/lib/crypt.h index 51bd3e57e8..a699b318f8 100644 --- a/lib/crypt.h +++ b/lib/crypt.h @@ -77,11 +77,18 @@ struct DATA_BLOCK { // size of text-encoded signature #define SIGNATURE_SIZE_TEXT (SIGNATURE_SIZE_BINARY*2+20) -extern int print_hex_data(FILE* f, DATA_BLOCK&); extern int sprint_hex_data(char* p, DATA_BLOCK&); +#ifndef _USING_FCGI_ +extern int print_hex_data(FILE* f, DATA_BLOCK&); extern int scan_hex_data(FILE* f, DATA_BLOCK&); extern int print_key_hex(FILE*, KEY* key, int len); extern int scan_key_hex(FILE*, KEY* key, int len); +#else +extern int print_hex_data(FCGI_FILE* f, DATA_BLOCK&); +extern int scan_hex_data(FCGI_FILE* f, DATA_BLOCK&); +extern int print_key_hex(FCGI_FILE*, KEY* key, int len); +extern int scan_key_hex(FCGI_FILE*, KEY* key, int len); +#endif extern int sscan_key_hex(const char*, KEY* key, int len); extern int encrypt_private( R_RSA_PRIVATE_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out diff --git a/lib/diagnostics.cpp b/lib/diagnostics.cpp index ce94435019..2df9ed7507 100644 --- a/lib/diagnostics.cpp +++ b/lib/diagnostics.cpp @@ -35,6 +35,10 @@ #include #endif +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#endif + #ifdef __APPLE__ #include "mac_backtrace.h" #endif @@ -299,7 +303,12 @@ int diagnostics_init( strcpy(proxy_address, ""); proxy_port = 0; +#ifndef _USING_FCGI_ p = fopen(INIT_DATA_FILE, "r"); +#else + p = FCGI::fopen(INIT_DATA_FILE, "r"); +#endif + if (p) { mf.init_file(p); while(mf.fgets(buf, sizeof(buf))) { diff --git a/lib/msg_log.h b/lib/msg_log.h index 1f770574ec..f17bded628 100644 --- a/lib/msg_log.h +++ b/lib/msg_log.h @@ -36,6 +36,9 @@ #define __attribute__(x) //nothing #endif +#undef printf +#undef vprintf + class MSG_LOG { public: int debug_level; diff --git a/lib/prefs.cpp b/lib/prefs.cpp index ed6feb12dc..c9d420fa04 100644 --- a/lib/prefs.cpp +++ b/lib/prefs.cpp @@ -27,6 +27,10 @@ #include #endif +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#endif + #include "parse.h" #include "util.h" @@ -592,7 +596,11 @@ int GLOBAL_PREFS::parse_file( GLOBAL_PREFS_MASK mask; int retval; +#ifndef _USING_FCGI_ f = fopen(filename, "r"); +#else + f = FCGI::fopen(filename, "r"); +#endif if (!f) return ERR_FOPEN; MIOFILE mf; mf.init_file(f); diff --git a/ltmain.sh b/ltmain.sh index f08d47facb..8e5a9304f1 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,8 +1,8 @@ # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify @@ -33,9 +33,6 @@ basename="s,^.*/,,g" # function. progpath="$0" -# RH: define SED for historic ltconfig's generated by Libtool 1.3 -[ -z "$SED" ] && SED=sed - # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" @@ -46,9 +43,22 @@ EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.5.6 -TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)" +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. if test "X$1" = X--no-reexec; then @@ -86,14 +96,15 @@ rm="rm -f" Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' # test EBCDIC or ASCII -case `echo A|tr A '\301'` in - A) # EBCDIC based system - SP2NL="tr '\100' '\n'" - NL2SP="tr '\r\n' '\100\100'" +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' ;; - *) # Assume ASCII based system - SP2NL="tr '\040' '\012'" - NL2SP="tr '\015\012' '\040\040'" + *) # EBCDIC based system + SP2NL='tr \100 \n' + NL2SP='tr \r\n \100\100' ;; esac @@ -102,16 +113,19 @@ esac # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi +for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + fi" +done # 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 $echo "$modename: not configured to build any kind of library" 1>&2 @@ -128,20 +142,62 @@ run= show="$echo" show_help= execute_dlfiles= +duplicate_deps=no +preserve_args= lo2o="s/\\.lo\$/.${objext}/" 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 () { +func_win32_libid () +{ win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in @@ -152,12 +208,17 @@ func_win32_libid () { 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 /{x;/import/!{s/^/import/;h;p;};x;};}'` - if test "X$win32_nmres" = "Ximport" ; then - win32_libid_type="x86 archive import" - else - win32_libid_type="x86 archive static" - fi + $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*) @@ -181,7 +242,8 @@ func_win32_libid () { # 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 () { +func_infer_tag () +{ if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do @@ -238,12 +300,126 @@ func_infer_tag () { 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. while test "$#" -gt 0 do @@ -306,12 +482,13 @@ do ;; --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2003 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $EXIT_SUCCESS + echo "\ +$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) @@ -320,7 +497,7 @@ do for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done - exit $EXIT_SUCCESS + exit $? ;; --debug) @@ -345,7 +522,7 @@ do else $echo "disable static libraries" fi - exit $EXIT_SUCCESS + exit $? ;; --finish) mode="finish" ;; @@ -360,7 +537,11 @@ do preserve_args="$preserve_args $arg" ;; - --tag) prevopt="--tag" prev=tag ;; + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; --tag=*) set tag "$optarg" ${1+"$@"} shift @@ -392,6 +573,18 @@ if test -n "$prevopt"; then exit $EXIT_FAILURE fi +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + # 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 # left over by shells. @@ -402,7 +595,7 @@ if test -z "$show_help"; then # Infer the operation mode. 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 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link @@ -468,7 +661,7 @@ if test -z "$show_help"; then for arg do - case "$arg_mode" in + case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" @@ -550,7 +743,10 @@ if test -z "$show_help"; then case $lastarg in # Double-quote args containing other shell metacharacters. # 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 + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; @@ -588,9 +784,10 @@ if test -z "$show_help"; then *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; + *.[fF][09]?) xform=[fF][09]. ;; *.for) xform=for ;; *.java) xform=java ;; + *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` @@ -624,6 +821,14 @@ if test -z "$show_help"; then 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 @@ -696,12 +901,17 @@ compiler." $run $rm $removelist exit $EXIT_FAILURE fi - $echo $srcfile > "$lockfile" + $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac $run $rm "$libobj" "${libobj}T" @@ -723,18 +933,18 @@ EOF fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then - command="$base_compile $srcfile $pic_flag" + command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code - command="$base_compile $srcfile" + command="$base_compile $qsrcfile" fi if test ! -d "${xdir}$objdir"; then $show "$mkdir ${xdir}$objdir" $run $mkdir ${xdir}$objdir - status=$? - if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then - exit $status + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then + exit $exit_status fi fi @@ -806,9 +1016,9 @@ EOF if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code - command="$base_compile $srcfile" + command="$base_compile $qsrcfile" else - command="$base_compile $srcfile $pic_flag" + command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" @@ -937,6 +1147,7 @@ EOF no_install=no objs= non_pic_objects= + notinst_path= # paths that contain not-installed libtool libraries precious_files_regex= prefer_static_libs=no preload=no @@ -957,22 +1168,32 @@ EOF for arg do case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) 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 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi - else + prefer_static_libs=yes + ;; + -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static 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_old_libs=yes - prefer_static_libs=yes break ;; esac @@ -1147,6 +1368,11 @@ EOF 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. @@ -1230,6 +1456,13 @@ EOF 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\"" prev= @@ -1288,6 +1521,18 @@ EOF 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) prev=inst_prefix continue @@ -1314,7 +1559,8 @@ EOF absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit $EXIT_FAILURE + absdir="$dir" + notinst_path="$notinst_path $dir" fi dir="$absdir" ;; @@ -1328,10 +1574,15 @@ EOF esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac ;; esac continue @@ -1340,15 +1591,15 @@ EOF -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; - *-*-mingw* | *-*-os2*) + *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; - *-*-openbsd* | *-*-freebsd*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; @@ -1356,10 +1607,19 @@ EOF # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" 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 elif test "X$arg" = "X-lc_r"; then case $host in - *-*-openbsd* | *-*-freebsd*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -1369,8 +1629,20 @@ EOF continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - deplibs="$deplibs $arg" + # 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 ;; @@ -1379,13 +1651,20 @@ EOF continue ;; - # gcc -m* arguments should be passed to the linker via $compiler_flags - # in order to pass architecture information to the linker - # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo - # but this is not reliable with gcc because gcc may use -mfoo to - # select a different linker, different libraries, etc, while - # -Wl,-mfoo simply passes -mfoo to the linker. - -m*) + # -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"` @@ -1396,9 +1675,7 @@ EOF esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" - if test "$with_gcc" = "yes" ; then - compiler_flags="$compiler_flags $arg" - fi + compiler_flags="$compiler_flags $arg" continue ;; @@ -1414,9 +1691,9 @@ EOF -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # 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: assuming \`-no-fast-install' instead" 1>&2 fast_install=no @@ -1475,7 +1752,7 @@ EOF continue ;; - -static) + -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects @@ -1636,6 +1913,11 @@ EOF 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. @@ -1741,9 +2023,9 @@ EOF if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir - status=$? - if test "$status" -ne 0 && test ! -d "$output_objdir"; then - exit $status + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status fi fi @@ -1806,7 +2088,6 @@ EOF newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" @@ -1853,12 +2134,12 @@ EOF lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - deplibs="$deplib $deplibs" + compiler_flags="$compiler_flags $deplib" fi continue ;; @@ -1867,10 +2148,6 @@ EOF $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi 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 search_ext in .la $std_shrext .so .a; do @@ -1981,7 +2258,22 @@ EOF fi case $linkmode in lib) - if test "$deplibs_check_method" != pass_all; then + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + 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" @@ -2031,7 +2323,7 @@ EOF esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else - $echo "$modename: cannot find the library \`$lib'" 1>&2 + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi @@ -2055,6 +2347,8 @@ EOF # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no + avoidtemprpath= + # Read the .la file case $lib in @@ -2153,11 +2447,19 @@ EOF dir="$libdir" absdir="$libdir" fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$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 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` @@ -2228,14 +2530,16 @@ EOF if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var"; then + 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 $dir" ;; + *) temp_rpath="$temp_rpath $absdir" ;; esac fi @@ -2272,8 +2576,12 @@ EOF 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 "$prefer_static_libs" = no || test -z "$old_library"; }; then + { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes @@ -2386,11 +2694,15 @@ EOF if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in - *-*-sco3.2v5* ) add_dir="-L$dir" ;; + *-*-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 + 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 @@ -2421,7 +2733,7 @@ EOF 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 + case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; @@ -2494,7 +2806,7 @@ EOF 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 + case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; @@ -2555,8 +2867,6 @@ EOF fi fi else - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi @@ -2674,12 +2984,12 @@ EOF *) continue ;; esac case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; esac case " $deplibs " in - *" $path "*) ;; - *) deplibs="$deplibs $path" ;; + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no @@ -2918,7 +3228,7 @@ EOF # which has an extra 1 added just for fun # case $version_type in - darwin|linux|osf|windows) + darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" @@ -2929,9 +3239,10 @@ EOF age="0" ;; irix|nonstopux) - current=`expr $number_major + $number_minor - 1` + current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_minor" + lt_irix_increment=no ;; esac ;; @@ -2944,27 +3255,27 @@ EOF # Check that each of the things are valid numbers. 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 exit $EXIT_FAILURE ;; esac 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 exit $EXIT_FAILURE ;; esac 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 exit $EXIT_FAILURE ;; @@ -2990,6 +3301,7 @@ EOF versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... 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" ;; @@ -3004,8 +3316,11 @@ EOF ;; irix | nonstopux) - major=`expr $current - $age + 1` - + if test "X$lt_irix_increment" = "Xno"; then + major=`expr $current - $age` + else + major=`expr $current - $age + 1` + fi case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; @@ -3142,11 +3457,11 @@ EOF fi # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` - deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` - done + #for path in $notinst_path; do + # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. @@ -3196,9 +3511,14 @@ EOF *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue + ;; + *-*-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. @@ -3242,13 +3562,12 @@ EOF int main() { return 0; } EOF $rm conftest - $LTCC -o conftest conftest.c $deplibs - if test "$?" -eq 0 ; then + if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then ldd_output=`ldd conftest` 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 test "$name" != "" && test "$name" -ne "0"; then + if test "$name" != "" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) @@ -3283,13 +3602,11 @@ EOF # Error occurred in the first compile. Let's try to salvage # the situation: Compile a separate program for each library. 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 test "$name" != "" && test "$name" != "0"; then $rm conftest - $LTCC -o conftest conftest.c $i - # Did it work? - if test "$?" -eq 0 ; then + if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in @@ -3321,7 +3638,7 @@ EOF droppeddeps=yes $echo $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 "*** functional. Installing it before continuing would be even better." fi @@ -3335,7 +3652,7 @@ EOF set dummy $deplibs_check_method file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 test "$name" != "" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then @@ -3404,7 +3721,7 @@ EOF set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then @@ -3534,6 +3851,35 @@ EOF deplibs=$newdeplibs 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). library_names= old_library= @@ -3578,7 +3924,10 @@ EOF test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + 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 @@ -3617,6 +3966,7 @@ EOF fi lib="$output_objdir/$realname" + linknames= for link do linknames="$linknames $link" @@ -3645,6 +3995,9 @@ EOF # 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 IFS="$save_ifs" @@ -3678,67 +4031,13 @@ EOF eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else 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" - for xlib in $convenience; do - # 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 - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" fi fi - + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" @@ -3768,7 +4067,8 @@ EOF fi fi - if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && + 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 @@ -3787,6 +4087,7 @@ EOF 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. @@ -3796,13 +4097,13 @@ EOF delfiles= last_robj= k=1 - output=$output_objdir/$save_output-${k}.$objext + 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" : ".*"` && + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else @@ -3816,9 +4117,9 @@ EOF # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi - last_robj=$output_objdir/$save_output-${k}.$objext + last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` - output=$output_objdir/$save_output-${k}.$objext + output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi @@ -3838,13 +4139,13 @@ EOF eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi - # Set up a command to remove the reloadale object files + # 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/$save_output-${i}.$objext" + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" @@ -3892,13 +4193,30 @@ EOF IFS="$save_ifs" eval cmd=\"$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 IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + 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 @@ -3968,72 +4286,20 @@ EOF reload_conv_objs= gentop= # 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= if test -n "$convenience"; 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 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" - for xlib in $convenience; do - # 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 - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi @@ -4134,6 +4400,35 @@ EOF ;; 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" finalize_command="$finalize_command $finalize_deplibs" @@ -4178,10 +4473,15 @@ EOF fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac ;; esac done @@ -4295,13 +4595,25 @@ extern \"C\" { # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" + export_symbols="$output_objdir/$outputname.exp" $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 - $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $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 @@ -4352,7 +4664,26 @@ extern \"C\" { #endif /* 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 { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } @@ -4399,16 +4730,29 @@ static const void *lt_preloaded_setup() { esac # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$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. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + case $host in + *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 @@ -4421,19 +4765,19 @@ static const void *lt_preloaded_setup() { # really was required. # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # 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" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" - status=$? + exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then @@ -4441,7 +4785,7 @@ static const void *lt_preloaded_setup() { $run $rm "$output_objdir/${outputname}S.${objext}" fi - exit $status + exit $exit_status fi if test -n "$shlibpath_var"; then @@ -4514,7 +4858,7 @@ static const void *lt_preloaded_setup() { if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" 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 # fast_install is set to needless relink_command= @@ -4551,7 +4895,7 @@ static const void *lt_preloaded_setup() { fi done 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 # Quote $echo for shipping. @@ -4581,10 +4925,12 @@ static const void *lt_preloaded_setup() { esac case $host in *cygwin* | *mingw* ) - cwrappersource=`$echo ${objdir}/lt-${output}.c` - cwrapper=`$echo ${output}.exe` - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + 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 < #include #include +#include +#include +#include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX @@ -4619,15 +4968,19 @@ EOF #endif #ifndef DIR_SEPARATOR -#define 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 +# 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 @@ -4637,17 +4990,32 @@ EOF (((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); -char * basename (const char *name); -char * fnqualify(const char *path); +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, ...); @@ -4657,29 +5025,51 @@ main (int argc, char *argv[]) char **newargz; int i; - program_name = (char *) xstrdup ((char *) basename (argv[0])); + 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 <> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = fnqualify(argv[0]); + 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> $cwrappersource <> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + cat >> $cwrappersource <<"EOF" + return 127; } void * @@ -4699,48 +5089,148 @@ xstrdup (const char *string) ; } -char * -basename (const char *name) +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 (name[0]) && name[1] == ':') + 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 (char *) base; + return base; } -char * -fnqualify(const char *path) +int +check_executable(const char * path) { - size_t size; - char *p; - char tmp[LT_PATHMAX + 1]; + struct stat st; - assert(path != NULL); + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; - /* Is it qualified already? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha (path[0]) && path[1] == ':') - return xstrdup (path); + 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 (IS_DIR_SEPARATOR (path[0])) - return xstrdup (path); +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} - /* prepend the current directory */ - /* doesn't handle '~' */ +/* 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"); - size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ - p = XMALLOC(char, size); - sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); - return p; + 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 * @@ -4784,16 +5274,16 @@ lt_fatal (const char *message, ...) 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 -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + # 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 "\ #! $SHELL @@ -4812,9 +5302,23 @@ EOF Xsed='${SED} -e 1s/^X//' 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 # 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\" @@ -4943,23 +5447,23 @@ else # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} + exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # 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 \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE @@ -4991,71 +5495,73 @@ fi\ if test -n "$addlibs"; then 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" - # Add in members from convenience archives. - for xlib in $addlibs; do - # 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 - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + 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 + + 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\" if len=`expr "X$cmds" : ".*"` && @@ -5069,20 +5575,7 @@ fi\ objlist= concat_cmds= save_oldobjs=$oldobjs - # GNU ar 2.10+ was changed to match POSIX; thus no paths are - # encoded into archives. This makes 'ar r' malfunction in - # this piecewise linking case whenever conflicting object - # names appear in distinct ar calls; check, warn and compensate. - if (for obj in $save_oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 - $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 - AR_FLAGS=cq - fi + # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do @@ -5093,7 +5586,7 @@ fi\ oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*"` && + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else @@ -5151,7 +5644,7 @@ fi\ done # Quote the link command for shipping. 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 @@ -5290,11 +5783,11 @@ relink_command=\"$relink_command\"" # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # 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. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac @@ -5303,14 +5796,14 @@ relink_command=\"$relink_command\"" shift else install_prog= - arg="$nonopt" + arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac @@ -5328,28 +5821,31 @@ relink_command=\"$relink_command\"" do if test -n "$dest"; then files="$files $dest" - dest="$arg" + dest=$arg continue fi case $arg in -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; - -*) ;; - + -*) + ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else - dest="$arg" + dest=$arg continue fi ;; @@ -5358,7 +5854,7 @@ relink_command=\"$relink_command\"" # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac @@ -5493,9 +5989,9 @@ relink_command=\"$relink_command\"" if test -n "$inst_prefix_dir"; then # 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 - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 @@ -5527,11 +6023,14 @@ relink_command=\"$relink_command\"" if test "$#" -gt 0; then # 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 do if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(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 && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi @@ -5544,7 +6043,16 @@ relink_command=\"$relink_command\"" IFS="$save_ifs" eval cmd=\"$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 IFS="$save_ifs" fi @@ -5638,17 +6146,15 @@ relink_command=\"$relink_command\"" notinst_deplibs= relink_command= - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac + # 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. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; esac # Check the variables that should have been set. @@ -5676,38 +6182,25 @@ relink_command=\"$relink_command\"" done relink_command= - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac + # 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. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - save_umask=`umask` - umask 0077 - if $mkdir "$tmpdir"; then - umask $save_umask - else - umask $save_umask - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi + tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # 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" if $run eval "$relink_command"; then : @@ -5727,7 +6220,7 @@ relink_command=\"$relink_command\"" fi # remove .exe since cygwin /usr/bin/install will append another - # one anyways + # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in @@ -5827,7 +6320,7 @@ relink_command=\"$relink_command\"" # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS - $echo "----------------------------------------------------------------------" + $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" @@ -5860,7 +6353,7 @@ relink_command=\"$relink_command\"" $echo $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 "----------------------------------------------------------------------" + $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; @@ -5918,8 +6411,10 @@ relink_command=\"$relink_command\"" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE + if test ! -f "$dir/$dlname"; then + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi fi ;; @@ -5983,12 +6478,12 @@ relink_command=\"$relink_command\"" fi # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi + for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + fi" + done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" @@ -6077,9 +6572,17 @@ relink_command=\"$relink_command\"" rmfiles="$rmfiles $objdir/$n" done 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 # Do each command in the postuninstall commands. cmds=$postuninstall_cmds @@ -6112,7 +6615,8 @@ relink_command=\"$relink_command\"" IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. - fi + ;; + esac fi ;; @@ -6336,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 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -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 - try to export only the symbols matching REGEX + try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened @@ -6352,9 +6856,11 @@ The following components of LINK-COMMAND are treated specially: -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -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]] - 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. @@ -6397,7 +6903,7 @@ esac $echo $echo "Try \`$modename --help' for more information about other modes." -exit $EXIT_SUCCESS +exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting @@ -6411,12 +6917,11 @@ exit $EXIT_SUCCESS # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes +disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` +disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: diff --git a/m4/boinc_check_lib_with.m4 b/m4/boinc_check_lib_with.m4 new file mode 100644 index 0000000000..027b6f9c7b --- /dev/null +++ b/m4/boinc_check_lib_with.m4 @@ -0,0 +1,31 @@ +AC_DEFUN([BOINC_CHECK_LIB_WITH],[ +dnl arguments $1 library name (-l$1) +dnl $2 function name +dnl $3 variable to append LDFLAGS to + AC_LANG_PUSH(C) + _sv_libs="$LIBS" + AC_ARG_WITH([lib$1], + AC_HELP_STRING([--with-lib$1=DIR],[look for the $1 library in DIR]), + [_lib_with=$withval],[_lib_with=no]) + _NEW_LDFLAGS= + if test "x${_lib_with}" != "xno" ; then + if test -d $_lib_with/. ; then + _NEW_LDFLAGS="${_NEW_LDFLAGS} -L${_lib_with}" + LIBS="${LIBS} ${_NEW_LDFLAGS}" + fi + AC_CHECK_LIB([$1],[$2],[_lib_found=yes]) + if test "x${_lib_found}" = "xyes" ; then + if test -f ${_lib_with} ; then + _NEW_LDFLAGS="${_NEW_LDFLAGS} ${_lib_with}" + elif test -h ${_lib_with} -a ! -d ${_lib_with}/. ; then + _NEW_LDFLAGS="${_NEW_LDFLAGS} ${_lib_with}" + else + _NEW_LDFLAGS="${_NEW_LDFLAGS} -l$1" + fi + $3="${$3} ${_NEW_LDFLAGS}" + fi + fi + LIBS="${_sv_libs}" + AC_LANG_POP(C) +]) + diff --git a/m4/boinc_gtk.m4 b/m4/boinc_gtk.m4 new file mode 100644 index 0000000000..9829d92988 --- /dev/null +++ b/m4/boinc_gtk.m4 @@ -0,0 +1,40 @@ + +AC_DEFUN([BOINC_CHECK_GTK],[ + AC_MSG_CHECKING([if wxWidgets uses GTK]) + loc_uses_gtk="`echo $WX_LIBS | grep gtk`" + if test "x${loc_uses_gtk}" = "x" ; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + AC_PATH_PROG(PKGCONFIG,[$mypkgconfig pkg-config]) + AC_MSG_CHECKING([if gtk uses pkg-config]) + gtk_module="`$PKGCONFIG --list-all | egrep '^gtk\+?-' | head -1 | awk '{print $[]1}'`" + if test "x${gtk_module}" != x; then + GTK_CONFIG="$PKGCONFIG ${gtk_module}" + AC_MSG_RESULT([yes]) + else + GTK_CONFIG="no" + AC_MSG_RESULT([no]) + fi + if test "x${GTK_CONFIG}" = "xno" ; then + AC_PATH_PROG(GTK_CONFIG,[gtk-config],no) + fi + if test "x${GTK_CONFIG}" != "xno" ; then + gtk_config_flags="--libs" + GTK_DYNLIBS="`$GTK_CONFIG ${gtk_config_flags}`" + if test "x${enable_client_release}" = "xyes" ; then + gtk_config_flags="--libs --static" + fi + AC_MSG_CHECKING([GTK libraries]) + GTK_LIBS=`$GTK_CONFIG ${gtk_config_flags}` + if test "x$GTK_LIBS" = "x" ; then + GTK_LIBS="$GTK_DYNLIBS" + fi + AC_MSG_RESULT([$GTK_LIBS]) + else + GTK_LIBS= + AC_MSG_RESULT(none) + fi + fi + AC_SUBST([GTK_LIBS]) +]) diff --git a/m4/boinc_wxwidgets.m4 b/m4/boinc_wxwidgets.m4 index cfd4aec17d..6afbe7ad07 100644 --- a/m4/boinc_wxwidgets.m4 +++ b/m4/boinc_wxwidgets.m4 @@ -1,6 +1,13 @@ dnl These functions still require wxWidgets.m4 AC_DEFUN([BOINC_OPTIONS_WXWIDGETS],[ + + AC_ARG_ENABLE(unicode, + AS_HELP_STRING([--enable-unicode/--disable-unicode], + [enable/disable building the manager with unicode support]), + [enable_unicode="$enableval"], + []) + AM_OPTIONS_WXCONFIG AM_PATH_WXCONFIG($1, [_ac_cv_have_wxwidgets=yes], [_ac_cv_have_wxwidgets=no]) AC_CACHE_CHECK([if wxWidgets works],[ac_cv_have_wxwidgets], @@ -38,7 +45,16 @@ WARNING: No static libraries for wxWidgets are installed. ac_cv_wxwidgets_options="${ac_cv_wxwidgets_options} --static=no" fi fi - + wx_default_config="`$WX_CONFIG ${ac_cv_wxwidgets_options} --selected-config`" + if test "x${enable_unicode}" = x ; then + isuc="`echo ${wx_default_config} | grep unicode`" + if test "x${isuc}" = x ; then + enable_unicode=no + else + enable_unicode=yes + fi + fi + if test "x${enable_unicode}" != x ; then if $WX_CONFIG ${ac_cv_wxwidgets_options} --unicode=${enable_unicode} --selected-config 2>&1 >/dev/null ; then ac_cv_wxwidgets_options="${ac_cv_wxwidgets_options} --unicode=${enable_unicode}" @@ -62,7 +78,7 @@ WARNING: No ${uprf} libraries for wxWidgets are installed. ac_cv_wxwidgets_options="${ac_cv_wxwidgets_options}" fi fi - + wx_default_config="`$WX_CONFIG ${ac_cv_wxwidgets_options} --selected-config`" if test "x${enable_wx_debug}" != x ; then if $WX_CONFIG ${ac_cv_wxwidgets_options} --debug=${enable_debug} --selected-config 2>&1 >/dev/null ; then ac_cv_wxwidgets_options="${ac_cv_wxwidgets_options} --debug=${enable_debug}" @@ -87,7 +103,10 @@ WARNING: No ${uprf} libraries for wxWidgets are installed. fi fi ]) - if test "x${am_cv_wxwidgets_options}" != "x" ; then + wx_default_config="`$WX_CONFIG ${ac_cv_wxwidgets_options} --selected-config`" + AC_MSG_CHECKING([wxWidgets config to use]) + AC_MSG_RESULT([$wx_default_config]) + if test "x${ac_cv_wxwidgets_options}" != "x" ; then AM_PATH_WXCONFIG($1, wxWin=1, wxWin=0, ${ac_cv_wxwidgets_options}) fi fi diff --git a/m4/check_ssl.m4 b/m4/check_ssl.m4 index 7b48034804..72a6eb528b 100644 --- a/m4/check_ssl.m4 +++ b/m4/check_ssl.m4 @@ -1,30 +1,70 @@ AC_DEFUN([CHECK_SSL], -[AC_MSG_CHECKING(for openssl) +[ SSLDIR= -found_ssl="no" +SSL_LIBS= +SSL_CFLAGS= +SSL_CXXFLAGS= +AC_ARG_WITH(pkg-config, + AC_HELP_STRING([--with-pkg-config], + [Use pkg-config specified]), + [mypkgconfig="${withval}"] + [mypkgconfig=]) + + +AC_PATH_PROG(PKGCONFIG,[$mypkgconfig pkg-config]) AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl], [Use openssl (in specified installation directory)]), [check_ssl_dir="$withval"], [check_ssl_dir=]) -for dir in $check_ssl_dir ${prefix} /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do - ssldir="$dir" - if test -f "$dir/include/openssl/ssl.h"; then - found_ssl="yes"; - SSLDIR="${ssldir}" - CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"; - CXXFLAGS="$CXXFLAGS -I$ssldir/include -I$ssldir/include/openssl"; - break; - fi - if test -f "$dir/include/ssl.h"; then - found_ssl="yes"; - SSLDIR="${ssldir}" - CFLAGS="$CFLAGS -I$ssldir/include/"; - CXXFLAGS="$CXXFLAGS -I$ssldir/include/"; - break - fi -done +if test "x${PKGCONFIG}" != "x" -a "x${check_ssl_dir}" = "x" ; then + SSLDIR="`${PKGCONFIG} openssl --cflags-only-I | sed -e 's/-I//' -e 's/\/include\/openssl//' -e 's/\/include//' | grep '[a-z]' 2>/dev/null`" + if test "x${SSLDIR}" = "x" ; then + if test -d "/usr/include/openssl" -o -f "/usr/include/ssl.h" ; then + SSLDIR="/usr" + fi + fi + if test "x${enable_client_release}" = "xyes" -o "x${disable_static_linkage}" = "xno" ; then + SSL_LIBS="`${PKGCONFIG} openssl --libs --static 2>/dev/null`" + fi + if test "x${SSL_LIBS}" = "x" ; then + SSL_LIBS="`${PKGCONFIG} openssl --libs 2>/dev/null`" + fi + + + SSL_CFLAGS="`${PKGCONFIG} openssl --cflags 2>/dev/null`" + SSL_CXXFLAGS="${SSL_CFLAGS}" + SSL_CPPFLAGS="${SSL_CFLAGS}" + found_ssl="yes" +fi +if test "x${SSL_LIBS}" = "x" ; then + found_ssl="no" + for dir in $check_ssl_dir ${prefix} /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr /opt/misc /opt/csw /opt/sfw; do + ssldir="$dir" + if test -f "$dir/include/openssl/ssl.h"; then + found_ssl="yes"; + SSLDIR="${ssldir}" + SSL_CFLAGS="-I$ssldir/include -I$ssldir/include/openssl"; + SSL_CXXFLAGS="-I$ssldir/include -I$ssldir/include/openssl"; + SSL_LIBS="-L$ssldir -lssl -lcrypto -ldl -lz" + break; + fi + if test -f "$dir/include/ssl.h"; then + found_ssl="yes" + SSLDIR="${ssldir}" + SSL_CFLAGS="-I$ssldir/include/" + SSL_CXXFLAGS="-I$ssldir/include/" + SSL_LIBS="-L$ssldir -lssl -lcrypto" + break; + fi + done +fi +AC_MSG_CHECKING(for openssl) AC_MSG_RESULT($found_ssl) + +BOINC_CHECK_LIB_WITH([gcrypt],[gcry_randomize],[SSL_LIBS]) +BOINC_CHECK_LIB_WITH([gpg-error],[gpg_strerror], [SSL_LIBS]) + if test x_$found_ssl != x_yes; then AC_MSG_ERROR([ ---------------------------------------------------------------------- @@ -35,11 +75,12 @@ if test x_$found_ssl != x_yes; then ---------------------------------------------------------------------- ]) else - printf "OpenSSL found in $ssldir\n"; - SSL_LIBS="-lssl -lcrypto"; - LDFLAGS="$LDFLAGS -L$ssldir/lib"; + printf "OpenSSL found in $SSLDIR\n"; AC_DEFINE_UNQUOTED([USE_OPENSSL],[1], ["Define to 1 if you want to use the openssl crypto library"]) AC_SUBST(SSLDIR) + AC_SUBST(SSL_CFLAGS) + AC_SUBST(SSL_CXXFLAGS) + AC_SUBST(SSL_LIBS) fi -])dnl +]) diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 index 0a51220239..19d3fe651d 100644 --- a/m4/libcurl.m4 +++ b/m4/libcurl.m4 @@ -95,16 +95,17 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], if test x"$LIBCURL_CPPFLAGS" = "x" ; then LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` fi + if test x"$LIBCURL" = "x" ; then if test "x${disable_static_linkage}" = "xno" ; then if $_libcurl_config --static-libs 2>&1 > /dev/null ; then - LIBCURL="`$_libcurl_config --static-libs` -lgcrypt" + LIBCURL="`$_libcurl_config --static-libs`" fi fi fi if test x"$LIBCURL" = "x" ; then - LIBCURL=`$_libcurl_config --libs` + LIBCURL="`$_libcurl_config --libs`" # This is so silly, but Apple actually has a bug in their # curl-config script. Fixed in Tiger, but there are still @@ -112,7 +113,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], case "${host}" in powerpc-apple-darwin7*) LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` - ;; + ;; esac fi @@ -130,6 +131,40 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], unset _libcurl_wanted fi + # do we need the ldap libraries? + if test "x${_libldap_with}" = "x" -a \ + "x`echo $_libcurl_protocols | grep LDAP`" != x; then + _libldap_with=yes + BOINC_CHECK_LIB_WITH([ldap],[ldap_initialize],[LIBCURL]) + else + _libldap_with=no + fi + + # some curl configs have the ber and ldap libraries in the wrong order, + # so lets add -lber after -lldap. + if test "x`echo $LIBCURL | grep ldap`" != "x" -a \ + "x`echo $LIBCURL | grep lber`" != "x" ; then + AC_CHECK_LIB([lber],[ber_scanf], + LIBCURL="`echo $LIBCURL | sed -e 's/ldap /ldap -llber /'`" + ) + fi + + BOINC_CHECK_LIB_WITH([gnutls],[gnutls_cipher_get],[LIBCURL]) + + BOINC_CHECK_LIB_WITH([sasl2],[sasl_dispose],[LIBCURL]) + + BOINC_CHECK_LIB_WITH([gssglue],[gss_wrap],[LIBCURL]) + if test "${_lib_with}" = yes ; then + LIBCURL="`echo $LIBCURL | sed -e 's/-lgssapi_krb5 / /g'`" + fi + + BOINC_CHECK_LIB_WITH([gssapi_krb5],[gss_wrap],[LIBCURL]) + if test "${_lib_with}" = yes ; then + LIBCURL="`echo $LIBCURL | sed -e 's/-lgssglue / /g'`" + fi + + BOINC_CHECK_LIB_WITH([gss],[gss_wrap],[LIBCURL]) + if test $_libcurl_try_link = yes ; then # we didn't find curl-config, so let's see if the user-supplied diff --git a/m4/sah_check_lib.m4 b/m4/sah_check_lib.m4 index ff40cad1bc..8dd3a3e13e 100644 --- a/m4/sah_check_lib.m4 +++ b/m4/sah_check_lib.m4 @@ -25,7 +25,6 @@ AC_DEFUN([SAH_CHECK_LIB],[ - AC_DEFUN([SAH_CHECK_LDFLAG],[ sv_ldflags="${LDFLAGS}" AC_MSG_CHECKING(if compiler works with $1 flag) @@ -55,51 +54,60 @@ AC_DEFUN([SAH_LINKAGE_FLAGS],[ ld_dynamic_option="" LD_EXPORT_DYNAMIC="" else - if test -z "${ld_static_option}" + if test -z "${ld_static_option}" && test -z "${using_libtool}" then - case $target in - *linux* | *solaris* | *cygwin* ) - AC_MSG_CHECKING([${CC} flags for static linkage ...]) - ld_static_option="-Wl,-Bstatic" - AC_MSG_RESULT($ld_static_option) - AC_MSG_CHECKING([${CC} flags for dynamic linkage ...]) - ld_dynamic_option="-Wl,-Bdynamic" - AC_MSG_RESULT($ld_dynamic_option) - ;; - *darwin* ) - AC_MSG_CHECKING([${CC} flags for static linkage ...]) - ld_static_option="-static" - AC_MSG_RESULT($ld_static_option) - AC_MSG_CHECKING([${CC} flags for dynamic linkage ...]) - ld_dynamic_option="-dynamic" - AC_MSG_RESULT($ld_dynamic_option) - ;; - *) - if test -z "${dummy_ld_variable_gfdsahjf}" - then - dummy_ld_variable_gfdsahjf="been there done that" + AC_MSG_CHECKING([if we are using libtool]) + if test "x$lt_cv_path_LD" != "x" ; then + AC_MSG_RESULT(yes) + using_libtool=yes + ld_static_option="-static-libtool-libs" + else + AC_MSG_RESULT(no) + using_libtool=no + case $target in + *linux* | *solaris* | *cygwin* ) AC_MSG_CHECKING([${CC} flags for static linkage ...]) - AC_MSG_RESULT(unknown) + ld_static_option="-Wl,-Bstatic" + AC_MSG_RESULT($ld_static_option) AC_MSG_CHECKING([${CC} flags for dynamic linkage ...]) - AC_MSG_RESULT(unknown) - fi - ;; - esac - AC_MSG_CHECKING([${CC} flags for exporting dynamic symbols from an executable ...]) - case $target in - *cygwin*) - LD_EXPORT_DYNAMIC="-Wl,--export-all-symbols" - AC_MSG_RESULT(${LD_EXPORT_DYNAMIC}) - ;; - *linux*) - AC_MSG_RESULT(-rdynamic) - LD_EXPORT_DYNAMIC="-rdynamic" - ;; - *) - AC_MSG_RESULT(none required) - LD_EXPORT_DYNAMIC= - ;; - esac + ld_dynamic_option="-Wl,-Bdynamic" + AC_MSG_RESULT($ld_dynamic_option) + ;; + *darwin* ) + AC_MSG_CHECKING([${CC} flags for static linkage ...]) + ld_static_option="-static" + AC_MSG_RESULT($ld_static_option) + AC_MSG_CHECKING([${CC} flags for dynamic linkage ...]) + ld_dynamic_option="-dynamic" + AC_MSG_RESULT($ld_dynamic_option) + ;; + *) + if test -z "${dummy_ld_variable_gfdsahjf}" + then + dummy_ld_variable_gfdsahjf="been there done that" + AC_MSG_CHECKING([${CC} flags for static linkage ...]) + AC_MSG_RESULT(unknown) + AC_MSG_CHECKING([${CC} flags for dynamic linkage ...]) + AC_MSG_RESULT(unknown) + fi + ;; + esac + AC_MSG_CHECKING([${CC} flags for exporting dynamic symbols from an executable ...]) + case $target in + *cygwin*) + LD_EXPORT_DYNAMIC="-Wl,--export-all-symbols" + AC_MSG_RESULT(${LD_EXPORT_DYNAMIC}) + ;; + *linux*) + AC_MSG_RESULT(-rdynamic) + LD_EXPORT_DYNAMIC="-rdynamic" + ;; + *) + AC_MSG_RESULT(none required) + LD_EXPORT_DYNAMIC= + ;; + esac + fi fi fi if test -z "${LIBEXT}"; @@ -145,30 +153,40 @@ AC_CACHE_CHECK([$tmp_msg], else sah_static_checklibs="lib$1.${LIBEXT} $1.${LIBEXT} -l$1" fi + if test "${using_libtool}" = "yes" ; then + echo ac_link=$ac_link + ac_sv_link="$ac_link" + ac_link="./libtool --mode=link ${ac_link}" + sah_static_checklibs="lib$1.la $1.la ${sah_static_checklibs}" + fi sah_save_libs="${LIBS}" for libname in ${sah_static_checklibs} do SAH_FIND_STATIC_LIB(${libname}) - if test -n "${tmp_lib_name}" - then - LIBS="${tmp_lib_name} $5 ${sah_save_libs}" - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #define CONFIG_TEST 1 - #ifdef __cplusplus - extern "C" { - #endif - char $2 (); - #ifdef __cplusplus - } - #endif - ]], - [ $2 (); ])], - [ - tmp_res="${tmp_lib_name}" - ] - ) - fi +dnl if test -z "`echo $tmp_lib_name | grep \\.la$`" ; then + if test -n "${tmp_lib_name}" + then + LIBS="${tmp_lib_name} $5 ${sah_save_libs}" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #define CONFIG_TEST 1 + #ifdef __cplusplus + extern "C" { + #endif + char $2 (); + #ifdef __cplusplus + } + #endif + ]], + [ $2 (); ])], + [ + tmp_res="${tmp_lib_name}" + ] + ) + fi +dnl else +dnl tmp_res="-l$1" +dnl fi if test "${tmp_res}" != "no" then break @@ -178,6 +196,9 @@ AC_CACHE_CHECK([$tmp_msg], eval ${varname}='"'${tmp_res}'"' eval ${var2}='"'${tmp_res}'"' ]) + if test "${using_libtool}" = "yes" ; then + ac_link="$ac_sv_link" + fi # # save the result for use by the caller sah_static_lib_last="`eval echo '${'$varname'}'`" @@ -225,6 +246,12 @@ AC_CACHE_CHECK([$tmp_msg], else sah_dynamic_checklibs="-l$1" fi + if test "${using_libtool}" = "yes" ; then + echo ac_link=$ac_link + ac_sv_link="$ac_link" + ac_link="./libtool --mode=link ${ac_link}" + sah_dynamic_checklibs="lib$1.la $1.la ${sah_dynamic_checklibs}" + fi sah_save_libs="${LIBS}" for libname in ${sah_dynamic_checklibs} do @@ -268,6 +295,9 @@ AC_CACHE_CHECK([$tmp_msg], ]) fi done + if test "${using_libtool}" = "yes" ; then + ac_link="${ac_sv_link}" + fi LIBS="${sah_save_libs}" eval ${varname}='"'${tmp_res}'"' eval ${var2}='"'${tmp_res}'"' @@ -342,6 +372,7 @@ fi gcc_version=`${CC} -v 2>&1 | grep "gcc version" | $AWK '{print $[]3}'` + for gcc_host in `${CC} -v 2>&1 | grep host` --host=${ac_cv_target} do if test -n "`echo x$gcc_host | grep x--host=`" @@ -362,6 +393,26 @@ do fi done +mydir=`pwd` +tmpgcc_libpath= + +for dirs in `${CC} -print-search-dirs 2>&1 | grep libraries | sed -e 's/:/ /g' -e 's/=/ /g'` +do + if test -d $dirs/. && cd $dirs 2>&1 >/dev/null ; then + nowdir=`pwd` + if test -n "${tmpgcc_libpath}" ; then + tmpgcc_libpath="${tmpgcc_libpath}:${nowdir}" + else + tmpgcc_libpath="${dirs}" + fi + fi + cd $mydir +done +cd $mydir +if test -n "${tmpgcc_libpath}" ; then + tmp_libpath="${tmpgcc_libpath}:${tmp_libpath}" +fi + # now lets add any directories in LIBS or LDFLAGS tmp_more_dirs=`echo $LIBS $LDFLAGS | $AWK '{for (i=1;i<(NF+1);i++) { printf("x%s\n",$[]i); }}' | grep x-L | sed 's/x-L//' | $AWK '{printf("%s:",$[]1);}'` tmp_libpath="${tmp_more_dirs}${tmp_libpath}" diff --git a/sea/Makefile.am b/packages/generic/sea/Makefile.am similarity index 53% rename from sea/Makefile.am rename to packages/generic/sea/Makefile.am index 166e1c54e8..901910ac77 100644 --- a/sea/Makefile.am +++ b/packages/generic/sea/Makefile.am @@ -5,44 +5,38 @@ vers = \ @BOINC_MAJOR_VERSION@.@BOINC_MINOR_VERSION@.@BOINC_RELEASE@_@boinc_platform@ sea = boinc_$(vers).sh tarfiles = BOINC/boinc BOINC/boincmgr BOINC/boinccmd BOINC/binstall.sh\ + BOINC/libboinc*.so* BOINC/boincmgr.16x16.png BOINC/boincmgr.32x32.png BOINC/boincmgr.48x48.png \ BOINC/libcudart.so BOINC/ca-bundle.crt -sea_debug = boinc_$(vers)_debug.sh -tarfiles_debug = BOINC_debug/boinc.unmodified BOINC_debug/boincmgr.unmodified\ - BOINC_debug/boinccmd.unmodified BOINC_debug/binstall.sh\ - BOINC_debug/boincmgr.16x16.png BOINC_debug/boincmgr.32x32.png\ - BOINC_debug/boincmgr.48x48.png \ - BOINC_debug/libcudart.so BOINC_debug/ca-bundle.crt - -all: $(sea) $(sea_debug) +all: $(sea) $(top_builddir)/stage # WARNING: WHAT FOLLOWS IS 'FRAGILE'. DO NOT REPLACE # TABS WITH SPACES! +$(top_builddir)/stage: + cd $(top_builddir) ; make stage + $(sea): sea.tar make-sea.sh Makefile ./make-sea.sh sea.tar $(sea) BOINC/binstall.sh -$(sea_debug): sea_debug.tar make-sea.sh Makefile - ./make-sea.sh sea_debug.tar $(sea_debug) BOINC_debug/binstall.sh - sea.tar: $(tarfiles) ./make-tar.sh -sea_debug.tar: $(tarfiles_debug) - ./make-tar_debug.sh +BOINC/boinc: $(top_builddir)/stage/$(bindir)/boinc BOINC + cp $(top_builddir)/stage/$(bindir)/boinc BOINC/boinc -BOINC/boinc: ../client/boinc BOINC - cp ../client/boinc BOINC/boinc +BOINC/libboinc*.so*: + cp -P $(top_builddir)/stage/$(libdir)/libboinc*.so* BOINC -BOINC/boincmgr: ../clientgui/boincmgr BOINC - cp ../clientgui/boincmgr BOINC/boincmgr +BOINC/boincmgr: $(top_builddir)/stage/$(bindir)/boincmgr BOINC + cp $(top_builddir)/stage/$(bindir)/boincmgr BOINC/boincmgr -BOINC/boinccmd: ../lib/boinccmd BOINC - cp ../lib/boinccmd BOINC/boinccmd +BOINC/boinccmd: $(top_builddir)/stage/$(bindir)/boinccmd BOINC + cp $(top_builddir)/stage/$(bindir)/boinccmd BOINC/boinccmd -BOINC/libcudart.so: ../coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC - cp ../coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC/libcudart.so +BOINC/libcudart.so: $(top_builddir)/coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC + cp $(top_builddir)/coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC/libcudart.so BOINC/boincmgr.16x16.png: boincmgr.16x16.png cp boincmgr.16x16.png BOINC/boincmgr.16x16.png @@ -50,20 +44,20 @@ BOINC/boincmgr.32x32.png: boincmgr.32x32.png cp boincmgr.32x32.png BOINC/boincmgr.32x32.png BOINC/boincmgr.48x48.png: boincmgr.48x48.png cp boincmgr.48x48.png BOINC/boincmgr.48x48.png -BOINC/ca-bundle.crt: ../curl/ca-bundle.crt - cp ../curl/ca-bundle.crt BOINC/ca-bundle.crt +BOINC/ca-bundle.crt: $(top_builddir)/curl/ca-bundle.crt + cp $(top_builddir)/curl/ca-bundle.crt BOINC/ca-bundle.crt -BOINC_debug/boinc.unmodified: ../client/boinc.unmodified BOINC_debug - cp ../client/boinc.unmodified BOINC_debug/boinc.unmodified +BOINC_debug/boinc.unmodified: $(top_builddir)/stage/$(bindir)/boinc.unmodified BOINC_debug + cp $(top_builddir)/stage/$(bindir)/boinc.unmodified BOINC_debug/boinc.unmodified -BOINC_debug/boincmgr.unmodified: ../clientgui/boincmgr.unmodified BOINC_debug - cp ../clientgui/boincmgr.unmodified BOINC_debug/boincmgr.unmodified +BOINC_debug/boincmgr.unmodified: $(top_builddir)/stage/$(bindir)/boincmgr.unmodified BOINC_debug + cp $(top_builddir)/stage/$(bindir)/boincmgr.unmodified BOINC_debug/boincmgr.unmodified -BOINC_debug/boinccmd.unmodified: ../lib/boinccmd.unmodified BOINC_debug - cp ../lib/boinccmd.unmodified BOINC_debug/boinccmd.unmodified +BOINC_debug/boinccmd.unmodified: $(top_builddir)/lib/boinccmd.unmodified BOINC_debug + cp $(top_builddir)/lib/boinccmd.unmodified BOINC_debug/boinccmd.unmodified -BOINC_debug/libcudart.so: ../coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC_debug - cp ../coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC_debug/libcudart.so +BOINC_debug/libcudart.so: $(top_builddir)/coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC_debug + cp $(top_builddir)/coprocs/CUDA/posix/@boinc_platform@/libcudart.so BOINC_debug/libcudart.so BOINC_debug/boincmgr.16x16.png: boincmgr.16x16.png cp boincmgr.16x16.png BOINC_debug/boincmgr.16x16.png @@ -71,8 +65,8 @@ BOINC_debug/boincmgr.32x32.png: boincmgr.32x32.png cp boincmgr.32x32.png BOINC_debug/boincmgr.32x32.png BOINC_debug/boincmgr.48x48.png: boincmgr.48x48.png cp boincmgr.48x48.png BOINC_debug/boincmgr.48x48.png -BOINC_debug/ca-bundle.crt: ../curl/ca-bundle.crt - cp ../curl/ca-bundle.crt BOINC_debug/ca-bundle.crt +BOINC_debug/ca-bundle.crt: $(top_builddir)/curl/ca-bundle.crt + cp $(top_builddir)/curl/ca-bundle.crt BOINC_debug/ca-bundle.crt BOINC/binstall.sh: BOINC Makefile echo 'cd BOINC &&\ diff --git a/sea/boincmgr.16x16.png b/packages/generic/sea/boincmgr.16x16.png similarity index 100% rename from sea/boincmgr.16x16.png rename to packages/generic/sea/boincmgr.16x16.png diff --git a/sea/boincmgr.32x32.png b/packages/generic/sea/boincmgr.32x32.png similarity index 100% rename from sea/boincmgr.32x32.png rename to packages/generic/sea/boincmgr.32x32.png diff --git a/sea/boincmgr.48x48.png b/packages/generic/sea/boincmgr.48x48.png similarity index 100% rename from sea/boincmgr.48x48.png rename to packages/generic/sea/boincmgr.48x48.png diff --git a/sea/insecure.sh b/packages/generic/sea/insecure.sh similarity index 100% rename from sea/insecure.sh rename to packages/generic/sea/insecure.sh diff --git a/sea/make-sea.sh b/packages/generic/sea/make-sea.sh similarity index 100% rename from sea/make-sea.sh rename to packages/generic/sea/make-sea.sh diff --git a/sea/make-tar.sh b/packages/generic/sea/make-tar.sh similarity index 100% rename from sea/make-tar.sh rename to packages/generic/sea/make-tar.sh diff --git a/sea/make-tar_debug.sh b/packages/generic/sea/make-tar_debug.sh similarity index 100% rename from sea/make-tar_debug.sh rename to packages/generic/sea/make-tar_debug.sh diff --git a/sea/secure.sh b/packages/generic/sea/secure.sh similarity index 100% rename from sea/secure.sh rename to packages/generic/sea/secure.sh diff --git a/samples/example_app/Makefile b/samples/example_app/Makefile index 87fbb13af1..f4455e935d 100644 --- a/samples/example_app/Makefile +++ b/samples/example_app/Makefile @@ -42,6 +42,8 @@ clean: distclean: /bin/rm -f $(PROGS) *.o libstdc++.a +install: uc2 + uc2: uc2.o libstdc++.a $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc.a $(CXX) $(CXXFLAGS) -o uc2 uc2.o libstdc++.a -pthread -lboinc_api -lboinc diff --git a/sched/Makefile.am b/sched/Makefile.am index fdac72a7bc..7907b9a0b1 100644 --- a/sched/Makefile.am +++ b/sched/Makefile.am @@ -3,6 +3,73 @@ include $(top_srcdir)/Makefile.incl +AM_CPPFLAGS += $(MYSQL_CFLAGS) $(PTHREAD_CFLAGS) + +if ENABLE_LIBRARIES + +libsched_sources = \ + sched_shmem.cpp \ + sched_util.cpp \ + sched_config.cpp \ + sched_msgs.cpp \ + ../db/boinc_db.cpp \ + ../db/db_base.cpp \ + ../tools/process_result_template.cpp \ + ../tools/backend_lib.cpp + +lib_LTLIBRARIES = libsched.la +libsched_la_SOURCES = $(libsched_sources) +libsched_la_CFLAGS = $(AM_CPPFLAGS) +libsched_la_CXXFLAGS = $(AM_CPPFLAGS) +libsched_la_LDFLAGS= -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +libsched_la_LIBADD= + +## install only headers that are meant for exporting the API !! +if INSTALL_HEADERS +pkginclude_HEADERS = \ + sched_config.h \ + sched_msgs.h \ + sched_util.h \ + ../tools/backend_lib.h \ + validate_util.h +endif +# end of "if INSTALL_HEADERS + +if ENABLE_FCGI + +lib_LTLIBRARIES += libsched_fcgi.la +libsched_fcgi_la_SOURCES = $(libsched_sources) +libsched_fcgi_la_CFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS) +libsched_fcgi_la_CXXFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS) +libsched_fcgi_la_LDFLAGS= -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +libsched_fcgi_la_LIBADD= + +endif +# end of "if ENABLE_FCGI" + +if BUILD_STATIC_LIBS +all_local = libsched.a +if ENABLE_FCGI +all_local += libsched_fcgi.a +endif +endif + +all-local: $(all_local) + +libsched.a: libsched.la + rm -f libsched.a + ln .libs/libsched.a + +libsched_fcgi.a: libsched_fcgi.la + rm -f libsched_fcgi.a + ln .libs/libsched_fcgi.a + + +endif +# end of "if ENABLE_LIBRARIES + +if ENABLE_SERVER + noinst_PROGRAMS = \ census \ cgi \ @@ -15,7 +82,7 @@ noinst_PROGRAMS = \ get_file \ make_work \ message_handler \ - pymw_assimilator \ + pymw_assimilator \ request_file_list \ sample_assimilator \ sample_dummy_assimilator \ @@ -31,31 +98,11 @@ noinst_PROGRAMS = \ update_stats \ wu_check -lib_LIBRARIES = libsched.a - -EXTRA_PROGRAMS = fcgi \ - fcgi_file_upload_handler - # scripts that 'make install' should put in bindir bin_SCRIPTS = start stop status -LDADD = $(LIBSCHED) $(LIBBOINC) $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS) -AM_CXXFLAGS = $(MYSQL_CFLAGS) - -libsched_a_SOURCES = \ - sched_shmem.cpp \ - sched_util.cpp \ - sched_config.cpp \ - sched_msgs.cpp \ - ../db/boinc_db.cpp \ - ../db/db_base.cpp \ - ../lib/msg_log.cpp \ - ../tools/process_result_template.cpp \ - ../tools/backend_lib.cpp - EXTRA_DIST = \ assimilate_handler.h \ - fcgiapp.h \ handle_request.h \ main.h \ sched_locality.h \ @@ -64,8 +111,7 @@ EXTRA_DIST = \ server_types.h \ start - -cgi_SOURCES = \ +cgi_sources = \ edf_sim.cpp \ handle_request.cpp \ hr.cpp \ @@ -81,21 +127,16 @@ cgi_SOURCES = \ sched_send.cpp \ sched_timezone.cpp \ server_types.cpp \ - time_stats_log.cpp \ - ../lib/synch.cpp + time_stats_log.cpp + +cgi_SOURCES = $(cgi_sources) +cgi_LDADD = $(SERVERLIBS) census_SOURCES = \ census.cpp \ hr.cpp \ hr_info.cpp - -## install only headers that are meant for exporting the API !! -pkginclude_HEADERS = \ - sched_config.h \ - sched_msgs.h \ - sched_util.h \ - ../tools/backend_lib.h \ - validate_util.h +census_LDADD = $(SERVERLIBS) feeder_SOURCES = \ @@ -103,112 +144,98 @@ feeder_SOURCES = \ hr.cpp \ hr_info.cpp \ ../lib/synch.cpp +feeder_LDADD = $(SERVERLIBS) wu_check_SOURCES = wu_check.cpp +wu_check_LDADD = $(SERVERLIBS) show_shmem_SOURCES = show_shmem.cpp +show_shmem_LDADD = $(SERVERLIBS) file_deleter_SOURCES = file_deleter.cpp +file_deleter_LDADD = $(SERVERLIBS) sample_bitwise_validator_SOURCES = validator.cpp sample_bitwise_validator.cpp validate_util.cpp validate_util.h validate_util2.cpp +sample_bitwise_validator_LDADD = $(SERVERLIBS) sample_trivial_validator_SOURCES = validator.cpp sample_trivial_validator.cpp validate_util.cpp validate_util.h validate_util2.cpp +sample_trivial_validator_LDADD = $(SERVERLIBS) sample_dummy_assimilator_SOURCES = assimilator.cpp sample_dummy_assimilator.cpp validate_util.cpp validate_util.h +sample_dummy_assimilator_LDADD = $(SERVERLIBS) sample_assimilator_SOURCES = assimilator.cpp sample_assimilator.cpp validate_util.cpp validate_util.h +sample_assimilator_LDADD = $(SERVERLIBS) pymw_assimilator_SOURCES = assimilator.cpp pymw_assimilator.cpp validate_util.cpp validate_util.h -pymw_assimilator_DEPENDENCIES = $(LIB_SCHED) +pymw_assimilator_LDADD = $(SERVERLIBS) single_job_assimilator_SOURCES = assimilator.cpp single_job_assimilator.cpp validate_util.cpp validate_util.h +single_job_assimilator_LDADD = $(SERVERLIBS) sample_work_generator_SOURCES = sample_work_generator.cpp +sample_work_generator_LDADD = $(SERVERLIBS) db_dump_SOURCES = db_dump.cpp +db_dump_LDADD = $(SERVERLIBS) db_purge_SOURCES = db_purge.cpp +db_purge_LDADD = $(SERVERLIBS) trickle_handler_SOURCES = trickle_handler.cpp +trickle_handler_LDADD = $(SERVERLIBS) update_stats_SOURCES = update_stats.cpp +update_stats_LDADD = $(SERVERLIBS) file_upload_handler_SOURCES = file_upload_handler.cpp +file_upload_handler_LDADD = $(SERVERLIBS) make_work_SOURCES = make_work.cpp +make_work_LDADD = $(SERVERLIBS) transitioner_SOURCES = transitioner.cpp +transitioner_LDADD = $(SERVERLIBS) message_handler_SOURCES = message_handler.cpp +message_handler_LDADD = $(SERVERLIBS) request_file_list_SOURCES = request_file_list.cpp +request_file_list_LDADD = $(SERVERLIBS) get_file_SOURCES = get_file.cpp +get_file_LDADD = $(SERVERLIBS) send_file_SOURCES = send_file.cpp +send_file_LDADD = $(SERVERLIBS) delete_file_SOURCES = delete_file.cpp +delete_file_LDADD = $(SERVERLIBS) sched_driver_SOURCES = sched_driver.cpp +sched_driver_LDADD = $(SERVERLIBS) -# N.B.: the FCGI scheduler can't use lib/libboinc.a; -# it needs to have specially compiled versions of everything -# because its stdio is different -fcgi_SOURCES = \ - handle_request.cpp \ - hr.cpp \ - hr_info.cpp \ - main.cpp \ - sched_array.cpp \ - sched_assign.cpp \ - sched_config.cpp \ - sched_hr.cpp \ - sched_locality.cpp \ - sched_msgs.cpp \ - sched_resend.cpp \ - sched_result.cpp \ - sched_plan.cpp \ - sched_send.cpp \ - sched_shmem.cpp \ - sched_timezone.cpp \ - sched_util.cpp \ - server_types.cpp \ - time_stats_log.cpp \ - edf_sim.cpp \ - ../db/boinc_db.cpp \ - ../db/db_base.cpp \ - ../lib/base64.cpp \ - ../lib/boinc_fcgi.cpp \ - ../lib/coproc.cpp \ - ../lib/crypt.cpp \ - ../lib/filesys.cpp \ - ../lib/md5.c \ - ../lib/md5_file.cpp \ - ../lib/miofile.cpp \ - ../lib/msg_log.cpp \ - ../lib/parse.cpp \ - ../lib/shmem.cpp \ - ../lib/synch.cpp \ - ../lib/str_util.cpp \ - ../lib/util.cpp \ - ../tools/process_result_template.cpp \ - ../tools/backend_lib.cpp +if ENABLE_FCGI + +noinst_PROGRAMS += fcgi \ + fcgi_file_upload_handler + +fcgi_SOURCES = $(cgi_sources) +fcgi_CPPFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS) +fcgi_LDADD = $(SERVERLIBS_FCGI) -fcgi_CPPFLAGS = -D_USING_FCGI_ -include boinc_fcgi.h $(AM_CPPFLAGS) -fcgi_LDADD = -lfcgi $(MYSQL_LIBS) fcgi_file_upload_handler_SOURCES = \ file_upload_handler.cpp \ sched_config.cpp \ - sched_msgs.cpp \ - ../lib/boinc_fcgi.cpp \ - ../lib/miofile.cpp \ - ../lib/msg_log.cpp \ - ../lib/parse.cpp \ - ../lib/crypt.cpp + sched_msgs.cpp +fcgi_file_upload_handler_CPPFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS) +fcgi_file_upload_handler_LDADD = $(SERVERLIBS_FCGI) -fcgi_file_upload_handler_CPPFLAGS = -D_USING_FCGI_ -include boinc_fcgi.h $(AM_CPPFLAGS) -fcgi_file_upload_handler_LDADD = $(LDADD) -lfcgi +endif +# end of "if ENABLE_FCGI" +endif +# end of "if ENABLE_SERVER" .PHONY: PHONY-start diff --git a/sched/edf_sim.cpp b/sched/edf_sim.cpp index b469d1f068..691d6e1289 100644 --- a/sched/edf_sim.cpp +++ b/sched/edf_sim.cpp @@ -15,22 +15,25 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -#include -#include -#include -#include +#include "config.h" -#ifdef _USING_FCGI_ -#include "boinc_fcgi.h" -#endif - -#ifdef SIM -#include -#else +#ifndef SIM #include "sched_config.h" #include "sched_msgs.h" #endif +#ifndef _USING_FCGI_ +#include +#else +#include "boinc_fcgi.h" +#endif + +#include +#include +#include +#include + + #include "edf_sim.h" using std::vector; diff --git a/sched/file_upload_handler.cpp b/sched/file_upload_handler.cpp index 56332a0256..92705aa91d 100644 --- a/sched/file_upload_handler.cpp +++ b/sched/file_upload_handler.cpp @@ -20,7 +20,11 @@ // #include "config.h" +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#else #include +#endif #include #include #include @@ -40,9 +44,6 @@ #include "sched_config.h" #include "sched_util.h" -#ifdef _USING_FCGI_ -#include "boinc_fcgi.h" -#endif #include "sched_msgs.h" #define ERR_TRANSIENT true diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index e98ad27a1e..ddc7f69f65 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -18,8 +18,12 @@ // Handle a scheduling server RPC #include "config.h" -#include +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#else #include +#endif +#include #include #include #include @@ -55,9 +59,6 @@ using namespace std; #include "sched_result.h" #include "time_stats_log.h" -#ifdef _USING_FCGI_ -#include "boinc_fcgi.h" -#endif // find the user's most recently-created host with given various characteristics // diff --git a/sched/main.cpp b/sched/main.cpp index 85f177aea4..2ccf20ecbb 100644 --- a/sched/main.cpp +++ b/sched/main.cpp @@ -51,6 +51,7 @@ using namespace std; #include "shmem.h" #include "util.h" #include "str_util.h" +#include "synch.h" #include "sched_config.h" #include "server_types.h" diff --git a/sched/sched_assign.cpp b/sched/sched_assign.cpp index 3fb13bc311..f983edf3a1 100644 --- a/sched/sched_assign.cpp +++ b/sched/sched_assign.cpp @@ -14,6 +14,14 @@ // // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . +// +#include "config.h" + +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#else +#include +#endif #include diff --git a/sched/sched_msgs.cpp b/sched/sched_msgs.cpp index d8c267a4ac..4b4906267e 100644 --- a/sched/sched_msgs.cpp +++ b/sched/sched_msgs.cpp @@ -57,7 +57,11 @@ void SCHED_MSG_LOG::close() { } } +#ifndef _USING_FCGI_ void SCHED_MSG_LOG::redirect(FILE* f) { +#else +void SCHED_MSG_LOG::redirect(FCGI_FILE* f) { +#endif close(); output = f; } diff --git a/sched/sched_msgs.h b/sched/sched_msgs.h index 56c569cd33..f08aed0216 100644 --- a/sched/sched_msgs.h +++ b/sched/sched_msgs.h @@ -37,7 +37,7 @@ public: void set_indent_level(const int new_indent_level); #ifdef _USING_FCGI_ ~SCHED_MSG_LOG(); - void redirect(FILE* f); + void redirect(FCGI_FILE* f); void close(); void flush(); #endif diff --git a/sched/sched_send.cpp b/sched/sched_send.cpp index cbb90b16b3..3840745824 100644 --- a/sched/sched_send.cpp +++ b/sched/sched_send.cpp @@ -34,6 +34,7 @@ using namespace std; #include "parse.h" #include "util.h" #include "str_util.h" +#include "synch.h" #include "server_types.h" #include "sched_shmem.h" diff --git a/sched/sched_shmem.cpp b/sched/sched_shmem.cpp index c4a1e2dfa1..f7e5e73723 100644 --- a/sched/sched_shmem.cpp +++ b/sched/sched_shmem.cpp @@ -31,13 +31,14 @@ using std::vector; #include "boinc_db.h" #include "error_numbers.h" +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#endif + #include "sched_shmem.h" #include "sched_util.h" #include "sched_msgs.h" -#ifdef _USING_FCGI_ -#include "boinc_fcgi.h" -#endif void SCHED_SHMEM::init(int nwu_results) { int size = sizeof(SCHED_SHMEM) + nwu_results*sizeof(WU_RESULT); diff --git a/sched/sched_shmem.h b/sched/sched_shmem.h index 341759aff9..4890d1d13c 100644 --- a/sched/sched_shmem.h +++ b/sched/sched_shmem.h @@ -96,7 +96,11 @@ struct SCHED_SHMEM { int scan_tables(); bool no_work(int pid); void restore_work(int pid); +#ifndef _USING_FCGI_ void show(FILE*); +#else + void show(FCGI_FILE*); +#endif APP* lookup_app(int); APP_VERSION* lookup_app_version(int appid, int platform); diff --git a/tools/Makefile.am b/tools/Makefile.am index 2ccf2a91e1..cb7577fc5b 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -5,17 +5,16 @@ bin_PROGRAMS = create_work sign_executable dir_hier_path dir_hier_move EXTRA_DIST = make_project xadd update_versions dbcheck_files_exist upgrade makelog.sh cleanlogs.sh vote_monitor calculate_credit_multiplier -LDADD = $(LIBSCHED) $(LIBBOINC) $(RSA_LIBS) $(MYSQL_LIBS) -AM_CXXFLAGS = $(MYSQL_CFLAGS) +AM_CXXFLAGS += $(MYSQL_CFLAGS) -create_work_SOURCES = \ - create_work.cpp +create_work_SOURCES = create_work.cpp +create_work_LDADD = $(SERVERLIBS) -sign_executable_SOURCES = \ - sign_executable.cpp +sign_executable_SOURCES = sign_executable.cpp +sign_executable_LDADD = $(SERVERLIBS) -dir_hier_path_SOURCES = \ - dir_hier_path.cpp +dir_hier_path_SOURCES = dir_hier_path.cpp +dir_hier_path_LDADD = $(SERVERLIBS) -dir_hier_move_SOURCES = \ - dir_hier_move.cpp +dir_hier_move_SOURCES = dir_hier_move.cpp +dir_hier_move_LDADD = $(SERVERLIBS) diff --git a/tools/backend_lib.cpp b/tools/backend_lib.cpp index e7652a8d16..9feab873f1 100644 --- a/tools/backend_lib.cpp +++ b/tools/backend_lib.cpp @@ -16,6 +16,11 @@ // along with BOINC. If not, see . #include "config.h" +#ifdef _USING_FCGI_ +#include "boinc_fcgi.h" +#else +#include +#endif #include #include #include @@ -26,6 +31,7 @@ #include #include + #include "boinc_db.h" #include "crypt.h" #include "error_numbers.h" @@ -39,11 +45,6 @@ #include "backend_lib.h" -#ifdef _USING_FCGI_ -#include "boinc_fcgi.h" -#else -#define FCGI_ToFILE(x) (x) -#endif using std::string; diff --git a/zip/Makefile.am b/zip/Makefile.am index 5a93217014..d850270142 100644 --- a/zip/Makefile.am +++ b/zip/Makefile.am @@ -3,16 +3,18 @@ ## note: -D flags taken from a zip config build under Linux +include ../Makefile.incl + SUBDIRS = zip unzip -AM_CPPFLAGS = -I$(top_srcdir)/zlib -I$(top_srcdir)/lib -I$(top_srcdir)/zip -I$(top_srcdir)/zip/zip -I$(top_srcdir)/zip/unzip -DUNIX -DDLL - -##noinst_PROGRAMS = test -lib_LIBRARIES = libboinc_zip.a +AM_CPPFLAGS += -I$(top_srcdir)/zlib -I$(top_srcdir)/lib -I$(top_srcdir)/zip -I$(top_srcdir)/zip/zip -I$(top_srcdir)/zip/unzip -DUNIX -DDLL +if INSTALL_HEADERS pkginclude_HEADERS = boinc_zip.h +endif -libboinc_zip_a_SOURCES = boinc_zip.cpp \ +libboinc_zip_sources = \ +boinc_zip.cpp \ ./unzip/apihelp.c \ ./unzip/crc32.c \ ./unzip/crctab.c \ @@ -42,6 +44,23 @@ libboinc_zip_a_SOURCES = boinc_zip.cpp \ ./zip/unix/z_unix.c \ ./unzip/unix/unix.c -##test_SOURCES = test.c -##test_LDADD = boinc_zip -##g++ -o test -DHAVE_DIRENT_H -I./ test.c ../lib/filesys.C ../lib/util.C -L./ -lboinc_zip +##noinst_PROGRAMS = test +if ENABLE_LIBRARIES + +lib_LTLIBRARIES = libboinc_zip.la +libboinc_zip_la_SOURCES = $(libboinc_zip_sources) +libboinc_zip_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +libboinc_zip_la_LIBADD = + +if BUILD_STATIC_LIBS +all_local = libboinc_zip.a + +endif + +all-local: $(all_local) + +libboinc_zip.a: libboinc_zip.la + rm -f libboinc_zip.a + ln .libs/libboinc_zip.a + +endif