From 69e6552234deb9bcd58870b4bdfddb92db356954 Mon Sep 17 00:00:00 2001 From: ikemo Date: Mon, 6 Feb 2006 14:47:07 +0000 Subject: [PATCH] update from KDE 3.3.2 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1770 56b19765-1e22-0410-a548-a0f45d66c51a --- admin/Doxyfile.am | 9 +- admin/Doxyfile.global | 96 ++- admin/Makefile.common | 9 +- admin/acinclude.m4.in | 1852 ++++++++++++++++++++++------------------- admin/am_edit | 605 +++++++++++--- admin/bcheck.pl | 156 ++++ admin/conf.change.pl | 20 +- admin/config.guess | 336 +++++--- admin/config.pl | 33 +- admin/config.sub | 172 +++- admin/configure.in.bot.end | 20 +- admin/cvs-clean.pl | 2 +- admin/cvs.sh | 347 ++++++-- admin/debianrules | 111 +-- admin/depcomp | 30 + admin/deps.am | 19 + admin/detect-autoconf.sh | 72 +- admin/libtool.m4.in | 1968 +++++++++++++++++++++++++++----------------- admin/ltmain.sh | 1610 ++++++++++++++++++++++++++---------- admin/nmcheck | 371 +++++++++ admin/oldinclude.m4.in | 192 +++++ 21 files changed, 5454 insertions(+), 2576 deletions(-) create mode 100644 admin/bcheck.pl create mode 100644 admin/deps.am create mode 100755 admin/nmcheck create mode 100644 admin/oldinclude.m4.in diff --git a/admin/Doxyfile.am b/admin/Doxyfile.am index 6758b33..0d6039a 100644 --- a/admin/Doxyfile.am +++ b/admin/Doxyfile.am @@ -17,6 +17,9 @@ apidox-am-yes: echo "IMAGE_PATH = $(top_srcdir)/doc/api" >> Doxyfile ;\ echo "OUTPUT_DIRECTORY = $(top_builddir)/apidocs" >> Doxyfile; \ echo "HTML_OUTPUT = $(subdir)/html" >> Doxyfile; \ + echo "HTML_HEADER = $(top_builddir)/apidocs/common/header.html" >> Doxyfile;\ + echo "HTML_FOOTER = $(top_builddir)/apidocs/common/footer.html" >> Doxyfile;\ + echo "HTML_STYLESHEET = $(top_builddir)/apidocs/common/doxygen.css" >> Doxyfile;\ echo "LATEX_OUTPUT = $(subdir)/latex" >> Doxyfile; \ echo "RTF_OUTPUT = $(subdir)/rtf" >> Doxyfile; \ echo "MAN_OUTPUT = $(subdir)/man" >> Doxyfile; \ @@ -26,11 +29,11 @@ apidox-am-yes: if test -n "$(DOXYGEN_EXCLUDE)"; then \ patterns= ;\ dirs= ;\ - for item in "$(DOXYGEN_EXCLUDE)"; do \ + for item in `echo "$(DOXYGEN_EXCLUDE)"`; do \ if test -d "$(srcdir)/$$item"; then \ dirs="$$dirs $(srcdir)/$$item/" ;\ else \ - patterns="$$paterns $$item" ;\ + patterns="$$patterns $$item" ;\ fi ;\ done ;\ echo "EXCLUDE_PATTERNS += $$patterns" >> Doxyfile; \ @@ -55,7 +58,7 @@ apidox-am-yes: fi ;\ fi ;\ done ;\ - echo "GENERATE_TAGFILE = $(top_builddir)/apidocs/$(subdir)/$(subdir).tag" >> Doxyfile ;\ + echo "GENERATE_TAGFILE = $(top_builddir)/apidocs/$(subdir)/`basename $(subdir)`.tag" >> Doxyfile ;\ echo "IGNORE_PREFIX = K" >> Doxyfile ;\ echo "HAVE_DOT = $(KDE_HAVE_DOT)" >> Doxyfile ;\ $(DOXYGEN) Doxyfile ;\ diff --git a/admin/Doxyfile.global b/admin/Doxyfile.global index bc654dc..54c8a15 100644 --- a/admin/Doxyfile.global +++ b/admin/Doxyfile.global @@ -1,4 +1,4 @@ -# Doxyfile 1.3.4 +# Doxyfile 1.3.6 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -23,7 +23,7 @@ PROJECT_NAME = # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "Version 3.0" +PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -38,7 +38,7 @@ OUTPUT_DIRECTORY = ../apidocs/ # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, +# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English @@ -58,7 +58,7 @@ USE_WINDOWS_ENCODING = NO # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. -BRIEF_MEMBER_DESC = YES +BRIEF_MEMBER_DESC = NO # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. @@ -67,6 +67,17 @@ BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is used +# as the annotated text. Otherwise, the brief description is used as-is. If left +# blank, the following values are used ("$name" is automatically replaced with the +# name of the entity): "The $name class" "The $name widget" "The $name file" +# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. @@ -89,7 +100,9 @@ FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. +# the path. It is allowed to use relative paths in the argument list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. STRIP_FROM_PATH = @@ -103,7 +116,7 @@ SHORT_NAMES = NO # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an -# explict @brief command for a brief description. +# explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = YES @@ -124,7 +137,7 @@ DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it -# reimplements. +# re-implements. INHERIT_DOCS = YES @@ -138,7 +151,7 @@ DISTRIBUTE_GROUP_DOC = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. -TAB_SIZE = 8 +TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". @@ -147,11 +160,7 @@ TAB_SIZE = 8 # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. -ALIASES = libdoc=@mainpage \ - sect=

\ - reimplemented= \ - "deprecated=This class or method is obsolete, it is provided for compatibility only." \ - obsolete=@deprecated +ALIASES = obsolete=@deprecated # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. @@ -270,6 +279,23 @@ INLINE_INFO = YES SORT_MEMBER_DOCS = NO +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. @@ -377,7 +403,12 @@ INPUT = FILE_PATTERNS = *.h \ *.cpp \ *.cc \ - *.hpp + *.hpp \ + *.dox \ + *.c++ \ + *.cxx \ + *.h++ \ + *.hh # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. @@ -453,7 +484,9 @@ FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES @@ -545,7 +578,9 @@ HTML_FOOTER = ../apidocs/common/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = ../apidocs/common/doxygen.css @@ -565,7 +600,7 @@ GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be -# written to the html output dir. +# written to the html output directory. CHM_FILE = @@ -700,7 +735,7 @@ LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimised for Word 97 and may not look very pretty with +# The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO @@ -727,7 +762,7 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assigments. You only have to provide +# config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = @@ -771,9 +806,7 @@ MAN_LINKS = YES # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. +# the code including all documentation. GENERATE_XML = NO @@ -795,6 +828,13 @@ XML_SCHEMA = XML_DTD = +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = NO + #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -887,7 +927,9 @@ INCLUDE_FILE_PATTERNS = # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. -PREDEFINED = QT_VERSION=305 __cplusplus +PREDEFINED = QT_VERSION=320 \ + __cplusplus \ + Q_WS_X11 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. @@ -905,7 +947,7 @@ EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. @@ -954,7 +996,7 @@ PERL_PATH = # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or # super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superceded by the HAVE_DOT option below. This is only a fallback. It is +# option is superseded by the HAVE_DOT option below. This is only a fallback. It is # recommended to install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES @@ -987,7 +1029,7 @@ CLASS_GRAPH = YES COLLABORATION_GRAPH = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similiar to the OMG's Unified Modeling +# collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO @@ -1081,7 +1123,7 @@ GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine +# Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be diff --git a/admin/Makefile.common b/admin/Makefile.common index d5c4d85..0ecd10d 100644 --- a/admin/Makefile.common +++ b/admin/Makefile.common @@ -6,7 +6,7 @@ SHELL=/bin/sh -cvs dist cvs-clean configure.in configure.files subdirs package-messages package-merge: +cvs dist cvs-clean configure configure.in configure.files subdirs package-messages package-merge Makefile.am acinclude.m4: @admindir=$(admindir); \ if test "x$$admindir" = x; then \ admindir=.; until test -f $$admindir/admin/cvs.sh; do \ @@ -21,12 +21,13 @@ cvs dist cvs-clean configure.in configure.files subdirs package-messages package fi; \ fi; \ if test "$@" = "package-merge"; then \ - MAKE=$(MAKE) POFILES="$(POFILES)" PACKAGE="$(PACKAGE)" \ + MAKE="$(MAKE)" POFILES="$(POFILES)" PACKAGE="$(PACKAGE)" \ $(SHELL) $$admindir/cvs.sh package-merge ;\ - else MAKE=$(MAKE) $(SHELL) $$admindir/cvs.sh $@ ;\ + else \ + MAKE="$(MAKE)" $(SHELL) $$admindir/cvs.sh $@ ;\ fi -configure.in: configure.files $(shell test -f configure.files && cat configure.files) subdirs +configure.in: configure.files subdirs configure.files: subdirs .SILENT: diff --git a/admin/acinclude.m4.in b/admin/acinclude.m4.in index 232bc98..c789010 100644 --- a/admin/acinclude.m4.in +++ b/admin/acinclude.m4.in @@ -26,20 +26,10 @@ dnl dnl Single-module modifications are best placed in configure.in for kdelibs dnl and kdebase or configure.in.in if present. -dnl ------------------------------------------------------------------------ -dnl Forward compatibility macros (make autoconf 2.13 look like 2.50), -dnl thanks to Raja R Harinath. -dnl ------------------------------------------------------------------------ -dnl -ifdef([_AC_PATH_X_XMKMF],[], - [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])]) -ifdef([AC_OUTPUT_SUBDIRS],[], - [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])]) - # KDE_PATH_X_DIRECT dnl Internal subroutine of AC_PATH_X. dnl Set ac_x_includes and/or ac_x_libraries. -AC_DEFUN(KDE_PATH_X_DIRECT, +AC_DEFUN([KDE_PATH_X_DIRECT], [ AC_REQUIRE([KDE_CHECK_LIB64]) @@ -166,7 +156,7 @@ dnl ------------------------------------------------------------------------ dnl Find a file (or one of more files in a list of dirs) dnl ------------------------------------------------------------------------ dnl -AC_DEFUN(AC_FIND_FILE, +AC_DEFUN([AC_FIND_FILE], [ $3=NO for i in $2; @@ -183,9 +173,15 @@ do done ]) -dnl KDE_FIND_PATH(programm-name, variable-name, list of directories, -dnl if-not-found, test-parameter) -AC_DEFUN(KDE_FIND_PATH, +dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs, +dnl if-not-found, test-parameter, prepend-path) +dnl +dnl Look for program-name in list-of-dirs+$PATH. +dnl If prepend-path is set, look in $PATH+list-of-dirs instead. +dnl If found, $variable-name is set. If not, if-not-found is evaluated. +dnl test-parameter: if set, the program is executed with this arg, +dnl and only a successful exit code is required. +AC_DEFUN([KDE_FIND_PATH], [ AC_MSG_CHECKING([for $1]) if test -n "$$2"; then @@ -196,12 +192,17 @@ AC_DEFUN(KDE_FIND_PATH, AC_CACHE_VAL(kde_cv_path_$kde_cache, [ kde_cv_path="NONE" - dirs="$3" kde_save_IFS=$IFS IFS=':' + dirs="" for dir in $PATH; do dirs="$dirs $dir" - done + done + if test -z "$6"; then dnl Append dirs in PATH (default) + dirs="$3 $dirs" + else dnl Prepend dirs in PATH (if 6th arg is set) + dirs="$dirs $3" + fi IFS=$kde_save_IFS for dir in $dirs; do @@ -238,7 +239,7 @@ AC_DEFUN(KDE_FIND_PATH, fi ]) -AC_DEFUN(KDE_MOC_ERROR_MESSAGE, +AC_DEFUN([KDE_MOC_ERROR_MESSAGE], [ AC_MSG_ERROR([No Qt meta object compiler (moc) found! Please check whether you installed Qt correctly. @@ -250,7 +251,7 @@ configure. ]) ]) -AC_DEFUN(KDE_UIC_ERROR_MESSAGE, +AC_DEFUN([KDE_UIC_ERROR_MESSAGE], [ AC_MSG_WARN([No Qt ui compiler (uic) found! Please check whether you installed Qt correctly. @@ -263,7 +264,7 @@ configure. ]) -AC_DEFUN(KDE_CHECK_UIC_FLAG, +AC_DEFUN([KDE_CHECK_UIC_FLAG], [ AC_MSG_CHECKING([whether uic supports -$1 ]) kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` @@ -298,8 +299,9 @@ dnl Find the meta object compiler and the ui compiler in the PATH, dnl in $QTDIR/bin, and some more usual places dnl ------------------------------------------------------------------------ dnl -AC_DEFUN(AC_PATH_QT_MOC_UIC, +AC_DEFUN([AC_PATH_QT_MOC_UIC], [ + AC_REQUIRE([KDE_CHECK_PERL]) qt_bindirs="" for dir in $kde_qt_dirs; do qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc" @@ -319,14 +321,14 @@ AC_DEFUN(AC_PATH_QT_MOC_UIC, UIC=$UIC_PATH if test $kde_qtver = 3; then - KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no) - KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no) + KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no) + KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no) - if test x$ac_uic_supports_libpath = xyes; then - UIC="$UIC -L \$(kde_widgetdir)" - fi - if test x$ac_uic_supports_nounload = xyes; then - UIC="$UIC -nounload" + if test x$ac_uic_supports_libpath = xyes; then + UIC="$UIC -L \$(kde_widgetdir)" + fi + if test x$ac_uic_supports_nounload = xyes; then + UIC="$UIC -nounload" fi fi fi @@ -345,7 +347,7 @@ AC_DEFUN(AC_PATH_QT_MOC_UIC, AC_SUBST(UIC_TR) ]) -AC_DEFUN(KDE_1_CHECK_PATHS, +AC_DEFUN([KDE_1_CHECK_PATHS], [ KDE_1_CHECK_PATH_HEADERS @@ -393,7 +395,7 @@ KDE_SET_PATHS($kde_result) ]) -AC_DEFUN(KDE_SET_PATHS, +AC_DEFUN([KDE_SET_PATHS], [ kde_cv_all_paths="kde_have_all_paths=\"yes\" \ kde_htmldir=\"$kde_htmldir\" \ @@ -404,6 +406,7 @@ AC_DEFUN(KDE_SET_PATHS, kde_locale=\"$kde_locale\" \ kde_cgidir=\"$kde_cgidir\" \ kde_confdir=\"$kde_confdir\" \ + kde_kcfgdir=\"$kde_kcfgdir\" \ kde_mimedir=\"$kde_mimedir\" \ kde_toolbardir=\"$kde_toolbardir\" \ kde_wallpaperdir=\"$kde_wallpaperdir\" \ @@ -412,59 +415,65 @@ AC_DEFUN(KDE_SET_PATHS, kde_servicesdir=\"$kde_servicesdir\" \ kde_servicetypesdir=\"$kde_servicetypesdir\" \ kde_moduledir=\"$kde_moduledir\" \ - kde_styledir=\"$kde_styledir\" \ + kde_styledir=\"$kde_styledir\" \ kde_widgetdir=\"$kde_widgetdir\" \ + xdg_appsdir=\"$xdg_appsdir\" \ + xdg_menudir=\"$xdg_menudir\" \ + xdg_directorydir=\"$xdg_directorydir\" \ kde_result=$1" ]) -AC_DEFUN(KDE_SET_DEFAULT_PATHS, +AC_DEFUN([KDE_SET_DEFAULT_PATHS], [ if test "$1" = "default"; then if test -z "$kde_htmldir"; then - kde_htmldir='\${prefix}/share/doc/HTML' + kde_htmldir='\${datadir}/doc/HTML' fi if test -z "$kde_appsdir"; then - kde_appsdir='\${prefix}/share/applnk' + kde_appsdir='\${datadir}/applnk' fi if test -z "$kde_icondir"; then - kde_icondir='\${prefix}/share/icons' + kde_icondir='\${datadir}/icons' fi if test -z "$kde_sounddir"; then - kde_sounddir='\${prefix}/share/sounds' + kde_sounddir='\${datadir}/sounds' fi if test -z "$kde_datadir"; then - kde_datadir='\${prefix}/share/apps' + kde_datadir='\${datadir}/apps' fi if test -z "$kde_locale"; then - kde_locale='\${prefix}/share/locale' + kde_locale='\${datadir}/locale' fi if test -z "$kde_cgidir"; then kde_cgidir='\${exec_prefix}/cgi-bin' fi if test -z "$kde_confdir"; then - kde_confdir='\${prefix}/share/config' + kde_confdir='\${datadir}/config' + fi + if test -z "$kde_kcfgdir"; then + kde_kcfgdir='\${datadir}/config.kcfg' fi if test -z "$kde_mimedir"; then - kde_mimedir='\${prefix}/share/mimelnk' + kde_mimedir='\${datadir}/mimelnk' fi if test -z "$kde_toolbardir"; then - kde_toolbardir='\${prefix}/share/toolbar' + kde_toolbardir='\${datadir}/toolbar' fi if test -z "$kde_wallpaperdir"; then - kde_wallpaperdir='\${prefix}/share/wallpapers' + kde_wallpaperdir='\${datadir}/wallpapers' fi if test -z "$kde_templatesdir"; then - kde_templatesdir='\${prefix}/share/templates' + kde_templatesdir='\${datadir}/templates' fi if test -z "$kde_bindir"; then kde_bindir='\${exec_prefix}/bin' fi if test -z "$kde_servicesdir"; then - kde_servicesdir='\${prefix}/share/services' + kde_servicesdir='\${datadir}/services' fi if test -z "$kde_servicetypesdir"; then - kde_servicetypesdir='\${prefix}/share/servicetypes' + kde_servicetypesdir='\${datadir}/servicetypes' fi if test -z "$kde_moduledir"; then if test "$kde_qtver" = "2"; then @@ -479,6 +488,15 @@ if test "$1" = "default"; then if test -z "$kde_widgetdir"; then kde_widgetdir='\${libdir}/kde3/plugins/designer' fi + if test -z "$xdg_appsdir"; then + xdg_appsdir='\${datadir}/applications/kde' + fi + if test -z "$xdg_menudir"; then + xdg_menudir='\${sysconfdir}/xdg/menus' + fi + if test -z "$xdg_directorydir"; then + xdg_directorydir='\${datadir}/desktop-directories' + fi KDE_SET_PATHS(defaults) @@ -494,56 +512,89 @@ else fi ]) -AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS, +AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS], [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" || test -z "$kde_icondir" || test -z "$kde_sounddir" || test -z "$kde_datadir" || test -z "$kde_locale" || test -z "$kde_cgidir" || test -z "$kde_confdir" || + test -z "$kde_kcfgdir" || test -z "$kde_mimedir" || test -z "$kde_toolbardir" || test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" || test -z "$kde_bindir" || test -z "$kde_servicesdir" || test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" || - test -z "$kde_styledir" || test -z "kde_widgetdir" + test -z "$kde_styledir" || test -z "kde_widgetdir" || + test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" || test "x$kde_have_all_paths" != "xyes"; then kde_have_all_paths=no fi ]) -AC_DEFUN(KDE_MISSING_PROG_ERROR, +AC_DEFUN([KDE_MISSING_PROG_ERROR], [ AC_MSG_ERROR([The important program $1 was not found! Please check whether you installed KDE correctly. ]) ]) -AC_DEFUN(KDE_MISSING_ARTS_ERROR, +AC_DEFUN([KDE_MISSING_ARTS_ERROR], [ AC_MSG_ERROR([The important program $1 was not found! -Please check whether you installed aRts correctly. +Please check whether you installed aRts correctly or use +--without-arts to compile without aRts support (this will remove functionality). ]) ]) -AC_DEFUN(KDE_SUBST_PROGRAMS, +AC_DEFUN([KDE_SET_DEFAULT_BINDIRS], +[ + kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin" + test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs" + if test -n "$KDEDIRS"; then + kde_save_IFS=$IFS + IFS=: + for dir in $KDEDIRS; do + kde_default_bindirs="$dir/bin $kde_default_bindirs " + done + IFS=$kde_save_IFS + fi +]) + +AC_DEFUN([KDE_SUBST_PROGRAMS], [ + AC_ARG_WITH(arts, + AC_HELP_STRING([--without-arts],[build without aRts [default=no]]), + [build_arts=$withval], + [build_arts=yes] + ) + AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no") + if test "$build_arts" = "no"; then + AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts]) + fi - kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin" - test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs" - if test -n "$KDEDIRS"; then - kde_save_IFS=$IFS - IFS=: - for dir in $KDEDIRS; do - kde_default_bindirs="$dir/bin $kde_default_bindirs " - done - IFS=$kde_save_IFS - fi - kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs" + KDE_SET_DEFAULT_BINDIRS + kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs" KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)]) KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)]) - KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)]) - KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)]) - KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs]) + if test "$build_arts" '!=' "no"; then + KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)]) + KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)]) + fi KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs]) - + + kde32ornewer=1 + if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then + kde32ornewer= + else + if test "$kde_qtver" = "3" && test "$kde_qtsubver" -le 1; then + kde32ornewer= + fi + fi + + if test -n "$kde32ornewer"; then + KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)]) + KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)]) + fi + KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""]) + if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share" test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs" @@ -556,33 +607,24 @@ AC_DEFUN(KDE_SUBST_PROGRAMS, fi DCOP_DEPENDENCIES='$(DCOPIDL)' + if test -n "$kde32ornewer"; then + KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)' + DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)' + AC_SUBST(KCONFIG_COMPILER) + AC_SUBST(KCFG_DEPENDENCIES) + AC_SUBST(DCOPIDLNG) + fi AC_SUBST(DCOPIDL) AC_SUBST(DCOPIDL2CPP) AC_SUBST(DCOP_DEPENDENCIES) AC_SUBST(MCOPIDL) AC_SUBST(ARTSCCONFIG) - AC_SUBST(KDECONFIG) AC_SUBST(MEINPROC) AC_SUBST(KDE_XSL_STYLESHEET) - - if test -x "$KDECONFIG"; then # it can be "compiled" - kde_libs_prefix=`$KDECONFIG --prefix` - if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then - AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs. - This means it has been moved since you installed it. - This won't work. Please recompile kdelibs for the new prefix. - ]) - fi - kde_libs_htmldir=`$KDECONFIG --install html --expandvars` - else - kde_libs_prefix='$(prefix)' - kde_libs_htmldir='$(kde_htmldir)' - fi - AC_SUBST(kde_libs_prefix) - AC_SUBST(kde_libs_htmldir) + AC_SUBST(XMLLINT) ])dnl -AC_DEFUN(AC_CREATE_KFSSTND, +AC_DEFUN([AC_CREATE_KFSSTND], [ AC_REQUIRE([AC_CHECK_RPATH]) @@ -600,12 +642,13 @@ if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then # wrong values were cached, may be, we can set better ones kde_result= kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir= - kde_datadir= kde_locale= kde_cgidir= kde_confdir= + kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir= kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir= kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir= kde_have_all_paths= kde_styledir= kde_widgetdir= + xdg_appsdir = xdg_menudir= xdg_directorydir= KDE_SET_DEFAULT_PATHS($1) eval "$kde_cv_all_paths" KDE_CHECK_PATHS_FOR_COMPLETENESS @@ -629,7 +672,7 @@ KDE_SUBST_PROGRAMS ]) -AC_DEFUN(AC_SUBST_KFSSTND, +AC_DEFUN([AC_SUBST_KFSSTND], [ AC_SUBST(kde_htmldir) AC_SUBST(kde_appsdir) @@ -638,14 +681,20 @@ AC_SUBST(kde_sounddir) AC_SUBST(kde_datadir) AC_SUBST(kde_locale) AC_SUBST(kde_confdir) +AC_SUBST(kde_kcfgdir) AC_SUBST(kde_mimedir) AC_SUBST(kde_wallpaperdir) AC_SUBST(kde_bindir) +dnl X Desktop Group standards +AC_SUBST(xdg_appsdir) +AC_SUBST(xdg_menudir) +AC_SUBST(xdg_directorydir) dnl for KDE 2 AC_SUBST(kde_templatesdir) AC_SUBST(kde_servicesdir) AC_SUBST(kde_servicetypesdir) AC_SUBST(kde_moduledir) +AC_SUBST(kdeinitdir, '$(kde_moduledir)') AC_SUBST(kde_styledir) AC_SUBST(kde_widgetdir) if test "$kde_qtver" = 1; then @@ -660,9 +709,8 @@ dnl AC_SUBST(kde_cgidir) dnl AC_SUBST(kde_toolbardir) ]) -AC_DEFUN(KDE_MISC_TESTS, +AC_DEFUN([KDE_MISC_TESTS], [ - AC_LANG_C dnl Checks for libraries. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD AC_SUBST(LIBUTIL) @@ -681,7 +729,6 @@ support]) AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function]) fi AC_CHECK_SOCKLEN_T - AC_LANG_C AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) if test $ac_cv_lib_dnet_dnet_ntoa = no; then AC_CHECK_LIB(dnet_stub, dnet_ntoa, @@ -706,20 +753,19 @@ support]) AC_CHECK_FUNC(shmat, , AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")) - # darwin needs this to initialize the environment - AC_CHECK_HEADERS(crt_externs.h) - AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])]) - # more headers that need to be explicitly included on darwin AC_CHECK_HEADERS(sys/types.h stdint.h) + # sys/bitypes.h is needed for uint32_t and friends on Tru64 + AC_CHECK_HEADERS(sys/bitypes.h) + # darwin requires a poll emulation library AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll") # CoreAudio framework AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [ AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API]) - FRAMEWORK_COREAUDIO="-framework CoreAudio" + FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio" ]) AC_CHECK_RES_INIT @@ -742,6 +788,20 @@ support]) KDE_CHECK_TYPES KDE_CHECK_LIBDL + KDE_CHECK_STRLCPY + +# darwin needs this to initialize the environment +AC_CHECK_HEADERS(crt_externs.h) +AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])]) + +AH_VERBATIM(_DARWIN_ENVIRON, +[ +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# define environ (*_NSGetEnviron()) +#endif +]) AH_VERBATIM(_AIX_STRINGS_H_BZERO, [ @@ -787,30 +847,36 @@ dnl Find the header files and libraries for X-Windows. Extended the dnl macro AC_PATH_X dnl ------------------------------------------------------------------------ dnl -AC_DEFUN(K_PATH_X, +AC_DEFUN([K_PATH_X], [ AC_REQUIRE([KDE_MISC_TESTS])dnl AC_REQUIRE([KDE_CHECK_LIB64]) AC_ARG_ENABLE( embedded, - [ --enable-embedded link to Qt-embedded, don't use X], + AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]), kde_use_qt_emb=$enableval, kde_use_qt_emb=no ) AC_ARG_ENABLE( qtopia, - [ --enable-qtopia link to Qt-embedded, link to the Qtopia Environment], + AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]), kde_use_qt_emb_palm=$enableval, kde_use_qt_emb_palm=no ) -if test "$kde_use_qt_emb" = "no"; then +AC_ARG_ENABLE( + mac, + AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]), + kde_use_qt_mac=$enableval, + kde_use_qt_mac=no +) + +if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then AC_MSG_CHECKING(for X) -AC_LANG_SAVE -AC_LANG_C + AC_CACHE_VAL(kde_cv_have_x, [# One or both of the vars are not set, and there is no cached value. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then @@ -904,11 +970,6 @@ fi all_includes="$X_INCLUDES" all_libraries="$X_LDFLAGS" -AC_SUBST(X_INCLUDES) -AC_SUBST(X_LDFLAGS) -AC_SUBST(x_libraries) -AC_SUBST(x_includes) - # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $X_LDFLAGS" @@ -920,13 +981,9 @@ LDFLAGS="$LDFLAGS $X_LDFLAGS" # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. AC_CHECK_LIB(ICE, IceConnectionNumber, [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS) -AC_SUBST(LIBSM) LDFLAGS="$ac_save_LDFLAGS" -AC_SUBST(X_PRE_LIBS) - LIB_X11='-lX11 $(LIBSOCKET)' -AC_SUBST(LIB_X11) AC_MSG_CHECKING(for libXext) AC_CACHE_VAL(kde_cv_have_libXext, @@ -948,11 +1005,11 @@ printf("hello Xext\n"); ], kde_cv_have_libXext=yes, kde_cv_have_libXext=no - ) +) LDFLAGS=$kde_ldflags_safe LIBS=$kde_libs_safe - ]) +]) AC_MSG_RESULT($kde_cv_have_libXext) @@ -962,57 +1019,10 @@ can't find it itself, we stop here assuming that make wouldn't find them either.]) fi -AC_MSG_CHECKING(for Xinerama) - - AC_ARG_WITH(xinerama, - [ --with-xinerama enable support for Xinerama ], - [ - no_xinerama=no - ], [ - no_xinerama=yes - ] -) - -kde_save_LDFLAGS="$LDFLAGS" -kde_save_CFLAGS="$CFLAGS" -kde_save_LIBS="$LIBS" -LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS" -CFLAGS="$CFLAGS -I$x_includes" -LIBS="-lXinerama -lXext" - -if test "x$no_xinerama" = "xno"; then - - AC_CACHE_VAL(ac_cv_have_xinerama, - [ - AC_TRY_LINK([#include - #include ], - [XineramaIsActive(NULL);], - [ac_cv_have_xinerama="yes"], - [ac_cv_have_xinerama="no"]) - ]) -else - ac_cv_have_xinerama=no; -fi - -AC_MSG_RESULT($ac_cv_have_xinerama) - -LIBXINERAMA="" - -if test "$ac_cv_have_xinerama" = "yes"; then - AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support]) - LIBXINERAMA="-lXinerama" -fi - -AC_SUBST(LIBXINERAMA) - -LDFLAGS="$kde_save_LDFLAGS" -CFLAGS="$kde_save_CFLAGS" -LIBS="$kde_save_LIBS" - LIB_XEXT="-lXext" QTE_NORTTI="" -else +elif test "$kde_use_qt_emb" = "yes"; then dnl We're using QT Embedded CPPFLAGS=-DQWS CXXFLAGS="$CXXFLAGS -fno-rtti" @@ -1020,28 +1030,41 @@ else X_PRE_LIBS="" LIB_X11="" LIB_XEXT="" + LIB_XRENDER="" + LIBSM="" + X_INCLUDES="" + X_LDFLAGS="" + x_includes="" + x_libraries="" +elif test "$kde_use_qt_mac" = "yes"; then + dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to + dnl be included to get the information) --Sam + CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp" + CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp" + X_PRE_LIBS="" + LIB_X11="" + LIB_XEXT="" + LIB_XRENDER="" LIBSM="" X_INCLUDES="" X_LDFLAGS="" x_includes="" x_libraries="" - AC_SUBST(X_PRE_LIBS) - AC_SUBST(LIB_X11) - AC_SUBST(LIBSM) - AC_SUBST(X_INCLUDES) - AC_SUBST(X_LDFLAGS) - AC_SUBST(x_includes) - AC_SUBST(x_libraries) fi +AC_SUBST(X_PRE_LIBS) +AC_SUBST(LIB_X11) +AC_SUBST(LIB_XRENDER) +AC_SUBST(LIBSM) +AC_SUBST(X_INCLUDES) +AC_SUBST(X_LDFLAGS) +AC_SUBST(x_includes) +AC_SUBST(x_libraries) AC_SUBST(QTE_NORTTI) AC_SUBST(LIB_XEXT) - -AC_LANG_RESTORE - ]) -AC_DEFUN(KDE_PRINT_QT_PROGRAM, +AC_DEFUN([KDE_PRINT_QT_PROGRAM], [ AC_REQUIRE([KDE_USE_QT]) cat > conftest.$ac_ext <> conftest.$ac_ext < /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi done fi +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIBQT="$LIBQT ${kde_int_qt}_incremental" + break + fi +done ac_qt_libraries="$qt_libdir" @@ -1497,8 +1532,8 @@ else qt_includes="$ac_qt_includes" fi -if test ! "$kde_qt_libs_given" = "yes"; then -KDE_CHECK_QT_DIRECT(qt_libraries= ,[]) +if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then + KDE_CHECK_QT_DIRECT(qt_libraries= ,[]) fi AC_SUBST(qt_libraries) @@ -1525,12 +1560,18 @@ AC_PATH_QT_MOC_UIC KDE_CHECK_QT_JPEG -if test "x$kde_use_qt_emb" != "xyes"; then -LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)' +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)' else -LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)' +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)' fi test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS" +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIB_QT="$LIB_QT ${kde_int_qt}_incremental" + break + fi +done AC_SUBST(LIB_QT) AC_SUBST(LIB_QPE) @@ -1538,12 +1579,12 @@ AC_SUBST(LIB_QPE) AC_SUBST(kde_qtver) ]) -AC_DEFUN(AC_PATH_QT, +AC_DEFUN([AC_PATH_QT], [ AC_PATH_QT_1_3 ]) -AC_DEFUN(KDE_CHECK_UIC_PLUGINS, +AC_DEFUN([KDE_CHECK_UIC_PLUGINS], [ AC_REQUIRE([AC_PATH_QT_MOC_UIC]) @@ -1574,6 +1615,9 @@ if test x$ac_uic_supports_nounload = xyes; then fi kde_line="$kde_line -impl actest.h actest.ui > actest.cpp" if AC_TRY_EVAL(kde_line); then + # if you're trying to debug this check and think it's incorrect, + # better check your installation. The check _is_ correct - your + # installation is not. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then kde_cv_uic_plugins=yes fi @@ -1581,20 +1625,20 @@ fi rm -f actest.ui actest.cpp ]) -if test "$kde_cv_uic_plugins" = yes; then - AC_MSG_RESULT([yes]) -else - AC_MSG_ERROR([not found - you need to install kdelibs first.]) +AC_MSG_RESULT([$kde_cv_uic_plugins]) +if test "$kde_cv_uic_plugins" != yes; then + AC_MSG_ERROR([you need to install kdelibs first.]) fi fi ]) -AC_DEFUN(KDE_CHECK_FINAL, +AC_DEFUN([KDE_CHECK_FINAL], [ - AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)], + AC_ARG_ENABLE(final, + AC_HELP_STRING([--enable-final], + [build size optimized apps (experimental - needs lots of memory)]), kde_use_final=$enableval, kde_use_final=no) - KDE_COMPILER_REPO if test "x$kde_use_final" = "xyes"; then KDE_USE_FINAL_TRUE="" KDE_USE_FINAL_FALSE="#" @@ -1604,10 +1648,15 @@ AC_DEFUN(KDE_CHECK_FINAL, fi AC_SUBST(KDE_USE_FINAL_TRUE) AC_SUBST(KDE_USE_FINAL_FALSE) +]) - AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation], - kde_use_closure=$enableval, kde_use_closure=yes) +AC_DEFUN([KDE_CHECK_CLOSURE], +[ + AC_ARG_ENABLE(closure, + AC_HELP_STRING([--enable-closure],[delay template instantiation]), + kde_use_closure=$enableval, kde_use_closure=no) + KDE_NO_UNDEFINED="" if test "x$kde_use_closure" = "xyes"; then KDE_USE_CLOSURE_TRUE="" KDE_USE_CLOSURE_FALSE="#" @@ -1615,9 +1664,44 @@ AC_DEFUN(KDE_CHECK_FINAL, else KDE_USE_CLOSURE_TRUE="#" KDE_USE_CLOSURE_FALSE="" + KDE_NO_UNDEFINED="" + case $host in + *-*-linux-gnu) + KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined], + [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined], + [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"], + [KDE_NO_UNDEFINED=""])], + [KDE_NO_UNDEFINED=""]) + ;; + esac fi AC_SUBST(KDE_USE_CLOSURE_TRUE) AC_SUBST(KDE_USE_CLOSURE_FALSE) + AC_SUBST(KDE_NO_UNDEFINED) +]) + +AC_DEFUN([KDE_CHECK_NMCHECK], +[ + AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]), + kde_use_nmcheck=$enableval, kde_use_nmcheck=no) + + if test "$kde_use_nmcheck" = "yes"; then + KDE_USE_NMCHECK_TRUE="" + KDE_USE_NMCHECK_FALSE="#" + else + KDE_USE_NMCHECK_TRUE="#" + KDE_USE_NMCHECK_FALSE="" + fi + AC_SUBST(KDE_USE_NMCHECK_TRUE) + AC_SUBST(KDE_USE_NMCHECK_FALSE) +]) + +AC_DEFUN([KDE_EXPAND_MAKEVAR], [ +savex=$exec_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +tmp=$$2 +while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done +exec_prefix=$savex ]) dnl ------------------------------------------------------------------------ @@ -1626,9 +1710,9 @@ dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed) dnl and $(kde_includes) will be the kdehdrlocation (if needed) dnl ------------------------------------------------------------------------ dnl -AC_DEFUN(AC_BASE_PATH_KDE, +AC_DEFUN([AC_BASE_PATH_KDE], [ -AC_PREREQ([2.13]) +AC_REQUIRE([KDE_CHECK_STL]) AC_REQUIRE([AC_PATH_QT])dnl AC_REQUIRE([KDE_CHECK_LIB64]) @@ -1636,19 +1720,12 @@ AC_CHECK_RPATH AC_MSG_CHECKING([for KDE]) if test "${prefix}" != NONE; then - kde_includes=${prefix}/include - ac_kde_includes=$prefix/include - - if test "${exec_prefix}" != NONE; then - kde_libraries=${libdir} - ac_kde_libraries=$libdir - if test "$ac_kde_libraries" = '${exec_prefix}/lib'${kdelibsuff}; then - ac_kde_libraries=$exec_prefix/lib${kdelibsuff} - fi - else - kde_libraries=${prefix}/lib${kdelibsuff} - ac_kde_libraries=$prefix/lib${kdelibsuff} - fi + kde_includes=${includedir} + KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir) + + kde_libraries=${libdir} + KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir) + else ac_kde_includes= ac_kde_libraries= @@ -1669,7 +1746,7 @@ fi if test -z "$1"; then -kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes" +kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes" test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs" kde_incdirs="$ac_kde_includes $kde_incdirs" AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir) @@ -1681,7 +1758,7 @@ in the prefix, you've chosen, are no KDE headers installed. This will fail. So, check this please and use another prefix!]) fi -kde_libdirs="/usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}" +kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}" test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs" kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs" AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir) @@ -1715,7 +1792,7 @@ else ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" fi -else dnl test -z $1 +else dnl test -z $1, e.g. from kdelibs ac_cv_have_kde="have_kde=no" @@ -1739,7 +1816,7 @@ if test "$have_kde" != "yes"; then fi kde_libraries="${libdir}" - kde_includes=${ac_kde_prefix}/include + kde_includes="${includedir}" else ac_cv_have_kde="have_kde=yes \ @@ -1758,6 +1835,8 @@ else KDE_INCLUDES="-I$kde_includes" all_includes="$KDE_INCLUDES $all_includes" fi + +KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION" KDE_LDFLAGS="-L$kde_libraries" if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then @@ -1785,11 +1864,10 @@ AC_SUBST(AUTODIRS) ]) -AC_DEFUN(KDE_CHECK_EXTRA_LIBS, +AC_DEFUN([KDE_CHECK_EXTRA_LIBS], [ AC_MSG_CHECKING(for extra includes) -AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR - adds non standard include paths], +AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]), kde_use_extra_includes="$withval", kde_use_extra_includes=NONE ) @@ -1814,7 +1892,7 @@ AC_MSG_RESULT($kde_use_extra_includes) kde_extra_libs= AC_MSG_CHECKING(for extra libs) -AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths], +AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]), kde_use_extra_libs=$withval, kde_use_extra_libs=NONE ) @@ -1840,7 +1918,7 @@ AC_MSG_RESULT($kde_use_extra_libs) ]) -AC_DEFUN(KDE_1_CHECK_PATH_HEADERS, +AC_DEFUN([KDE_1_CHECK_PATH_HEADERS], [ AC_MSG_CHECKING([for KDE headers installed]) AC_LANG_SAVE @@ -1873,11 +1951,16 @@ int main() { printf("kde_moduledir=\\"/tmp/dummy\\"\n"); printf("kde_styledir=\\"/tmp/dummy\\"\n"); printf("kde_widgetdir=\\"/tmp/dummy\\"\n"); + printf("xdg_appsdir=\\"/tmp/dummy\\"\n"); + printf("xdg_menudir=\\"/tmp/dummy\\"\n"); + printf("xdg_directorydir=\\"/tmp/dummy\\"\n"); + printf("kde_kcfgdir=\\"/tmp/dummy\\"\n"); return 0; } EOF - ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext' + ac_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$all_includes $CPPFLAGS" if AC_TRY_EVAL(ac_compile); then AC_MSG_RESULT(yes) else @@ -1885,11 +1968,12 @@ EOF Check, if you installed the KDE header files correctly. For more details about this problem, look at the end of config.log.]) fi + CPPFLAGS=$ac_save_CPPFLAGS AC_LANG_RESTORE ]) -AC_DEFUN(KDE_CHECK_KDEQTADDON, +AC_DEFUN([KDE_CHECK_KDEQTADDON], [ AC_MSG_CHECKING(for kde-qt-addon) AC_CACHE_VAL(kde_cv_have_kdeqtaddon, @@ -1925,37 +2009,7 @@ It is a separate package (and CVS module) named kde-qt-addon.]) fi ]) -AC_DEFUN(KDE_CHECK_KIMGIO, -[ - AC_REQUIRE([AC_BASE_PATH_KDE]) - AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) - AC_REQUIRE([AC_FIND_TIFF]) - AC_REQUIRE([AC_FIND_JPEG]) - AC_REQUIRE([AC_FIND_PNG]) - AC_REQUIRE([KDE_CREATE_LIBS_ALIASES]) - - if test "$1" = "existance"; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - kde_save_LIBS="$LIBS" - LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm" - AC_CHECK_LIB(kimgio, kimgioRegister, [ - LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no) - LIBS="$kde_save_LIBS" - AC_LANG_RESTORE - else - LIBKIMGIO_EXISTS=yes - fi - - if test "$LIBKIMGIO_EXISTS" = "yes"; then - LIB_KIMGIO='-lkimgio' - else - LIB_KIMGIO='' - fi - AC_SUBST(LIB_KIMGIO) -]) - -AC_DEFUN(KDE_CREATE_LIBS_ALIASES, +AC_DEFUN([KDE_CREATE_LIBS_ALIASES], [ AC_REQUIRE([KDE_MISC_TESTS]) AC_REQUIRE([KDE_CHECK_LIBDL]) @@ -1972,6 +2026,8 @@ if test $kde_qtver = 3; then AC_SUBST(LIB_KSPELL, "-lkspell") AC_SUBST(LIB_KPARTS, "-lkparts") AC_SUBST(LIB_KDEPRINT, "-lkdeprint") + AC_SUBST(LIB_KUTILS, "-lkutils") + AC_SUBST(LIB_KDEPIM, "-lkdepim") # these are for backward compatibility AC_SUBST(LIB_KSYCOCA, "-lkio") AC_SUBST(LIB_KFILE, "-lkio") @@ -1996,10 +2052,10 @@ else fi ]) -AC_DEFUN(AC_PATH_KDE, +AC_DEFUN([AC_PATH_KDE], [ AC_BASE_PATH_KDE - AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install], + AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]), [ if test "$enableval" = "no"; then ac_use_path_checking="default" @@ -2021,7 +2077,7 @@ AC_DEFUN(AC_PATH_KDE, ]) dnl KDE_CHECK_FUNC_EXT(, [headers], [sample-use], [C prototype], [autoheader define], [call if found]) -AC_DEFUN(KDE_CHECK_FUNC_EXT, +AC_DEFUN([KDE_CHECK_FUNC_EXT], [ AC_MSG_CHECKING(for $1) AC_CACHE_VAL(kde_cv_func_$1, @@ -2032,7 +2088,7 @@ save_CXXFLAGS="$CXXFLAGS" kde_safe_LIBS="$LIBS" LIBS="$LIBS $X_EXTRA_LIBS" if test "$GXX" = "yes"; then - CXXFLAGS="$CXXFLAGS -pedantic-errors" +CXXFLAGS="$CXXFLAGS -pedantic-errors" fi AC_TRY_COMPILE([ $2 @@ -2043,7 +2099,7 @@ $3 kde_cv_func_$1=yes, kde_cv_func_$1=no) CXXFLAGS="$save_CXXFLAGS" -LIBS=$kde_safe_LIBS +LIBS="$kde_safe_LIBS" AC_LANG_RESTORE ]) @@ -2102,14 +2158,17 @@ AH_VERBATIM([_HAVE_$5_PROTO], [ #if !defined(HAVE_$5_PROTO) #ifdef __cplusplus -extern "C" +extern "C" { #endif $4; +#ifdef __cplusplus +} +#endif #endif ]) ]) -AC_DEFUN(AC_CHECK_SETENV, +AC_DEFUN([AC_CHECK_SETENV], [ KDE_CHECK_FUNC_EXT(setenv, [ #include @@ -2119,7 +2178,7 @@ AC_DEFUN(AC_CHECK_SETENV, [SETENV]) ]) -AC_DEFUN(AC_CHECK_UNSETENV, +AC_DEFUN([AC_CHECK_UNSETENV], [ KDE_CHECK_FUNC_EXT(unsetenv, [ #include @@ -2129,21 +2188,23 @@ AC_DEFUN(AC_CHECK_UNSETENV, [UNSETENV]) ]) -AC_DEFUN(AC_CHECK_GETDOMAINNAME, +AC_DEFUN([AC_CHECK_GETDOMAINNAME], [ KDE_CHECK_FUNC_EXT(getdomainname, [ #include #include +#include ], [ char buffer[200]; getdomainname(buffer, 200); ], - [int getdomainname (char *, unsigned int)], + [#include + int getdomainname (char *, size_t)], [GETDOMAINNAME]) ]) -AC_DEFUN(AC_CHECK_GETHOSTNAME, +AC_DEFUN([AC_CHECK_GETHOSTNAME], [ KDE_CHECK_FUNC_EXT(gethostname, [ #include @@ -2157,7 +2218,7 @@ gethostname(buffer, 200); [GETHOSTNAME]) ]) -AC_DEFUN(AC_CHECK_USLEEP, +AC_DEFUN([AC_CHECK_USLEEP], [ KDE_CHECK_FUNC_EXT(usleep, [ #include @@ -2170,7 +2231,7 @@ usleep(200); ]) -AC_DEFUN(AC_CHECK_RANDOM, +AC_DEFUN([AC_CHECK_RANDOM], [ KDE_CHECK_FUNC_EXT(random, [ #include @@ -2192,7 +2253,7 @@ srandom(27); ]) -AC_DEFUN(AC_CHECK_INITGROUPS, +AC_DEFUN([AC_CHECK_INITGROUPS], [ KDE_CHECK_FUNC_EXT(initgroups, [ #include @@ -2207,32 +2268,34 @@ initgroups(buffer, 27); [INITGROUPS]) ]) -AC_DEFUN(AC_CHECK_MKSTEMP, +AC_DEFUN([AC_CHECK_MKSTEMPS], [ - KDE_CHECK_FUNC_EXT(mkstemp, [ + KDE_CHECK_FUNC_EXT(mkstemps, [ #include +#include ], [ -mkstemp("/tmp/aaaXXXXXX"); +mkstemps("/tmp/aaaXXXXXX", 6); ], - [int mkstemp(char *)], - [MKSTEMP]) + [int mkstemps(char *, int)], + [MKSTEMPS]) ]) -AC_DEFUN(AC_CHECK_MKSTEMPS, +AC_DEFUN([AC_CHECK_MKDTEMP], [ - KDE_CHECK_FUNC_EXT(mkstemps, [ + KDE_CHECK_FUNC_EXT(mkdtemp, [ #include #include ], [ -mkstemps("/tmp/aaaXXXXXX", 6); +mkdtemp("/tmp/aaaXXXXXX"); ], - [int mkstemps(char *, int)], - [MKSTEMPS]) + [char *mkdtemp(char *)], + [MKDTEMP]) ]) -AC_DEFUN(AC_CHECK_RES_INIT, + +AC_DEFUN([AC_CHECK_RES_INIT], [ AC_MSG_CHECKING([if res_init needs -lresolv]) kde_libs_safe="$LIBS" @@ -2254,29 +2317,22 @@ AC_DEFUN(AC_CHECK_RES_INIT, ], [ AC_MSG_RESULT(no) ] ) - LIBS="$kde_libs_safe" + LIBS=$kde_libs_safe AC_SUBST(LIBRESOLV) - AC_MSG_CHECKING([if res_init is available]) - AC_TRY_COMPILE( + KDE_CHECK_FUNC_EXT(res_init, [ #include #include #include #include ], - [ - res_init(); - ], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function]) - ], - [ AC_MSG_RESULT(no) ] - ) + [res_init()], + [int res_init(void)], + [RES_INIT]) ]) -AC_DEFUN(AC_CHECK_STRLCPY, +AC_DEFUN([AC_CHECK_STRLCPY], [ KDE_CHECK_FUNC_EXT(strlcpy, [ #include @@ -2288,7 +2344,7 @@ AC_DEFUN(AC_CHECK_STRLCPY, [STRLCPY]) ]) -AC_DEFUN(AC_CHECK_STRLCAT, +AC_DEFUN([AC_CHECK_STRLCAT], [ KDE_CHECK_FUNC_EXT(strlcat, [ #include @@ -2301,11 +2357,43 @@ AC_DEFUN(AC_CHECK_STRLCAT, [STRLCAT]) ]) -AC_DEFUN(AC_FIND_GIF, +AC_DEFUN([AC_CHECK_RES_QUERY], +[ + KDE_CHECK_FUNC_EXT(res_query, [ +#include +#include +#include +#include +#include +], +[ +res_query(NULL, 0, 0, NULL, 0); +], + [int res_query(const char *, int, int, unsigned char *, int)], + [RES_QUERY]) +]) + +AC_DEFUN([AC_CHECK_DN_SKIPNAME], +[ + KDE_CHECK_FUNC_EXT(dn_skipname, [ +#include +#include +#include +#include +], +[ +dn_skipname (NULL, NULL); +], + [int dn_skipname (unsigned char *, unsigned char *)], + [DN_SKIPNAME]) +]) + + +AC_DEFUN([AC_FIND_GIF], [AC_MSG_CHECKING([for giflib]) AC_CACHE_VAL(ac_cv_lib_gif, [ac_save_LIBS="$LIBS" -if test "x$kde_use_qt_emb" != "xyes"; then +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then LIBS="$all_libraries -lgif -lX11 $LIBSOCKET" else LIBS="$all_libraries -lgif" @@ -2335,12 +2423,11 @@ else fi ]) -AC_DEFUN(KDE_FIND_JPEG_HELPER, +AC_DEFUN([KDE_FIND_JPEG_HELPER], [ AC_MSG_CHECKING([for libjpeg$2]) AC_CACHE_VAL(ac_cv_lib_jpeg_$1, [ -AC_LANG_C ac_save_LIBS="$LIBS" LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm" ac_save_CFLAGS="$CFLAGS" @@ -2378,7 +2465,7 @@ fi ]) -AC_DEFUN(AC_FIND_JPEG, +AC_DEFUN([AC_FIND_JPEG], [ dnl first look for libraries KDE_FIND_JPEG_HELPER(6b, 6b, @@ -2430,8 +2517,9 @@ AH_VERBATIM(_AC_CHECK_JPEG, ]) ]) -AC_DEFUN(KDE_CHECK_QT_JPEG, +AC_DEFUN([KDE_CHECK_QT_JPEG], [ +if test -n "$LIBJPEG"; then AC_MSG_CHECKING([if Qt needs $LIBJPEG]) AC_CACHE_VAL(kde_cv_qt_jpeg, [ @@ -2453,6 +2541,7 @@ AC_TRY_LINK( LIBS="$ac_save_LIBS" CXXFLAGS="$ac_save_CXXFLAGS" AC_LANG_RESTORE +fi ]) if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then @@ -2465,13 +2554,12 @@ fi ]) -AC_DEFUN(AC_FIND_ZLIB, +AC_DEFUN([AC_FIND_ZLIB], [ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) AC_MSG_CHECKING([for libz]) AC_CACHE_VAL(ac_cv_lib_z, [ -AC_LANG_C kde_save_LIBS="$LIBS" LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET" kde_save_CFLAGS="$CFLAGS" @@ -2480,7 +2568,14 @@ AC_TRY_LINK(dnl [ #include ], - [return (zlibVersion() == ZLIB_VERSION); ], +[ + char buf[42]; + gzFile f = (gzFile) 0; + /* this would segfault.. but we only link, don't run */ + (void) gzgets(f, buf, sizeof(buf)); + + return (zlibVersion() == ZLIB_VERSION); +], eval "ac_cv_lib_z='-lz'", eval "ac_cv_lib_z=no") LIBS="$kde_save_LIBS" @@ -2489,16 +2584,19 @@ CFLAGS="$kde_save_CFLAGS" if test ! "$ac_cv_lib_z" = no; then AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz]) LIBZ="$ac_cv_lib_z" - AC_SUBST(LIBZ) AC_MSG_RESULT($ac_cv_lib_z) else - AC_MSG_ERROR(not found. Check your installation and look into config.log) + AC_MSG_ERROR(not found. + Possibly configure picks up an outdated version + installed by XFree86. Remove it from your system. + + Check your installation and look into config.log) LIBZ="" - AC_SUBST(LIBZ) fi +AC_SUBST(LIBZ) ]) -AC_DEFUN(KDE_TRY_TIFFLIB, +AC_DEFUN([KDE_TRY_TIFFLIB], [ AC_MSG_CHECKING([for libtiff $1]) @@ -2507,7 +2605,7 @@ AC_CACHE_VAL(kde_cv_libtiff_$1, AC_LANG_SAVE AC_LANG_CPLUSPLUS kde_save_LIBS="$LIBS" -if test "x$kde_use_qt_emb" != "xyes"; then +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm" else LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm" @@ -2544,7 +2642,7 @@ fi ]) -AC_DEFUN(AC_FIND_TIFF, +AC_DEFUN([AC_FIND_TIFF], [ AC_REQUIRE([K_PATH_X]) AC_REQUIRE([AC_FIND_ZLIB]) @@ -2558,7 +2656,7 @@ AC_SUBST(LIBTIFF) ]) -AC_DEFUN(AC_FIND_PNG, +AC_DEFUN([AC_FIND_PNG], [ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) AC_REQUIRE([AC_FIND_ZLIB]) @@ -2566,14 +2664,14 @@ AC_MSG_CHECKING([for libpng]) AC_CACHE_VAL(ac_cv_lib_png, [ kde_save_LIBS="$LIBS" -if test "x$kde_use_qt_emb" != "xyes"; then +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET" else LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm" fi kde_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" -AC_LANG_C + AC_TRY_LINK(dnl [ #include @@ -2601,12 +2699,49 @@ else fi ]) -AC_DEFUN(AC_CHECK_BOOL, + +AC_DEFUN([AC_FIND_JASPER], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_JPEG]) +AC_MSG_CHECKING([for jasper]) +AC_CACHE_VAL(ac_cv_jasper, +[ +kde_save_LIBS="$LIBS" +LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl + [ + #include + ], + [ + return( jas_init() ); + ], + eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'", + eval "ac_cv_jasper=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper]) + LIB_JASPER="$ac_cv_jasper" + AC_MSG_RESULT($ac_cv_jasper) +else + AC_MSG_RESULT(no) + LIB_JASPER="" +fi +AC_SUBST(LIB_JASPER) +]) + +AC_DEFUN([AC_CHECK_BOOL], [ AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool]) ]) -AC_DEFUN(AC_CHECK_GNU_EXTENSIONS, +AC_DEFUN([AC_CHECK_GNU_EXTENSIONS], [ AC_MSG_CHECKING(if you need GNU extensions) AC_CACHE_VAL(ac_cv_gnu_extensions, @@ -2634,10 +2769,10 @@ if test "$ac_cv_gnu_extensions" = "yes"; then fi ]) -AC_DEFUN(KDE_CHECK_COMPILER_FLAG, +AC_DEFUN([KDE_CHECK_COMPILER_FLAG], [ -AC_MSG_CHECKING(whether $CXX supports -$1) -kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` +AC_MSG_CHECKING([whether $CXX supports -$1]) +kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'` AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, [ AC_LANG_SAVE @@ -2659,10 +2794,36 @@ else fi ]) +AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG], +[ +AC_MSG_CHECKING([whether $CC supports -$1]) +kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'` +AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache, +[ + AC_LANG_SAVE + AC_LANG_C + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -$1" + AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], []) + CFLAGS="$save_CFLAGS" + AC_LANG_RESTORE +]) +if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + + dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) dnl it's all white-space separated -AC_DEFUN(AC_REMOVE_FORBIDDEN, +AC_DEFUN([AC_REMOVE_FORBIDDEN], [ __val=$$1 __forbid=" $2 " if test -n "$__val"; then @@ -2683,7 +2844,7 @@ AC_DEFUN(AC_REMOVE_FORBIDDEN, ]) dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given -AC_DEFUN(AC_VALIDIFY_CXXFLAGS, +AC_DEFUN([AC_VALIDIFY_CXXFLAGS], [dnl if test "x$kde_use_qt_emb" != "xyes"; then AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) @@ -2694,9 +2855,10 @@ else fi ]) -AC_DEFUN(AC_CHECK_COMPILERS, +AC_DEFUN([AC_CHECK_COMPILERS], [ - AC_ARG_ENABLE(debug,[ --enable-debug[=ARG] enables debug symbols (yes|no|full) [default=no]], + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]), [ case $enableval in yes) @@ -2718,9 +2880,14 @@ AC_DEFUN(AC_CHECK_COMPILERS, ]) dnl Just for configure --help - AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[]) - - AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)], + AC_ARG_ENABLE(dummyoption, + AC_HELP_STRING([--disable-debug], + [disables debug output and debug symbols [default=no]]), + [],[]) + + AC_ARG_ENABLE(strict, + AC_HELP_STRING([--enable-strict], + [compiles with strict compiler options (may not work!)]), [ if test $enableval = "no"; then kde_use_strict_options="no" @@ -2729,7 +2896,7 @@ AC_DEFUN(AC_CHECK_COMPILERS, fi ], [kde_use_strict_options="no"]) - AC_ARG_ENABLE(warnings,[ --disable-warnings disables compilation with -Wall and similiar], + AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similiar]), [ if test $enableval = "no"; then kde_use_warnings="no" @@ -2743,16 +2910,11 @@ AC_DEFUN(AC_CHECK_COMPILERS, kde_use_warnings=yes fi - AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]], + AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]), [kde_use_profiling=$enableval], [kde_use_profiling="no"] ) - AC_ARG_ENABLE(gcov,[ --enable-gcov enables gcov test coverage support [default=no]], - [kde_use_gcov=$enableval], - [kde_use_gcov=no] - ) - dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS CFLAGS=" $CFLAGS" @@ -2762,8 +2924,8 @@ AC_DEFUN(AC_CHECK_COMPILERS, if test "$GCC" = "yes"; then if test "$kde_use_debug_code" != "no"; then - if test $kde_use_debug_code = "full" || test $kde_use_gcov = "yes"; then - CFLAGS="-g3 $CFLAGS" + if test $kde_use_debug_code = "full"; then + CFLAGS="-g3 -fno-inline $CFLAGS" else CFLAGS="-g -O2 $CFLAGS" fi @@ -2796,7 +2958,7 @@ AC_DEFUN(AC_CHECK_COMPILERS, CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS" else if test "$kde_use_debug_code" = "full"; then - CXXFLAGS="-g3 $CXXFLAGS" + CXXFLAGS="-g3 -fno-inline $CXXFLAGS" else CXXFLAGS="-g -O2 $CXXFLAGS" fi @@ -2827,37 +2989,33 @@ AC_DEFUN(AC_CHECK_COMPILERS, ]) fi - if test "$kde_use_gcov" = "yes"; then - KDE_CHECK_COMPILER_FLAG(fprofile-arcs, - [ - CFLAGS="-fprofile-arcs -ftest-coverage $CFLAGS" - CXXFLAGS="-fprofile-arcs -ftest-coverage $CXXFLAGS" - ]) - fi - if test "$kde_use_warnings" = "yes"; then if test "$GCC" = "yes"; then + CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS" case $host in *-*-linux-gnu) - CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS" - CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS" + CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS" + CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS" + KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"]) + KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"]) ;; esac - CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS" KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"]) KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"]) KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"]) fi fi - if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then + if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS" fi if test "$GXX" = "yes"; then KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"]) KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"]) + KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"]) KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= ) + ENABLE_PERMISSIVE_FLAG="-fpermissive" fi if test "$CXX" = "KCC"; then dnl unfortunately we currently cannot disable exception support in KCC @@ -2865,7 +3023,9 @@ AC_DEFUN(AC_CHECK_COMPILERS, dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"]) dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= ) - AC_ARG_ENABLE(pch,[ --enable-pch enables precompiled header support (currently only KCC) [default=no]], + AC_ARG_ENABLE(pch, + AC_HELP_STRING([--enable-pch], + [enables precompiled header support (currently only KCC) [default=no]]), [ kde_use_pch=$enableval ],[kde_use_pch=no]) @@ -2920,26 +3080,29 @@ AC_DEFUN(AC_CHECK_COMPILERS, AC_PROG_CXXCPP if test "$GCC" = yes; then - NOOPT_CXXFLAGS=-O0 NOOPT_CFLAGS=-O0 fi + KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0]) AC_SUBST(NOOPT_CXXFLAGS) AC_SUBST(NOOPT_CFLAGS) + AC_SUBST(ENABLE_PERMISSIVE_FLAG) KDE_CHECK_FINAL + KDE_CHECK_CLOSURE + KDE_CHECK_NMCHECK ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), []) ]) -AC_DEFUN(KDE_ADD_DEPENDENCIES, +AC_DEFUN([KDE_ADD_DEPENDENCIES], [ [A]M_DEPENDENCIES(CC) [A]M_DEPENDENCIES(CXX) ]) dnl just a wrapper to clean up configure.in -AC_DEFUN(KDE_PROG_LIBTOOL, +AC_DEFUN([KDE_PROG_LIBTOOL], [ AC_REQUIRE([AC_CHECK_COMPILERS]) AC_REQUIRE([AC_ENABLE_SHARED]) @@ -2948,35 +3111,22 @@ AC_REQUIRE([AC_ENABLE_STATIC]) AC_REQUIRE([AC_LIBTOOL_DLOPEN]) AC_REQUIRE([KDE_CHECK_LIB64]) -AC_LANG_SAVE -AC_LANG_C AC_OBJEXT AC_EXEEXT -AC_LANG_RESTORE AM_PROG_LIBTOOL AC_LIBTOOL_CXX LIBTOOL_SHELL="/bin/sh ./libtool" # LIBTOOL="$LIBTOOL --silent" -KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)" +KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)" AC_SUBST(KDE_PLUGIN) -AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps using objprelink (obsolete)], - kde_use_objprelink=$enableval, kde_use_objprelink=no) - if test "x$kde_use_objprelink" = "xyes"; then - AC_MSG_WARN([ ------------------------------------------------------------- -Configuration option --enable-objprelink is no longer useful. -See http:://objprelink.sourceforge.net for details: -1- Recent binutils are fast enough to do without objprelink. -2- Newer versions of objprelink do not need this option. ------------------------------------------------------------- -]) - fi +# we patch configure quite some so we better keep that consistent for incremental runs +AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure') ]) -AC_DEFUN(KDE_CHECK_LIB64, +AC_DEFUN([KDE_CHECK_LIB64], [ kdelibsuff=no AC_ARG_ENABLE(libsuffix, @@ -2996,19 +3146,20 @@ AC_DEFUN(KDE_CHECK_LIB64, libdir="$libdir${kdelibsuff}" AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms fi - AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories) + AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories) AC_MSG_RESULT([using lib directory suffix $kdelibsuff]) fi ]) -AC_DEFUN(KDE_CHECK_TYPES, +AC_DEFUN([KDE_CHECK_TYPES], [ AC_CHECK_SIZEOF(int, 4)dnl + AC_CHECK_SIZEOF(short)dnl AC_CHECK_SIZEOF(long, 4)dnl AC_CHECK_SIZEOF(char *, 4)dnl - AC_CHECK_SIZEOF(char, 1)dnl ])dnl -AC_DEFUN(KDE_DO_IT_ALL, +dnl Not used - kept for compat only? +AC_DEFUN([KDE_DO_IT_ALL], [ AC_CANONICAL_SYSTEM AC_ARG_PROGRAM @@ -3021,11 +3172,11 @@ AM_KDE_WITH_NLS AC_PATH_KDE ]) -AC_DEFUN(AC_CHECK_RPATH, +AC_DEFUN([AC_CHECK_RPATH], [ AC_MSG_CHECKING(for rpath) AC_ARG_ENABLE(rpath, - [ --disable-rpath do not use the rpath feature of ld], + AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]), USE_RPATH=$enableval, USE_RPATH=yes) if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then @@ -3037,7 +3188,7 @@ if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then fi dnl $x_libraries is set to /usr/lib in case if test -n "$X_LDFLAGS"; then - X_RPATH="-R \$(x_libraries)" + X_RPATH="-R \$(x_libraries)" KDE_RPATH="$KDE_RPATH $X_RPATH" fi if test -n "$KDE_EXTRA_RPATH"; then @@ -3051,40 +3202,56 @@ AC_MSG_RESULT($USE_RPATH) ]) dnl Check for the type of the third argument of getsockname -AC_DEFUN(AC_CHECK_SOCKLEN_T, [ - AC_MSG_CHECKING(for socklen_t) - AC_CACHE_VAL(ac_cv_socklen_t, [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([ -#include -#include - ],[ -socklen_t a=0; -getsockname(0,(struct sockaddr*)0, &a); - ], - ac_cv_socklen_t=socklen_t, +AC_DEFUN([AC_CHECK_SOCKLEN_T], +[ + AC_MSG_CHECKING(for socklen_t) + AC_CACHE_VAL(kde_cv_socklen_t, + [ + AC_LANG_PUSH(C++) + kde_cv_socklen_t=no AC_TRY_COMPILE([ -#include -#include - ],[ -int a=0; -getsockname(0,(struct sockaddr*)0, &a); - ], - ac_cv_socklen_t=int, - ac_cv_socklen_t=size_t - ) - ) - AC_LANG_RESTORE - ]) - - AC_MSG_RESULT($ac_cv_socklen_t) - if test "$ac_cv_socklen_t" != "socklen_t"; then - AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t, - [Define the real type of socklen_t]) - fi - AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define]) - + #include + #include + ], + [ + socklen_t len; + getpeername(0,0,&len); + ], + [ + kde_cv_socklen_t=yes + kde_cv_socklen_t_equiv=socklen_t + ]) + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT($kde_cv_socklen_t) + if test $kde_cv_socklen_t = no; then + AC_MSG_CHECKING([for socklen_t equivalent for socket functions]) + AC_CACHE_VAL(kde_cv_socklen_t_equiv, + [ + kde_cv_socklen_t_equiv=int + AC_LANG_PUSH(C++) + for t in int size_t unsigned long "unsigned long"; do + AC_TRY_COMPILE([ + #include + #include + ], + [ + $t len; + getpeername(0,0,&len); + ], + [ + kde_cv_socklen_t_equiv="$t" + break + ]) + done + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT($kde_cv_socklen_t_equiv) + fi + AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined]) + AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)]) ]) dnl This is a merge of some macros out of the gettext aclocal.m4 @@ -3103,7 +3270,7 @@ dnl PARTICULAR PURPOSE. dnl > dnl for this file it is relicensed under LGPL -AC_DEFUN(AM_KDE_WITH_NLS, +AC_DEFUN([AM_KDE_WITH_NLS], [ dnl If we use NLS figure out what method @@ -3146,7 +3313,7 @@ AC_DEFUN(AM_KDE_WITH_NLS, dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE, +AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) @@ -3188,7 +3355,7 @@ AC_SUBST($1)dnl # serial 1 -AC_DEFUN(AM_LC_MESSAGES, +AC_DEFUN([AM_LC_MESSAGES], [if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], @@ -3234,7 +3401,7 @@ AC_DEFUN([AM_FUNC_ERROR_AT_LINE], # serial 1 # Stephan Kulow: I put a KDE in it to avoid name conflicts -AC_DEFUN(AM_KDE_GNU_GETTEXT, +AC_DEFUN([AM_KDE_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_HEADER_STDC])dnl @@ -3296,14 +3463,14 @@ __argz_count __argz_stringify __argz_next]) ]) -AC_DEFUN(AC_HAVE_XPM, +AC_DEFUN([AC_HAVE_XPM], [AC_REQUIRE_CPP()dnl AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) test -z "$XPM_LDFLAGS" && XPM_LDFLAGS= test -z "$XPM_INCLUDE" && XPM_INCLUDE= - AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests], + AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]), xpm_test=$withval, xpm_test="yes") if test "x$xpm_test" = xno; then ac_cv_have_xpm=no @@ -3311,10 +3478,9 @@ AC_DEFUN(AC_HAVE_XPM, AC_MSG_CHECKING(for XPM) AC_CACHE_VAL(ac_cv_have_xpm, [ - AC_LANG_C ac_save_ldflags="$LDFLAGS" ac_save_cflags="$CFLAGS" - if test "x$kde_use_qt_emb" != "xyes"; then + if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET" else LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET" @@ -3352,7 +3518,7 @@ AC_DEFUN(AC_HAVE_XPM, AC_SUBST(XPMLIB) ]) -AC_DEFUN(AC_HAVE_DPMS, +AC_DEFUN([AC_HAVE_DPMS], [AC_REQUIRE_CPP()dnl AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) @@ -3360,7 +3526,7 @@ AC_DEFUN(AC_HAVE_DPMS, test -z "$DPMS_INCLUDE" && DPMS_INCLUDE= DPMS_LIB= - AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving], + AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]), dpms_test=$withval, dpms_test="yes") if test "x$dpms_test" = xno; then ac_cv_have_dpms=no @@ -3370,11 +3536,10 @@ AC_DEFUN(AC_HAVE_DPMS, dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms". AC_CACHE_VAL(ac_cv_have_dpms, [ - if test "x$kde_use_qt_emb" = "xyes"; then + if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then AC_MSG_RESULT(no) ac_cv_have_dpms="no" else - AC_LANG_C ac_save_ldflags="$LDFLAGS" ac_save_cflags="$CFLAGS" ac_save_libs="$LIBS" @@ -3436,18 +3601,32 @@ AC_DEFUN(AC_HAVE_DPMS, $1 fi fi + ac_save_cflags="$CFLAGS" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO, + [Define if you have the DPMSCapable prototype in ]) + AC_CHECK_DECL(DPMSCapable, + AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),, + [#include ]) + AH_TEMPLATE(HAVE_DPMSINFO_PROTO, + [Define if you have the DPMSInfo prototype in ]) + AC_CHECK_DECL(DPMSInfo, + AC_DEFINE(HAVE_DPMSINFO_PROTO),, + [#include ]) + CFLAGS="$ac_save_cflags" AC_SUBST(DPMSINC) AC_SUBST(DPMSLIB) ]) -AC_DEFUN(AC_HAVE_GL, +AC_DEFUN([AC_HAVE_GL], [AC_REQUIRE_CPP()dnl AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) test -z "$GL_LDFLAGS" && GL_LDFLAGS= test -z "$GL_INCLUDE" && GL_INCLUDE= - AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes], + AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]), gl_test=$withval, gl_test="yes") if test "x$kde_use_qt_emb" = "xyes"; then # GL and Qt Embedded is a no-go for now. @@ -3463,7 +3642,7 @@ AC_DEFUN(AC_HAVE_GL, ac_save_ldflags="$LDFLAGS" ac_save_cxxflags="$CXXFLAGS" LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU" - test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" + test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET" CXXFLAGS="$CFLAGS $X_INCLUDES" test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" @@ -3473,7 +3652,7 @@ AC_DEFUN(AC_HAVE_GL, ac_cv_have_gl="mesa", ac_cv_have_gl="no") if test "x$ac_cv_have_gl" = "xno"; then LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL" - test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" + test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET" CXXFLAGS="$ac_save_cflags $X_INCLUDES" test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" @@ -3523,63 +3702,74 @@ AC_DEFUN(AC_HAVE_GL, dnl shadow password and PAM magic - maintained by ossi@kde.org -AC_DEFUN(KDE_PAM, [ +AC_DEFUN([KDE_PAM], [ AC_REQUIRE([KDE_CHECK_LIBDL]) + want_pam= AC_ARG_WITH(pam, - [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]], + AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]), [ if test "x$withval" = "xyes"; then - use_pam=yes + want_pam=yes pam_service=kde elif test "x$withval" = "xno"; then - use_pam=no + want_pam=no else - use_pam=yes + want_pam=yes pam_service=$withval fi - ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service" - ], [ - AC_CACHE_VAL(ac_cv_path_pam, - [ use_pam=no - AC_CHECK_LIB(pam, pam_start, - [ AC_CHECK_HEADER(security/pam_appl.h, - [ use_pam=yes - pam_service=kde ]) - ], , $LIBDL) - ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service" - ]) - ]) - eval "$ac_cv_path_pam" + ], [ pam_service=kde ]) + + use_pam= + PAMLIBS= + if test "x$want_pam" != xno; then + AC_CHECK_LIB(pam, pam_start, [ + AC_CHECK_HEADER(security/pam_appl.h, + [ pam_header=security/pam_appl.h ], + [ AC_CHECK_HEADER(pam/pam_appl.h, + [ pam_header=pam/pam_appl.h ], + [ + AC_MSG_WARN([PAM detected, but no headers found! +Make sure you have the necessary development packages installed.]) + ] + ) + ] + ) + ], , $LIBDL) + if test -z "$pam_header"; then + if test "x$want_pam" = xyes; then + AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!]) + fi + else + AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)]) + PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL" + use_pam=yes - AC_MSG_CHECKING(for PAM) - if test "x$use_pam" = xno; then - AC_MSG_RESULT(no) - PAMLIBS="" - else - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)]) - PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL" - - dnl test whether struct pam_message is const (Linux) or not (Sun) - AC_MSG_CHECKING(for const pam_message) - AC_EGREP_HEADER([struct pam_message], security/pam_appl.h, - [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h, - [AC_MSG_RESULT([const: Linux-type PAM])], - [AC_MSG_RESULT([nonconst: Sun-type PAM]) - AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])] - )], - [AC_MSG_RESULT([not found - assume const, Linux-type PAM])]) + dnl darwin claims to be something special + if test "$pam_header" = "pam/pam_appl.h"; then + AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/]) + fi + + dnl test whether struct pam_message is const (Linux) or not (Sun) + AC_MSG_CHECKING(for const pam_message) + AC_EGREP_HEADER([struct pam_message], $pam_header, + [ AC_EGREP_HEADER([const struct pam_message], $pam_header, + [AC_MSG_RESULT([const: Linux-type PAM])], + [AC_MSG_RESULT([nonconst: Sun-type PAM]) + AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])] + )], + [AC_MSG_RESULT([not found - assume const, Linux-type PAM])]) + fi fi AC_SUBST(PAMLIBS) ]) dnl DEF_PAM_SERVICE(arg name, full name, define name) -AC_DEFUN(DEF_PAM_SERVICE, [ +AC_DEFUN([DEF_PAM_SERVICE], [ AC_ARG_WITH($1-pam, - [ --with-$1-pam=[val] override PAM service from --with-pam for $2], + AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]), [ if test "x$use_pam" = xyes; then - $3_PAM_SERVICE="$withval" + $3_PAM_SERVICE=$withval else AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected. You may want to enforce it by using --with-pam.]) @@ -3596,7 +3786,7 @@ You may want to enforce it by using --with-pam.]) AC_SUBST($3_PAM_SERVICE) ]) -AC_DEFUN(KDE_SHADOWPASSWD, [ +AC_DEFUN([KDE_SHADOWPASSWD], [ AC_REQUIRE([KDE_PAM]) AC_CHECK_LIB(shadow, getspent, @@ -3619,7 +3809,7 @@ AC_DEFUN(KDE_SHADOWPASSWD, [ AC_MSG_CHECKING([for shadow passwords]) AC_ARG_WITH(shadow, - [ --with-shadow If you want shadow password support ], + AC_HELP_STRING([--with-shadow],[If you want shadow password support]), [ if test "x$withval" != "xno"; then use_shadow=yes else @@ -3653,7 +3843,7 @@ AC_DEFUN(KDE_SHADOWPASSWD, [ ]) -AC_DEFUN(KDE_PASSWDLIBS, [ +AC_DEFUN([KDE_PASSWDLIBS], [ AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT AC_REQUIRE([KDE_PAM]) AC_REQUIRE([KDE_SHADOWPASSWD]) @@ -3679,7 +3869,7 @@ AC_DEFUN(KDE_PASSWDLIBS, [ AC_SUBST(PASSWDLIBS) ]) -AC_DEFUN(KDE_CHECK_LIBDL, +AC_DEFUN([KDE_CHECK_LIBDL], [ AC_CHECK_LIB(dl, dlopen, [ LIBDL="-ldl" @@ -3694,7 +3884,7 @@ ac_cv_have_shload=yes AC_SUBST(LIBDL) ]) -AC_DEFUN(KDE_CHECK_DLOPEN, +AC_DEFUN([KDE_CHECK_DLOPEN], [ KDE_CHECK_LIBDL AC_CHECK_HEADERS(dlfcn.h dl.h) @@ -3709,7 +3899,7 @@ fi dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE dnl (MM) AC_ARG_ENABLE(dlopen, -[ --disable-dlopen link statically [default=no]] , +AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]), enable_dlopen=$enableval, enable_dlopen=yes) @@ -3734,7 +3924,7 @@ fi ]) -AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING, +AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING], [ KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no) KDE_PROG_LIBTOOL @@ -3754,7 +3944,7 @@ else fi ]) -AC_DEFUN(KDE_ADD_INCLUDES, +AC_DEFUN([KDE_ADD_INCLUDES], [ if test -z "$1"; then test_include="Pix.h" @@ -3791,165 +3981,60 @@ fi ]) ]) - -AC_DEFUN(KDE_CHECK_MICO, +AC_DEFUN([KDE_CHECK_LIBPTHREAD], [ -AC_REQUIRE([KDE_CHECK_LIBDL]) -AC_REQUIRE([KDE_MISC_TESTS]) -AC_MSG_CHECKING(for MICO) - -if test -z "$MICODIR"; then - kde_micodir=/usr/local - else - kde_micodir="$MICODIR" -fi - -AC_ARG_WITH(micodir, - [ --with-micodir=micodir where mico is installed ], - kde_micodir=$withval, - kde_micodir=$kde_micodir -) - -AC_CACHE_VAL(kde_cv_mico_incdir, -[ - mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes" -AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir) + dnl This code is here specifically to handle the + dnl various flavors of threading library on FreeBSD + dnl 4-, 5-, and 6-, and the (weird) rules around it. + dnl There may be an environment PTHREAD_LIBS that + dnl specifies what to use; otherwise, search for it. + dnl -pthread is special cased and unsets LIBPTHREAD + dnl below if found. + LIBPTHREAD="" -]) -kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'` - -if test ! -r $kde_micodir/include/CORBA.h; then - AC_MSG_ERROR([No CORBA.h found, specify another micodir]) -fi - -AC_MSG_RESULT($kde_micodir) - -MICO_INCLUDES=-I$kde_micodir/include -AC_SUBST(MICO_INCLUDES) -MICO_LDFLAGS=-L$kde_micodir/lib -AC_SUBST(MICO_LDFLAGS) -micodir=$kde_micodir -AC_SUBST(micodir) - -AC_MSG_CHECKING([for MICO version]) -AC_CACHE_VAL(kde_cv_mico_version, -[ -AC_LANG_C -cat >conftest.$ac_ext < -#include -int main() { - - printf("MICO_VERSION=%s\n",MICO_VERSION); - return (0); -} -EOF -ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest' -if AC_TRY_EVAL(ac_compile); then - if eval `./conftest 2>&5`; then - kde_cv_mico_version=$MICO_VERSION - else - AC_MSG_ERROR([your system is not able to execute a small application to - find MICO version! Check $kde_micodir/include/mico/version.h]) + if test -n "$PTHREAD_LIBS"; then + if test "x$PTHREAD_LIBS" = "x-pthread" ; then + LIBPTHREAD="PTHREAD" + else + PTHREAD_LIBS_save="$PTHREAD_LIBS" + PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'` + AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS]) + KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [ + LIBPTHREAD="$PTHREAD_LIBS_save"]) + PTHREAD_LIBS="$PTHREAD_LIBS_save" + fi fi -else - AC_MSG_ERROR([your system is not able to compile a small application to - find MICO version! Check $kde_micodir/include/mico/version.h]) -fi -]) - -dnl installed MICO version -mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'` -mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'` -mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'` - -if test "x$1" = "x"; then - req_version="2.3.0" -else - req_version=$1 -fi - -dnl required MICO version -req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'` -req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'` -req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'` -if test "$mico_v_maj" -lt "$req_v_maj" || \ - ( test "$mico_v_maj" -eq "$req_v_maj" && \ - test "$mico_v_mid" -lt "$req_v_mid" ) || \ - ( test "$mico_v_mid" -eq "$req_v_mid" && \ - test "$mico_v_min" -lt "$req_v_min" ) - -then - AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \ -at least is required. You should upgrade MICO.]) -else - AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)]) -fi - -LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL" -AC_SUBST(LIBMICO) -if test -z "$IDL"; then - IDL='$(kde_bindir)/cuteidl' -fi -AC_SUBST(IDL) -IDL_DEPENDENCIES='$(kde_includes)/CUTE.h' -AC_SUBST(IDL_DEPENDENCIES) - -idldir="\$(includedir)/idl" -AC_SUBST(idldir) - -]) - -AC_DEFUN(KDE_CHECK_MINI_STL, -[ -AC_REQUIRE([KDE_CHECK_MICO]) - -AC_MSG_CHECKING(if we use mico's mini-STL) -AC_CACHE_VAL(kde_cv_have_mini_stl, -[ -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -kde_save_cxxflags="$CXXFLAGS" -CXXFLAGS="$CXXFLAGS $MICO_INCLUDES" -AC_TRY_COMPILE( -[ -#include -], -[ -#ifdef HAVE_MINI_STL -#error "nothing" -#endif -], -kde_cv_have_mini_stl=no, -kde_cv_have_mini_stl=yes) -CXXFLAGS="$kde_save_cxxflags" -AC_LANG_RESTORE -]) - -if test "x$kde_cv_have_mini_stl" = "xyes"; then - AC_MSG_RESULT(yes) - $1 -else - AC_MSG_RESULT(no) - $2 -fi -]) + dnl Is this test really needed, in the face of the Tru64 test below? + if test -z "$LIBPTHREAD"; then + AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"]) + fi -]) + dnl This is a special Tru64 check, see BR 76171 issue #18. + if test -z "$LIBPTHREAD" ; then + AC_MSG_CHECKING([for pthread_create in -lpthread]) + kde_safe_libs=$LIBS + LIBS="$LIBS -lpthread" + AC_TRY_LINK([#include ],[(void)pthread_create(0,0,0,0);],[ + AC_MSG_RESULT(yes) + LIBPTHREAD="-lpthread"],[ + AC_MSG_RESULT(no)]) + LIBS=$kde_safe_libs + fi + dnl Un-special-case for FreeBSD. + if test "x$LIBPTHREAD" = "xPTHREAD" ; then + LIBPTHREAD="" + fi -AC_DEFUN(KDE_CHECK_LIBPTHREAD, -[ -AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] ) -AC_SUBST(LIBPTHREAD) + AC_SUBST(LIBPTHREAD) ]) -AC_DEFUN(KDE_CHECK_PTHREAD_OPTION, +AC_DEFUN([KDE_CHECK_PTHREAD_OPTION], [ USE_THREADS="" if test -z "$LIBPTHREAD"; then - KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] ) + KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"]) fi AH_VERBATIM(__svr_define, [ @@ -3963,7 +4048,7 @@ AC_DEFUN(KDE_CHECK_PTHREAD_OPTION, CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" ;; freebsd*) - CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS" ;; aix*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" @@ -3982,7 +4067,7 @@ AC_DEFUN(KDE_CHECK_PTHREAD_OPTION, AC_SUBST(LIBPTHREAD) ]) -AC_DEFUN(KDE_CHECK_THREADING, +AC_DEFUN([KDE_CHECK_THREADING], [ AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION]) @@ -3996,14 +4081,14 @@ AC_DEFUN(KDE_CHECK_THREADING, else kde_check_threading_default=yes fi - AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ], + AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]), kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default) if test "x$kde_use_threading" = "xyes"; then AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) fi ]) -AC_DEFUN(KDE_TRY_LINK_PYTHON, +AC_DEFUN([KDE_TRY_LINK_PYTHON], [ if test "$kde_python_link_found" = no; then @@ -4015,8 +4100,6 @@ fi AC_CACHE_VAL(kde_cv_try_link_python_$1, [ -AC_LANG_SAVE -AC_LANG_C kde_save_cflags="$CFLAGS" CFLAGS="$CFLAGS $PYTHONINC" kde_save_libs="$LIBS" @@ -4049,13 +4132,12 @@ else AC_MSG_RESULT(no) $4 fi -AC_LANG_RESTORE fi ]) -AC_DEFUN(KDE_CHECK_PYTHON_DIR, +AC_DEFUN([KDE_CHECK_PYTHON_DIR], [ AC_MSG_CHECKING([for Python directory]) @@ -4069,7 +4151,7 @@ AC_CACHE_VAL(kde_cv_pythondir, ]) AC_ARG_WITH(pythondir, -[ --with-pythondir=pythondir use python installed in pythondir ], +AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]), [ ac_python_dir=$withval ], ac_python_dir=$kde_cv_pythondir @@ -4078,7 +4160,7 @@ AC_ARG_WITH(pythondir, AC_MSG_RESULT($ac_python_dir) ]) -AC_DEFUN(KDE_CHECK_PYTHON_INTERN, +AC_DEFUN([KDE_CHECK_PYTHON_INTERN], [ AC_REQUIRE([KDE_CHECK_LIBDL]) AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) @@ -4104,13 +4186,16 @@ fi PYTHONINC=-I$python_incdir -python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs" -AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir) -if test ! -r $python_libdir/libpython$version.a; then - AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir) - python_libdir=$python_libdir/python$version/config +python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs" +AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir) +if test ! -r $python_libdir/libpython$version.so; then + AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir) if test ! -r $python_libdir/libpython$version.a; then - python_libdir=no + AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir) + python_libdir=$python_libdir/python$version/config + if test ! -r $python_libdir/libpython$version.a; then + python_libdir=no + fi fi fi @@ -4120,7 +4205,6 @@ if test -z "$LIBPYTHON"; then LIBPYTHON=-lpython$version fi -python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs" AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir) python_moddir=$python_moddir/python$version if test ! -r $python_moddir/copy.py; then @@ -4150,9 +4234,10 @@ else KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3]) KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil]) KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm]) + KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses]) KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [], [AC_MSG_WARN([it seems, Python depends on another library. - Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this + Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this and contact the authors to let them know about this problem]) ]) @@ -4167,19 +4252,27 @@ fi ]) -AC_DEFUN(KDE_CHECK_PYTHON, +AC_DEFUN([KDE_CHECK_PYTHON], [ KDE_CHECK_PYTHON_INTERN("2.3", - [KDE_CHECK_PYTHON_INTERN("2.2", - [KDE_CHECK_PYTHON_INTERN("2.1", - [KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ]) - ])])]) + [KDE_CHECK_PYTHON_INTERN("2.2", + [KDE_CHECK_PYTHON_INTERN("2.1", + [KDE_CHECK_PYTHON_INTERN("2.0", + [KDE_CHECK_PYTHON_INTERN($1, $2) ]) + ]) + ]) + ]) ]) -AC_DEFUN(KDE_CHECK_STL_SGI, +AC_DEFUN([KDE_CHECK_STL], [ - AC_MSG_CHECKING([if STL implementation is SGI like]) - AC_CACHE_VAL(kde_cv_stl_type_sgi, + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`" + + AC_MSG_CHECKING([if C++ programs can be compiled]) + AC_CACHE_VAL(kde_cv_stl_works, [ AC_TRY_COMPILE([ #include @@ -4188,60 +4281,26 @@ using namespace std; string astring="Hallo Welt."; astring.erase(0, 6); // now astring is "Welt" return 0; -], kde_cv_stl_type_sgi=yes, - kde_cv_stl_type_sgi=no) +], kde_cv_stl_works=yes, + kde_cv_stl_works=no) ]) - AC_MSG_RESULT($kde_cv_stl_type_sgi) + AC_MSG_RESULT($kde_cv_stl_works) - if test "$kde_cv_stl_type_sgi" = "yes"; then - AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI]) - fi -]) - -AC_DEFUN(KDE_CHECK_STL_HP, -[ - AC_MSG_CHECKING([if STL implementation is HP like]) - AC_CACHE_VAL(kde_cv_stl_type_hp, - [ - AC_TRY_COMPILE([ -#include -using namespace std; -],[ - string astring="Hello World"; - astring.remove(0, 6); // now astring is "World" - return 0; -], kde_cv_stl_type_hp=yes, - kde_cv_stl_type_hp=no) -]) - AC_MSG_RESULT($kde_cv_stl_type_hp) - - if test "$kde_cv_stl_type_hp" = "yes"; then - AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP]) + if test "$kde_cv_stl_works" = "yes"; then + # back compatible + AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI]) + else + AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs. +Check config.log for details - if you're using a Linux distribution you might miss +a package named similiar to libstd++-dev.]) fi -]) -AC_DEFUN(KDE_CHECK_STL, -[ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`" - KDE_CHECK_STL_SGI - - if test "$kde_cv_stl_type_sgi" = "no"; then - KDE_CHECK_STL_HP - - if test "$kde_cv_stl_type_hp" = "no"; then - AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?") - fi - fi - - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE ]) -AC_DEFUN(AC_FIND_QIMGIO, +AC_DEFUN([AC_FIND_QIMGIO], [AC_REQUIRE([AC_FIND_JPEG]) AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) AC_MSG_CHECKING([for qimgio]) @@ -4280,28 +4339,7 @@ else fi ]) -AC_DEFUN(KDE_CHECK_ANSI, -[ -]) - -AC_DEFUN(KDE_CHECK_INSURE, -[ - AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]], - [ - if test $enableval = "no"; dnl - then ac_use_insure="no" - else ac_use_insure="yes" - fi - ], [ac_use_insure="no"]) - - AC_MSG_CHECKING(if we will use Insure++ to debug) - AC_MSG_RESULT($ac_use_insure) - if test "$ac_use_insure" = "yes"; dnl - then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "???? - fi -]) - -AC_DEFUN(AM_DISABLE_LIBRARIES, +AC_DEFUN([AM_DISABLE_LIBRARIES], [ AC_PROVIDE([AM_ENABLE_STATIC]) AC_PROVIDE([AM_ENABLE_SHARED]) @@ -4310,7 +4348,7 @@ AC_DEFUN(AM_DISABLE_LIBRARIES, ]) -AC_DEFUN(AC_CHECK_UTMP_FILE, +AC_DEFUN([AC_CHECK_UTMP_FILE], [ AC_MSG_CHECKING([for utmp file]) @@ -4343,7 +4381,7 @@ AC_DEFUN(AC_CHECK_UTMP_FILE, ]) -AC_DEFUN(KDE_CREATE_SUBDIRSLIST, +AC_DEFUN([KDE_CREATE_SUBDIRSLIST], [ DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin" @@ -4358,9 +4396,10 @@ if test ! -s $srcdir/subdirs; then done fi +ac_topsubdirs= if test -s $srcdir/inst-apps; then ac_topsubdirs="`cat $srcdir/inst-apps`" -else +elif test -s $srcdir/subdirs; then ac_topsubdirs="`cat $srcdir/subdirs`" fi @@ -4377,7 +4416,7 @@ for i in $ac_topsubdirs; do install_it="no" fi AC_MSG_RESULT($install_it) - vari=`echo $i | sed -e 's,[[-+.]],_,g'` + vari=`echo $i | sed -e 's,[[-+.@]],_,g'` if test $install_it = "yes"; then TOPSUBDIRS="$TOPSUBDIRS $i" eval "$vari""_SUBDIR_included=yes" @@ -4389,7 +4428,7 @@ done AC_SUBST(TOPSUBDIRS) ]) -AC_DEFUN(KDE_CHECK_NAMESPACES, +AC_DEFUN([KDE_CHECK_NAMESPACES], [ AC_MSG_CHECKING(whether C++ compiler supports namespaces) AC_LANG_SAVE @@ -4415,22 +4454,15 @@ AC_MSG_RESULT(no) AC_LANG_RESTORE ]) -AC_DEFUN(KDE_CHECK_NEWLIBS, -[ - -]) - dnl ------------------------------------------------------------------------ dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org dnl ------------------------------------------------------------------------ dnl -AC_DEFUN(AC_CHECK_S_ISSOCK, +AC_DEFUN([AC_CHECK_S_ISSOCK], [ AC_MSG_CHECKING(for S_ISSOCK) AC_CACHE_VAL(ac_cv_have_s_issock, [ -AC_LANG_SAVE -AC_LANG_C AC_TRY_LINK( [ #include @@ -4441,7 +4473,6 @@ int b = S_ISSOCK( buff.st_mode ); ], ac_cv_have_s_issock=yes, ac_cv_have_s_issock=no) -AC_LANG_RESTORE ]) AC_MSG_RESULT($ac_cv_have_s_issock) if test "$ac_cv_have_s_issock" = "yes"; then @@ -4462,12 +4493,11 @@ dnl ------------------------------------------------------------------------ dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org dnl ------------------------------------------------------------------------ dnl -AC_DEFUN(AC_CHECK_KDEMAXPATHLEN, +AC_DEFUN([AC_CHECK_KDEMAXPATHLEN], [ AC_MSG_CHECKING(for MAXPATHLEN) AC_CACHE_VAL(ac_cv_maxpathlen, [ -AC_LANG_C cat > conftest.$ac_ext < @@ -4497,50 +4527,18 @@ AC_MSG_RESULT($ac_cv_maxpathlen) AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] ) ]) -dnl ------------------------------------------------------------------------- -dnl See if the compiler supports a template repository bero@redhat.de -dnl ------------------------------------------------------------------------- -AC_DEFUN(KDE_COMPILER_REPO, -[ - REPO="" - NOREPO="" - - KDE_CHECK_COMPILER_FLAG(frepo, - [ - REPO="-frepo" - NOREPO="-fno-repo" - ]) - - if test -z "$REPO"; then - KDE_CHECK_COMPILER_FLAG(instances=explicit, - [ - REPO="-instances=explicit" - NOREPO="-instances=extern" - ]) - fi - - if test -n "$REPO"; then - AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1, - [C++ compiler supports template repository]) - $1 - fi - - AC_SUBST(REPO) - AC_SUBST(NOREPO) -]) - -AC_DEFUN(KDE_CHECK_HEADER, +AC_DEFUN([KDE_CHECK_HEADER], [ AC_LANG_SAVE kde_safe_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $all_includes" AC_LANG_CPLUSPLUS - AC_CHECK_HEADER($1, $2, $3, $4) + AC_CHECK_HEADER([$1], [$2], [$3], [$4]) CPPFLAGS=$kde_safe_cppflags AC_LANG_RESTORE ]) -AC_DEFUN(KDE_CHECK_HEADERS, +AC_DEFUN([KDE_CHECK_HEADERS], [ AH_CHECK_HEADERS([$1]) AC_LANG_SAVE @@ -4552,14 +4550,14 @@ AC_DEFUN(KDE_CHECK_HEADERS, AC_LANG_RESTORE ]) -AC_DEFUN(KDE_FAST_CONFIGURE, +AC_DEFUN([KDE_FAST_CONFIGURE], [ dnl makes configure fast (needs perl) - AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)], + AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]), with_fast_perl=$enableval, with_fast_perl=yes) ]) -AC_DEFUN(KDE_CONF_FILES, +AC_DEFUN([KDE_CONF_FILES], [ val= if test -f $srcdir/configure.files ; then @@ -4574,7 +4572,10 @@ AC_DEFUN(KDE_CONF_FILES, AC_SUBST(CONF_FILES) ])dnl -AC_DEFUN(KDE_SET_PREFIX, +dnl This sets the prefix, for arts and kdelibs +dnl Do NOT use in any other module. +dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde +AC_DEFUN([KDE_SET_PREFIX_CORE], [ unset CDPATH dnl make $KDEDIR the default for the installation @@ -4584,9 +4585,66 @@ AC_DEFUN(KDE_SET_PREFIX, prefix=$ac_default_prefix ac_configure_args="$ac_configure_args --prefix=$prefix" fi - # And delete superflous '/' to make compares easier + # And delete superfluous '/' to make compares easier prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + + kde_libs_prefix='$(prefix)' + kde_libs_htmldir='$(kde_htmldir)' + AC_SUBST(kde_libs_prefix) + AC_SUBST(kde_libs_htmldir) + KDE_FAST_CONFIGURE + KDE_CONF_FILES +]) + + +AC_DEFUN([KDE_SET_PREFIX], +[ + unset CDPATH + dnl We can't give real code to that macro, only a value. + dnl It only matters for --help, since we set the prefix in this function anyway. + AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix}) + + KDE_SET_DEFAULT_BINDIRS + if test "x$prefix" = "xNONE"; then + dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it + KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend) + else + dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH + kde_save_PATH="$PATH" + PATH="$exec_prefix/bin:$prefix/bin:$PATH" + KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend) + PATH="$kde_save_PATH" + fi + + kde_libs_prefix=`$KDECONFIG --prefix` + if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then + AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs. + This means it has been moved since you installed it. + This won't work. Please recompile kdelibs for the new prefix. + ]) + fi + kde_libs_htmldir=`$KDECONFIG --install html --expandvars` + + AC_MSG_CHECKING([where to install]) + if test "x$prefix" = "xNONE"; then + prefix=$kde_libs_prefix + AC_MSG_RESULT([$prefix (as returned by kde-config)]) + else + dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different + given_prefix=$prefix + AC_MSG_RESULT([$prefix (as requested)]) + fi + + # And delete superfluous '/' to make compares easier + prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + + AC_SUBST(KDECONFIG) + AC_SUBST(kde_libs_prefix) + AC_SUBST(kde_libs_htmldir) + KDE_FAST_CONFIGURE KDE_CONF_FILES ]) @@ -4657,7 +4715,7 @@ pushdef([AC_PROG_INSTALL], fi ])dnl -AC_DEFUN(KDE_LANG_CPLUSPLUS, +AC_DEFUN([KDE_LANG_CPLUSPLUS], [AC_LANG_CPLUSPLUS ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS]) @@ -4668,7 +4726,7 @@ pushdef([AC_LANG_CPLUSPLUS], KDE_LANG_CPLUSPLUS ]) -AC_DEFUN(KDE_CHECK_LONG_LONG, +AC_DEFUN([KDE_CHECK_LONG_LONG], [ AC_MSG_CHECKING(for long long) AC_CACHE_VAL(kde_cv_c_long_long, @@ -4688,7 +4746,7 @@ if test "$kde_cv_c_long_long" = yes; then fi ]) -AC_DEFUN(KDE_CHECK_LIB, +AC_DEFUN([KDE_CHECK_LIB], [ kde_save_LDFLAGS="$LDFLAGS" dnl AC_CHECK_LIB modifies LIBS, so save it here @@ -4704,7 +4762,7 @@ AC_DEFUN(KDE_CHECK_LIB, LIBS="$kde_save_LIBS" ]) -AC_DEFUN(KDE_JAVA_PREFIX, +AC_DEFUN([KDE_JAVA_PREFIX], [ dir=`dirname "$1"` base=`basename "$1"` @@ -4727,11 +4785,11 @@ AC_DEFUN(KDE_JAVA_PREFIX, ]) dnl KDE_CHEC_JAVA_DIR(onlyjre) -AC_DEFUN(KDE_CHECK_JAVA_DIR, +AC_DEFUN([KDE_CHECK_JAVA_DIR], [ AC_ARG_WITH(java, -[ --with-java=javadir use java installed in javadir, --without-java disables ], +AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]), [ ac_java_dir=$withval ], ac_java_dir="" ) @@ -4743,12 +4801,16 @@ if test "x$ac_java_dir" = "xno"; then kde_java_bindir=no kde_java_includedir=no kde_java_libjvmdir=no + kde_java_libgcjdir=no kde_java_libhpidir=no else if test "x$ac_java_dir" = "x"; then - dnl No option set -> look in $PATH + dnl No option set -> collect list of candidate paths + if test -n "$JAVA_HOME"; then + KDE_JAVA_PREFIX($JAVA_HOME) + fi KDE_JAVA_PREFIX(/usr/j2se) KDE_JAVA_PREFIX(/usr/lib/j2se) KDE_JAVA_PREFIX(/usr/j*dk*) @@ -4763,25 +4825,33 @@ else KDE_JAVA_PREFIX(/usr/lib/IBMJava2*) KDE_JAVA_PREFIX(/usr/lib/IBMJava*) KDE_JAVA_PREFIX(/opt/java*) - + kde_cv_path="NONE" kde_save_IFS=$IFS IFS=':' for dir in $PATH; do - javadirs="$javadirs $dir" + if test -d "$dir"; then + javadirs="$javadirs $dir" + fi done IFS=$kde_save_IFS jredirs= + dnl Now javadirs contains a list of paths that exist, all ending with bin/ for dir in $javadirs; do - if test ! -d $dir; then break; fi - if test -x "$dir/java"; then - libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` - if test ! -f $libjvmdir/libjvm.so; then continue; fi - jredirs="$jredirs $dir" + dnl Check for the java executable + if test -x "$dir/java"; then + dnl And also check for a libjvm.so somewhere under there + dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big. + if test "$dir" != "/usr/bin"; then + libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + if test ! -f $libjvmdir/libjvm.so; then continue; fi + jredirs="$jredirs $dir" + fi fi done + dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found JAVAC= JAVA= kde_java_bindir=no @@ -4816,6 +4886,8 @@ if test "x$kde_java_bindir" != "xno"; then dnl Look for libjvm.so kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + dnl Look for libgcj.so + kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1` dnl Look for libhpi.so and avoid green threads kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1` @@ -4837,26 +4909,41 @@ if test "x$kde_java_bindir" != "xno"; then jni_includes="-I$kde_java_includedir" dnl Strange thing, jni.h requires jni_md.h which is under genunix here.. - dnl and under linux here.. - test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux" - test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris" - test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix" + dnl and under linux here.. + + dnl not needed for gcj + + if test "x$kde_java_libgcjdir" = "x"; then + test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux" + test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris" + test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix" + fi else JAVAC= jni_includes= fi - if test ! -r "$kde_java_libjvmdir/libjvm.so"; then - AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.]) - fi + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libjvmdir/libjvm.so"; then + AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.]) + fi + else + if test ! -r "$kde_java_libgcjdir/libgcj.so"; then + AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.]) + fi + fi if test ! -x "$kde_java_bindir/java"; then AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) fi - if test ! -r "$kde_java_libhpidir/libhpi.so"; then - AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.]) + dnl not needed for gcj compile + + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libhpidir/libhpi.so"; then + AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.]) + fi fi if test -n "$jni_includes"; then @@ -4895,14 +4982,29 @@ if test "x$kde_java_bindir" != "xno"; then JAVAH=$kde_java_bindir/javah JAR=$kde_java_bindir/jar AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) - JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi" + if test "x$kde_java_libgcjdir" = "x"; then + JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi" + else + JVMLIBS="-L$kde_java_libgcjdir -lgcj" + fi AC_MSG_RESULT([java JDK in $kde_java_bindir]) else AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) AC_MSG_RESULT([java JRE in $kde_java_bindir]) fi -else # no +elif test -d "/Library/Java/Home"; then + kde_java_bindir="/Library/Java/Home/bin" + jni_includes="-I/Library/Java/Home/include" + + JAVAC=$kde_java_bindir/javac + JAVAH=$kde_java_bindir/javah + JAR=$kde_java_bindir/jar + JVMLIBS="-Xlinker -framework -Xlinker JavaVM" + + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + AC_MSG_RESULT([Apple Java Framework]) +else AC_MSG_RESULT([none found]) fi @@ -4927,13 +5029,13 @@ m4_define([mm_car], [[$1]]) m4_define([mm_car2], [[$@]]) m4_define([_mm_foreach], [m4_if(m4_quote($2), [], [], - [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1], - mm_car2(m4_shift($2)), - [$3])])]) + [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1], + mm_car2(m4_shift($2)), + [$3])])]) m4_define([AC_FOREACH], [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) -AC_DEFUN(KDE_NEED_FLEX, +AC_DEFUN([KDE_NEED_FLEX], [ kde_libs_safe=$LIBS LIBS="$LIBS $USER_LDFLAGS" @@ -4945,7 +5047,7 @@ fi AC_SUBST(LEXLIB) ]) -AC_DEFUN(AC_PATH_QTOPIA, +AC_DEFUN([AC_PATH_QTOPIA], [ dnl TODO: use AC_CACHE_VAL @@ -4974,7 +5076,7 @@ AC_DEFUN(AC_PATH_QTOPIA, ac_qtopia_incdir=NO AC_ARG_WITH(qtopia-dir, - [ --with-qtopia-dir=DIR where the root of Qtopia is installed ], + AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]), [ ac_qtopia_incdir="$withval"/include] ) qtopia_incdirs="" @@ -5049,7 +5151,7 @@ the end of config.log]) ]) -AC_DEFUN(KDE_INIT_DOXYGEN, +AC_DEFUN([KDE_INIT_DOXYGEN], [ AC_MSG_CHECKING([for Qt docs]) kde_qtdir= @@ -5057,7 +5159,7 @@ if test "${with_qt_dir+set}" = set; then kde_qtdir="$with_qt_dir" fi -AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html ], QTDOCDIR) +AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR) AC_MSG_RESULT($QTDOCDIR) AC_SUBST(QTDOCDIR) @@ -5086,16 +5188,17 @@ AC_SUBST(KDE_HAS_DOXYGEN) ]) -AC_DEFUN(AC_FIND_BZIP2, +AC_DEFUN([AC_FIND_BZIP2], [ AC_MSG_CHECKING([for bzDecompress in libbz2]) AC_CACHE_VAL(ac_cv_lib_bzip2, [ -AC_LANG_C +AC_LANG_SAVE +AC_LANG_CPLUSPLUS kde_save_LIBS="$LIBS" LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET" -kde_save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +kde_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" AC_TRY_LINK(dnl [ #define BZ_NO_STDIO @@ -5105,7 +5208,8 @@ AC_TRY_LINK(dnl eval "ac_cv_lib_bzip2='-lbz2'", eval "ac_cv_lib_bzip2=no") LIBS="$kde_save_LIBS" -CFLAGS="$kde_save_CFLAGS" +CXXFLAGS="$kde_save_CXXFLAGS" +AC_LANG_RESTORE ])dnl AC_MSG_RESULT($ac_cv_lib_bzip2) @@ -5129,6 +5233,7 @@ else AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2]) AC_CACHE_VAL(ac_cv_lib_bzip2_prefix, [ + AC_LANG_SAVE AC_LANG_CPLUSPLUS kde_save_LIBS="$LIBS" LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET" @@ -5145,12 +5250,11 @@ else eval "ac_cv_lib_bzip2_prefix=no") LIBS="$kde_save_LIBS" CXXFLAGS="$kde_save_CXXFLAGS" + AC_LANG_RESTORE ])dnl AC_MSG_RESULT($ac_cv_lib_bzip2_prefix) - - if test ! "$ac_cv_lib_bzip2_prefix" = no; then BZIP2DIR=bzip2 @@ -5171,7 +5275,7 @@ dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed) dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed) dnl ------------------------------------------------------------------------ dnl -AC_DEFUN(KDE_CHECK_SSL, +AC_DEFUN([KDE_CHECK_SSL], [ LIBSSL="-lssl -lcrypto" AC_REQUIRE([KDE_CHECK_LIB64]) @@ -5180,14 +5284,14 @@ ac_ssl_includes=NO ac_ssl_libraries=NO ssl_libraries="" ssl_includes="" AC_ARG_WITH(ssl-dir, - [ --with-ssl-dir=DIR where the root of OpenSSL is installed], + AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]), [ ac_ssl_includes="$withval"/include ac_ssl_libraries="$withval"/lib$kdelibsuff ]) want_ssl=yes AC_ARG_WITH(ssl, - [ --without-ssl disable SSL checks], + AC_HELP_STRING([--without-ssl],[disable SSL checks]), [want_ssl=$withval]) if test $want_ssl = yes; then @@ -5216,14 +5320,9 @@ AC_CACHE_VAL(ac_cv_have_ssl, ac_ssl_libraries="$ssl_libdir" - AC_LANG_SAVE - AC_LANG_C - - ac_cflags_safe="$CFLAGS" ac_ldflags_safe="$LDFLAGS" ac_libs_safe="$LIBS" - CFLAGS="$CFLAGS -I$ssl_incdir $all_includes" LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries" LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref" @@ -5233,12 +5332,9 @@ AC_CACHE_VAL(ac_cv_have_ssl, ac_ssl_rsaref="no" ) - CFLAGS="$ac_cflags_safe" LDFLAGS="$ac_ldflags_safe" LIBS="$ac_libs_safe" - AC_LANG_RESTORE - if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then have_ssl=no else @@ -5266,8 +5362,6 @@ if test "$have_ssl" = yes; then dnl Check for SSL version AC_CACHE_VAL(ac_cv_ssl_version, [ - AC_LANG_SAVE - AC_LANG_C cat >conftest.$ac_ext < @@ -5286,11 +5380,12 @@ if test "$have_ssl" = yes; then } EOF - ac_compile='${CC-gcc} $CFLAGS conftest.$ac_ext -o conftest' + ac_save_CPPFLAGS=$CPPFLAGS if test "$ac_ssl_includes" != "/usr/include"; then - ac_compile="$ac_compile -I$ac_ssl_includes" + CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes" fi - if AC_TRY_EVAL(ac_compile); then + + if AC_TRY_EVAL(ac_link); then if eval `./conftest 2>&5`; then if test $ssl_version = error; then @@ -5313,8 +5408,7 @@ EOF Check config.log, and if you can't figure it out, send a mail to David Faure , attaching your config.log]) fi - - AC_LANG_RESTORE + CPPFLAGS=$ac_save_CPPFLAGS ]) @@ -5342,13 +5436,17 @@ else fi fi -if test "$ssl_includes" = "/usr/include" || test "$ssl_includes" = "/usr/local/include" || test -z "$ssl_includes"; then - SSL_INCLUDES=""; -else - SSL_INCLUDES="-I$ssl_includes" +SSL_INCLUDES= + +if test "$ssl_includes" = "/usr/include"; then + if test -f /usr/kerberos/include/krb5.h; then + SSL_INCLUDES="-I/usr/kerberos/include" + fi +elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then + SSL_INCLUDES="-I$ssl_includes" fi -if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then +if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then SSL_LDFLAGS="" else SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries" @@ -5359,24 +5457,80 @@ AC_SUBST(SSL_LDFLAGS) AC_SUBST(LIBSSL) ]) -AC_DEFUN(KDE_CHECK_STRLCPY, +AC_DEFUN([KDE_CHECK_STRLCPY], [ - AC_CHECK_STRLCPY - AC_CHECK_STRLCAT + AC_REQUIRE([AC_CHECK_STRLCAT]) + AC_REQUIRE([AC_CHECK_STRLCPY]) AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(unsigned long) - AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned long)]) + AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long]) AC_TRY_COMPILE(,[ #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG choke me #endif - ],[AC_MSG_RESULT([yes])],[ - AC_MSG_RESULT([no]) + ],AC_MSG_RESULT([yes]),[ + AC_MSG_RESULT(no) AC_MSG_ERROR([ - Apparently on your system our assumption sizeof(size_t) == sizeof(unsigned long) + Apparently on your system our assumption sizeof size_t == sizeof unsigned long does not apply. Please mail kde-devel@kde.org with a description of your system! ]) ]) ]) +AC_DEFUN([KDE_CHECK_BINUTILS], +[ + AC_MSG_CHECKING([if ld supports unversioned version maps]) + + kde_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + echo "{ local: extern \"C++\" { foo }; };" > conftest.map + AC_TRY_LINK([int foo;], +[ +#ifdef __INTEL_COMPILER +icc apparently does not support libtools version-info and version-script +at the same time. Dunno where the bug is, but until somebody figured out, +better disable the optional version scripts. +#endif + + foo = 42; +], kde_supports_versionmaps=yes, kde_supports_versionmaps=no) + LDFLAGS="$kde_save_LDFLAGS" + rm -f conftest.map + AM_CONDITIONAL(include_VERSION_SCRIPT, + [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"]) + + AC_MSG_RESULT($kde_supports_versionmaps) +]) + +AC_DEFUN([AM_PROG_OBJC],[ +AC_CHECK_PROGS(OBJC, gcc, gcc) +test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH]) +if test "x${OBJCFLAGS-unset}" = xunset; then + OBJCFLAGS="-g -O2" +fi +AC_SUBST(OBJCFLAGS) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)]) +]) + +AC_DEFUN([KDE_CHECK_PERL], +[ + KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [ + AC_MSG_ERROR([No Perl found in your $PATH. +We need perl to generate some code.]) + ]) + AC_SUBST(PERL) +]) + +AC_DEFUN([KDE_CHECK_LARGEFILE], +[ +AC_SYS_LARGEFILE +if test "$ac_cv_sys_file_offset_bits" != no; then + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" +fi + +if test "x$ac_cv_sys_large_files" != "xno"; then + CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1" +fi + +]) diff --git a/admin/am_edit b/admin/am_edit index c9989f2..fa2f6aa 100644 --- a/admin/am_edit +++ b/admin/am_edit @@ -31,6 +31,7 @@ # Alex Zepeda # David Faure # Stephan Kulow +# Dirk Mueller use Cwd; use File::Find; @@ -50,6 +51,7 @@ sub findMocCandidates (); sub pruneMocCandidates ($); sub checkMocCandidates (); sub addMocRules (); +sub findKcfgFile($); sub tag_AUTOMAKE (); sub tag_META_INCLUDES (); @@ -59,10 +61,14 @@ sub tag_DOCFILES (); sub tag_LOCALINSTALL(); sub tag_IDLFILES(); sub tag_UIFILES(); +sub tag_KCFGFILES(); sub tag_SUBDIRS(); sub tag_ICON(); sub tag_CLOSURE(); +sub tag_NO_UNDEFINED(); +sub tag_NMCHECK(); sub tag_DIST(); +sub tag_KDEINIT(); # Some global globals... $verbose = 0; # a debug flag @@ -99,6 +105,7 @@ while (defined ($ARGV[0])) "Making it useful by Stephan Kulow and\n", "Harri Porten \n", "Updated (Feb-1999), John Birch \n", + "Fixes and Improvements by Dirk Mueller \n", "Current Maintainer Stephan Kulow\n\n"; exit 0; } @@ -106,11 +113,12 @@ while (defined ($ARGV[0])) { $verbose = 1; # Oh is there a problem...? } - elsif (/^-p(.+)$|^--path=(.+)$/) + elsif (/^(?:-p|--path=)(.+)$/) { - $thisProg = "$1/".basename($thisProg) if($1); - $thisProg = "$2/".basename($thisProg) if($2); + my $p = $1; + $thisProg = $p . "/". basename($thisProg); warn ("$thisProg doesn't exist\n") if (!(-f $thisProg)); + $thisProg .= " -p".$p; $pathoption=1; } elsif (/^--help$|^-h$/) @@ -207,6 +215,8 @@ sub processMakefile ($) local @programs = (); # lists the names of programs and libraries local $program = ""; + local @kdeinits = (); # lists the kdeinit targets + local %realObjs = (); # lists the objects compiled into $program local %sources = (); # lists the sources used for $program local %finalObjs = (); # lists the objects compiled when final @@ -215,17 +225,20 @@ sub processMakefile ($) local %globalmocs = ();# list of all mocfiles (in %mocFiles format) local %important = (); # list of files to be generated asap local %uiFiles = (); + local %kcfgFiles = (); local $allidls = ""; local $idl_output = "";# lists all idl generated files for cleantarget local $ui_output = "";# lists all uic generated files for cleantarget + local $kcfg_output = "";# lists all kcfg generated files for cleantarget - local %depedmocs = (); + local %dependmocs = (); local $metasourceTags = 0; local $dep_files = ""; local $dep_finals = ""; local %target_adds = (); # the targets to add + local %rule_adds = (); local $kdelang = ""; local @cleanfiles = (); local $cleanMoc = ""; @@ -240,24 +253,37 @@ sub processMakefile ($) $makefile = basename($makefile); print STDOUT "Processing makefile $printname\n" if ($verbose); - + # Setup and see if we need to do this. return if (!initialise()); - + tag_AUTOMAKE (); # Allows a "make" to redo the Makefile.in tag_META_INCLUDES (); # Supplies directories for src locations - + foreach $program (@programs) { $sources_changed{$program} = 0; - $depedmocs{$program} = ""; + $dependmocs{$program} = ""; $important{$program} = ""; tag_IDLFILES(); # Sorts out idl rules + tag_NO_UNDEFINED(); tag_CLOSURE(); - tag_UIFILES(); # Sorts out ui rules + tag_NMCHECK(); + tag_UIFILES(); # Sorts out ui rules + tag_KCFGFILES(); # Sorts out kcfg rules tag_METASOURCES (); # Sorts out the moc rules if ($sources_changed{$program}) { - my $lookup = "$program" . '_SOURCES\s*=\s*(.*)'; - substituteLine($lookup, "$program\_SOURCES=" . $sources{$program}); + my $lookup = $program . '_SOURCES\s*=[ \t]*(.*)'; + + if($program =~ /libkdeinit_(.*)/) { + my $prog = $1; + substituteLine($prog . '_SOURCES\s*=[ \t]*(.*)', + "${prog}_SOURCES = ${prog}_dummy.$cxxsuffix\n" . + "libkdeinit_${prog}_SOURCES = " . $sources{$program}); + $sources{$prog} = "${prog}_dummy.$cxxsuffix"; + } + else { + substituteLine($lookup, "$program\_SOURCES=" . $sources{$program}); + } } if ($important{$program}) { local %source_dict = (); @@ -300,6 +326,11 @@ sub processMakefile ($) $target_adds{"$cleantarget-am"} .= "$cleantarget-ui "; } + if ($kcfg_output) { + appendLines ("$cleantarget-kcfg:\n\t-rm -f $kcfg_output\n"); + $target_adds{"$cleantarget-am"} .= "$cleantarget-kcfg "; + } + if ($closure_output) { appendLines ("$cleantarget-closures:\n\t-rm -f $closure_output\n"); $target_adds{"$cleantarget-am"} .= "$cleantarget-closures "; @@ -321,6 +352,7 @@ sub processMakefile ($) $tmp .= "\t$automkCall\n\tcd \$(top_srcdir) && perl $thisProg $printname\n\n"; appendLines($tmp); + make_bcheck_target(); make_meta_classes(); tag_COMPILE_FIRST(); tag_FINAL() if (!$kdeopts{"nofinal"}); @@ -331,20 +363,15 @@ sub processMakefile ($) my $nofinal_install_lines = "no-final-install:\n\t\$(MAKE) "; foreach $program (@programs) { - - my $lookup = "$program\_OBJECTS.*=[^\n]*"; - + my $lookup = $program . '_OBJECTS\s*=[ \t]*.*'; my $new = ""; - my @list = split(/[\034\s]+/, $realObjs{$program}); - if (!$kdeopts{"nofinal"} && @list > 1 && $finalObjs{$program}) { - $new .= "$program\_final\_OBJECTS = " . $finalObjs{$program}; $new .= "\n$program\_nofinal\_OBJECTS = " . $realObjs{$program}; $new .= "\n\@KDE_USE_FINAL_FALSE\@$program\_OBJECTS = \$($program\_nofinal\_OBJECTS)"; $new .= "\n\@KDE_USE_FINAL_TRUE\@$program\_OBJECTS = \$($program\_final\_OBJECTS)"; - + $final_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" "; $final_install_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" "; $nofinal_lines .= "$program\_OBJECTS=\"\$($program\_nofinal\_OBJECTS)\" "; @@ -352,15 +379,20 @@ sub processMakefile ($) } else { $new = "$program\_OBJECTS = " . $realObjs{$program}; } - substituteLine ($lookup, $new); + if($MakefileData =~ m/\n$lookup/) { + substituteLine ($lookup, $new); + } + else { + appendLines("$new\n"); + } } - appendLines($final_lines . "all-am"); - appendLines($final_install_lines . "install-am"); - appendLines($nofinal_lines . "all-am"); - appendLines($nofinal_install_lines . "install-am"); + appendLines($final_lines . "all-am\n"); + appendLines($final_install_lines . "install-am\n"); + appendLines($nofinal_lines . "all-am\n"); + appendLines($nofinal_install_lines . "install-am\n"); - my $lookup = '(\@\S+\@)?DEP_FILES\s*=([^\n]*)'; - if ($MakefileData =~ /\n$lookup\n/o) { + my $lookup = '(\@\S+\@)?DEP_FILES\s*=[ \t]*(.*)'; + if ($MakefileData =~ /\n$lookup/) { my $condition = $1; my $depfiles = $2; my $workfiles; @@ -373,15 +405,23 @@ sub processMakefile ($) $lines = "$condition\@KDE_USE_FINAL_TRUE\@DEP_FILES = $workfiles\n"; $workfiles = "$dep_files $depfiles"; $workfiles =~ s/\034/\034$condition\@KDE_USE_FINAL_FALSE\@\t/g; - $lines .= "$condition\@KDE_USE_FINAL_FALSE\@DEP_FILES = $workfiles\n"; + $lines .= "$condition\@KDE_USE_FINAL_FALSE\@DEP_FILES = $workfiles"; } else { $workfiles = "$dep_files $depfiles"; $workfiles =~ s/\034/\034$condition\t/g; - $lines = $condition . "DEP_FILES = $workfiles\n"; + $lines = $condition . "DEP_FILES = $workfiles"; } substituteLine($lookup, $lines); } + # new recursive targets + $target_adds{ "nmcheck" } .= ""; # always create nmcheck target + $target_adds{ "nmcheck-am" } .= "nmcheck"; + $lookup = 'RECURSIVE_TARGETS\s*=[ \t]*(.*)'; + if ($MakefileData =~ /\n$lookup/) { + substituteLine($lookup, "RECURSIVE_TARGETS = $1 nmcheck-recursive bcheck-recursive"); + } + my $cvs_lines = "cvs-clean:\n"; $cvs_lines .= "\t\$(MAKE) admindir=\$(top_srcdir)/admin -f \$(top_srcdir)/admin/Makefile.common cvs-clean\n"; appendLines($cvs_lines); @@ -426,21 +466,23 @@ sub processMakefile ($) $lines .= "$add: " . $target_adds{$add} . "\n"; } } - if ($lines) { - appendLines($lines); - } + + appendLines($lines) if ($lines); + + $lines = join("\n", values %rule_adds); + appendLines($lines) if ($lines); my $found = 1; while ($found) { if ($MakefileData =~ m/\n(.*)\$\(CXXFLAGS\)(.*)\n/) { - my $vor = $1; # "vor" means before in German - my $nach = $2; # "nach" means after in German + my $stuff_before = $1; + my $stuff_after = $2; my $lookup = quotemeta("$1\$(CXXFLAGS)$2"); my $replacement = "$1\$(KCXXFLAGS)$2"; $MakefileData =~ s/$lookup/$replacement/; $lookup =~ s/\\\$\\\(CXXFLAGS\\\)/\\\$\\\(KCXXFLAGS\\\)/; - $replacement = "$vor\$(KCXXFLAGS) \$(KDE_CXXFLAGS)$nach"; + $replacement = "$stuff_before\$(KCXXFLAGS) \$(KDE_CXXFLAGS)$stuff_after"; substituteLine($lookup, $replacement); } else { $found = 0; @@ -496,8 +538,10 @@ sub initialise () } # Checking for files to process... - open (FILEIN, $makefile) - || die "Could not open $makefileDir/$makefile: $!\n"; + + open (FILEIN, $makefile) || die "Can't open $makefileDir/$makefile: $!\n"; + # perl bug in 5.8.0: in utf8 mode it badly screws up + binmode(FILEIN, ":bytes") if ($] >= 5.008); # Read the file # stat(FILEIN)[7] might look more elegant, but is slower as it # requires stat'ing the file @@ -532,7 +576,7 @@ sub initialise () read_variables(); - if ($MakefileData =~ /\nKDE_OPTIONS\s*=\s*([^\n]*)\n/) { + if ($MakefileData =~ /\nKDE_OPTIONS\s*=[ \t]*([^\n]*)\n/) { my $kde_options_str = $1; local @kde_options = split(/[\034\s]+/, $kde_options_str); if (grep(/^foreign$/, @kde_options)) { @@ -573,7 +617,9 @@ sub initialise () } } - while ($MakefileData =~ /\n(\S*)_OBJECTS\s*=[\034\s]*([^\n]*)\n/g) { + tag_KDEINIT(); + + while ($MakefileData =~ /\n(\S*)_OBJECTS\s*=[\034 \t]*([^\n]*)\n/g) { my $program = $1; my $objs = $2; # safe them @@ -595,6 +641,7 @@ sub initialise () } next if ($ocv); + next if ($program =~ /^am_libkdeinit_/); $program =~ s/^am_// if ($program =~ /^am_/); @@ -606,7 +653,7 @@ sub initialise () $realObjs{$program} = $objs; - if ($MakefileData =~ /\n$sourceprogram\_SOURCES\s*=\s*(.*)\n/) { + if ($MakefileData =~ /\n$sourceprogram\_SOURCES\s*=[ \t]*(.*)\n/) { $sources{$program} = $1; } else { @@ -623,18 +670,16 @@ sub initialise () $realname{$program} = ""; } } - + my $lookup = 'DEPDIR\s*=.*'; - if ($MakefileData !~ /\n($lookup)\n/o) { - $lookup = 'bindir\s*=.*'; - if ($MakefileData =~ /\n($lookup)\n/) { - substituteLine ($lookup, "DEPDIR = .deps\n$1"); - } - } + if ($MakefileData !~ /\n$lookup/) { + $lookup = 'bindir\s*=[ \t]*.*'; + substituteLine($lookup, "DEPDIR = .deps\n$1") if ($MakefileData =~ /\n($lookup)/); + } my @marks = ('MAINTAINERCLEANFILES', 'CLEANFILES', 'DISTCLEANFILES'); foreach $mark (@marks) { - while ($MakefileData =~ /\n($mark)\s*=\s*([^\n]*)/g) { + while ($MakefileData =~ /\n($mark)\s*=[ \t]*([^\n]*)/g) { my $clean_str = $2; foreach $file (split('[\034\s]+', $clean_str)) { $file =~ s/\.\///; @@ -655,8 +700,8 @@ sub initialise () # header files could be located. sub tag_META_INCLUDES () { - my $lookup = '[^=\n]*META_INCLUDES\s*=\s*(.*)'; - return 1 if ($MakefileData !~ /($lookup)\n/o); + my $lookup = '[^=\n]*META_INCLUDES\s*=[ \t]*(.*)'; + return 1 if ($MakefileData !~ /($lookup)\n/); print STDOUT "META_INCLUDE processing <$1>\n" if ($verbose); my $headerStr = $2; @@ -702,6 +747,7 @@ sub tag_FINAL() my %shash = (); @shash{@progsources} = 1; # we are only interested in the existence my %sourcelist = (); + my %extradeps = (); foreach $source (@progsources) { my $suffix = $source; @@ -719,8 +765,13 @@ sub tag_FINAL() $moc_cpp_added = 1; } } + + # scan for extra given dependencies and add them to our target + while ($MakefileData =~ /\n\s*(\S+)\.(?:lo|o)\s*:([^\n]*)/g) { + $extradeps{$1} = $2; + } + foreach $suffix (keys %sourcelist) { - # See if this file contains c++ code. (i.e., just check the file's suffix against c++ extensions) my $suffix_is_cxx = 0; if($suffix =~ /($cppExt)$/) { @@ -737,7 +788,8 @@ sub tag_FINAL() # we support IDL on our own if ($suffix eq "skel" || $suffix =~ /^stub/ || $suffix =~ /^signals/ # obsolete, remove in KDE-4 - || $suffix eq "h" || $suffix eq "ui" ) { + || $suffix eq "h" || $suffix eq "ui" + || $suffix eq "kcfgc" ) { next; } @@ -761,6 +813,9 @@ sub tag_FINAL() } else { $source_deps .= " $source"; } + my $plainsource = $source; + $plainsource =~ s/\.$cppExt$//; + $source_deps .= " " . $extradeps{$plainsource} if (exists($extradeps{$plainsource})); } $handling = "$program.all_$suffix.$suffix: \$(srcdir)/Makefile.in" . $source_deps . " " . join(' ', $mocs) . "\n"; @@ -801,18 +856,186 @@ sub tag_FINAL() } } +sub tag_KDEINIT() +{ + my @progs = (); + my $ltlibs = ""; + my $lookup = 'kdeinit_LTLIBRARIES\s*=[ \t]*(.*)'; + + if ($MakefileData =~ m/\n$lookup/) { + @kdeinits = split(/[\034\s]+/, $1); + my $lines = ""; + foreach my $kdeinit (@kdeinits) { + if ($kdeinit =~ m/\.la$/) { + $kdeinit =~ s/\.la$//; + push(@progs, $kdeinit); + + $lines .= "\n${kdeinit}.la.$cxxsuffix:\n"; + $lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' > ${kdeinit}.la.$cxxsuffix; \\\n"; + $lines .= "\techo 'int main(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}.la.$cxxsuffix\n"; + + $lines .= "\n${kdeinit}_dummy.$cxxsuffix:\n"; + $lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' > ${kdeinit}_dummy.$cxxsuffix; \\\n"; + $lines .= "\techo 'extern \"C\" int kdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}_dummy.$cxxsuffix\n"; + + push(@cleanfiles, "${kdeinit}.la.$cxxsuffix"); + push(@cleanfiles, "${kdeinit}_dummy.$cxxsuffix"); + + # add dependency + $dep_files .= " \$(DEPDIR)/${kdeinit}.la.Po" if($dep_files !~/${kdeinit}.la.Po/ ); + $dep_files .= " \$(DEPDIR)/${kdeinit}_dummy.Plo" if($dep_files !~/${kdeinit}_dummy.Plo/ ); + + # make library + $lookup = $kdeinit . '_la_LIBADD\s*=[ \t]*(.*)'; + if($MakefileData =~ m/\n$lookup/) { + my $libadd = $1; + substituteLine($lookup, "${kdeinit}_la_LIBADD = libkdeinit_${kdeinit}.la"); + appendLines("libkdeinit_${kdeinit}_la_LIBADD = $libadd\n"); + } + appendLines("libkdeinit_${kdeinit}_la_LDFLAGS = -no-undefined -avoid-version \$(all_libraries)\n"); + + # add library dependencies + $lookup = $kdeinit . '_la_DEPENDENCIES\s*=[ \t]*(.*)'; + if($MakefileData =~ m/\n$lookup/) { + my $libdeps = $1; + substituteLine($lookup, "${kdeinit}_la_DEPENDENCIES = libkdeinit_${kdeinit}.la"); + appendLines("libkdeinit_${kdeinit}_la_DEPENDENCIES = $libdeps\n"); + } + + # make library objects + $lookup = "am_${kdeinit}_la_OBJECTS" . '\s*=[ \t]*(.*)'; + if($MakefileData =~ m/\n$lookup/) { + my $libobjects = $1; + substituteLine($lookup, "am_${kdeinit}_la_OBJECTS = ${kdeinit}_dummy.lo"); + appendLines("am_libkdeinit_${kdeinit}_la_OBJECTS = $libobjects\n"); + my $prog = "libkdeinit_${kdeinit}_la"; + push(@programs, $prog); + $realObjs{$prog} = $libobjects; + $realname{$prog} = "libkdeinit_${kdeinit}.la"; + } + $target_adds{"libkdeinit_${kdeinit}.la"} = "\$(libkdeinit_${kdeinit}_la_OBJECTS) \$(libkdeinit_${kdeinit}_la_DEPENDENCIES)\n" . + "\t\$(CXXLINK) -rpath \$(libdir) \$(libkdeinit_${kdeinit}_la_LDFLAGS) ". + "\$(libkdeinit_${kdeinit}_la_OBJECTS) " . + "\$(libkdeinit_${kdeinit}_la_LIBADD) " . + "\$(LIBS)\n"; + + # make libkdeinit sources + $lookup = $kdeinit . '_la_SOURCES\s*=[ \t]*(.*)'; + if($MakefileData =~ m/\n$lookup/) { + my $srces = $1; + $sources_changed{"libkdeinit_${kdeinit}_la"} = 1; + $sources{"libkdeinit_${kdeinit}_la"} = $srces; + } + + # make libkdeinit metasources + $lookup = $kdeinit . '_la_METASOURCES\s*=[ \t]*(.*)'; + substituteLine($lookup, "libkdeinit_${kdeinit}_la_METASOURCES = $1") + if($MakefileData =~ m/\n$lookup/); + +=cut + # make binary sources + $lookup = $kdeinit. '_SOURCES\s*=[ \t]*(.*)'; + if($MakefileData =~ m/\n$lookup/) { + substituteLine($lookup, "${kdeinit}_SOURCES = ${kdeinit}.la.$cxxsuffix"); + $lookup = 'SOURCES\s*=[ \t]*(.*)'; + if($MakefileData =~ m/\n$lookup/) { + my $srces = $1; + $srces =~ s/\b$kdeinit\.c\b/\$(${kdeinit}_SOURCES)/; + $srces =~ s/\$\(${kdeinit}_la_SOURCES\)/\$(libkdeinit_${kdeinit}_la_SOURCES)/; + substituteLine($lookup, "SOURCES = $srces"); + } + $lookup = 'DIST_SOURCES\s*=[ \t](.*)'; + if($MakefileData =~ m/\n$lookup/) { + my $srces = $1; + $srces =~ s/\b$kdeinit\.c\b/\$(${kdeinit}_SOURCES)/; + $srces =~ s/\$\(${kdeinit}_la_SOURCES\)/\$(libkdeinit_${kdeinit}_la_SOURCES)/; + substituteLine($lookup, "DIST_SOURCES = $srces"); + } + } + + # make binary objects / libs + $lookup = $kdeinit . '_OBJECTS\s*=[ \t]*.*'; + if($MakefileData =~ m/\n$lookup/) { + $realObjs{$kdeinit} = "${kdeinit}.la.\$(OBJEXT)"; + substituteLine("${kdeinit}_LDFLAGS\\s*=.*", "${kdeinit}_LDFLAGS = \$(all_libraries)"); + substituteLine("${kdeinit}_LDADD\\s*=.*", "${kdeinit}_LDADD = libkdeinit_${kdeinit}.la"); + substituteLine("${kdeinit}_DEPENDENCIES\\s*=.*", "${kdeinit}_DEPENDENCIES = libkdeinit_${kdeinit}.la"); + } +=cut + # add binary + push(@programs, $kdeinit); + $realObjs{$kdeinit} = "${kdeinit}.la.\$(OBJEXT)"; + $realname{$kdeinit} = $kdeinit; + $sources{$kdeinit} = "${kdeinit}.la.$cxxsuffix"; + + $lines .= "${kdeinit}_LDFLAGS = \$(KDE_RPATH) -no-undefined \$(all_libraries)\n"; + $lines .= "${kdeinit}_LDADD = libkdeinit_${kdeinit}.la\n"; + $lines .= "${kdeinit}_DEPENDENCIES = libkdeinit_${kdeinit}.la\n"; + + $target_adds{"${kdeinit}\$(EXEEXT)"} = + "\$(${kdeinit}_OBJECTS) \$(${kdeinit}_DEPENDENCIES)\n" . + "\t\@rm -f ${kdeinit}\$(EXEEXT)\n" . + "\t\$(CXXLINK) \$(${kdeinit}_LDFLAGS) \$(${kdeinit}_OBJECTS) \$(${kdeinit}_LDADD) \$(LIBS)\n"; + + $ltlibs .= " libkdeinit_${kdeinit}.la"; + } + } + appendLines($lines); + + # add libkdeinit target + $lookup = 'lib_LTLIBRARIES\s*=[ \t]*(.*)'; + if($MakefileData =~ m/\n$lookup/) { + substituteLine($lookup, "lib_LTLIBRARIES = $1 $ltlibs"); + } + else { + print STDERR + "Error: lib_LTLIBRARIES missing in $printname (required for kdeinit_LTLIBRARIES).\n"; + $errorflag = 1; + } + } + + if($#progs >= 0) { + if($MakefileData !~ m/\nbin_PROGRAMS\s*=/) { + print STDERR "Error: bin_PROGRAMS missing in $printname (required for kdeinit_LTLIBRARIES).\n"; + $errorflag = 1; + } + else { + # add our new progs to SOURCES, DIST_SOURCES and bin_PROGRAMS + my $progsources = ""; + my $progexes = ""; + foreach my $p (@progs) { + $progsources .= "\$(${p}_SOURCES) "; + $progexes .= "${p}\$(EXEEXT) "; + } + $lookup = 'SOURCES\s*=[ \t]*(.*)'; + if($MakefileData =~ /\n$lookup/) { + substituteLine($lookup, "SOURCES = $1 $progsources"); + } + $lookup = 'DIST_SOURCES\s*=[ \t]*(.*)'; + if($MakefileData =~ /\n$lookup/) { + substituteLine($lookup, "DIST_SOURCES = $1 $progsources"); + } + # bin_PROGRAMS is complicated, as it exists twice, so we do a little + # magic trick here + $lookup = 'PROGRAMS\s*=[ \t]*(.*)'; + if ($MakefileData =~ /\n$lookup/) { + substituteLine($lookup, "bin_PROGRAMS += $progexes\nPROGRAMS = $1"); + } + } + } +} + #----------------------------------------------------------------------------- sub tag_COMPILE_FIRST() { foreach $program (@programs) { - my $lookup = "$program" . '_COMPILE_FIRST\s*=\s*(.*)'; + my $lookup = "$program" . '_COMPILE_FIRST\s*=[ \t]*(.*)'; if ($MakefileData =~ m/\n$lookup\n/) { my $compilefirst_str = $1; my @compilefirst = split(/[\034\s]+/, $compilefirst_str); my @progsources = split(/[\034\s]+/, $sources{$program}); my %donesources = (); - $handling = ""; foreach $source (@progsources) { my @deps = (); my $sdeps = ""; @@ -827,10 +1050,9 @@ sub tag_COMPILE_FIRST() next if defined($donesources{$depend}); push @deps, $depend; } - $handling .= "$sdeps: " . join(' ', @deps) . "\n" if (@deps); + $target_adds{$sdeps} .= join(' ', @deps) . ' ' if (@deps); $donesources{$source} = 1; } - appendLines($handling) if (length($handling)); } } } @@ -843,7 +1065,7 @@ sub tag_COMPILE_FIRST() sub tag_METASOURCES () { local @newObs = (); # here we add to create object files - local @deped = (); # here we add to create moc files + local @depend = (); # here we add to create moc files local $mocExt = ".moc"; local %mocFiles = (); @@ -852,7 +1074,6 @@ sub tag_METASOURCES () my $lookup; my $found = ""; -#print "$program: tag_METASOURCES\n"; if ($metasourceTags > 1) { $lookup = $program . '_METASOURCES\s*=\s*(.*)'; return 1 if ($MakefileData !~ /\n($lookup)\n/); @@ -861,7 +1082,7 @@ sub tag_METASOURCES () $lookup = $program . '_METASOURCES\s*=\s*(.*)'; if ($MakefileData !~ /\n($lookup)\n/) { $lookup = 'METASOURCES\s*=\s*(.*)'; - return 1 if ($MakefileData !~ /\n($lookup)\n/o); + return 1 if ($MakefileData !~ /\n($lookup)\n/); $found = $1; $metasourceTags = 0; # we can use the general target only once } else { @@ -901,15 +1122,15 @@ sub tag_METASOURCES () if (@newObs) { my $ext = ($program =~ /_la$/) ? ".moc.lo " : ".moc.o "; $realObjs{$program} .= "\034" . join ($ext, @newObs) . $ext; - $depedmocs{$program} = join (".moc.$cxxsuffix " , @newObs) . ".moc.$cxxsuffix"; + $dependmocs{$program} = join (".moc.$cxxsuffix " , @newObs) . ".moc.$cxxsuffix"; foreach $file (@newObs) { $dep_files .= " \$(DEPDIR)/$file.moc.P" if($dep_files !~/$file.moc.P/); } } - if (@deped) { - $depedmocs{$program} .= " "; - $depedmocs{$program} .= join('.moc ', @deped) . ".moc"; - $depedmocs{$program} .= " "; + if (@depend) { + $dependmocs{$program} .= " "; + $dependmocs{$program} .= join('.moc ', @depend) . ".moc"; + $dependmocs{$program} .= " "; } addMocRules (); @globalmocs{keys %mocFiles}=values %mocFiles; @@ -926,8 +1147,19 @@ sub tag_AUTOMAKE () print STDOUT "AUTOMAKE processing <$1>\n" if ($verbose); my $newLine = $1."\n\tcd \$(top_srcdir) && perl $thisProg $printname"; + + # automake 1.8.x adds another automake call. *sigh* + $newLine =~ s/;([\034\s]+cd\s+\$\(srcdir\)\s+&&[\034\s]+\$\(AUTOMAKE\).*)[\034\s]+\&\&[\034\s]+exit[\034\s]+0;([\034\s]+exit\s+1)/; \034 ( $1 ) || exit 1; echo \' cd \$(top_srcdir) && perl $thisProg \'; cd \$(top_srcdir) && perl $thisProg && exit 0; $2/; substituteLine ($lookup, $newLine); $automkCall = $1; + + $lookup = '.*cd \$\(srcdir\)\s+&&[\034\s]+\$\(AUTOCONF\)(.*)'; + if ($MakefileData =~ /\n($lookup)\n/) { + $newLine = "\tcd \$(srcdir) && rm -f configure\n"; + $newLine .= "\tcd \$(top_srcdir) && \$(MAKE) -f admin/Makefile.common configure"; + substituteLine ($lookup, $newLine); + } + return 0; } @@ -988,8 +1220,7 @@ sub tag_SUBDIRS () } closedir (THISDIR); - my $lines = "SUBDIRS =$subdirs\n"; - substituteLine('SUBDIRS\s*=.*', $lines); + substituteLine('SUBDIRS\s*=.*', "SUBDIRS =$subdirs"); return 0; } @@ -1000,23 +1231,19 @@ sub tag_IDLFILES () my @cppFiles = (); foreach $source (@psources) { - my $skel = ($source =~ m/\.skel$/); my $stub = ($source =~ m/\.stub$/); my $signals = ($source =~ m/\.signals$/); # obsolete, remove in KDE-4 if ($stub || $skel || $signals) { - + my $qs = quotemeta($source); $sources{$program} =~ s/$qs//; $sources_changed{$program} = 1; - - print STDOUT "adding IDL file $source\n" if ($verbose); - + $source =~ s/\.(stub|skel|signals)$//; - my $sourcename; - + if ($skel) { $sourcename = "$source\_skel"; } elsif ($stub) { @@ -1037,8 +1264,11 @@ sub tag_IDLFILES () if ($allidls !~ /$source\_kidl/) { + $use_ng = ($MakefileData =~ /\n$source\_DCOPIDLNG\s*=\s*(\S+)\n/); + $dcopidl = $use_ng ? "KDECONFIG=\"\$(KDECONFIG)\" \$(DCOPIDLNG)" : "\$(DCOPIDL)"; + $dep_lines .= "$source.kidl: $sourcedir$source.h \$(DCOP_DEPENDENCIES)\n"; - $dep_lines .= "\t\$(DCOPIDL) $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; false )\n"; + $dep_lines .= "\t$dcopidl $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; false )\n"; $allidls .= $source . "_kidl "; } @@ -1109,7 +1339,6 @@ sub tag_IDLFILES () sub tag_UIFILES () { my @psources = split(/[\034\s]+/, $sources{$program}); - my $dep_lines = ""; my @depFiles = (); foreach $source (@psources) { @@ -1131,14 +1360,15 @@ sub tag_UIFILES () if (!$uiFiles{$source}) { - $dep_lines .= "$source.$cxxsuffix: $sourcedir$source.ui $source.h $source.moc\n"; + my $dep_lines = "$source.$cxxsuffix: $sourcedir$source.ui $source.h $source.moc\n"; $dep_lines .= "\trm -f $source.$cxxsuffix\n"; if (!$kdeopts{"qtonly"}) { - $dep_lines .= "\techo '#include ' > $source.$cxxsuffix\n"; + $dep_lines .= "\techo '#include ' > $source.$cxxsuffix\n"; + $dep_lines .= "\techo '#include ' >> $source.$cxxsuffix\n"; my ($mangled_source) = $source; $mangled_source =~ s/[^A-Za-z0-9]/_/g; # get rid of garbage $dep_lines .= "\t\$(UIC) -tr \${UIC_TR} -i $source.h $sourcedir$source.ui > $source.$cxxsuffix.temp ; ret=\$\$?; \\\n"; - $dep_lines .= "\tsed -e \"s,\${UIC_TR}( \\\"\\\" ),QString::null,g\" $source.$cxxsuffix.temp | sed -e \"s,\${UIC_TR}( \\\"\\\"\\, \\\"\\\" ),QString::null,g\" | sed -e \"s,image\\([0-9][0-9]*\\)_data,img\\1_" . $mangled_source . ",g\" >> $source.$cxxsuffix ;\\\n"; + $dep_lines .= "\t\$(PERL) -pe \"s,\${UIC_TR}( \\\"\\\" ),QString::null,g\" $source.$cxxsuffix.temp | \$(PERL) -pe \"s,\${UIC_TR}( \\\"\\\"\\, \\\"\\\" ),QString::null,g\" | \$(PERL) -pe \"s,image([0-9][0-9]*)_data,img\\\$\$1_" . $mangled_source . ",g\" >> $source.$cxxsuffix ;\\\n"; $dep_lines .= "\trm -f $source.$cxxsuffix.temp ;\\\n"; } else { $dep_lines .= "\t\$(UIC) -i $source.h $sourcedir$source.ui > $source.$cxxsuffix; ret=\$\$?; \\\n"; @@ -1149,8 +1379,10 @@ sub tag_UIFILES () $dep_lines .= "$source.moc: $source.h\n"; $dep_lines .= "\t\$(MOC) $source.h -o $source.moc\n"; + $rule_adds{"$source.$cxxsuffix"} = $dep_lines; + $uiFiles{$source} = 1; - $depedmocs{$program} .= " $source.moc"; + $dependmocs{$program} .= " $source.moc"; $globalmocs{$source} = "\035$source.h\035$source.cpp"; } @@ -1164,23 +1396,76 @@ sub tag_UIFILES () $important{$program} .= "$source.h "; $ui_output .= "\\\n\t$source.$cxxsuffix $source.h $source.moc "; push(@cleanfiles, "$source.$cxxsuffix"); - push(@cleanfiles, "source.h"); + push(@cleanfiles, "$source.h"); push(@cleanfiles, "$source.moc"); $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ ); } } - if ($dep_lines) { - appendLines($dep_lines); +} + +sub tag_KCFGFILES () +{ + my @psources = split(/[\034\s]+/, $sources{$program}); + my @depFiles = (); + + foreach $source (@psources) { + + if ($source =~ m/\.kcfgc$/) { + + print STDERR "adding KCFG file $source\n" if ($verbose); + + my $qs = quotemeta($source); + $sources{$program} =~ s/$qs//; + $sources_changed{$program} = 1; + + $source =~ s/\.kcfgc$//; + + my $sourcedir = ''; + if (-f "$makefileDir/$source.kcfgc") { + $sourcedir = '$(srcdir)/'; + } + + if (!$kcfgFiles{$source}) { + $kcfg = "$program.kcfg"; + findKcfgFile("$source.kcfgc"); + + my $fixsuffix = ""; + $fixsuffix = "else mv $source.cpp $source.$cxxsuffix ; " + unless "cpp" eq $cxxsuffix; + + my $dep_lines = "$source.$cxxsuffix: $source.h\n"; + $dep_lines .= "$source.h: $sourcedir$kcfg $sourcedir$source.kcfgc \$(KCFG_DEPENDENCIES)\n"; + $dep_lines .= "\t\$(KCONFIG_COMPILER) $sourcedir$kcfg $sourcedir$source.kcfgc; ret=\$\$?; \\\n"; + $dep_lines .= "\tif test \"\$\$ret\" != 0; then rm -f $source.h ; exit \$\$ret ; $fixsuffix fi\n\n"; + + $rule_adds{"$source.$cxxsuffix"} = $dep_lines; + + $kcfgFiles{$source} = 1; + } + + if ($program =~ /_la$/) { + $realObjs{$program} .= " $source.lo"; + } else { + $realObjs{$program} .= " $source.\$(OBJEXT)"; + } + $sources{$program} .= " $source.$cxxsuffix"; + $sources_changed{$program} = 1; + $important{$program} .= "$source.h "; + $kcfg_output .= "\\\n\t$source.$cxxsuffix $source.h "; + push(@cleanfiles, "$source.$cxxsuffix"); + push(@cleanfiles, "$source.h"); + $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ ); + } } } sub tag_ICON() { - my $lookup = '([^\s]*)_ICON\s*=\s*([^\n]*)'; + my $lookup = '([^\s]*)_ICON\s*=[ \t]*(.*)'; my $install = ""; my $uninstall = ""; - while ($MakefileData =~ /\n$lookup/og) { + while ($MakefileData =~ /\n$lookup/g) { my $destdir; if ($1 eq "KDE") { $destdir = "kde_icondir"; @@ -1332,7 +1617,7 @@ sub handle_POFILES($$) } appendLines ($tmp); my $lookup = 'POFILES\s*=([^\n]*)'; - if ($MakefileData !~ /\n$lookup/o) { + if ($MakefileData !~ /\n$lookup/) { appendLines("$pofileLine\nGMOFILES =$allgmofiles"); } else { substituteLine ($lookup, "$pofileLine\nGMOFILES =$allgmofiles"); @@ -1345,8 +1630,8 @@ sub handle_POFILES($$) $target_adds{"maintainer-clean"} .= "clean-nls "; - $lookup = 'DISTFILES\s*=\s*(.*)'; - if ($MakefileData =~ /\n$lookup\n/o) { + $lookup = 'DISTFILES\s*=[ \t]*(.*)'; + if ($MakefileData =~ /\n$lookup/) { $tmp = "DISTFILES = \$(GMOFILES) \$(POFILES) $1"; substituteLine ($lookup, $tmp); } @@ -1426,7 +1711,7 @@ sub handle_POFILES($$) sub tag_POFILES () { my $lookup = 'POFILES\s*=([^\n]*)'; - return 1 if ($MakefileData !~ /\n$lookup/o); + return 1 if ($MakefileData !~ /\n$lookup/); print STDOUT "POFILES processing <$1>\n" if ($verbose); my $tmp = $1; @@ -1447,7 +1732,7 @@ sub tag_POFILES () $pofiles = join(" ", grep(/\.po$/, readdir(THISDIR))); closedir (THISDIR); print STDOUT "pofiles found = $pofiles\n" if ($verbose); - if (-f "charset" && -f "kdelibs.po") { + if (-f "charset" && -f "kdelibs/kdelibs.po") { handle_TOPLEVEL(); } } @@ -1516,11 +1801,35 @@ sub replaceDestDir($) { } #--------------------------------------------------------------------------- +# libtool is very hard to persuade it could use -Wl,--no-undefined for making +# -no-undefined actually work +# append $(KDE_NO_UNFINED) after every -no-undefined in LDFLAGS +# this may go away if libtool ever does this on its own +sub tag_NO_UNDEFINED () { + return if ($program !~ /_la$/); + + my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n"; + $MakefileData =~ m/$lookup/; + return if (!defined($1)); + return if ($1 !~ /CXXLINK/); + + if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ ) { + return; + } + + $lookup = $program . '\_LDFLAGS(\s*)=(.*)-no-undefined(.*)'; + if ($MakefileData =~ /\n$lookup\n/) { + my $replace = $program . "\_LDFLAGS$1=$2-no-undefined \$(KDE_NO_UNDEFINED)$3"; + substituteLine($lookup, $replace); + } +} + sub tag_CLOSURE () { return if ($program !~ /_la$/); my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n"; $MakefileData =~ m/$lookup/; + return if (!defined($1)); return if ($1 !~ /CXXLINK/); if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ && @@ -1547,6 +1856,49 @@ sub tag_CLOSURE () { $closure_output .= " $closure"; } +sub tag_NMCHECK () { + return if ($program !~ /_la$/); + my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n"; + $MakefileData =~ m/$lookup/; + my $linkcmd = $1; + return if (!defined($1)); + return if ($linkcmd !~ /CXXLINK/ && $linkcmd !~ /LINK/); + + $lookup = $program . '_NMCHECK\s*=([^\n]*)'; + if( $MakefileData !~ m/\n$lookup\n/ ) { + return; + } + my $allowed = $1; + $allowed =~ s/^ *//; + $lookup = $program . '_NMCHECKWEAK\s*=([^\n]*)'; + my $weak = ""; + my $is_weak = 0; + if( $MakefileData =~ m/\n$lookup\n/ ) { + $weak = $1; + $is_weak = 1; + } + $weak =~ s/^ *//; + + if( $is_weak ) + { + $weak = '--allowweak=\'' . $weak . '\' '; + } + my $nmline = "\@KDE_USE_NMCHECK_TRUE@\t\@\$(MAKE) \$(AM_MAKEFLAGS) nmcheck_$realname{$program} || ( rm -f $realname{$program}; exit 1 )"; + $lookup = '(\t\$\(CXXLINK\)[^\n]*' . $program . '_OBJECTS[^\n]*)'; + if( $MakefileData =~ /\n$lookup\n/ ) { + my $oldstuff = $1; + substituteLine( $lookup, $oldstuff . "\n" . $nmline ); + } + $lookup = '(\t\$\(LINK\)[^\n]*' . $program . '_OBJECTS[^\n]*)'; + if( $MakefileData =~ /\n$lookup\n/ ) { + my $oldstuff = $1; + substituteLine( $lookup, $oldstuff . "\n" . $nmline ); + } + $nmline = "\@\$(top_srcdir)/admin/nmcheck $realname{$program} \'$allowed\' $weak"; + appendLines( "\nnmcheck_$realname{$program}: $realname{$program} \n\t$nmline\n" ); + $target_adds{ "nmcheck" } .= "nmcheck_$realname{$program} "; +} + sub tag_DIST () { my %foundfiles = (); opendir (THISDIR, "."); @@ -1562,7 +1914,7 @@ sub tag_DIST () { # doing this for MAINTAINERCLEANFILES would be wrong my @marks = ("EXTRA_DIST", "DIST_COMMON", '\S*_SOURCES', '\S*_HEADERS', 'CLEANFILES', 'DISTCLEANFILES', '\S*_OBJECTS'); foreach $mark (@marks) { - while ($MakefileData =~ /\n($mark)\s*=\s*([^\n]*)/g) { + while ($MakefileData =~ /\n($mark)\s*=[ \t]*([^\n]*)/g) { my $cleanfiles_str = $2; foreach $file (split('[\034\s]+', $cleanfiles_str)) { $file =~ s/\.\///; @@ -1586,9 +1938,10 @@ sub tag_DIST () { if ($KDE_DIST) { print "KDE_DIST $printname $KDE_DIST\n" if ($verbose); - my $lookup = "DISTFILES *=(.*)"; - if ($MakefileData =~ /\n$lookup\n/o) { - substituteLine($lookup, "KDE_DIST=$KDE_DIST\n\nDISTFILES=$1 \$(KDE_DIST)\n"); + my $lookup = 'DISTFILES\s*=[ \t]*(.*)'; + if ($MakefileData =~ /\n$lookup/) { + substituteLine($lookup, "DISTFILES = $1 \$(KDE_DIST)"); + appendLines("KDE_DIST=$KDE_DIST\n"); } } } @@ -1600,8 +1953,8 @@ sub tag_DOCFILES () { $target_adds{"all"} .= "docs-am "; - my $lookup = 'KDE_DOCS\s*=\s*([^\n]*)'; - goto nodocs if ($MakefileData !~ /\n$lookup/o); + my $lookup = 'KDE_DOCS\s*=[ \t]*([^\n]*)'; + goto nodocs if ($MakefileData !~ /\n$lookup/); print STDOUT "KDE_DOCS processing <$1>\n" if ($verbose); my $tmp = $1; @@ -1652,7 +2005,7 @@ sub tag_DOCFILES () $lookup = '\nindex.cache.bz2:'; if ($MakefileData !~ /\n($lookup)/) { $lines .= "index.cache.bz2: \$(srcdir)/index.docbook \$(KDE_XSL_STYLESHEET) $files\n"; - $lines .= "\t\@if test -n \"\$(MEINPROC)\"; then echo \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook || true; fi\n"; + $lines .= "\t\@if test -n \"\$(MEINPROC)\"; then echo \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; fi\n"; $lines .= "\n"; } @@ -1844,7 +2197,7 @@ sub checkMocCandidates () @cppFiles = keys %{$moc2cpp->{"$mocFile.moc"}}; if (@cppFiles == 1) { $mocFiles{$mocFile} .= "\035" . $cppFiles[0]; - push(@deped, $mocFile); + push(@depend, $mocFile); } elsif (@cppFiles == 0) { push (@newObs, $mocFile); # Produce new object file next if ($haveAutomocTag); # This is expected... @@ -1887,17 +2240,53 @@ sub addMocRules () $target_adds{"$cppFile.lo"} .= "$mocFile.moc "; appendLines ("$mocFile.moc: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile.moc\n"); $cleanMoc .= " $mocFile.moc"; - appendLines ("mocs: $mocFile.moc"); + appendLines ("mocs: $mocFile.moc\n"); } else { appendLines ("$mocFile$mocExt: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile$mocExt\n"); $cleanMoc .= " $mocFile$mocExt"; - appendLines ("mocs: $mocFile$mocExt"); + appendLines ("mocs: $mocFile$mocExt\n"); } } } +sub make_bcheck_target() +{ + my $lookup = 'RECURSIVE_TARGETS\s*=[ \t]*(.*)'; + my $bcheckdep = "bcheck-am"; + $bcheckdep = "bcheck-recursive" if ($MakefileData =~ /\n$lookup/); + + my $headers= ""; + $headers = $1 if($MakefileData =~ /\nHEADERS\s*=[ \t]*(.+)/); + $headers =~ s/\$\((?:noinst|EXTRA)_HEADERS\)//g; + + $target_adds{"clean-am"} .= "clean-bcheck "; + + my $t = "clean-bcheck: \n" . + "\trm -f *.bchecktest.cc *.bchecktest.cc.class a.out\n\n" . + "bcheck: $bcheckdep\n\n" . + "bcheck-am:\n" . + "\t\@for i in $headers; do \\\n" . + "\t if test \$(srcdir)/\$\$i -nt \$\$i.bchecktest.cc; then \\\n" . + "\t echo \"int main() {return 0;}\" > \$\$i.bchecktest.cc ; \\\n" . + "\t echo \"#include \\\"\$\$i\\\"\" >> \$\$i.bchecktest.cc ; \\\n" . + "\t echo \"\$\$i\"; \\\n" . + "\t if ! "; + $t .= $cxxsuffix eq "KKK" ? + "\$(CXX) \$(DEFS) -I. -I\$(srcdir) -I\$(top_builddir) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS) \$(KDE_CXXFLAGS) " : + "\$(CXXCOMPILE) "; + $t .= " --dump-class-hierarchy -c \$\$i.bchecktest.cc; then \\\n" . + "\t rm -f \$\$i.bchecktest.cc; exit 1; \\\n" . + "\t fi ; \\\n" . + "\t echo \"\" >> \$\$i.bchecktest.cc.class; \\\n" . + "\t perl \$(top_srcdir)/admin/bcheck.pl \$\$i.bchecktest.cc.class || { rm -f \$\$i.bchecktest.cc; exit 1; }; \\\n" . + "\t rm -f a.out; \\\n" . + "\t fi ; \\\n" . + "\tdone\n"; + appendLines("$t\n"); +} + sub make_meta_classes () { return if ($kdeopts{"qtonly"}); @@ -1908,7 +2297,7 @@ sub make_meta_classes () foreach $program (@programs) { my $mocs = ""; my @progsources = split(/[\034\s]+/, $sources{$program}); - my @depmocs = split(' ', $depedmocs{$program}); + my @depmocs = split(' ', $dependmocs{$program}); my %shash = (), %mhash = (); @shash{@progsources} = 1; # we are only interested in the existence @mhash{@depmocs} = 1; @@ -1929,7 +2318,7 @@ sub make_meta_classes () # Bah. This is the case, if no C++ file includes the .moc # file. We make a .moc.cpp file for that. Unfortunately this # is not included in the %sources hash, but rather is mentioned - # in %depedmocs. If the user wants to use AUTO he can't just + # in %dependmocs. If the user wants to use AUTO he can't just # use an unspecific METAINCLUDES. Instead he must use # program_METAINCLUDES. Anyway, it's not working real nicely. # E.g. Its not clear what happens if user specifies two @@ -1999,7 +2388,7 @@ sub substituteLine ($$) $new =~ s/\\\n/\034/g; $MakefileData =~ s/\n$lookup/\n#>- $old\n#>\+ $newCount\n$new/; } else { - print STDERR "Warning: substitution of \"$lookup\" in $printname failed\n"; + warn "Warning: substitution of \"$lookup\" in $printname failed\n"; } } @@ -2009,6 +2398,7 @@ sub substituteLine ($$) sub appendLines ($) { my ($new) = @_; + my $copynew = $new; my $newCount = ($new =~ tr/\034//) + ($new =~ tr/\n//) + 1; $new =~ s/\\\n/\034/g; # Fix continuation lines $MakefileData .= "\n#>\+ $newCount\n$new"; @@ -2035,3 +2425,18 @@ sub restoreMakefile () } #----------------------------------------------------------------------------- + +# find the .kcfg file listed in the .kcfgc file +sub findKcfgFile($) +{ + my ($kcfgf) = @_; + open (KCFGFIN, $kcfgf) || die "Could not open $kcfgf: $!\n"; + seek(KCFGFIN, 0, 2); + my $kcfgfsize = tell(KCFGFIN); + seek(KCFGFIN, 0, 0); + read KCFGFIN, $kcfgfData, $kcfgfsize; + close KCFGFIN; + if(($kcfgfData =~ m/^File=(.*\.kcfg)/gm)) { + $kcfg = $1; + } +} diff --git a/admin/bcheck.pl b/admin/bcheck.pl new file mode 100644 index 0000000..46485e5 --- /dev/null +++ b/admin/bcheck.pl @@ -0,0 +1,156 @@ +#!/usr/bin/perl -w + +use DB_File; +use Fcntl ':flock'; + +if (!defined($ARGV[0])) { + print "usage: requires .class dump as parameter!\n"; + exit; +} + +sub bailout +{ + untie %bcheckdb if(defined(%bcheckdb)); + + if(defined(MYLOCK)) { + flock MYLOCK, LOCK_UN; + close(MYLOCK); + } + + print @_; + exit 5; +} + +sub ask_user +{ + my ($dbkey, $dbchunk) = @_; + + if (defined($ENV{"BCHECK_UPDATE"})) { + $bcheckdb{$dbkey} = $dbchunk; + return; + } + + &bailout("BC problem detected") if (! -t STDIN); + + print "(I)gnore / (Q)uit / (U)pdate: "; + + my $key; + while(defined(read STDIN, $key, 1)) { + $key = lc($key); + + print "got: >$key<\n"; + + return if ($key eq 'i'); + + &bailout("BC problem. aborted") if ($key eq 'q'); + + if ($key eq 'u') { + $bcheckdb{$dbkey} = $dbchunk; + return; + } + print "\n(I)gnore / (Q)uit / (U)pdate: "; + } +} + +sub diff_chunk($$) +{ + my ($oldl, $newl) = @_; + my @old = split /^/m, $oldl; + my @new = split /^/m, $newl; + my $haschanges = 0; + my $max = $#old > $#new ? $#old : $#new; + + die "whoops. key different" if ($old[0] ne $new[0]); + + if ($#old != $#new) { + warn ("Structural difference.\n"); + print @old; + print "-----------------------------------------------\n"; + print @new; + $haschanges = 1; + return $haschanges; + } + + print $old[0]; + + my ($class) = ($old[0] =~ /^(?:Class |Vtable for )(\S+)/); + + my $c = 1; + while ($c < $max) { + my ($o, $n) = ($old[$c], $new[$c]); + chomp $o; + chomp $n; + $c++; + next if ($o eq $n); + + if(defined($class) and $n =~ /^(\d+\s+)\w+(::\S+\s*.*)$/) { + next if ($n eq "$1$class$2"); + } + + $haschanges = 1; + + print "-$o\n+$n\n\n"; + } + + return $haschanges; +} + +local $dblock = $ENV{"HOME"} . "/bcheck.lock"; +my $dbfile = $ENV{"HOME"} . "/bcheck.db"; +my $cdump = $ARGV[0]; + +die "file $cdump is not readable: $!" if (! -f $cdump); + +# make sure the advisory lock exists +open(MYLOCK, ">$dblock"); +print MYLOCK ""; + +flock MYLOCK, LOCK_EX; + +tie %bcheckdb, 'DB_File', $dbfile; + +my $chunk = ""; + +open (IN, "<$cdump") or die "cannot open $cdump: $!"; +while () { + + chop; + + s/0x[0-9a-fA-F]+/0x......../g; + s/base size=/size=/g; + s/base align=/align=/g; + + $chunk .= $_ . "\n"; + + if(/^\s*$/) { + my @lines = split /^/m, $chunk; + my $key = $lines[0]; + chomp $key; + + if($key !~ // && + $key !~ //) { + if(defined($bcheckdb{$key})) { + my $dbversion = $bcheckdb{$key}; + + if($dbversion ne $chunk) { + &ask_user($key, $chunk) if(&diff_chunk($dbversion, $chunk)); + } + } + else { + $bcheckdb{$key} = $chunk; + print "NEW: $key\n"; + } + } + + $chunk = ""; + next; + } + +} +close(IN); + +untie %bcheckdb; +flock MYLOCK, LOCK_UN; +close(MYLOCK); + +exit 0; diff --git a/admin/conf.change.pl b/admin/conf.change.pl index bb7dcc1..645b820 100644 --- a/admin/conf.change.pl +++ b/admin/conf.change.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # this script patches a config.status file, to use our own perl script # in the main loop @@ -27,11 +27,12 @@ # later autoconf's # 2. the big main loop which patches all Makefile.in's +use strict; use File::Basename; my $ac_aux_dir = dirname($0); my ($flag); -local $ac_version = 0; +my $ac_version = 0; my $vpath_seen = 0; $flag = 0; @@ -78,6 +79,11 @@ while (<>) { # 2. begins with: "for ac_file in.*CONFIG_FILES" (the next 'for' after (1)) # end with: "rm -f conftest.s\*" # on autoconf 250, it ends with '# CONFIG_HEADER section' +# +# gg: if a post-processing commands section is found first, +# stop there and insert a new loop to honour the case/esac. +# (pattern: /^\s+#\sRun the commands associated with the file./) + if (/^\s*for\s+ac_file\s+in\s+.*CONFIG_FILES/ ) { $flag = 3; } else { @@ -94,9 +100,11 @@ while (<>) { if ($ac_version != 2141) { print STDERR "hmm, don't know autoconf version\n"; } - } elsif (/^\#\s*CONFIG_HEADER section.*/) { + } elsif (/^\#\s*CONFIG_(HEADER|COMMANDS) section.*|^\s+#\s(Run) the commands associated/) { $flag = 4; + my $commands = defined $2; &insert_main_loop(); + $commands && insert_command_loop(); if($ac_version != 250) { print STDERR "hmm, something went wrong :-(\n"; } @@ -175,3 +183,9 @@ rm -f \$ac_cs_root.s* EOF return; } + +sub insert_command_loop { + print <&2 && exit 1) ; -dummy=$tmpdir/dummy ; -files="$dummy.c $dummy.o $dummy.rel $dummy" ; -trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +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" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do @@ -113,15 +117,13 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in CC_FOR_BUILD="$c"; break ; fi ; done ; - rm -f $files ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; -unset files' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -178,21 +180,41 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -223,71 +245,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; 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 + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. # A Vn.n version is a released version. # A 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. - eval $set_cc_for_build - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null - if test "$?" = 0 ; then - case `$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - 3-1307) - UNAME_MACHINE="alphaev7" - ;; - esac - fi - rm -f $dummy.s $dummy && rmdir $tmpdir - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? @@ -310,6 +328,9 @@ EOF *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -327,6 +348,9 @@ EOF NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; @@ -399,6 +423,9 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -439,8 +466,7 @@ EOF EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) @@ -449,7 +475,7 @@ EOF Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS) + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -524,8 +550,7 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -624,10 +649,20 @@ EOF } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy && rmdir $tmpdir + test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; 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 + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) @@ -661,8 +696,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -720,21 +754,26 @@ EOF CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; 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 ;; + 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; @@ -745,19 +784,7 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *: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=` - rm -f $dummy.c && rmdir $tmpdir - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -768,14 +795,17 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks exit 0 ;; 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 i386-pc-interix + echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin @@ -787,17 +817,28 @@ EOF echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + *: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 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -818,8 +859,26 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c && rmdir $tmpdir - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu @@ -855,6 +914,9 @@ EOF s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -912,9 +974,11 @@ EOF LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c && rmdir $tmpdir test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; @@ -932,6 +996,26 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; + 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 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; 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 @@ -966,9 +1050,6 @@ EOF echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -995,9 +1076,12 @@ EOF mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; - M68*:*:R3V[567]*:*) + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[5678]*:*) 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) + 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) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1014,9 +1098,6 @@ EOF mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; @@ -1098,7 +1179,11 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1111,7 +1196,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1134,11 +1219,6 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; @@ -1157,12 +1237,19 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; + esac esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1283,8 +1370,7 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 -rm -f $dummy.c $dummy && rmdir $tmpdir +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. diff --git a/admin/config.pl b/admin/config.pl index 88fb0eb..034042e 100644 --- a/admin/config.pl +++ b/admin/config.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # a script for use by autoconf to make the Makefiles # from the Makefile.in's # @@ -28,6 +28,8 @@ # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. +use strict; + use File::Path; my $ac_subs=$ARGV[0]; @@ -35,14 +37,19 @@ my $ac_sacfiles = $ARGV[1]; my $ac_given_srcdir=$ARGV[2]; my $ac_given_INSTALL=$ARGV[3]; +my @comp_match; +my @comp_subs; + #print "ac_subs=$ac_subs\n"; #print "ac_sacfiles=$ac_sacfiles\n"; #print "ac_given_srcdir=$ac_given_srcdir\n"; #print "ac_given_INSTALL=$ac_given_INSTALL\n"; +my $configure_input; my ($srcdir, $top_srcdir); my $INSTALL; my $bad_perl = ($] < 5.005); +my $created_file_count = 0; open(CF, "< $ac_subs") || die "can't open $ac_subs: $!"; my @subs = ; @@ -96,7 +103,7 @@ if ($bad_perl) { push @comp_match, eval "qr/\Q$1\E/"; push @comp_subs, ""; } else { - die "Uhh. Malformed pattern in $ac_cs_root.subs ($pat)" + die "Uhh. Malformed pattern in $ac_subs ($pat)" unless ( $pat =~ /^\s*$/ ); # ignore white lines } } @@ -168,20 +175,20 @@ foreach $ac_file (@ac_files) { my $ac_comsub=""; my $fname=$ac_file_in; $fname =~ s%.*/%%; - my $configure_input="Generated automatically from $fname by config.pl."; - if ($ac_file =~ /.*[Mm]akefile.*/) { - $ac_comsub="# ".$configure_input."\n"; # for the first line in $ac_file - } + $configure_input="$ac_file. Generated from $fname by config.pl."; my $ac_file_inputs; ($ac_file_inputs = $ac_file_in) =~ s%^%$ac_given_srcdir/%; $ac_file_inputs =~ s%:% $ac_given_srcdir/%g; - patch_file($ac_file, $ac_file_inputs, $ac_comsub); + patch_file($ac_file, $ac_file_inputs); + ++$created_file_count; } +print "config.pl: fast created $created_file_count file(s).\n"; + sub patch_file { - my ($outf, $infiles, $identline) = @_; + my ($outf, $infiles) = @_; my $filedata; my @infiles=split(' ', $infiles); my $i=0; @@ -196,10 +203,6 @@ sub patch_file { print STDERR "can't open $name: $!"."\n"; } } - if ($identline) { - # Put the ident in the second line. For shitty automake 1.6x. - $filedata =~ s%\n%\n$identline%; - } $filedata =~ s%\@configure_input\@%$configure_input%g; $filedata =~ s%\@srcdir\@%$srcdir%g; @@ -225,11 +228,7 @@ sub patch_file { sub make_closure { my ($pat, $sub) = @_; - $pat =~ s/\@/\\@/g; # @bla@ -> \@bla\@ - $pat =~ s/\$/\\\$/g; # $bla -> \$bla - $sub =~ s/\@/\\@/g; - $sub =~ s/\$/\\\$/g; - my $ret = eval "return sub { my \$ref=shift; \$\$ref =~ s%$pat%$sub%g; }"; + my $ret = eval "return sub { my \$ref=shift; \$\$ref =~ s%\Q$pat\E%\Q$sub\E%g; }"; if ($@) { print "can't create CODE: $@\n"; } diff --git a/admin/config.sub b/admin/config.sub index 1dea9b7..ac6de98 100755 --- a/admin/config.sub +++ b/admin/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2002-09-05' +timestamp='2004-06-24' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,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 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -118,7 +118,8 @@ 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* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | 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 +145,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 ;; @@ -228,14 +229,15 @@ case $basic_machine in | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | clipper \ + | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | 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 \ + | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -245,21 +247,24 @@ case $basic_machine in | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ - | tahoe | thumb | tic80 | tron \ + | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ @@ -294,16 +299,16 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ - | clipper-* | cydra-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ - | m32r-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ @@ -315,21 +320,27 @@ case $basic_machine in | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39 | mipstx39el \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ @@ -353,6 +364,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + abacus) + basic_machine=abacus-unknown + ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -367,6 +381,12 @@ case $basic_machine in basic_machine=a29k-none os=-bsd ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -426,12 +446,24 @@ 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 ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -632,10 +664,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 @@ -727,6 +755,10 @@ case $basic_machine in basic_machine=or32-unknown os=-coff ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -758,18 +790,24 @@ case $basic_machine in pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; - pentiumii | pentium2) + pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; + pentium4) + basic_machine=i786-pc + ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumii-* | pentium2-*) + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pn) basic_machine=pn-gould ;; @@ -828,6 +866,10 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; sequent) basic_machine=i386-sequent ;; @@ -835,6 +877,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh64) + basic_machine=sh64-unknown + ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks @@ -901,10 +946,6 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; - t3d) - basic_machine=alpha-cray - os=-unicos - ;; t3e) basic_machine=alphaev5-cray os=-unicos @@ -913,14 +954,18 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic4x | c4x*) - basic_machine=tic4x-unknown - os=-coff - ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -934,6 +979,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 @@ -977,10 +1026,6 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt - ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1011,6 +1056,9 @@ case $basic_machine in romp) basic_machine=romp-ibm ;; + mmix) + basic_machine=mmix-knuth + ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1027,13 +1075,13 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + sh3 | sh4 | 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) basic_machine=sparc-sun ;; cydra) @@ -1106,18 +1154,20 @@ 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* \ + | -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* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -mingw32* | -linux-gnu* | -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*) + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1129,8 +1179,10 @@ case $os in ;; esac ;; + -nto-qnx*) + ;; -nto*) - os=-nto-qnx + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ @@ -1139,6 +1191,9 @@ case $os in -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1151,6 +1206,9 @@ case $os in -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1172,6 +1230,9 @@ case $os in -atheos*) os=-atheos ;; + -syllable*) + os=-syllable + ;; -386bsd) os=-bsd ;; @@ -1194,6 +1255,9 @@ case $os in -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1224,6 +1288,12 @@ case $os in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; -none) ;; *) @@ -1255,6 +1325,9 @@ case $basic_machine in arm*-semi) os=-aout ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1301,6 +1374,9 @@ case $basic_machine in *-ibm) os=-aix ;; + *-knuth) + os=-mmixware + ;; *-wec) os=-proelf ;; @@ -1433,9 +1509,15 @@ case $basic_machine in -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; diff --git a/admin/configure.in.bot.end b/admin/configure.in.bot.end index fb483b6..14da279 100644 --- a/admin/configure.in.bot.end +++ b/admin/configure.in.bot.end @@ -1,6 +1,24 @@ +# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure +if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then + # And if so, warn when they don't match + if test "$kde_libs_prefix" != "$given_prefix"; then + # And if kde doesn't know about the prefix yet + echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null + if test $? -ne 0; then + echo "" + echo "Warning: you chose to install this package in $given_prefix," + echo "but KDE was found in $kde_libs_prefix." + echo "For this to work, you will need to tell KDE about the new prefix, by ensuring" + echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix" + echo "Then restart KDE." + echo "" + fi + fi +fi + if test "$all_tests" = "bad"; then if test ! "$cache_file" = "/dev/null"; then - echo "" + echo "" echo "Please remove the file $cache_file after changing your setup" echo "so that configure will find the changes next time." echo "" diff --git a/admin/cvs-clean.pl b/admin/cvs-clean.pl index 669dbdc..35d48e9 100644 --- a/admin/cvs-clean.pl +++ b/admin/cvs-clean.pl @@ -7,7 +7,7 @@ # written by Oswald Buddenhagen # inspired by the "old" cvs-clean target from Makefile.common # -# This file is free software in terms of the BSD licence. That means +# This file is free software in terms of the BSD license. That means # that you can do anything with it except removing this license or # the above copyright notice. There is NO WARRANTY of any kind. # diff --git a/admin/cvs.sh b/admin/cvs.sh index cffa478..1731eb2 100644 --- a/admin/cvs.sh +++ b/admin/cvs.sh @@ -20,24 +20,25 @@ call_and_fix_autoconf() strip_makefile() { - if test -f $makefile_wo; then :; else - perl -e '$in=0; while ( <> ) { $in = 1 if ($_=~ m/^if /); print $_ unless ($in); $in = 0 if ($_ =~ m/^endif/); }' < Makefile.am.in > $makefile_wo + if test ! -f $makefile_wo; then + perl -e '$in=0; while ( <> ) { $in = 1 if ($_ =~ m/^if / ); print $_ unless ($in || $_ =~ m/^include /); $in = 0 if ($_ =~ m/^endif/); }' < $makefile_am > $makefile_wo fi } check_autotool_versions() { +required_autoconf_version="2.53 or newer" AUTOCONF_VERSION=`$AUTOCONF --version | head -n 1` case $AUTOCONF_VERSION in Autoconf*2.5* | autoconf*2.5* ) : ;; "" ) echo "*** AUTOCONF NOT FOUND!." - echo "*** KDE requires autoconf 2.52, 2.53 or 2.54" + echo "*** KDE requires autoconf $required_autoconf_version" exit 1 ;; * ) echo "*** YOU'RE USING $AUTOCONF_VERSION." - echo "*** KDE requires autoconf 2.52, 2.53 or 2.54" + echo "*** KDE requires autoconf $required_autoconf_version" exit 1 ;; esac @@ -47,27 +48,28 @@ case $AUTOHEADER_VERSION in Autoconf*2.5* | autoheader*2.5* ) : ;; "" ) echo "*** AUTOHEADER NOT FOUND!." - echo "*** KDE requires autoheader 2.52 or 2.53 (part of autoconf)" + echo "*** KDE requires autoheader $required_autoconf_version" exit 1 ;; * ) echo "*** YOU'RE USING $AUTOHEADER_VERSION." - echo "*** KDE requires autoheader 2.52 or 2.53 (part of autoconf)" + echo "*** KDE requires autoheader $required_autoconf_version" exit 1 ;; esac AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1` +required_automake_version="1.6.1 or newer" case $AUTOMAKE_STRING in - automake*1.5d* ) + automake*1.5d* | automake*1.5* | automake*1.5-* ) echo "*** YOU'RE USING $AUTOMAKE_STRING." - echo "*** KDE requires automake 1.6" + echo "*** KDE requires automake $required_automake_version" exit 1 ;; - automake*1.6.* | automake*1.7* | automake*1.8* | automake*1.9* ) : ;; + automake*1.6.* | automake*1.7* | automake*1.8* | automake*1.9*) : ;; "" ) echo "*** AUTOMAKE NOT FOUND!." - echo "*** KDE requires automake 1.6" + echo "*** KDE requires automake $required_automake_version" exit 1 ;; unsermake* ) : @@ -76,40 +78,47 @@ case $AUTOMAKE_STRING in ;; * ) echo "*** YOU'RE USING $AUTOMAKE_STRING." - echo "*** KDE requires automake 1.6" + echo "*** KDE requires automake $required_automake_version" exit 1 ;; esac +unset required_automake_version } cvs() { check_autotool_versions - -### Produce acinclude.m4 -if grep '\$(top_srcdir)/acinclude.m4:' $makefile_am >/dev/null; then - echo "*** Creating acinclude.m4" - rm -f acinclude.m4 configure.files - - strip_makefile - $MAKE -f $makefile_wo top_srcdir=. ./acinclude.m4 -fi +acinclude_m4 ### Make new subdirs and configure.in. ### The make calls could be optimized away here, ### with a little thought. if test -r configure.in.in; then - rm -f subdirs configure.in - echo "*** Creating list of subdirectories" - subdirs - echo "*** Creating configure.in" - configure_files - strip_makefile - $MAKE -f $makefile_wo top_srcdir=. ./configure.in || exit 1 + rm -f configure.in + echo "*** Creating list of subdirectories" + create_subdirs + + if test -r Makefile.am.in; then + echo "*** Creating Makefile.am" + if grep '\$(top_srcdir)/Makefile.am:' $makefile_am >/dev/null; then + strip_makefile + $MAKE -f $makefile_wo top_srcdir=. ./Makefile.am || exit 1 + else + Makefile_am + fi + fi + configure_files + echo "*** Creating configure.in" + if grep '\$(top_srcdir)/configure.in:' $makefile_am >/dev/null; then + strip_makefile + $MAKE -f $makefile_wo top_srcdir=. ./configure.in || exit 1 + else + configure_in + fi fi echo "*** Creating aclocal.m4" -$ACLOCAL || exit 1 +$ACLOCAL $ACLOCALFLAGS || exit 1 echo "*** Creating configure" call_and_fix_autoconf @@ -145,19 +154,33 @@ check_autotool_versions ### ### First build all of the files necessary to do just "make" ### -if grep '\$(top_srcdir)/acinclude.m4:' $makefile_am >/dev/null; then - strip_makefile - $MAKE -f $makefile_wo top_srcdir=. ./acinclude.m4 -fi +acinclude_m4 if test -r configure.in.in; then - subdirs + rm -f configure.in + create_subdirs + + if test -r Makefile.am.in; then + if grep '\$(top_srcdir)/Makefile.am:' $makefile_am >/dev/null; then + strip_makefile + $MAKE -f $makefile_wo top_srcdir=. ./Makefile.am || exit 1 + else + Makefile_am + fi + fi configure_files - strip_makefile - $MAKE -f $makefile_wo top_srcdir=. ./configure.in + if grep '\$(top_srcdir)/configure.in:' $makefile_am >/dev/null; then + strip_makefile + $MAKE -f $makefile_wo top_srcdir=. ./configure.in || exit 1 + else + configure_in + fi fi -$ACLOCAL -$AUTOHEADER -$AUTOMAKE --foreign --include-deps +$ACLOCAL $ACLOCALFLAGS +if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then + echo "*** Creating config.h template" + $AUTOHEADER || exit 1 +fi +$AUTOMAKE --foreign perl -w admin/am_edit call_and_fix_autoconf touch stamp-h.in @@ -184,10 +207,10 @@ fi subdir_dist() { -$ACLOCAL +$ACLOCAL $ACLOCALFLAGS $AUTOHEADER -$AUTOMAKE --foreign --include-deps -perl -w ../admin/am_edit +$AUTOMAKE +perl -w ../admin/am_edit --path=../admin call_and_fix_autoconf touch stamp-h.in } @@ -197,45 +220,63 @@ configure_in() rm -f configure.in configure.in.new kde_use_qt_param= test -f configure.files || { echo "need configure.files for configure.in"; exit 1; } -cat `egrep -v "configure.in.bot" < configure.files` > configure.in.new +list=`fgrep -v "configure.in.bot" < configure.files | fgrep -v "configure.in.mid"` +: > configure.in.new +for file in $list; do + echo "dnl =======================================================" >> configure.in.new + echo "dnl FILE: $file" >> configure.in.new + echo "dnl =======================================================" >> configure.in.new + echo "" >> configure.in.new + cat $file >> configure.in.new +done echo "KDE_CREATE_SUBDIRSLIST" >> configure.in.new if test -f Makefile.am.in; then subdirs=`cat subdirs` for dir in $subdirs; do - dir=`echo $dir | sed -e "s,[-+.],_,g"` - echo "AM_CONDITIONAL($dir""_SUBDIR_included, test \"x\$$dir""_SUBDIR_included\" = xyes)" >> configure.in.new + vdir=`echo $dir | sed -e 's,[-+.@],_,g'` + echo "AM_CONDITIONAL($vdir""_SUBDIR_included, test \"x\$$vdir""_SUBDIR_included\" = xyes)" >> configure.in.new + if test -f "$dir/configure.in"; then + echo "if test \"x\$$vdir""_SUBDIR_included\" = xyes; then " >> configure.in.new + echo " AC_CONFIG_SUBDIRS($dir)" >> configure.in.new + echo "fi" >> configure.in.new + fi done fi -# echo "AC_OUTPUT( \\" >> configure.in.new -mfs=`find . -type d -print | fgrep -v "/." | \ - sed -e "s#\./##" -e "/^debian/d" | sort` -for i in $mfs; do - topleveldir=`echo $i| sed -e "s#/.*##"` + +echo "AC_CONFIG_FILES([ Makefile ])" >> configure.in.new +if test -n "$UNSERMAKE"; then + echo "AC_CONFIG_FILES([ Makefile.rules ])" >> configure.in.new + echo "AC_CONFIG_FILES([ Makefile.calls ])" >> configure.in.new +fi + +if test -f inst-apps; then + topleveldirs=`cat inst-apps` +else + topleveldirs= + for dir in `ls -1d * | sort`; do + if test "$dir" != "debian" && test -d $dir; then + topleveldirs="$topleveldirs $dir" + fi + done +fi + +for topleveldir in $topleveldirs; do if test -f $topleveldir/configure.in; then continue fi - if test -f $i/Makefile.am; then :; else + if test -f $topleveldir/Makefile.am; then :; else continue fi - if test -s inst-apps; then - if grep "\"^$topleveldir\"" inst-apps > /dev/null 2>&1; then - continue - fi - fi - if test "$i" = "."; then - echo "AC_CONFIG_FILES([ Makefile ])" >> configure.in.new - else - echo "AC_CONFIG_FILES([ $i/Makefile ])" >> configure.in.new - fi - if test -n "$UNSERMAKE"; then - if test "$i" = "."; then - echo "AC_CONFIG_FILES([ Makefile.rules ])" >> configure.in.new - echo "AC_CONFIG_FILES([ Makefile.calls ])" >> configure.in.new - else - echo "AC_CONFIG_FILES([ $i/Makefile.rules ])" >> configure.in.new - echo "AC_CONFIG_FILES([ $i/Makefile.calls ])" >> configure.in.new - fi - fi + + mfs=`find $topleveldir -name Makefile.am -print | fgrep -v "/." | \ + sed -e 's#\./##; s#/Makefile.am$##' | sort | sed -e 's#$#/Makefile#'` + for i in $mfs; do + echo "AC_CONFIG_FILES([ $i ])" >> configure.in.new + if test -n "$UNSERMAKE"; then + echo "AC_CONFIG_FILES([ $i.rules ])" >> configure.in.new + echo "AC_CONFIG_FILES([ $i.calls ])" >> configure.in.new + fi + done done files=`cat configure.files` @@ -247,6 +288,10 @@ done if test -n "$UNSERMAKE"; then echo "AC_CONFIG_FILES([ MakeVars ])" >> configure.in.new fi + +midfiles=`cat configure.files | fgrep "configure.in.mid"` +test -n "$midfiles" && cat $midfiles >> configure.in.new + echo "AC_OUTPUT" >> configure.in.new modulename= if test -f configure.in.in; then @@ -264,7 +309,7 @@ if test -f configure.in.in; then fi fi if test -z "$VERSION" || test "$VERSION" = "@VERSION@"; then - VERSION="\"3.1.5\"" + VERSION="\"3.3.2\"" fi if test -z "$modulename" || test "$modulename" = "@MODULENAME@"; then modulename=`pwd`; @@ -287,6 +332,7 @@ rm -f configure.in.new configure_files() { +echo "*** Creating configure.files" admindir=NO for i in . .. ../.. ../../..; do if test -x $i/admin; then admindir=$i/admin; break; fi @@ -297,21 +343,66 @@ if test -f configure.in.in && head -n 2 configure.in.in | grep "^#MIN_CONFIG" > echo $admindir/configure.in.min >> configure.files fi test -f configure.in.in && echo configure.in.in >> configure.files -list=`find . -name "configure.in.in" -o -name "configure.in.bot" | \ - sed -e "s,/configure,/aaaconfigure," | sort | sed -e "s,/aaaconfigure,/configure,"` +# we collect files in the subdirs and do some sorting tricks, so subsubdirs come after subdirs +if test -f inst-apps; then + inst=`cat inst-apps` + list="" + for i in $inst; do + list="$list `find $i/ -name "configure.in.in" -o -name "configure.in.bot" -o -name "configure.in.mid" | \ + sed -e "s,/configure,/aaaconfigure," | sort | sed -e "s,/aaaconfigure,/configure,"`" + done +else + list=`find . -name "configure.in.in" -o -name "configure.in.bot" -o -name "configure.in.mid" | \ + sed -e "s,/configure,/aaaconfigure," | sort | sed -e "s,/aaaconfigure,/configure,"` +fi for i in $list; do if test -f $i && test `dirname $i` != "." ; then echo $i >> configure.files fi; done test -f configure.in.mid && echo configure.in.mid >> configure.files test -f configure.in.bot && echo configure.in.bot >> configure.files +if test ! -s configure.files; then + echo "There are no files to build a configure. Please check your checkout." + exit 1 +fi +} + +create_subdirs() +{ +if grep '\$(top_srcdir)/subdirs:' $makefile_am >/dev/null; then + # as many modules contain rules to create subdirs without any + # dependencies make won't create it unless there is no file. + # so we check if that's a dummy rule or one that works + rm -f subdirs.cvs.sh.$$ + if test -f subdirs; then + mv subdirs subdirs.cvs.sh.$$ + fi + strip_makefile + $MAKE -f $makefile_wo top_srcdir=. ./subdirs || exit 1 + if test -f subdirs.cvs.sh.$$; then + if test -s subdirs; then + rm subdirs.cvs.sh.$$ + else + mv subdirs.cvs.sh.$$ subdirs + fi + fi +else + subdirs +fi } subdirs() { dirs= +idirs= +if test -f inst-apps; then + idirs=`cat inst-apps` +else + idirs=`ls -1 | sort` +fi + compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -n 1` compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -n 1` -for i in `ls -1`; do +for i in $idirs; do if test -f $i/Makefile.am; then case " $compilefirst $compilelast " in *" $i "*) ;; @@ -342,10 +433,47 @@ for d in $compilelast; do echo $d >> ./_SUBDIRS done +if test -r subdirs && cmp -s subdirs _SUBDIRS; then + rm -f _SUBDIRS +fi +test -r _SUBDIRS && mv _SUBDIRS subdirs || true +} + +Makefile_am() +{ if test -f Makefile.am.in; then - rm -f Makefile.am - cat Makefile.am.in > Makefile.am + compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -n 1` + compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -n 1` + + idirs= + dirs= + if test -f inst-apps; then + idirs=`cat inst-apps` + else + idirs=`cat subdirs` + fi + for i in $idirs; do + case " $compilefirst $compilelast " in + *" $i "*) ;; + *) dirs="$dirs $i" + esac + done + + adds=`fgrep '$(top_srcdir)/acinclude.m4:' Makefile.am.in | sed -e 's,^[^:]*: *,,; s,\$(top_srcdir)/,,g'` + if echo "$adds" | fgrep "*" >/dev/null ; then + adds=`ls -d -1 $adds 2>/dev/null` + fgrep -v '$(top_srcdir)/acinclude.m4:' Makefile.am.in > Makefile.am.in.adds + str='$(top_srcdir)/acinclude.m4:' + for add in $adds; do + str="$str \$(top_srcdir)/$add" + done + echo $str >> Makefile.am.in.adds + else + cat Makefile.am.in > Makefile.am.in.adds + fi + if test -n "$UNSERMAKE"; then + cat Makefile.am.in.adds > Makefile.am topsubdirs= for i in $compilefirst $dirs $compilelast; do vari=`echo $i | sed -e "s,[-+],_,g"` @@ -356,13 +484,35 @@ if test -f Makefile.am.in; then done echo "SUBDIRS=$topsubdirs" >> Makefile.am else + cat Makefile.am.in.adds | \ + sed -e 's,^\s*\(COMPILE_BEFORE.*\),# \1,' | \ + sed -e 's,^\s*\(COMPILE_AFTER.*\),# \1,' > Makefile.am echo "SUBDIRS="'$(TOPSUBDIRS)' >> Makefile.am fi + rm Makefile.am.in.adds fi -if test -r subdirs && diff subdirs _SUBDIRS > /dev/null; then - rm -f _SUBDIRS -fi -test -r _SUBDIRS && mv _SUBDIRS subdirs || true +} + +acinclude_m4() +{ + echo "*** Creating acinclude.m4" + adds= + if grep '\$(top_srcdir)/acinclude.m4:' $makefile_am >/dev/null; then + strip_makefile + rm -f acinclude.m4 + adds=`grep '\$(top_srcdir)/acinclude.m4:' $makefile_wo | sed -e 's,^[^:]*: *,,; s,\$(top_srcdir),.,g'` + if echo $adds | fgrep "*" >/dev/null ; then + adds=`ls -d -1 $adds 2>/dev/null` + else + $MAKE -f $makefile_wo top_srcdir=. ./acinclude.m4 || exit 1 + fi + else + rm -f acinclude.m4 + fi + # if it wasn't created up to now, then we do it better + if test ! -f acinclude.m4; then + cat admin/acinclude.m4.in admin/libtool.m4.in $adds > acinclude.m4 + fi } cvs_clean() @@ -401,7 +551,7 @@ mkdir po.backup for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do egrep -v '^#([^:]|$)' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > po.backup/$i - cp po/$i po.backup/backup_$i + cat po/$i > po.backup/backup_$i touch -r po/$i po.backup/backup_$i rm po/$i done @@ -418,22 +568,27 @@ for subdir in $dirs; do test -z "$VERBOSE" || echo "Making messages in $subdir" (cd $subdir if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then - $EXTRACTRC *.rc *.ui > rc.cpp + $EXTRACTRC *.rc *.ui *.kcfg > rc.cpp else - candidates=`ls -1 *.rc *.ui 2>/dev/null` + candidates=`ls -1 *.rc *.ui *.kcfg 2>/dev/null` if test -n "$candidates"; then - echo "$subdir has *.rc or *.ui files, but not correct messages line" + echo "$subdir has *.rc, *.ui or *.kcfg files, but not correct messages line" fi fi - if test -n "`grep -r KAboutData *.c* *.C* 2>/dev/null`"; then + if test -n "`find . -name \*.c\* -o -name \*.h\* | xargs grep -s KAboutData 2>/dev/null`"; then echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp else echo " " > _translatorinfo.cpp fi - perl -e '$mes=0; while () { next if (/^(if|else|endif)\s/); if (/^messages:/) { $mes=1; print $_; next; } if ($mes) { if (/$\\(XGETTEXT\)/ && / -o/) { s/ -o \$\(podir\)/ _translatorinfo.cpp -o \$\(podir\)/ } print $_; } else { print $_; } }' < Makefile.am | egrep -v '^include ' > _transMakefile + perl -e '$mes=0; while () { next if (/^(if\s|else\s|endif)/); if (/^messages:/) { $mes=1; print $_; next; } if ($mes) { if (/$\\(XGETTEXT\)/ && / -o/) { s/ -o \$\(podir\)/ _translatorinfo.cpp -o \$\(podir\)/ } print $_; } else { print $_; } }' < Makefile.am | egrep -v '^include ' > _transMakefile + + kdepotpath=${includedir:-${KDEDIR:-`kde-config --prefix`}/include}/kde.pot $MAKE -s -f _transMakefile podir=$podir EXTRACTRC="$EXTRACTRC" PREPARETIPS="$PREPARETIPS" \ - XGETTEXT="${XGETTEXT:-xgettext} -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x ${includedir:-$KDEDIR/include}/kde/kde.pot" \ - messages + XGETTEXT="${XGETTEXT:-xgettext} -C -ki18n -ktr2i18n -kI18N_NOOP -kaliasLocale -x $kdepotpath" messages + exit_code=$? + if test "$exit_code" != 0; then + echo "make exit code: $exit_code" + fi ) 2>&1 | grep -v '^make\[1\]' > $tmpname test -s $tmpname && { echo $subdir ; cat "$tmpname"; } test -f $subdir/rc.cpp && rm -f $subdir/rc.cpp @@ -445,10 +600,12 @@ for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v test -f po/$i || echo "disappeared: $i" done for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do + sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n",' po/$i > po/$i.new && mv po/$i.new po/$i msgmerge -q -o po/$i po/$i po/$i egrep -v '^#([^:]|$)' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > temp.pot if test -f po.backup/$i && test -n "`diff temp.pot po.backup/$i`"; then echo "will update $i" + sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n",' po.backup/backup_$i > po/$i.new && mv po/$i.new po.backup/backup_$i msgmerge -q po.backup/backup_$i po/$i > temp.pot mv temp.pot po/$i else @@ -465,15 +622,22 @@ rm -f temp.pot rm -rf po.backup } +unset LC_ALL || : +unset LANG || : +unset LC_CTYPE || : +unset LANGUAGE || : + +unset CDPATH || : admindir=`echo "$0" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$admindir" = "x$0" && admindir=. test "x$MAKE" = x && MAKE=make makefile_am=Makefile.am -makefile_wo=Makefile.am +makefile_wo=Makefile.am.wo if test -f Makefile.am.in; then makefile_am=Makefile.am.in makefile_wo=Makefile.am.in.wo + rm -f $makefile_wo fi # Suck in the AUTOCONF detection code @@ -486,7 +650,8 @@ fi arg=`echo $1 | tr '\-.' __` case $arg in cvs | dist | subdir_dist | configure_in | configure_files | subdirs | \ - cvs_clean | package_merge | package_messages ) $arg ;; + cvs_clean | package_merge | package_messages | Makefile_am | acinclude_m4 ) $arg ;; + configure ) call_and_fix_autoconf ;; * ) echo "Usage: cvs.sh " echo "Target can be one of:" echo " cvs cvs-clean dist" @@ -497,8 +662,8 @@ case $arg in exit 1 ;; esac -if test -f Makefile.am.in.wo; then - rm Makefile.am.in.wo +if test -f $makefile_wo; then + rm $makefile_wo fi exit 0 diff --git a/admin/debianrules b/admin/debianrules index bdf347d..25897f2 100755 --- a/admin/debianrules +++ b/admin/debianrules @@ -7,108 +7,37 @@ use Cwd; $origPwd = `pwd`; chomp $origPwd; -$kde_confdir = "/etc/kde3"; -$kde_prefix = "/usr"; -$kde_bindir = "$kde_prefix/bin"; -$kde_includedir = "$kde_prefix/include/kde"; -$kde_libdir = "$kde_prefix/lib"; -$kde_cgidir = "$kde_prefix/lib/cgi-bin"; -$kde_moduledir = "$kde_prefix/lib/kde3"; -$kde_appsdir = "$kde_prefix/share/applnk"; -$kde_datadir = "$kde_prefix/share/apps"; -$kde_htmldir = "$kde_prefix/share/doc/kde/HTML"; -$kde_icondir = "$kde_prefix/share/icons"; -$kde_locale = "$kde_prefix/share/locale"; -$kde_mimedir = "$kde_prefix/share/mimelnk"; -$kde_servicesdir = "$kde_prefix/share/services"; -$kde_servicetypesdir = "$kde_prefix/share/servicetypes"; -$kde_sounddir = "$kde_prefix/share/sounds"; -$kde_templatesdir = "$kde_prefix/share/templates"; -$kde_wallpaperdir = "$kde_prefix/share/wallpapers"; +$kde_prefix = "/usr"; +$sysconfdir = "/etc"; +$kde_includedir = "$kde_prefix/include/kde"; +$infodir = "$kde_prefix/share/info"; +$mandir = "$kde_prefix/share/man"; +$qtdir = "/usr/share/qt3"; -$mandir = "$kde_prefix/share/man"; -$infodir = "$kde_prefix/share/info"; -$sysconfdir = "/etc"; - -$QTDIR = "/usr/share/qt3"; -$IDL = "$kde_bindir/cuteidl"; -$DCOPIDL = "$kde_bindir/dcopidl"; -$DCOPIDL2CPP = "$kde_bindir/dcopidl2cpp"; -$KDB2HTML = "$kde_bindir/kdb2html"; -$MCOPIDL = "$kde_bindir/mcopidl"; -$ARTSCCONFIG = "$kde_bindir/artsc-config"; +$kde_cgidir = "$kde_prefix/lib/cgi-bin"; +$kde_confdir = "$sysconfdir/kde3"; +$kde_htmldir = "$kde_prefix/share/doc/kde/HTML"; if (defined $ENV{DEB_BUILD_OPTIONS} && - $ENV{DEB_BUILD_OPTIONS} =~ /\bdebug\b/) { - $enable_debug="--enable-debug"; - $enable_final=""; -} -else { - $enable_debug="--disable-debug"; - $enable_final="--enable-final"; + $ENV{DEB_BUILD_OPTIONS} =~ /\bnostrip\b/) { + $enable_debug="--enable-debug=full"; +} else { + $enable_debug="--disable-debug"; } if (@ARGV && $ARGV[0] eq 'echodirs') { - print STDOUT "export kde_confdir=$kde_confdir\n"; print STDOUT "export kde_prefix=$kde_prefix\n"; - print STDOUT "export kde_bindir=$kde_bindir\n"; + print STDOUT "export sysconfdir=$sysconfdir\n"; print STDOUT "export kde_includedir=$kde_includedir\n"; - print STDOUT "export kde_libdir=$kde_libdir\n"; - print STDOUT "export kde_cgidir=$kde_cgidir\n"; - print STDOUT "export kde_moduledir=$kde_moduledir\n"; - print STDOUT "export kde_appsdir=$kde_appsdir\n"; - print STDOUT "export kde_datadir=$kde_datadir\n"; - print STDOUT "export kde_htmldir=$kde_htmldir\n"; - print STDOUT "export kde_icondir=$kde_icondir\n"; - print STDOUT "export kde_locale=$kde_locale\n"; - print STDOUT "export kde_mimedir=$kde_mimedir\n"; - print STDOUT "export kde_servicesdir=$kde_servicesdir\n"; - print STDOUT "export kde_servicetypesdir=$kde_servicetypesdir\n"; - print STDOUT "export kde_sounddir=$kde_sounddir\n"; - print STDOUT "export kde_templatesdir=$kde_templatesdir\n"; - print STDOUT "export kde_wallpaperdir=$kde_wallpaperdir\n"; - - print STDOUT "export mandir=$mandir\n"; print STDOUT "export infodir=$infodir\n"; - print STDOUT "export sysconfdir=$sysconfdir\n"; + print STDOUT "export mandir=$mandir\n"; + print STDOUT "export qtdir=$qtdir\n"; - print STDOUT "export QTDIR=$QTDIR\n"; - print STDOUT "export IDL=$IDL\n"; - print STDOUT "export DCOPIDL=$DCOPIDL\n"; - print STDOUT "export DCOPIDL2CPP=$DCOPIDL2CPP\n"; - print STDOUT "export KDB2HTML=$KDB2HTML\n"; - print STDOUT "export MCOPIDL=$MCOPIDL\n"; - print STDOUT "export ARTSCCONFIG=$ARTSCCONFIG\n"; - print STDOUT "export INSTALL_DATA=install -p -c -m 644\n"; + print STDOUT "export kde_cgidir=$kde_cgidir\n"; + print STDOUT "export kde_confdir=$kde_confdir\n"; + print STDOUT "export kde_htmldir=$kde_htmldir\n"; - print STDOUT "configkde=$enable_debug $enable_final --disable-rpath --prefix=\$(kde_prefix) --libexecdir=\$(kde_bindir) --sysconfdir=\$(sysconfdir) --libdir=\$(kde_libdir) --includedir=\$(kde_includedir) --with-qt-includes=/usr/include/qt3 --mandir=\$(mandir) --infodir=\$(infodir) --with-xinerama\n"; - print STDOUT "configkdevelop=$enable_debug $enable_final --disable-rpath --enable-docbase --enable-kdoc2 --libdir=\$(kde_libdir) --includedir=\$(kde_includedir) --with-qt-includes=/usr/include/qt3 --mandir=\$(mandir) --with-kdelibsdoc-dir=/usr/share/doc/kdelibs3-doc/html --with-xinerama\n"; - print STDOUT "configkdepim=$enable_debug $enable_final --disable-rpath --with-extra-includes=/usr/include/libpisock --enable-shared --prefix=\$(kde_prefix) --libexecdir=\$(kde_bindir) --with-qt-includes=/usr/include/qt3 --mandir=\$(mandir) --infodir=\$(infodir) --with-xinerama\n"; + print STDOUT "configkde=$enable_debug --disable-rpath --prefix=\$(kde_prefix) --sysconfdir=\$(sysconfdir) --includedir=\$(kde_includedir) --infodir=\$(infodir) --mandir=\$(mandir) --with-qt-dir=\$(qtdir)\n"; exit } - -if (@ARGV && $ARGV[0] eq 'echoglobals') { - print STDOUT "[Directories]\n"; - print STDOUT "dir_config=$kde_confdir\n"; - print STDOUT "dir_tmp=/tmp\n"; - print STDOUT "dir_socket=/tmp\n"; - print STDOUT "dir_exe=$kde_bindir\n"; - print STDOUT "dir_lib=$kde_libdir\n"; - print STDOUT "dir_cgi=$kde_cgidir\n"; - print STDOUT "dir_module=$kde_moduledir\n"; - print STDOUT "dir_apps=$kde_appsdir\n"; - print STDOUT "dir_data=$kde_datadir\n"; - print STDOUT "dir_html=$kde_htmldir\n"; - print STDOUT "dir_icon=$kde_icondir\n"; - print STDOUT "dir_locale=$kde_locale\n"; - print STDOUT "dir_mime=$kde_mimedir\n"; - print STDOUT "dir_services=$kde_servicesdir\n"; - print STDOUT "dir_servicetypes=$kde_servicetypesdir\n"; - print STDOUT "dir_sound=$kde_sounddir\n"; - print STDOUT "dir_templates=$kde_templatesdir\n"; - print STDOUT "dir_wallpaper=$kde_wallpaperdir\n"; - print STDOUT "[General]\n"; - print STDOUT "TerminalApplication=x-terminal-emulator\n"; - exit -} diff --git a/admin/depcomp b/admin/depcomp index 6589965..4c20c6c 100755 --- a/admin/depcomp +++ b/admin/depcomp @@ -197,6 +197,36 @@ aix) rm -f "$tmpdepfile" ;; +icc) + # Must come before tru64. + + # Intel's C compiler understands `-MD -MF file'. However + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + tru64) # The Tru64 AIX compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. diff --git a/admin/deps.am b/admin/deps.am new file mode 100644 index 0000000..8f83a96 --- /dev/null +++ b/admin/deps.am @@ -0,0 +1,19 @@ +$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in $(top_srcdir)/admin/cvs.sh + @cd $(top_srcdir) && $(SHELL) admin/cvs.sh acinclude_m4 + +$(top_srcdir)/configure.in: $(top_srcdir)/subdirs $(top_srcdir)/configure.files $(top_srcdir)/admin/cvs.sh + @cd $(top_srcdir) && $(SHELL) admin/cvs.sh configure_in + +$(top_srcdir)/configure.files: $(top_srcdir)/subdirs $(CONF_FILES) + @cd $(top_srcdir) && $(SHELL) admin/cvs.sh configure.files $(top_srcdir)/admin/cvs.sh + +$(top_srcdir)/Makefile.am: $(top_srcdir)/Makefile.am.in $(top_srcdir)/subdirs $(top_srcdir)/admin/cvs.sh + @cd $(top_srcdir) && $(SHELL) admin/cvs.sh Makefile_am + +$(top_srcdir)/subdirs: $(top_srcdir)/Makefile.am.in $(top_srcdir)/admin/cvs.sh + @cd $(top_srcdir) && $(SHELL) admin/cvs.sh subdirs + +# defining default rules for files that may not be present +$(top_srcdir)/Makefile.am.in: +$(CONF_FILES): + diff --git a/admin/detect-autoconf.sh b/admin/detect-autoconf.sh index 56950ca..3d69531 100644 --- a/admin/detect-autoconf.sh +++ b/admin/detect-autoconf.sh @@ -7,59 +7,38 @@ AUTOM4TE="autom4te" AUTOMAKE="automake" ACLOCAL="aclocal" - -# We don't use variable here for remembering the type ... strings. -# local variables are not that portable, but we fear namespace issues with -# our includer. The repeated type calls are not that expensive. +# Please add higher versions first. The last version number is the minimum +# needed to compile KDE. Do not forget to include the name/version # +# separator if one is present, e.g. -1.2 where - is the separator. +KDE_AUTOCONF_VERS="-2.58 -2.57 257 -2.54 -2.53a -2.53 -2.52 -2.5x" +KDE_AUTOMAKE_VERS="-1.7 17 -1.6" + +# We don't use variable here for remembering the type ... strings. Local +# variables are not that portable, but we fear namespace issues with our +# includer. checkAutoconf() { - if test -x "`$WHICH autoconf-2.5x`" ; then - AUTOCONF="`$WHICH autoconf-2.5x`" - elif test -x "`$WHICH autoconf-2.54`" ; then - AUTOCONF="`$WHICH autoconf-2.54`" - elif test -x "`$WHICH autoconf-2.53`" ; then - AUTOCONF="`$WHICH autoconf-2.53`" - elif test -x "`$WHICH autoconf-2.53a`" ; then - AUTOCONF="`$WHICH autoconf-2.53a`" - elif test -x "`$WHICH autoconf-2.52`" ; then - AUTOCONF="`$WHICH autoconf-2.52`" - elif test -x "`$WHICH autoconf2.50`" ; then - AUTOCONF="`$WHICH autoconf2.50`" + for kde_autoconf_version in $KDE_AUTOCONF_VERS; do + if test -x "`$WHICH $AUTOCONF$kde_autoconf_version 2>/dev/null`"; then + AUTOCONF="`$WHICH $AUTOCONF$kde_autoconf_version`" + AUTOHEADER="`$WHICH $AUTOHEADER$kde_autoconf_version`" + AUTOM4TE="`$WHICH $AUTOM4TE$kde_autoconf_version`" + break fi + done } -checkAutoheader() +checkAutomake () { - if test -x "`$WHICH autoheader-2.5x`" ; then - AUTOHEADER="`$WHICH autoheader-2.5x`" - AUTOM4TE="`$WHICH autom4te-2.5x`" - elif test -x "`$WHICH autoheader-2.54`" ; then - AUTOHEADER="`$WHICH autoheader-2.54`" - AUTOM4TE="`$WHICH autom4te-2.54`" - elif test -x "`$WHICH autoheader-2.53`" ; then - AUTOHEADER="`$WHICH autoheader-2.53`" - AUTOM4TE="`$WHICH autom4te-2.53`" - elif test -x "`$WHICH autoheader-2.53a`" ; then - AUTOHEADER="`$WHICH autoheader-2.53a`" - AUTOM4TE="`$WHICH autom4te-2.53a`" - elif test -x "`$WHICH autoheader-2.52`" ; then - AUTOHEADER="`$WHICH autoheader-2.52`" - elif test -x "`$WHICH autoheader2.50`" ; then - AUTOHEADER="`$WHICH autoheader2.50`" + for kde_automake_version in $KDE_AUTOMAKE_VERS; do + if test -x "`$WHICH $AUTOMAKE$kde_automake_version 2>/dev/null`"; then + AUTOMAKE="`$WHICH $AUTOMAKE$kde_automake_version`" + ACLOCAL="`$WHICH $ACLOCAL$kde_automake_version`" + break fi -} + done -checkAutomakeAclocal () -{ - if test -z "$UNSERMAKE"; then - if test -x "`$WHICH automake-1.6`" ; then - AUTOMAKE="`$WHICH automake-1.6`" - ACLOCAL="`$WHICH aclocal-1.6`" - elif test -x "`$WHICH automake-1.7`" ; then - AUTOMAKE="`$WHICH automake-1.7`" - ACLOCAL="`$WHICH aclocal-1.7`" - fi - else + if test -n "$UNSERMAKE"; then AUTOMAKE="$UNSERMAKE" fi } @@ -75,7 +54,6 @@ checkWhich () checkWhich checkAutoconf -checkAutoheader -checkAutomakeAclocal +checkAutomake export WHICH AUTOHEADER AUTOCONF AUTOM4TE AUTOMAKE ACLOCAL diff --git a/admin/libtool.m4.in b/admin/libtool.m4.in index 5039063..105c0fe 100644 --- a/admin/libtool.m4.in +++ b/admin/libtool.m4.in @@ -24,6 +24,17 @@ # serial 47 AC_PROG_LIBTOOL + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], @@ -34,6 +45,11 @@ dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run @@ -59,6 +75,7 @@ dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed @@ -86,7 +103,6 @@ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl @@ -143,6 +159,7 @@ ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" +AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) @@ -192,8 +209,8 @@ file_magic*) ;; esac -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], @@ -224,8 +241,7 @@ AC_DEFUN([_LT_AC_SYS_COMPILER], LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. -set dummy $CC -compiler="[$]2" +compiler=$CC ])# _LT_AC_SYS_COMPILER @@ -239,24 +255,32 @@ compiler="[$]2" # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) - +[_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} @@ -274,7 +298,7 @@ if test "X[$]1" = X--no-reexec; then elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else @@ -404,8 +428,7 @@ if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then fi AC_SUBST(ECHO) -AC_DIVERT_POP -])# _LT_AC_PROG_ECHO_BACKSLASH +])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK @@ -438,6 +461,19 @@ ia64-*-hpux*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -449,26 +485,55 @@ ia64-*-hpux*) LD="${LD-ld} -64" ;; esac + fi fi rm -rf conftest* ;; -*-*-linux*) - # Test if the compiler is 64bit +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *"ELF 32"*) + case "`/usr/bin/file conftest.o`" in + *32-bit*) LINUX_64_MODE="32" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac ;; - *"ELF 64"*) + *64-bit*) LINUX_64_MODE="64" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac ;; esac fi rm -rf conftest* ;; - + *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" @@ -482,34 +547,11 @@ ia64-*-hpux*) CFLAGS="$SAVE_CFLAGS" fi ;; -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, - [AC_TRY_LINK([], - [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0);], - [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) - - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, - [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain@16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac ;; ]) esac @@ -524,24 +566,34 @@ need_locks="$enable_libtool_lock" # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_CACHE_CHECK([$1], [$2], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $3" - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - else + if test ! -s conftest.err; then $2=yes fi fi $rm conftest* - CFLAGS="$save_CFLAGS" ]) if test x"[$]$2" = xyes; then @@ -561,7 +613,7 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -593,7 +645,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 testring="ABCD" - case $host_os in + case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun @@ -609,7 +661,18 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=-1; ;; - *) + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. @@ -753,11 +816,26 @@ else lt_cv_dlopen_self=yes ;; - cygwin* | mingw* | pw32*) + mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], @@ -844,13 +922,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], mkdir conftest cd conftest mkdir out - ifelse([$1],[],[save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"], - [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"], - [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS" - GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of @@ -859,20 +931,28 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], # builds. chmod -w . - if (eval $ac_compile 2>out/conftest.err) && test -s out/conftest2.$ac_objext + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test -s out/conftest.err; then - # Append any errors to the config.log. - cat out/conftest.err 1>&AS_MESSAGE_LOG_FD - else + if test ! -s out/conftest.err; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi - ifelse([$1],[],[CFLAGS="$save_CFLAGS"], - [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"], - [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"]) chmod u+w . $rm conftest* out/* rmdir out @@ -934,7 +1014,8 @@ AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var $1)"; then + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && @@ -978,7 +1059,20 @@ if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) AC_MSG_RESULT([no]) + ;; + esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP @@ -991,6 +1085,7 @@ AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], library_names_spec= libname_spec='lib$name' soname_spec= +shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -1011,18 +1106,21 @@ need_version=unknown case $host_os in aix3*) version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' + soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file @@ -1048,12 +1146,12 @@ aix4* | aix5*) # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' + soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi @@ -1066,7 +1164,7 @@ amigaos*) ;; beos*) - library_names_spec='${libname}.so' + library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -1074,8 +1172,8 @@ beos*) bsdi4*) version_type=linux need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -1087,41 +1185,55 @@ bsdi4*) cygwin* | mingw* | pw32*) version_type=windows + shrext=".dll" need_version=no need_lib_prefix=no + case $GCC,$host_os in - yes,cygwin*) + yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"` - if echo "$sys_lib_search_path_spec" | [egrep ';[C-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - ;; + *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' @@ -1134,21 +1246,26 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -1156,17 +1273,29 @@ freebsd1*) dynamic_linker=no ;; +freebsd*-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac @@ -1190,8 +1319,8 @@ gnu*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; @@ -1202,26 +1331,42 @@ hpux9* | hpux10* | hpux11*) version_type=sunos need_lib_prefix=no need_version=no - if test "$host_cpu" = ia64; then + case "$host_cpu" in + ia64*) + shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - else + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - fi + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; @@ -1229,21 +1374,29 @@ hpux9* | hpux10* | hpux11*) irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; - *) version_type=irix ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; @@ -1252,6 +1405,7 @@ irix5* | irix6* | nonstopux*) shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. @@ -1264,8 +1418,8 @@ linux*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' libsuff= if test "x$LINUX_64_MODE" = x64; then @@ -1297,12 +1451,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -1312,17 +1466,17 @@ netbsd*) newsos6) version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; -nto-qnx) +nto-qnx*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -1331,7 +1485,7 @@ openbsd*) version_type=sunos need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then @@ -1350,8 +1504,9 @@ openbsd*) os2*) libname_spec='$name' + shrext=".dll" need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' + library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; @@ -1360,8 +1515,8 @@ osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" @@ -1369,8 +1524,8 @@ osf3* | osf4* | osf5*) sco3.2v5*) version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; @@ -1378,8 +1533,8 @@ solaris*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -1389,7 +1544,7 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -1401,12 +1556,18 @@ sunos4*) sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no ;; motorola) need_lib_prefix=no @@ -1420,16 +1581,16 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) sysv4*MP*) if test -d /usr/nec ;then version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -1446,13 +1607,9 @@ test "$dynamic_linker" = no && can_build_shared=no # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags=TAGS], - [include additional configurations @<:@CXX,GCJ@:>@])], - [tagnames="$withval"], - [tagnames="CXX,GCJ" - case $host_os in - mingw*|cygwin*) tagnames="$tagnames,RC" ;; - esac]) + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then @@ -1470,7 +1627,7 @@ if test -f "$ltmain" && test -n "$tagnames"; then # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do @@ -1493,11 +1650,27 @@ if test -f "$ltmain" && test -n "$tagnames"; then case $tagname in CXX) - AC_LIBTOOL_LANG_CXX_CONFIG + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi ;; GCJ) - AC_LIBTOOL_LANG_GCJ_CONFIG + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi ;; RC) @@ -1510,8 +1683,10 @@ if test -f "$ltmain" && test -n "$tagnames"; then esac # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi + fi done IFS="$lt_save_ifs" @@ -1670,11 +1845,27 @@ pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_MSG_CHECKING([for $1]) +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) @@ -1698,7 +1889,7 @@ dnl not every word. This closes a longstanding sh security hole. file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then + $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 @@ -1749,20 +1940,21 @@ fi # AC_PROG_LD # ---------- -# find the path to the GNU or non-GNU linker +# find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) + AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1774,10 +1966,10 @@ if test "$GCC" = yes; then # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; @@ -1806,11 +1998,14 @@ AC_CACHE_VAL(lt_cv_path_LD, # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + case `"$lt_cv_path_LD" -v 2>&1 &1 &5; then +case `$LD -v 2>&1 /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; @@ -1994,7 +2207,7 @@ newos6*) lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; -nto-qnx) +nto-qnx*) lt_cv_deplibs_check_method=unknown ;; @@ -2042,6 +2255,9 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; esac ;; @@ -2058,7 +2274,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown # AC_PROG_NM # ---------- -# find the path to a BSD-compatible name lister +# find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then @@ -2075,16 +2291,23 @@ else # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - if ("$tmp_nm" -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break - elif ("$tmp_nm" -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac fi done IFS="$lt_save_ifs" @@ -2101,15 +2324,15 @@ AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32*) - # These system don't have libm +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, main, LIBM="-lm") + AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM @@ -2154,7 +2377,7 @@ AC_DEFUN([AC_LIBLTDL_CONVENIENCE], # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, + AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) @@ -2176,14 +2399,6 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE], ])# AC_LIBLTDL_INSTALLABLE -# If this macro is not defined by Autoconf, define it here. -ifdef([AC_PROVIDE_IFELSE], - [], - [define([AC_PROVIDE_IFELSE], - [ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries @@ -2197,9 +2412,26 @@ AC_DEFUN([AC_LIBTOOL_CXX], AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries @@ -2217,6 +2449,7 @@ AC_DEFUN([_LT_AC_LANG_GCJ], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ @@ -2224,7 +2457,8 @@ AC_DEFUN([_LT_AC_LANG_GCJ], # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([AC_PROG_RC]) +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC @@ -2246,10 +2480,10 @@ objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='main(){return(0);}' +lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER @@ -2266,7 +2500,7 @@ if test "$GCC" = no; then fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no @@ -2293,9 +2527,9 @@ AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built @@ -2321,6 +2555,32 @@ aix4*) test "$enable_shared" = yes && enable_static=no fi ;; + darwin* | rhapsody*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; esac AC_MSG_RESULT([$enable_shared]) @@ -2354,12 +2614,17 @@ _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= @@ -2368,27 +2633,42 @@ _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= -# Source file extension for C test sources. +# Source file extension for C++ test sources. ac_ext=cc -# Object file extension for compiled C test sources. +# Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(int char *[]) { return(0); }' +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} -set dummy $CC -compiler="[$]2" +compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` @@ -2403,12 +2683,11 @@ fi if test "$GXX" = yes; then # Set up default GNU C++ configuration + AC_PROG_LD + # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if eval "`$CC -print-prog-name=ld` --version 2>&1" | \ - egrep 'GNU ld' > /dev/null; then - with_gnu_ld=yes - + if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' @@ -2422,7 +2701,7 @@ if test "$GXX" = yes; then # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - egrep 'no-whole-archive' > /dev/null; then + grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= @@ -2436,13 +2715,13 @@ if test "$GXX" = yes; then # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no @@ -2563,6 +2842,71 @@ case $host_os in ;; esac ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + dgux*) case $cc_basename in ec++) @@ -2594,25 +2938,79 @@ case $host_os in ;; gnu*) ;; - hpux*) + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) if test $with_gnu_ld = no; then - if test "$host_cpu" = ia64; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - else + ;; + *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - fi + ;; + esac fi - if test "$host_cpu" = ia64; then + case "$host_cpu" in + hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - else + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes - fi - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac case $cc_basename in CC) @@ -2620,16 +3018,12 @@ case $host_os in _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) - case $host_os in - hpux9*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - fi + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -2640,21 +3034,17 @@ case $host_os in # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then - case $host_os in - hpux9*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + case "$host_cpu" in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - fi + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -2682,7 +3072,7 @@ case $host_os in if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes @@ -2699,9 +3089,8 @@ case $host_os in # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -2710,7 +3099,7 @@ case $host_os in # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -2719,6 +3108,16 @@ case $host_os in # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; cxx) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' @@ -2736,7 +3135,7 @@ case $host_os in # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; @@ -2761,17 +3160,25 @@ case $host_os in esac ;; netbsd*) - # NetBSD uses g++ - do we need to do anything? - ;; - osf3*) - case $cc_basename in - KCC) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: @@ -2801,7 +3208,7 @@ case $host_os in # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then @@ -2814,7 +3221,7 @@ case $host_os in # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support @@ -2831,7 +3238,7 @@ case $host_os in # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: @@ -2848,7 +3255,7 @@ case $host_os in cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~ + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' @@ -2864,7 +3271,7 @@ case $host_os in # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then @@ -2877,7 +3284,7 @@ case $host_os in # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support @@ -2927,7 +3334,7 @@ case $host_os in # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' @@ -2952,7 +3359,7 @@ case $host_os in # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -2971,26 +3378,26 @@ case $host_os in # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | egrep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -3026,9 +3433,55 @@ esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no -# Figure out "hidden" C++ library dependencies from verbose -# compiler output whening linking a shared library. -cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments - _LT_AC_FILE_LTDLL_C - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments - _LT_AC_FILE_IMPGEN_C -EOF - ;; esac # We use sed instead of cat because bash on DJGPP gets confused if @@ -3721,7 +4288,7 @@ if test "$GCC" = yes; then AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions -c conftest.$ac_ext], [], + [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI @@ -3773,6 +4340,9 @@ hpux*) # Its linker distinguishes data from code symbols irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; solaris* | sysv5*) symcode='[[BDT]]' ;; @@ -3783,16 +4353,17 @@ esac # Handle CRLF in mingw tool chain opt_cr= -case $host_os in +case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[[ABCDGISTW]]' -fi +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGISTW]]' ;; +esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do @@ -3828,8 +4399,8 @@ EOF fi # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { @@ -3855,7 +4426,7 @@ const struct { lt_preloaded_symbols[[]] = { EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; @@ -3937,10 +4508,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - cygwin* | mingw* | os2*) + mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' @@ -3960,10 +4531,15 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) fi ;; hpux*) - # PIC is the default for IA64 HP-UX, but not for PA HP-UX. - if test "$host_cpu" != ia64; then + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - fi + ;; + esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' @@ -4016,9 +4592,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) aCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi + ;; + esac ;; *) ;; @@ -4042,6 +4623,12 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha @@ -4172,11 +4759,11 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - cygwin* | mingw* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' @@ -4202,10 +4789,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ;; hpux*) - # PIC is the default for IA64 HP-UX, but not for PA HP-UX. - if test "$host_cpu" != ia64; then + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - fi + ;; + esac ;; *) @@ -4225,7 +4818,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) fi ;; - cygwin* | mingw* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' @@ -4233,9 +4826,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" != ia64; then + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi + ;; + esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; @@ -4251,6 +4851,21 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; + linux*) + case $CC in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. @@ -4275,11 +4890,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - if test "x$host_vendor" = xsni; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-LD' - else - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - fi + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; @@ -4310,7 +4921,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [], + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; @@ -4324,7 +4935,7 @@ case "$host_os" in _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC" + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) @@ -4336,30 +4947,32 @@ esac AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; - cygwin* | mingw* | pw32*) + pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= - + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= @@ -4367,17 +4980,21 @@ ifelse([$1],[CXX],[ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an egrep regular expression of symbols to exclude + # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. @@ -4441,7 +5058,7 @@ EOF ;; beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME @@ -4452,80 +5069,28 @@ EOF ;; cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is - # no search path for DLLs. + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left by newer dlltools. - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi ;; netbsd*) @@ -4533,13 +5098,13 @@ EOF _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 @@ -4551,7 +5116,7 @@ EOF *** used, and then restart. EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else @@ -4567,7 +5132,7 @@ EOF ;; *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else @@ -4580,20 +5145,12 @@ EOF runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - ;; - esac + fi fi else # PORTME fill in a description of your system's linker (not GNU ld) @@ -4622,7 +5179,7 @@ EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' @@ -4735,38 +5292,58 @@ EOF # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no # Tell ltmain to make .lib files, not .a files. libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) + if test "$GXX" = yes ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; esac - - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. Also zsh mangles - # `"' quotes if we put them in here... so don't! - _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' - # We need to add '_' to the symbols in $export_symbols first - #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi ;; dgux*) @@ -4806,54 +5383,80 @@ EOF _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - hpux9* | hpux10* | hpux11*) + hpux9*) if test "$GCC" = yes; then - case $host_os in - hpux9*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - ;; - *) - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - esac + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - case $host_os in - hpux9*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - ;; - *) - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - ;; - esac - fi - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - else - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: @@ -4882,9 +5485,8 @@ EOF openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else @@ -4894,7 +5496,7 @@ EOF _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac @@ -4929,7 +5531,7 @@ EOF else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly @@ -4950,11 +5552,11 @@ EOF _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' @@ -4982,13 +5584,23 @@ EOF ;; sysv4) - if test "x$host_vendor" = xsni; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - fi + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5034,7 +5646,7 @@ EOF # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -5064,48 +5676,54 @@ fi # # Do we need to explicitly link libc? # -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - echo 'static int dummy;' > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + cat conftest.err 1>&5 fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac -fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac ])# AC_LIBTOOL_PROG_LD_SHLIBS @@ -5149,146 +5767,6 @@ AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ ])# _LT_AC_FILE_LTDLL_C -# _LT_AC_FILE_IMPGEN_C -# -------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_IMPGEN_C], [ -# /* impgen.c starts here */ -# /* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=$TMPDIR/sed$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - { (exit 1); exit 1; } -} - _max=0 - _count=0 - # Add /usr/xpg4/bin/sed as it is typically found on Solaris - # along with /bin/sed that truncates output. - for _sed in $_sed_list /usr/xpg4/bin/sed; do - test ! -f ${_sed} && break - cat /dev/null > "$tmp/sed.in" - _count=0 - echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in" - # Check for GNU sed and select it if it is found. - if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then - lt_cv_path_SED=${_sed} - break; +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed fi - while true; do - cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" - mv "$tmp/sed.tmp" "$tmp/sed.in" - cp "$tmp/sed.in" "$tmp/sed.nl" - echo >>"$tmp/sed.nl" - ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break - cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break - # 10000 chars as input seems more than enough - test $_count -gt 10 && break - _count=`expr $_count + 1` - if test $_count -gt $_max; then - _max=$_count - lt_cv_path_SED=$_sed - fi - done done - rm -rf "$tmp" +done ]) +SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) diff --git a/admin/ltmain.sh b/admin/ltmain.sh index f2a88ef..035a3c1 100644 --- a/admin/ltmain.sh +++ b/admin/ltmain.sh @@ -1,7 +1,7 @@ # 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 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # @@ -55,8 +55,8 @@ modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.4e -TIMESTAMP=" (1.1090 2002/02/07 19:54:36)" +VERSION=1.5a +TIMESTAMP=" (1.1240 2003/06/26 06:55:19)" default_mode= help="Try \`$progname --help' for more information." @@ -69,8 +69,17 @@ rm="rm -f" # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -SP2NL='tr \040 \012' -NL2SP='tr \015\012 \040\040' +# 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'" + ;; + *) # Assume ASCII based system + SP2NL="tr '\040' '\012'" + NL2SP="tr '\015\012' '\040\040'" + ;; +esac # NLS nuisances. # Only set LANG and LC_ALL to C if already set. @@ -88,8 +97,8 @@ fi : ${IFS=" "} if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - echo "$modename: not configured to build any kind of library" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + $echo "$modename: not configured to build any kind of library" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi @@ -105,6 +114,49 @@ execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# 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. +win32_libid () { + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + grep -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 + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + +# End of Shell function definitions +##################################### + # Parse our command line options once, thoroughly. while test "$#" -gt 0 do @@ -128,7 +180,7 @@ do # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) - echo "$progname: invalid tag name: $tagname" 1>&2 + $echo "$progname: invalid tag name: $tagname" 1>&2 exit 1 ;; esac @@ -144,7 +196,7 @@ do # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" else - echo "$progname: ignoring unknown tag $tagname" 1>&2 + $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac @@ -166,12 +218,11 @@ do ;; --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - echo - echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001" - echo "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." + $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 0 ;; @@ -185,7 +236,7 @@ do ;; --debug) - echo "$progname: enabling shell trace mode" + $echo "$progname: enabling shell trace mode" set -x ;; @@ -194,16 +245,16 @@ do ;; --features) - echo "host: $host" + $echo "host: $host" if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" + $echo "enable shared libraries" else - echo "disable shared libraries" + $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - echo "enable static libraries" + $echo "enable static libraries" else - echo "disable static libraries" + $echo "disable static libraries" fi exit 0 ;; @@ -259,8 +310,10 @@ 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 case $nonopt in - *cc | *++ | gcc* | *-gcc*) + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do @@ -315,153 +368,122 @@ if test -z "$show_help"; then modename="$modename: compile" # Get the compilation command and the source file. base_compile= - prev= - lastarg= - srcfile="$nonopt" + srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_output= + arg_mode=normal + libobj= - user_target=no for arg do - case $prev in - "") ;; - xcompiler) - # Aesthetically quote the previous argument. - prev= - lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - - case $arg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac + case "$arg_mode" in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi + target ) + libobj="$arg" + arg_mode=normal continue ;; - esac - # Accept any command-line options. - case $arg in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit 1 + fi + arg_mode=target + continue + ;; - -static) - build_old_libs=yes - continue - ;; + -static) + build_old_libs=yes + continue + ;; - -prefer-pic) - pic_mode=yes - continue - ;; + -prefer-pic) + pic_mode=yes + continue + ;; - -prefer-non-pic) - pic_mode=no - continue - ;; + -prefer-non-pic) + pic_mode=no + continue + ;; - -Xcompiler) - prev=xcompiler - continue - ;; + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - # Add the arguments to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else + # Add the arguments to base_compile. base_compile="$base_compile $lastarg" - fi - continue - ;; - esac + continue + ;; - case $user_target in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" + esac # case $arg_mode # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + 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. - case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done + base_compile="$base_compile $lastarg" + done # for arg - case $user_target in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit 1 ;; - *) + target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; esac # Recognize several different file suffixes. @@ -498,28 +520,25 @@ if test -z "$show_help"; then # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. if test -n "$available_tags" && test -z "$tagname"; then - case "$base_compile " in - "$CC "*) ;; + case $base_compile in # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when ltconfig was run. - "`$echo $CC` "*) ;; + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" case "$base_compile " in - "$CC "*) + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; - "`$echo $CC` "*) - tagname=$z - break - ;; esac fi done @@ -527,11 +546,11 @@ if test -z "$show_help"; then # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then - echo "$modename: unable to infer tagged configuration" - echo "$modename: specify a tag with \`--tag'" 1>&2 + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 exit 1 # else -# echo "$modename: using $tagname tagged configuration" +# $echo "$modename: using $tagname tagged configuration" fi ;; esac @@ -595,7 +614,7 @@ if test -z "$show_help"; then done elif test "$need_locks" = warn; then if test -f "$lockfile"; then - echo "\ + $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` @@ -609,7 +628,7 @@ compiler." $run $rm $removelist exit 1 fi - echo $srcfile > "$lockfile" + $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then @@ -667,7 +686,7 @@ EOF if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - echo "\ + $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` @@ -737,7 +756,7 @@ EOF if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - echo "\ + $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` @@ -801,7 +820,7 @@ EOF # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra - # flag for every libtool invokation. + # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying @@ -833,6 +852,7 @@ EOF linker_flags= dllsearchpath= lib_search_path=`pwd` + inst_prefix_dir= avoid_version=no dlfiles= @@ -859,6 +879,7 @@ EOF temp_rpath= thread_safe=no vinfo= + vinfo_number=no # We need to know -static, to get the right output filenames. for arg @@ -965,6 +986,11 @@ EOF prev= continue ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; release) release="-$arg" prev= @@ -981,7 +1007,7 @@ EOF # A libtool-controlled object. # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= @@ -1115,6 +1141,14 @@ EOF finalize_command="$finalize_command $wl$qarg" continue ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; *) eval "$prev=\"\$arg\"" prev= @@ -1173,6 +1207,11 @@ EOF continue ;; + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) @@ -1224,6 +1263,9 @@ EOF # These systems don't actually have a C or math library (as such) continue ;; + *-*-freebsd*-gnu*) + # prevent being parsed by the freebsd regexp below + ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue @@ -1239,7 +1281,10 @@ EOF esac elif test "X$arg" = "X-lc_r"; then case $host in - *-*-openbsd* | *-*-freebsd*) + *-*-freebsd*-gnu*) + # prevent being parsed by the freebsd regexp below + ;; + *-*-openbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -1254,6 +1299,34 @@ 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*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + if test "$with_gcc" = "yes" ; then + compiler_flags="$compiler_flags $arg" + fi + continue + ;; + + -shrext) + prev=shrext + continue + ;; + -no-fast-install) fast_install=no continue @@ -1335,6 +1408,11 @@ EOF prev=vinfo continue ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` @@ -1383,6 +1461,11 @@ EOF continue ;; + -XCClinker) + prev=xcclinker + continue + ;; + # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need @@ -1405,7 +1488,7 @@ EOF # A libtool-controlled object. # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= @@ -1551,27 +1634,24 @@ EOF # command doesn't match the default compiler. if test -n "$available_tags" && test -z "$tagname"; then case $base_compile in - "$CC "*) ;; # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when ltconfig was run. - "`$echo $CC` "*) ;; + # but not from the CC environment variable when configure was run. + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" case $base_compile in - "$CC "*) + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) # The compiler in $compile_command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; - "`$echo $CC` "*) - tagname=$z - break - ;; esac fi done @@ -1579,11 +1659,11 @@ EOF # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then - echo "$modename: unable to infer tagged configuration" - echo "$modename: specify a tag with \`--tag'" 1>&2 + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 exit 1 # else -# echo "$modename: using $tagname tagged configuration" +# $echo "$modename: using $tagname tagged configuration" fi ;; esac @@ -1638,7 +1718,17 @@ EOF *) linkmode=prog ;; # Anything else should be a program. esac + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplcations in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac specialdeplibs= + libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) @@ -1658,7 +1748,7 @@ EOF # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= - if test "X$duplicate_deps" = "Xyes" ; then + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; @@ -1732,12 +1822,18 @@ EOF 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 - # Search the libtool library - lib="$searchdir/lib${name}.la" - if test -f "$lib"; then - found=yes - break - fi + for search_ext in .la $shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library @@ -1749,6 +1845,42 @@ EOF test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi fi ;; # -l -L*) @@ -1799,17 +1931,17 @@ EOF case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then - echo - echo "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not used here." + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." else - echo - echo "*** Warning: Linking the shared library $output against the" - echo "*** static library $deplib is not portable!" + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue @@ -1853,7 +1985,7 @@ EOF fi # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 @@ -1869,8 +2001,9 @@ EOF library_names= old_library= # If the library was installed with an old release of libtool, - # it will not redefine variable installed. + # it will not redefine variables installed, or shouldnotlink installed=yes + shouldnotlink=no # Read the .la file case $lib in @@ -1914,6 +2047,7 @@ EOF continue fi # $pass = conv + # Get the name of the library we link against. linklib= for l in $old_library $library_names; do @@ -2006,6 +2140,7 @@ EOF continue fi + if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" @@ -2092,6 +2227,17 @@ EOF need_relink=yes fi # This is a shared library + + # Warn about portability, can't link against -module's on some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. @@ -2129,7 +2275,7 @@ EOF elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin*) + *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; @@ -2141,8 +2287,8 @@ EOF # Make a new name for the extract_expsyms_cmds to use soroot="$soname" - soname=`echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : @@ -2184,6 +2330,22 @@ EOF immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" + case $host in + *-*-sco3.2v5* ) 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 | grep "bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; @@ -2202,6 +2364,14 @@ EOF add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="-L$inst_prefix_dir$libdir $add_dir" + ;; + esac + fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" @@ -2257,9 +2427,23 @@ EOF *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="-L$inst_prefix_dir$libdir $add_dir" + ;; + esac + fi add="-l$name" fi @@ -2291,21 +2475,21 @@ EOF # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - echo - echo "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -2376,19 +2560,70 @@ EOF ;; esac if grep "^installed=no" $deplib > /dev/null; then - path="-L$absdir/$objdir" + path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi - path="-L$absdir" + if test "$absdir" != "$libdir"; then + # Sure, some shells/systems don't implement the -ef. + # Those will have to live with the warning. + test "$absdir" -ef "$libdir" > /dev/null 2>&1 || + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + path="" + fi + ;; + *) + path="-L$path" + ;; + esac + + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac ;; *) continue ;; esac case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$deplibs $depdepl" ;; + esac + case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac @@ -2434,6 +2669,7 @@ EOF # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or @@ -2470,18 +2706,25 @@ EOF *) tmp_libs="$tmp_libs $deplib" ;; esac ;; - -R*) - temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi + # Last step: remove runtime libs from dependency_libs (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" @@ -2507,7 +2750,7 @@ EOF fi if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then @@ -2529,6 +2772,7 @@ EOF case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" ;; *) @@ -2540,6 +2784,7 @@ EOF if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` @@ -2552,9 +2797,9 @@ EOF $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else - echo - echo "*** Warning: Linking the shared library $output against the non-libtool" - echo "*** objects $objs is not portable!" + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi @@ -2582,7 +2827,7 @@ EOF fi if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then @@ -2601,9 +2846,46 @@ EOF exit 1 fi - current="$2" - revision="$3" - age="$4" + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac # Check that each of the things are valid numbers. case $current in @@ -2667,14 +2949,14 @@ EOF ;; irix | nonstopux) + major=`expr $current - $age + 1` + case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" - major=`expr $current - $age + 1` - # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do @@ -2694,7 +2976,7 @@ EOF ;; osf) - major=`expr $current - $age` + major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" @@ -2724,7 +3006,7 @@ EOF *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac @@ -2773,7 +3055,7 @@ EOF # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= - tempremovelist=`echo "$output_objdir/*"` + tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) @@ -2800,9 +3082,9 @@ EOF # 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'` + 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 @@ -2853,6 +3135,12 @@ EOF *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; + *-*-freebsd*-gnu*) + # Prevent $arg from being parsed by the freebsd regexp below. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue @@ -2886,7 +3174,7 @@ EOF # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. + # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) @@ -2905,62 +3193,82 @@ EOF for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" -ne "0"; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - echo - echo "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which I believe you do not have" - echo "*** because a test_compile did reveal that the linker did not use it for" - echo "*** its dynamic dependency list that programs get resolved with at runtime." + if test "$name" != "" && test "$name" -ne "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $i "*) + newdeplibs="$newdeplibs $i" + i="" + ;; + esac + fi + if test -n "$i" ; then + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + $echo + $echo "*** Warning: dynamic linker does not accept needed library $i." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which I believe you do not have" + $echo "*** because a test_compile did reveal that the linker did not use it for" + $echo "*** its dynamic dependency list that programs get resolved with at runtime." + fi fi else newdeplibs="$newdeplibs $i" fi done else - # Error occured in the first compile. Let's try to salvage + # 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\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then + # 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 ldd_output=`ldd conftest` - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - echo - echo "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because a test_compile did reveal that the linker did not use this one" - echo "*** as a dynamic dependency that programs can get resolved with at runtime." + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $i "*) + newdeplibs="$newdeplibs $i" + i="" + ;; + esac + fi + if test -n "$i" ; then + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + $echo + $echo "*** Warning: dynamic linker does not accept needed library $i." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because a test_compile did reveal that the linker did not use this one" + $echo "*** as a dynamic dependency that programs can get resolved with at runtime." + fi fi else 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 "*** library that it depends on before this library will be fully" - echo "*** functional. Installing it before continuing would be even better." + $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 "*** library that it depends on before this library will be fully" + $echo "*** functional. Installing it before continuing would be even better." fi else newdeplibs="$newdeplibs $i" @@ -2974,11 +3282,20 @@ EOF for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do + if test "$name" != "" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then @@ -2999,26 +3316,27 @@ EOF done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ - | egrep "$file_magic_regex" > /dev/null; then + | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi - done - done + done + done + fi if test -n "$a_deplib" ; then droppeddeps=yes - echo - echo "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then - echo "*** with $libname but no candidates were found. (...for file magic test)" + $echo "*** with $libname but no candidates were found. (...for file magic test)" else - echo "*** with $libname and none of the candidates passed a file format test" - echo "*** using a file magic. Last file checked: $potlib" + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" fi fi else @@ -3034,33 +3352,43 @@ EOF name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | egrep "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done done - done + fi if test -n "$a_deplib" ; then droppeddeps=yes - echo - echo "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then - echo "*** with $libname but no candidates were found. (...for regex pattern test)" + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else - echo "*** with $libname and none of the candidates passed a file format test" - echo "*** using a regex pattern. Last file checked: $potlib" + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else @@ -3071,16 +3399,23 @@ EOF ;; none | unknown | *) newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." + $echo "*** Warning: inter-library dependencies are not supported in this platform." else - echo "*** Warning: inter-library dependencies are not known to be supported." + $echo "*** Warning: inter-library dependencies are not known to be supported." fi - echo "*** All declared inter-library dependencies are being dropped." + $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; @@ -3100,17 +3435,17 @@ EOF if test "$droppeddeps" = yes; then if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -3120,16 +3455,16 @@ EOF build_libtool_libs=no fi else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module @@ -3187,7 +3522,11 @@ EOF if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - eval dep_rpath=\"$hardcode_libdir_flag_spec\" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. @@ -3207,6 +3546,7 @@ EOF fi # Get the real and link names of the library. + eval shared_ext=\"$shrext\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" @@ -3240,13 +3580,21 @@ EOF save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi @@ -3257,6 +3605,17 @@ EOF $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs @@ -3290,8 +3649,34 @@ EOF 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 @@ -3318,13 +3703,21 @@ EOF #linker_flags="$linker_flags $add_flags" # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval cmds=\"$module_expsym_cmds\" + else + eval cmds=\"$module_cmds\" + fi + else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" + fi fi - if len=`expr "X$cmds" : ".*"` && + if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else @@ -3385,6 +3778,15 @@ EOF test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + # Set up a command to remove the reloadale object files # after they are used. i=0 @@ -3541,8 +3943,34 @@ EOF 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 @@ -3609,7 +4037,7 @@ EOF prog) case $host in - *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 @@ -3634,6 +4062,16 @@ EOF ;; esac + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" @@ -3784,12 +4222,12 @@ extern \"C\" { done if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi @@ -3807,8 +4245,8 @@ extern \"C\" { for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done @@ -3817,12 +4255,18 @@ extern \"C\" { test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S @@ -3831,7 +4275,7 @@ extern \"C\" { if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else - echo '/* NONE */' >> "$output_objdir/$dlsyms" + $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ @@ -4075,13 +4519,228 @@ static const void *lt_preloaded_setup() { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in - *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in - *cygwin*) exeext=.exe ;; + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac + case $host in + *cygwin* | *mingw* ) + cwrappersource=`$echo ${objdir}/lt-${output}.c` + cwrapper=`$echo ${output}.exe` + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +#define DIR_SEPARATOR '/' +#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 +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +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); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup ((char *) basename (argv[0])); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = fnqualify(argv[0]); + /* 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; +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +char * +basename (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] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return (char *) base; +} + +char * +fnqualify(const char *path) +{ + size_t size; + char *p; + char tmp[LT_PATHMAX + 1]; + + assert(path != NULL); + + /* Is it qualified already? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha (path[0]) && path[1] == ':') + return xstrdup (path); +#endif + if (IS_DIR_SEPARATOR (path[0])) + return xstrdup (path); + + /* prepend the current directory */ + /* doesn't handle '~' */ + 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; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC -s -o $cwrapper $cwrappersource + ;; + esac $rm $output trap "$rm $output; exit 1" 1 2 15 @@ -4159,7 +4818,7 @@ else " if test "$fast_install" = yes; then - echo >> $output "\ + $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" @@ -4175,7 +4834,7 @@ else $rm \"\$progdir/\$file\" fi" - echo >> $output "\ + $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then @@ -4193,13 +4852,13 @@ else $rm \"\$progdir/\$file\" fi" else - echo >> $output "\ + $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi - echo >> $output "\ + $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" @@ -4230,14 +4889,6 @@ else # Run the actual program with our arguments. " case $host in - # win32 systems need to use the prog path for dll - # lookup to work - *-*-cygwin* | *-*-pw32*) - $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} -" - ;; - # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ @@ -4245,13 +4896,16 @@ else " ;; + *-*-freebsd* ) + # Need to set LD_LIBRARY_PATH, to the value already + # computed within libtool. + $echo >> $output "\ + LD_LIBRARY_PATH=\"$rpath\" exec \$progdir/\$program \${1+\"\$@\"} +" + ;; *) $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} + exec \$progdir/\$program \${1+\"\$@\"} " ;; esac @@ -4263,7 +4917,7 @@ else # The program doesn't exist. \$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 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ @@ -4286,7 +4940,6 @@ fi\ oldobjs="$libobjs_save" build_libtool_libs=no else - #oldobjs="$oldobjs$old_deplibs $non_pic_objects" oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" @@ -4322,8 +4975,34 @@ fi\ 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 @@ -4348,6 +5027,25 @@ 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 + last_oldobj=$obj + done for obj in $save_oldobjs do oldobjs="$objlist $obj" @@ -4359,6 +5057,9 @@ fi\ else # the above command should be used before it gets too long oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= @@ -4366,7 +5067,11 @@ fi\ done RANLIB=$save_RANLIB oldobjs=$objlist - eval cmds=\"\$concat_cmds~$old_archive_cmds\" + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~$old_archive_cmds\" + fi fi fi save_ifs="$IFS"; IFS='~' @@ -4402,9 +5107,11 @@ fi\ fi done # Quote the link command for shipping. - relink_command="($relink_command; cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" + relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - + if test "$hardcode_automatic" = yes ; then + relink_command= + fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do @@ -4457,7 +5164,7 @@ fi\ # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file @@ -4486,6 +5193,9 @@ revision=$revision # Is this an already installed library? installed=$installed +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' @@ -4668,7 +5378,7 @@ relink_command=\"$relink_command\"" *.la) # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 @@ -4703,12 +5413,33 @@ relink_command=\"$relink_command\"" dir="$dir$objdir" if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit 1 + fi + + 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%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - continue + exit 1 fi fi @@ -4816,23 +5547,43 @@ relink_command=\"$relink_command\"" destfile="$destdir/$destfile" fi + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) - wrapper=`echo $file | ${SED} -e 's,.exe$,,'` + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac - if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 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 # If there is no directory component, then add one. case $file in - */* | *\\*) . $wrapper ;; - *) . ./$wrapper ;; + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. @@ -4860,10 +5611,17 @@ 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 # If there is no directory component, then add one. case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; esac outputname= @@ -4872,12 +5630,12 @@ relink_command=\"$relink_command\"" tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi - file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + 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'` @@ -4895,7 +5653,7 @@ relink_command=\"$relink_command\"" fi else # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -4911,7 +5669,7 @@ relink_command=\"$relink_command\"" destfile=$destfile.exe ;; *:*.exe) - destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; @@ -4998,40 +5756,40 @@ relink_command=\"$relink_command\"" # Exit here if they wanted silent mode. exit 0 - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" + $echo "----------------------------------------------------------------------" + $echo "Libraries have been installed in:" for libdir in $libdirs; do - echo " $libdir" + $echo " $libdir" done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" fi if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" - echo " - use the \`$flag' linker flag" + $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" + $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi - 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 + $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 "----------------------------------------------------------------------" exit 0 ;; @@ -5059,7 +5817,7 @@ relink_command=\"$relink_command\"" case $file in *.la) # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 @@ -5130,7 +5888,7 @@ relink_command=\"$relink_command\"" -*) ;; *) # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; @@ -5153,7 +5911,7 @@ relink_command=\"$relink_command\"" eval "export $shlibpath_var" fi - # Restore saved enviroment variables + # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi @@ -5203,13 +5961,14 @@ relink_command=\"$relink_command\"" rmdirs= + origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. - objdir="$objdir" + objdir="$origobjdir" else - objdir="$dir/$objdir" + objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" @@ -5239,7 +5998,7 @@ relink_command=\"$relink_command\"" case $name in *.la) # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. @@ -5286,7 +6045,7 @@ relink_command=\"$relink_command\"" *.lo) # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name @@ -5306,15 +6065,31 @@ relink_command=\"$relink_command\"" ;; *) - # Do a test to see if this is a libtool program. - if test "$mode" = clean && - (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$file + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi fi fi ;; @@ -5322,6 +6097,7 @@ relink_command=\"$relink_command\"" $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done + objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -5383,7 +6159,9 @@ MODE must be one of the following: uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." +a more detailed description of MODE. + +Report bugs to ." exit 0 ;; @@ -5541,7 +6319,7 @@ Otherwise, only FILE itself is deleted using RM." ;; esac -echo +$echo $echo "Try \`$modename --help' for more information about other modes." exit 0 @@ -5563,7 +6341,7 @@ build_old_libs=yes # ### 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` +build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: diff --git a/admin/nmcheck b/admin/nmcheck new file mode 100755 index 0000000..1544713 --- /dev/null +++ b/admin/nmcheck @@ -0,0 +1,371 @@ +#!/usr/bin/perl -w + +# Check namespace cleanness of a library. +# Allowed symbols are passed as arguments. +# They may have trailing * = wildcard. +# Wildcards may be also specified as *::* (e.g. K*::* for all KDE classes) +# Symbols are listed as full function unmangled names without arguments, +# e.g. 'foo bar* nspace::*' allows foo(), foo(int), bar(), barbar() +# and all symbols in namespace/class nspace. +# If an argument has comma in it, it's a filename of a file containing +# allowed symbols, one per line. + + +$thisProg = "$0"; # This programs name + +$library = ""; +$allowed_symbols = ""; +$debug = 0; +$allowed_weak = ""; +$weak_specified = 0; + +while( defined( $ARGV[ 0 ] )) +{ + $_ = shift; + if( /^--verbose$|^-v$/ ) + { + $debug = 1; + } + elsif( /^--help$|^-h$/ ) + { + print STDOUT "Usage $thisProg [OPTION] ... library [allowed symbols] ...\n", + "\n", + "Check if the given library has only allowed public symbols.\n", + "\n", + " --allowweak=[symbol] allow only these weak symbols\n", + " -v, --verbose verbosely list files processed\n", + " -h, --help print this help, then exit\n"; + exit 0; + } + elsif( /^--allowweak=(.*)$/ ) + { + $allowed_weak .= " " . $1; + $weak_specified = 1; + } + elsif( /^--allowweak$/ ) # simply list all weak + { + $allowed_weak .= " "; + $weak_specified = 1; + } + elsif( /^--*/ ) + { + die "Invalid argument!\n"; + } + else + { + if( ! $library ) + { + $library = $_; + } + else + { + $allowed_symbols .= " " . $_; + } + } +} + +if( ! $weak_specified ) +{ + $allowed_weak = "*"; + # allow all weak symbols by default + # instances of templates and similar stuff - unfortunately includes also things from other libraries, + # so it cannot be on by default +} + +print STDERR "library:" . $library . "\n" if $debug; +print STDERR "allowed_symbols:" . $allowed_symbols . "\n" if $debug; +print STDERR "allowed_weak:" . $allowed_weak . "\n" if $debug; + +$default_symbols = "_fini _init"; # system symbols +# on my system, every .so has : +# A _DYNAMIC +# A _GLOBAL_OFFSET_TABLE_ +# A __bss_start +# A _edata +# A _end +# T _fini +# T _init +# no need to list A symbols in $default_symbols + +print STDERR "default_symbols: " . $default_symbols . "\n" if $debug; + +print STDOUT "Namespace cleanness check for " . $library . " :\n"; + +$lib_file = ""; +if( $library =~ /\.la$/ ) +{ + # get the real library file from .la + open( FILEIN, $library ) || die "Couldn't open $! !\n"; + while( $line = ) + { + if( $line =~ /library_names=\'([^ ]*).*/o ) + { + $lib_file = $1; + } + } + close( FILEIN ); + if( ! $lib_file ) + { + print STDERR "Library file not found in .la file!\n"; + exit 1; + } + my $libpath = $library; + $libpath =~ s%[^/]*$%%; + if( -e $libpath . ".libs/" . $lib_file ) + { + $lib_file = $libpath . ".libs/" . $lib_file; + } + else + { + $lib_file = $libpath . $lib_file; + } +} +else +{ + $lib_file = $library; +} + +print STDERR "libfile: ". $lib_file . "\n" if $debug; + +$allowed_symbols .= " " . $default_symbols; + +sub process_symbols($\@\%\@); + +@wildcards = (); +%exacts = (); +@regwildcards = (); +process_symbols( $allowed_symbols, @wildcards, %exacts, @regwildcards ); +@weak_wildcards = (); +%weak_exacts = (); +@weak_regwildcards = (); +process_symbols( $allowed_weak, @weak_wildcards, %weak_exacts, @weak_regwildcards ); + +# grep is for stripping not exported symbols, which don't have address (=first column) +$nm_command = "nm -BDCg " . $lib_file . " | grep -v '^ ' |"; + +# TODO how portable is this nmcheck stuff? + +print STDERR "nm command:" . $nm_command . "\n" if $debug; + +open( FILEIN, $nm_command ) || die "nm command failed\n"; + +my $exit_code = 0; + +while( $line = ) +{ + my $type; + my $symbol; + if( $line =~ /^[^ ]* (.) (.*)$/o ) + { + $type = $1; + $symbol = $2; + } + else + { + die "Invalid line: " . $line . "\n"; + } + + print STDERR "Type: " . $type . " , symbol: " . $symbol . "\n" if $debug; + if( $type eq "A" ) + { # these should be system symbols, so ignore them + next; + } + + my $orig_symbol = $symbol; + + if( $symbol =~ /\(anonymous namespace\)/o ) + { # TODO tell to prefer named namespaces? (shorter symbols) + next; + } + + # strip prefixes + # the :: appending is to make "CLASS::*" work also for "vtable for CLASS" + $symbol =~ s/^typeinfo for (.*)$/$1::/o; + $symbol =~ s/^typeinfo fn for (.*)$/$1::/o; + $symbol =~ s/^typeinfo name for (.*)$/$1::/o; + $symbol =~ s/^vtable for (.*)$/$1::/o; + $symbol =~ s/^guard variable for (.*)$/$1::/o; + $symbol =~ s/^reference temporary for (.*)$/$1::/o; + $symbol =~ s/^VTT for (.*)$/$1::/o; + $symbol =~ s/^virtual thunk \[[^\]]*\] to (.*)$/$1::/o; + $symbol =~ s/^non-virtual thunk \[[^\]]*\] to (.*)$/$1::/o; + $symbol =~ s/^covariant return thunk \[[^\]]*\] to (.*)$/$1::/o; + $symbol =~ s/^construction vtable thunk for (.*)$/$1::/o; + $symbol =~ s/^construction vtable for .*-in-(.*) [0-9]*$/$1::/o; + + # templates seem to have also return types mangled in their name, and nm prints it too + # they have also template arguments in the symbol + # get rid of both of those + while( $symbol =~ /<.*>/o ) + { + $symbol =~ s/<[^<>]*>//o; # strip innermost <> + } + if( $symbol !~ /operator\(\)/o ) + { + $symbol =~ s/ ?\(.*\).*$//o; # strip () and all after it + } + else + { + $symbol =~ s/(^|:| )operator\(\) ?\(.*\).*$//o; # strip () and all after it + } + $symbol =~ s/\[.*\] *$//o; # strip [in-charge] etc. + if( $symbol =~ /(^|:| )operator /o ) + { + $symbol =~ s/.* ([^\s]*)operator /$1/o; # strip everything before 'X::operator blah' + } + else + { + $symbol =~ s/.* ([^\s]+) *$/$1/o; # get last word (strip return type) + } + + # print STDERR "Processed symbol: " . $symbol . "\n" if $debug; + + my $found = 0; + if( $exacts{ $symbol } ) + { + $found = 1; + } + if( ! $found ) + { + for my $wild ( @wildcards ) + { + if( index( $symbol, $wild ) == 0 ) + { + $found = 1; + last; + } + } + } + if( ! $found ) + { + for my $wild ( @regwildcards ) + { + if( $symbol =~ /^$wild$/ ) + { + $found = 1; + last; + } + } + } + if( ( ! $found ) && ( $type eq "W" || $type eq "V" )) + { + if( $weak_exacts{ $symbol } ) + { + $found = 1; + } + if( ! $found ) + { + for my $wild ( @weak_wildcards ) + { + if( index( $symbol, $wild ) == 0 ) + { + $found = 1; + last; + } + } + } + if( ! $found ) + { + for my $wild ( @weak_regwildcards ) + { + if( $symbol =~ /^$wild$/ ) + { + $found = 1; + last; + } + } + } + } + + if( ! $found ) + { + print STDERR "Public symbol " . $orig_symbol . " is not allowed!\n"; + $exit_code = 1; + } +} + +close( FILEIN ); + +print STDOUT $exit_code == 0 ? "OK\n" : "FAILED\n"; + +exit $exit_code; + +sub process_symbols($\@\%\@) +{ + my $allowed_symbols = $_[ 0 ]; + my $wildcards_ref = $_[ 1 ]; + my $exacts_ref = $_[ 2 ]; + my $regwildcards_ref = $_[ 3 ]; + + $allowed_symbols =~ s/^ *//o; # strip whitespace + $allowed_symbols =~ s/ *$//o; + + if( $allowed_symbols eq "NONE" ) + { + $allowed_symbols = ""; + } + + my @symbols1 = split( ' ', $allowed_symbols ); + my $i = 0; + my @symbols2 = (); + while( defined( $symbols1[ $i ] )) + { + my $symbol = $symbols1[ $i ]; + if( $symbol =~ /\./ ) # dot in name -> file + { + open( SYMIN, $symbol ) || die ( "Cannot open file " . $symbol . "!" ); + while( $line = ) + { + $line =~ s/^\s*//o; # strip whitespace + $line =~ s/\s*$//o; + if( $line !~ /^$/o # empty line + && $line !~ /^\s*#/ ) # comment line starting with # + { + $symbols2[ $#symbols2 + 1 ] = $line; + } + } + close( SYMIN ); + } + else + { + $symbols2[ $#symbols2 + 1 ] = $symbol; + } + $i++; + } + $i = 0; + while( defined( $symbols2[ $i ] )) + { + my $symbol = $symbols2[ $i ]; + if( $symbol =~ /__/ + || $symbol =~ /^_[A-Z]/ ) + { # ISO C++ 2.10.2 + die "Symbols containing a double underscore or beginning with an underscore and an upper-case letter are reserved!\n"; + } + elsif( $symbol eq "main" + || $symbol eq "main*" ) + { + die "Symbol main is not allowed!\n"; + } + if( $symbol =~ /^([^\*]*)\*$/o # trailing * without any * before it + && $symbol !~ /operator\*$/o ) + { + print STDERR "wildcard:" . $symbol . "\n" if $debug; + $wildcards_ref->[ $#{$wildcards_ref} + 1 ] = $1; + } + elsif( $symbol =~ /\*$/o + && ( $symbol =~ /\*::/o || $symbol =~ /::\*/o ) + && $symbol !~ /^\*/o + && $symbol !~ /operator\*$/o ) + { + print STDERR "regwildcard:" . $symbol . "\n" if $debug; + $symbol =~ s/\*/\.\*/go; # change * to .* (regexp) + $regwildcards_ref->[ $#{$regwildcards_ref} + 1 ] = $symbol; + } + else + { + print STDERR "exact:" . $symbol . "\n" if $debug; + $exacts_ref->{ $symbol } = 1; + } + $i++; + } +} diff --git a/admin/oldinclude.m4.in b/admin/oldinclude.m4.in new file mode 100644 index 0000000..e5eb176 --- /dev/null +++ b/admin/oldinclude.m4.in @@ -0,0 +1,192 @@ +### -*- autoconf -*- + +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) +dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) + +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +dnl Boston, MA 02111-1307, USA. + +AC_DEFUN([KDE_CHECK_MICO], +[ +AC_REQUIRE([KDE_CHECK_LIBDL]) +AC_REQUIRE([KDE_MISC_TESTS]) +AC_MSG_CHECKING(for MICO) + +if test -z "$MICODIR"; then + kde_micodir=/usr/local + else + kde_micodir="$MICODIR" +fi + +AC_ARG_WITH(micodir, + [ --with-micodir=micodir where mico is installed ], + kde_micodir=$withval, + kde_micodir=$kde_micodir +) + +AC_CACHE_VAL(kde_cv_mico_incdir, +[ + mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes" +AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir) + +]) +kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'` + +if test ! -r $kde_micodir/include/CORBA.h; then + AC_MSG_ERROR([No CORBA.h found, specify another micodir]) +fi + +AC_MSG_RESULT($kde_micodir) + +MICO_INCLUDES=-I$kde_micodir/include +AC_SUBST(MICO_INCLUDES) +MICO_LDFLAGS=-L$kde_micodir/lib +AC_SUBST(MICO_LDFLAGS) +micodir=$kde_micodir +AC_SUBST(micodir) + +AC_MSG_CHECKING([for MICO version]) +AC_CACHE_VAL(kde_cv_mico_version, +[ +AC_LANG_C +cat >conftest.$ac_ext < +#include +int main() { + + printf("MICO_VERSION=%s\n",MICO_VERSION); + return (0); +} +EOF +ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest' +if AC_TRY_EVAL(ac_compile); then + if eval `./conftest 2>&5`; then + kde_cv_mico_version=$MICO_VERSION + else + AC_MSG_ERROR([your system is not able to execute a small application to + find MICO version! Check $kde_micodir/include/mico/version.h]) + fi +else + AC_MSG_ERROR([your system is not able to compile a small application to + find MICO version! Check $kde_micodir/include/mico/version.h]) +fi +]) + +dnl installed MICO version +mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'` +mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'` +mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'` + +if test "x$1" = "x"; then + req_version="2.3.0" +else + req_version=$1 +fi + +dnl required MICO version +req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'` +req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'` +req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'` + +if test "$mico_v_maj" -lt "$req_v_maj" || \ + ( test "$mico_v_maj" -eq "$req_v_maj" && \ + test "$mico_v_mid" -lt "$req_v_mid" ) || \ + ( test "$mico_v_mid" -eq "$req_v_mid" && \ + test "$mico_v_min" -lt "$req_v_min" ) + +then + AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \ +at least is required. You should upgrade MICO.]) +else + AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)]) +fi + +LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL" +AC_SUBST(LIBMICO) +if test -z "$IDL"; then + IDL='$(kde_bindir)/cuteidl' +fi +AC_SUBST(IDL) +IDL_DEPENDENCIES='$(kde_includes)/CUTE.h' +AC_SUBST(IDL_DEPENDENCIES) + +idldir="\$(includedir)/idl" +AC_SUBST(idldir) + +]) + +AC_DEFUN([KDE_CHECK_MINI_STL], +[ +AC_REQUIRE([KDE_CHECK_MICO]) + +AC_MSG_CHECKING(if we use mico's mini-STL) +AC_CACHE_VAL(kde_cv_have_mini_stl, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +kde_save_cxxflags="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $MICO_INCLUDES" +AC_TRY_COMPILE( +[ +#include +], +[ +#ifdef HAVE_MINI_STL +#error "nothing" +#endif +], +kde_cv_have_mini_stl=no, +kde_cv_have_mini_stl=yes) +CXXFLAGS="$kde_save_cxxflags" +AC_LANG_RESTORE +]) + +if test "x$kde_cv_have_mini_stl" = "xyes"; then + AC_MSG_RESULT(yes) + $1 +else + AC_MSG_RESULT(no) + $2 +fi +]) + +]) + +AC_DEFUN([KDE_CHECK_ANSI], +[ +]) + +AC_DEFUN([KDE_CHECK_INSURE], +[ + AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]], + [ + if test $enableval = "no"; dnl + then ac_use_insure="no" + else ac_use_insure="yes" + fi + ], [ac_use_insure="no"]) + + AC_MSG_CHECKING(if we will use Insure++ to debug) + AC_MSG_RESULT($ac_use_insure) + if test "$ac_use_insure" = "yes"; dnl + then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "???? + fi +]) + +AC_DEFUN([KDE_CHECK_NEWLIBS], +[ + +]) -- 2.11.0