Skip to content
Snippets Groups Projects
aclocal.m4 127 KiB
Newer Older
  • Learn to ignore specific revisions
  • dnl aclocal.m4 generated automatically by aclocal 1.4a
    
    dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
    dnl This file is free software; the Free Software Foundation
    dnl gives unlimited permission to copy and/or distribute it,
    dnl with or without modifications, as long as this notice is preserved.
    
    dnl This program is distributed in the hope that it will be useful,
    dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    dnl PARTICULAR PURPOSE.
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    dnl Copyright 1998-2005 The OpenLDAP Foundation.
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    dnl All rights reserved.
    
    dnl
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    dnl Redistribution and use in source and binary forms, with or without
    dnl modification, are permitted only as authorized by the OpenLDAP
    
    dnl Public License.
    
    dnl A copy of this license is available in the file LICENSE in the
    dnl top-level directory of the distribution or, alternatively, at
    dnl <http://www.OpenLDAP.org/license.html>.
    
    divert(-1)
    
    # Do all the work for Automake.  This macro actually does too much --
    # some checks are only needed if your package does certain things.
    # But this isn't really a big deal.
    
    # serial 1
    
    dnl Usage:
    dnl AM_INIT_AUTOMAKE(package,version, [no-define])
    
    AC_DEFUN(AM_INIT_AUTOMAKE,
    [AC_REQUIRE([AC_PROG_INSTALL])
    dnl We require 2.13 because we rely on SHELL being computed by configure.
    AC_PREREQ([2.13])
    PACKAGE=[$1]
    AC_SUBST(PACKAGE)
    VERSION=[$2]
    AC_SUBST(VERSION)
    dnl test to see if srcdir already configured
    if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
      AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
    
    ifelse([$3],,
    AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
    AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
    AC_REQUIRE([AM_SANITY_CHECK])
    AC_REQUIRE([AC_ARG_PROGRAM])
    dnl FIXME This is truly gross.
    missing_dir=`cd $ac_aux_dir && pwd`
    AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
    AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
    AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
    AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
    AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
    dnl Set install_sh for make dist
    install_sh="$missing_dir/install-sh"
    test -f "$install_sh" || install_sh="$missing_dir/install.sh"
    AC_SUBST(install_sh)
    dnl We check for tar when the user configures the end package.
    dnl This is sad, since we only need this for "dist".  However,
    dnl there's no other good way to do it.  We prefer GNU tar if
    dnl we can find it.  If we can't find a tar, it doesn't really matter.
    AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
    dnl We need awk for the "check" target.  The system "awk" is bad on
    dnl some platforms.
    AC_REQUIRE([AC_PROG_AWK])
    AMTARFLAGS=
    if test -n "$AMTAR"; then
      if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
        dnl We have GNU tar.
        AMTARFLAGS=o
      fi
    
    AC_SUBST(AMTARFLAGS)
    AC_REQUIRE([AC_PROG_MAKE_SET])])
    
    #
    # Check to make sure that the build environment is sane.
    #
    
    AC_DEFUN(AM_SANITY_CHECK,
    [AC_MSG_CHECKING([whether build environment is sane])
    # Just in case
    sleep 1
    echo timestamp > conftestfile
    # Do `set' in a subshell so we don't clobber the current shell's
    # arguments.  Must try -L first in case configure is actually a
    # symlink; some systems play weird games with the mod time of symlinks
    # (eg FreeBSD returns the mod time of the symlink's containing
    # directory).
    if (
       set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
       if test "[$]*" = "X"; then
          # -L didn't work.
          set X `ls -t $srcdir/configure conftestfile`
       fi
       if test "[$]*" != "X $srcdir/configure conftestfile" \
          && test "[$]*" != "X conftestfile $srcdir/configure"; then
    
          # If neither matched, then we have a broken ls.  This can happen
          # if, for instance, CONFIG_SHELL is bash and it inherits a
          # broken ls alias from the environment.  This has actually
          # happened.  Such a system could not be considered "sane".
          AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
    alias in your environment])
       fi
    
       test "[$]2" = conftestfile
       )
    then
       # Ok.
       :
    else
       AC_MSG_ERROR([newly created file is older than distributed files!
    Check your system clock])
    fi
    rm -f conftest*
    AC_MSG_RESULT(yes)])
    
    dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
    dnl The program must properly implement --version.
    AC_DEFUN(AM_MISSING_PROG,
    [AC_MSG_CHECKING(for working $2)
    # Run test in a subshell; some versions of sh will print an error if
    # an executable is not found, even if stderr is redirected.
    # Redirect stdin to placate older versions of autoconf.  Sigh.
    if ($2 --version) < /dev/null > /dev/null 2>&1; then
       $1=$2
       AC_MSG_RESULT(found)
    else
       $1="$3/missing $2"
       AC_MSG_RESULT(missing)
    fi
    AC_SUBST($1)])
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    # serial 46 AC_PROG_LIBTOOL
    
    AC_DEFUN([AC_PROG_LIBTOOL],
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
    
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    # This can be used to rebuild libtool when needed
    LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
    
    # Always use our own libtool.
    LIBTOOL='$(SHELL) $(top_builddir)/libtool'
    AC_SUBST(LIBTOOL)dnl
    
    # Prevent multiple expansion
    define([AC_PROG_LIBTOOL], [])
    ])
    
    AC_DEFUN([AC_LIBTOOL_SETUP],
    [AC_PREREQ(2.13)dnl
    AC_REQUIRE([AC_ENABLE_SHARED])dnl
    AC_REQUIRE([AC_ENABLE_STATIC])dnl
    AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
    AC_REQUIRE([AC_CANONICAL_HOST])dnl
    AC_REQUIRE([AC_CANONICAL_BUILD])dnl
    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
    
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    AC_REQUIRE([AC_PROG_LN_S])dnl
    AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
    AC_REQUIRE([AC_OBJEXT])dnl
    AC_REQUIRE([AC_EXEEXT])dnl
    dnl
    
    _LT_AC_PROG_ECHO_BACKSLASH
    # Only perform the check for file, if the check method requires it
    case $deplibs_check_method in
    file_magic*)
      if test "$file_magic_cmd" = '$MAGIC_CMD'; then
        AC_PATH_MAGIC
      fi
      ;;
    esac
    
    AC_CHECK_TOOL(RANLIB, ranlib, :)
    AC_CHECK_TOOL(STRIP, strip, :)
    
    ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
    ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
    enable_win32_dll=yes, enable_win32_dll=no)
    
    AC_ARG_ENABLE(libtool-lock,
      [  --disable-libtool-lock  avoid locking (might break parallel builds)])
    test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
    
    # Some flags need to be propagated to the compiler or linker for good
    # libtool support.
    case $host in
    *-*-irix6*)
      # Find out which ABI we are using.
      echo '[#]line __oline__ "configure"' > conftest.$ac_ext
      if AC_TRY_EVAL(ac_compile); then
        case `/usr/bin/file conftest.$ac_objext` in
        *32-bit*)
          LD="${LD-ld} -32"
          ;;
        *N32*)
          LD="${LD-ld} -n32"
          ;;
        *64-bit*)
          LD="${LD-ld} -64"
          ;;
        esac
      fi
      rm -rf conftest*
      ;;
    
    *-*-sco3.2v5*)
      # On SCO OpenServer 5, we need -belf to get full-featured binaries.
      SAVE_CFLAGS="$CFLAGS"
      CFLAGS="$CFLAGS -belf"
      AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
        [AC_LANG_SAVE
         AC_LANG_C
         AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
         AC_LANG_RESTORE])
      if test x"$lt_cv_cc_needs_belf" != x"yes"; then
        # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
        CFLAGS="$SAVE_CFLAGS"
      fi
      ;;
    
    ifdef([AC_PROVIDE_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
    
    _LT_AC_LTCONFIG_HACK
    
    ])
    
    # AC_LIBTOOL_HEADER_ASSERT
    # ------------------------
    AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
    [AC_CACHE_CHECK([whether $CC supports assert without backlinking],
        [lt_cv_func_assert_works],
        [case $host in
        *-*-solaris*)
          if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
            case `$CC --version 2>/dev/null` in
            [[12]].*) lt_cv_func_assert_works=no ;;
            *)        lt_cv_func_assert_works=yes ;;
            esac
          fi
          ;;
        esac])
    
    if test "x$lt_cv_func_assert_works" = xyes; then
      AC_CHECK_HEADERS(assert.h)
    fi
    ])# AC_LIBTOOL_HEADER_ASSERT
    
    # _LT_AC_CHECK_DLFCN
    # --------------------
    AC_DEFUN([_LT_AC_CHECK_DLFCN],
    [AC_CHECK_HEADERS(dlfcn.h)
    ])# _LT_AC_CHECK_DLFCN
    
    # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
    # ---------------------------------
    AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
    [AC_REQUIRE([AC_CANONICAL_HOST])
    AC_REQUIRE([AC_PROG_NM])
    AC_REQUIRE([AC_OBJEXT])
    # Check for command to grab the raw symbol name followed by C symbol from nm.
    AC_MSG_CHECKING([command to parse $NM output])
    AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
    
    # These are sane defaults that work on at least a few old systems.
    # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
    
    # Character class describing NM global symbol codes.
    symcode='[[BCDEGRST]]'
    
    # Regexp to match symbols that can be accessed directly from C.
    sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
    
    # Transform the above into a raw symbol and a C symbol.
    symxfrm='\1 \2\3 \3'
    
    # Transform an extracted symbol line into a proper C declaration
    lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
    
    # Transform an extracted symbol line into symbol name and symbol address
    lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
    
    # Define system-specific variables.
    case $host_os in
    aix*)
      symcode='[[BCDT]]'
      ;;
    cygwin* | mingw* | pw32*)
      symcode='[[ABCDGISTW]]'
      ;;
    hpux*) # Its linker distinguishes data from code symbols
      lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
      lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
      ;;
    
    irix* | nonstopux*)
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
      symcode='[[BCDEGRST]]'
      ;;
    
    osf*)
      symcode='[[BCDEGQRST]]'
      ;;
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    solaris* | sysv5*)
      symcode='[[BDT]]'
      ;;
    sysv4)
      symcode='[[DFNSTU]]'
      ;;
    esac
    
    # Handle CRLF in mingw tool chain
    opt_cr=
    case $host_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
    
    # Try without a prefix undercore, then with it.
    for ac_symprfx in "" "_"; do
    
      # Write the raw and C identifiers.
    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
    
      # Check to see that the pipe works correctly.
      pipe_works=no
      rm -f conftest*
      cat > conftest.$ac_ext <<EOF
    #ifdef __cplusplus
    extern "C" {
    #endif
    char nm_test_var;
    void nm_test_func(){}
    #ifdef __cplusplus
    }
    #endif
    int main(){nm_test_var='a';nm_test_func();return(0);}
    EOF
    
      if AC_TRY_EVAL(ac_compile); then
        # Now try to grab the symbols.
        nlist=conftest.nm
        if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
          # Try sorting and uniquifying the output.
          if sort "$nlist" | uniq > "$nlist"T; then
    	mv -f "$nlist"T "$nlist"
          else
    	rm -f "$nlist"T
          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
    	  cat <<EOF > conftest.$ac_ext
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    EOF
    	  # Now generate the symbol file.
    	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
    
    	  cat <<EOF >> conftest.$ac_ext
    #if defined (__STDC__) && __STDC__
    # define lt_ptr void *
    #else
    # define lt_ptr char *
    # define const
    #endif
    
    /* The mapping between symbol names and symbols. */
    const struct {
      const char *name;
      lt_ptr address;
    }
    lt_preloaded_symbols[[]] =
    {
    EOF
    	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
    	  cat <<\EOF >> conftest.$ac_ext
      {0, (lt_ptr) 0}
    };
    
    #ifdef __cplusplus
    }
    #endif
    EOF
    	  # Now try linking the two files.
    	  mv conftest.$ac_objext conftstm.$ac_objext
    	  save_LIBS="$LIBS"
    	  save_CFLAGS="$CFLAGS"
    	  LIBS="conftstm.$ac_objext"
    	  CFLAGS="$CFLAGS$no_builtin_flag"
    
    	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    	    pipe_works=yes
    	  fi
    	  LIBS="$save_LIBS"
    	  CFLAGS="$save_CFLAGS"
    	else
    	  echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
    	fi
          else
    	echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
          fi
        else
          echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
        fi
      else
        echo "$progname: failed program was:" >&AC_FD_CC
        cat conftest.$ac_ext >&5
      fi
      rm -f conftest* conftst*
    
      # Do not use the global_symbol_pipe unless it works.
      if test "$pipe_works" = yes; then
        break
      else
        lt_cv_sys_global_symbol_pipe=
      fi
    done
    ])
    global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
    if test -z "$lt_cv_sys_global_symbol_pipe"; then
      global_symbol_to_cdecl=
      global_symbol_to_c_name_address=
    else
      global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
      global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
    fi
    if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
    then
      AC_MSG_RESULT(failed)
    else
      AC_MSG_RESULT(ok)
    fi
    ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
    
    # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
    # ---------------------------------
    AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
    [# Find the correct PATH separator.  Usually this is `:', but
    # DJGPP uses `;' like DOS.
    if test "X${PATH_SEPARATOR+set}" != Xset; then
      UNAME=${UNAME-`uname 2>/dev/null`}
      case X$UNAME in
        *-DOS) lt_cv_sys_path_separator=';' ;;
        *)     lt_cv_sys_path_separator=':' ;;
      esac
      PATH_SEPARATOR=$lt_cv_sys_path_separator
    fi
    ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
    
    # _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_LIBTOOL_SYS_PATH_SEPARATOR
    
    # Check that we are running under the correct shell.
    SHELL=${CONFIG_SHELL-/bin/sh}
    
    case X$ECHO in
    X*--fallback-echo)
      # Remove one level of quotation (which was required for Make).
      ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
      ;;
    esac
    
    echo=${ECHO-echo}
    if test "X[$]1" = X--no-reexec; then
      # Discard the --no-reexec flag, and continue.
      shift
    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
      # Yippee, $echo works!
      :
    else
      # Restart under the correct shell.
      exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
    fi
    
    if test "X[$]1" = X--fallback-echo; then
      # used as fallback echo
      shift
      cat <<EOF
    $*
    EOF
      exit 0
    fi
    
    # The HP-UX ksh and POSIX shell print the target directory to stdout
    # if CDPATH is set.
    if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
    
    if test -z "$ECHO"; then
    if test "X${echo_test_string+set}" != Xset; then
    # find a string as large as possible, as long as the shell can cope with it
      for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
        # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
        if (echo_test_string="`eval $cmd`") 2>/dev/null &&
           echo_test_string="`eval $cmd`" &&
           (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
        then
          break
        fi
      done
    fi
    
    if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
       echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
       test "X$echo_testing_string" = "X$echo_test_string"; then
      :
    else
      # The Solaris, AIX, and Digital Unix default echo programs unquote
      # backslashes.  This makes it impossible to quote backslashes using
      #   echo "$something" | sed 's/\\/\\\\/g'
      #
      # So, first we look for a working echo in the user's PATH.
    
      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
      for dir in $PATH /usr/ucb; do
        if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
           test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
           echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
           test "X$echo_testing_string" = "X$echo_test_string"; then
          echo="$dir/echo"
          break
        fi
      done
      IFS="$save_ifs"
    
      if test "X$echo" = Xecho; then
        # We didn't find a better echo, so look for alternatives.
        if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
           echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
           test "X$echo_testing_string" = "X$echo_test_string"; then
          # This shell has a builtin print -r that does the trick.
          echo='print -r'
        elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
    	 test "X$CONFIG_SHELL" != X/bin/ksh; then
          # If we have ksh, try running configure again with it.
          ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
          export ORIGINAL_CONFIG_SHELL
          CONFIG_SHELL=/bin/ksh
          export CONFIG_SHELL
          exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
        else
          # Try using printf.
          echo='printf %s\n'
          if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
    	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
    	 test "X$echo_testing_string" = "X$echo_test_string"; then
    	# Cool, printf works
    	:
          elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
    	   test "X$echo_testing_string" = 'X\t' &&
    	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
    	   test "X$echo_testing_string" = "X$echo_test_string"; then
    	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
    	export CONFIG_SHELL
    	SHELL="$CONFIG_SHELL"
    	export SHELL
    	echo="$CONFIG_SHELL [$]0 --fallback-echo"
          elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
    	   test "X$echo_testing_string" = 'X\t' &&
    	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
    	   test "X$echo_testing_string" = "X$echo_test_string"; then
    	echo="$CONFIG_SHELL [$]0 --fallback-echo"
          else
    	# maybe with a smaller string...
    	prev=:
    
    	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
    	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
    	  then
    	    break
    	  fi
    	  prev="$cmd"
    	done
    
    	if test "$prev" != 'sed 50q "[$]0"'; then
    	  echo_test_string=`eval $prev`
    	  export echo_test_string
    	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
    	else
    	  # Oops.  We lost completely, so just stick with echo.
    	  echo=echo
    	fi
          fi
        fi
      fi
    fi
    fi
    
    # Copy echo and quote the copy suitably for passing to libtool from
    # the Makefile, instead of quoting the original, which is used later.
    ECHO=$echo
    if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
       ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
    fi
    
    AC_SUBST(ECHO)
    AC_DIVERT_POP
    ])# _LT_AC_PROG_ECHO_BACKSLASH
    
    # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
    #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
    # ------------------------------------------------------------------
    AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
    [if test "$cross_compiling" = yes; then :
      [$4]
    else
      AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
      lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
      lt_status=$lt_dlunknown
      cat > conftest.$ac_ext <<EOF
    [#line __oline__ "configure"
    #include "confdefs.h"
    
    #if HAVE_DLFCN_H
    #include <dlfcn.h>
    #endif
    
    #include <stdio.h>
    
    #ifdef RTLD_GLOBAL
    #  define LT_DLGLOBAL		RTLD_GLOBAL
    #else
    #  ifdef DL_GLOBAL
    #    define LT_DLGLOBAL		DL_GLOBAL
    #  else
    #    define LT_DLGLOBAL		0
    #  endif
    #endif
    
    /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
       find out it does not work in some platform. */
    #ifndef LT_DLLAZY_OR_NOW
    #  ifdef RTLD_LAZY
    #    define LT_DLLAZY_OR_NOW		RTLD_LAZY
    #  else
    #    ifdef DL_LAZY
    #      define LT_DLLAZY_OR_NOW		DL_LAZY
    #    else
    #      ifdef RTLD_NOW
    #        define LT_DLLAZY_OR_NOW	RTLD_NOW
    #      else
    #        ifdef DL_NOW
    #          define LT_DLLAZY_OR_NOW	DL_NOW
    #        else
    #          define LT_DLLAZY_OR_NOW	0
    #        endif
    #      endif
    #    endif
    #  endif
    #endif
    
    #ifdef __cplusplus
    extern "C" void exit (int);
    #endif
    
    void fnord() { int i=42;}
    int main ()
    {
      void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
      int status = $lt_dlunknown;
    
      if (self)
        {
          if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
          else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
          /* dlclose (self); */
        }
    
        exit (status);
    }]
    EOF
      if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
        (./conftest; exit; ) 2>/dev/null
        lt_status=$?
        case x$lt_status in
          x$lt_dlno_uscore) $1 ;;
          x$lt_dlneed_uscore) $2 ;;
          x$lt_unknown|x*) $3 ;;
        esac
      else :
        # compilation failed
        $3
      fi
    fi
    rm -fr conftest*
    ])# _LT_AC_TRY_DLOPEN_SELF
    
    # AC_LIBTOOL_DLOPEN_SELF
    # -------------------
    AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
    [if test "x$enable_dlopen" != xyes; then
      enable_dlopen=unknown
      enable_dlopen_self=unknown
      enable_dlopen_self_static=unknown
    else
      lt_cv_dlopen=no
      lt_cv_dlopen_libs=
    
      case $host_os in
      beos*)
        lt_cv_dlopen="load_add_on"
        lt_cv_dlopen_libs=
        lt_cv_dlopen_self=yes
        ;;
    
      cygwin* | mingw* | pw32*)
        lt_cv_dlopen="LoadLibrary"
        lt_cv_dlopen_libs=
       ;;
    
      *)
    
        AC_CHECK_FUNC([dllload],
        	[lt_cv_dlopen="dllload"],
        [AC_CHECK_FUNC([shl_load],
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
              [lt_cv_dlopen="shl_load"],
          [AC_CHECK_LIB([dld], [shl_load],
                [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
    	[AC_CHECK_FUNC([dlopen],
    	      [lt_cv_dlopen="dlopen"],
    	  [AC_CHECK_LIB([dl], [dlopen],
    	        [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
    	    [AC_CHECK_LIB([svld], [dlopen],
    	          [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
    	      [AC_CHECK_LIB([dld], [dld_link],
    	            [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
    	      ])
    	    ])
    	  ])
    	])
          ])
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
        ;;
      esac
    
      if test "x$lt_cv_dlopen" != xno; then
        enable_dlopen=yes
      else
        enable_dlopen=no
      fi
    
      case $lt_cv_dlopen in
      dlopen)
        save_CPPFLAGS="$CPPFLAGS"
        AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
        test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
    
        save_LDFLAGS="$LDFLAGS"
        eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
    
        save_LIBS="$LIBS"
        LIBS="$lt_cv_dlopen_libs $LIBS"
    
        AC_CACHE_CHECK([whether a program can dlopen itself],
    	  lt_cv_dlopen_self, [dnl
    	  _LT_AC_TRY_DLOPEN_SELF(
    	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
    	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
        ])
    
        if test "x$lt_cv_dlopen_self" = xyes; then
          LDFLAGS="$LDFLAGS $link_static_flag"
          AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
        	  lt_cv_dlopen_self_static, [dnl
    	  _LT_AC_TRY_DLOPEN_SELF(
    	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
    	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
          ])
        fi
    
        CPPFLAGS="$save_CPPFLAGS"
        LDFLAGS="$save_LDFLAGS"
        LIBS="$save_LIBS"
        ;;
      esac
    
      case $lt_cv_dlopen_self in
      yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
      *) enable_dlopen_self=unknown ;;
      esac
    
      case $lt_cv_dlopen_self_static in
      yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
      *) enable_dlopen_self_static=unknown ;;
      esac
    fi
    ])# AC_LIBTOOL_DLOPEN_SELF
    
    AC_DEFUN([_LT_AC_LTCONFIG_HACK],
    [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
    # Sed substitution that helps us do robust quoting.  It backslashifies
    # metacharacters that are still active within double-quoted strings.
    Xsed='sed -e s/^X//'
    sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
    
    # Same as above, but do not quote variable references.
    double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
    
    # Sed substitution to delay expansion of an escaped shell variable in a
    # double_quote_subst'ed string.
    delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
    
    # Constants:
    rm="rm -f"
    
    # Global variables:
    default_ofile=libtool
    can_build_shared=yes
    
    # All known linkers require a `.a' archive for static linking (except M$VC,
    # which needs '.lib').
    libext=a
    ltmain="$ac_aux_dir/ltmain.sh"
    ofile="$default_ofile"
    with_gnu_ld="$lt_cv_prog_gnu_ld"
    need_locks="$enable_libtool_lock"
    
    old_CC="$CC"
    old_CFLAGS="$CFLAGS"
    
    # Set sane defaults for various variables
    test -z "$AR" && AR=ar
    test -z "$AR_FLAGS" && AR_FLAGS=cru
    test -z "$AS" && AS=as
    test -z "$CC" && CC=cc
    test -z "$DLLTOOL" && DLLTOOL=dlltool
    test -z "$LD" && LD=ld
    test -z "$LN_S" && LN_S="ln -s"
    test -z "$MAGIC_CMD" && MAGIC_CMD=file
    test -z "$NM" && NM=nm
    test -z "$OBJDUMP" && OBJDUMP=objdump
    test -z "$RANLIB" && RANLIB=:
    test -z "$STRIP" && STRIP=:
    test -z "$ac_objext" && ac_objext=o
    
    if test x"$host" != x"$build"; then
      ac_tool_prefix=${host_alias}-
    else
      ac_tool_prefix=
    fi
    
    # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
    case $host_os in
    linux-gnu*) ;;
    linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
    esac
    
    case $host_os in
    aix3*)
      # AIX sometimes has problems with the GCC collect2 program.  For some
      # reason, if we set the COLLECT_NAMES environment variable, the problems
      # vanish in a puff of smoke.
      if test "X${COLLECT_NAMES+set}" != Xset; then
        COLLECT_NAMES=
        export COLLECT_NAMES
      fi
      ;;
    esac
    
    # Determine commands to create old-style static archives.
    old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
    old_postinstall_cmds='chmod 644 $oldlib'
    old_postuninstall_cmds=
    
    if test -n "$RANLIB"; then
      case $host_os in
      openbsd*)
        old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
        ;;
      *)
        old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
        ;;
      esac
      old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
    fi
    
    # Allow CC to be a program name with arguments.
    set dummy $CC
    compiler="[$]2"
    
    AC_MSG_CHECKING([for objdir])
    rm -f .libs 2>/dev/null
    mkdir .libs 2>/dev/null
    if test -d .libs; then
      objdir=.libs
    else
      # MS-DOS does not allow filenames that begin with a dot.
      objdir=_libs
    fi
    rmdir .libs 2>/dev/null
    AC_MSG_RESULT($objdir)
    
    
    AC_ARG_WITH(pic,
    [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
    pic_mode="$withval", pic_mode=default)
    test -z "$pic_mode" && pic_mode=default
    
    # We assume here that the value for lt_cv_prog_cc_pic will not be cached
    # in isolation, and that seeing it set (from the cache) indicates that
    # the associated values are set (in the cache) correctly too.
    AC_MSG_CHECKING([for $compiler option to produce PIC])
    AC_CACHE_VAL(lt_cv_prog_cc_pic,
    [ lt_cv_prog_cc_pic=
      lt_cv_prog_cc_shlib=
      lt_cv_prog_cc_wl=
      lt_cv_prog_cc_static=
      lt_cv_prog_cc_no_builtin=
      lt_cv_prog_cc_can_build_shared=$can_build_shared
    
      if test "$GCC" = yes; then
        lt_cv_prog_cc_wl='-Wl,'
        lt_cv_prog_cc_static='-static'
    
        case $host_os in
        aix*)
          # Below there is a dirty hack to force normal static linking with -ldl
          # The problem is because libdl dynamically linked with both libc and
          # libC (AIX C++ library), which obviously doesn't included in libraries
          # list by gcc. This cause undefined symbols with -static flags.
          # This hack allows C programs to be linked with "-static -ldl", but
          # not sure about C++ programs.
          lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
          ;;
        amigaos*)
          # FIXME: we need at least 68020 code to build shared libraries, but
          # adding the `-m68020' flag to GCC prevents building anything better,
          # like `-m68040'.
          lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
          ;;
    
        beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
          # PIC is the default for these OSes.
          ;;
        darwin* | rhapsody*)
          # PIC is the default on this platform
          # Common symbols not allowed in MH_DYLIB files
          lt_cv_prog_cc_pic='-fno-common'
          ;;
        cygwin* | 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_cv_prog_cc_pic='-DDLL_EXPORT'
          ;;
        sysv4*MP*)