Annotation of libwww/config/ltmain.sh, revision 1.4

1.1       frystyk     1: # ltmain.sh - Provide generalized library-building support services.
1.2       frystyk     2: # NOTE: Changing this file will not affect anything until you rerun ltconfig.
                      3: #
1.4     ! frystyk     4: # Copyright (C) 1996-1999 Free Software Foundation, Inc.
1.1       frystyk     5: # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
                      6: #
                      7: # This program is free software; you can redistribute it and/or modify
                      8: # it under the terms of the GNU General Public License as published by
                      9: # the Free Software Foundation; either version 2 of the License, or
                     10: # (at your option) any later version.
                     11: #
                     12: # This program is distributed in the hope that it will be useful, but
                     13: # WITHOUT ANY WARRANTY; without even the implied warranty of
                     14: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                     15: # General Public License for more details.
                     16: #
                     17: # You should have received a copy of the GNU General Public License
                     18: # along with this program; if not, write to the Free Software
                     19: # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
                     20: #
                     21: # As a special exception to the GNU General Public License, if you
                     22: # distribute this file as part of a program that contains a
                     23: # configuration script generated by Autoconf, you may include it under
                     24: # the same distribution terms that you use for the rest of that program.
                     25: 
1.3       frystyk    26: # Check that we have a working $echo.
                     27: if test "X$1" = X--no-reexec; then
                     28:   # Discard the --no-reexec flag, and continue.
                     29:   shift
1.4     ! frystyk    30: elif test "X$1" = X--fallback-echo; then
        !            31:   # used as fallback echo
        !            32:   shift
        !            33:   cat <<EOF
        !            34: $*
        !            35: EOF
        !            36:   exit 0
1.3       frystyk    37: elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
                     38:   # Yippee, $echo works!
                     39:   :
                     40: else
                     41:   # Restart under the correct shell, and then maybe $echo will work.
                     42:   exec $SHELL "$0" --no-reexec ${1+"$@"}
                     43: fi
                     44: 
1.1       frystyk    45: # The name of this program.
1.2       frystyk    46: progname=`$echo "$0" | sed 's%^.*/%%'`
                     47: modename="$progname"
1.1       frystyk    48: 
                     49: # Constants.
                     50: PROGRAM=ltmain.sh
                     51: PACKAGE=libtool
1.4     ! frystyk    52: VERSION=1.2e
        !            53: TIMESTAMP=" (1.222 1999/01/24 20:43:44)"
1.1       frystyk    54: 
                     55: default_mode=
                     56: help="Try \`$progname --help' for more information."
                     57: magic="%%%MAGIC variable%%%"
                     58: mkdir="mkdir"
                     59: mv="mv -f"
                     60: rm="rm -f"
                     61: 
1.2       frystyk    62: # Sed substitution that helps us do robust quoting.  It backslashifies
                     63: # metacharacters that are still active within double-quoted strings.
1.4     ! frystyk    64: Xsed='sed -e 1s/^X//'
1.2       frystyk    65: sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
1.4     ! frystyk    66: SP2NL='tr \040 \012'
        !            67: NL2SP='tr \012 \040'
1.2       frystyk    68: 
                     69: # NLS nuisances.
                     70: # Only set LANG and LC_ALL to C if already set.
                     71: # These must not be set unconditionally because not all systems understand
                     72: # e.g. LANG=C (notably SCO).
1.3       frystyk    73: # We save the old values to restore during execute mode.
                     74: if test "${LC_ALL+set}" = set; then
                     75:   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
                     76: fi
                     77: if test "${LANG+set}" = set; then
                     78:   save_LANG="$LANG"; LANG=C; export LANG
                     79: fi
1.2       frystyk    80: 
1.1       frystyk    81: if test "$LTCONFIG_VERSION" != "$VERSION"; then
1.2       frystyk    82:   echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
1.1       frystyk    83:   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
                     84:   exit 1
                     85: fi
                     86: 
                     87: if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1.2       frystyk    88:   echo "$modename: not configured to build any kind of library" 1>&2
1.1       frystyk    89:   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
                     90:   exit 1
                     91: fi
                     92: 
                     93: # Global variables.
                     94: mode=$default_mode
                     95: nonopt=
                     96: prev=
                     97: prevopt=
                     98: run=
1.2       frystyk    99: show="$echo"
1.1       frystyk   100: show_help=
1.2       frystyk   101: execute_dlfiles=
1.4     ! frystyk   102: lo2o="s/\\.lo\$/.${objext}/"
1.1       frystyk   103: 
                    104: # Parse our command line options once, thoroughly.
                    105: while test $# -gt 0
                    106: do
                    107:   arg="$1"
                    108:   shift
                    109: 
                    110:   case "$arg" in
1.2       frystyk   111:   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
1.1       frystyk   112:   *) optarg= ;;
                    113:   esac
                    114: 
                    115:   # If the previous option needs an argument, assign it.
                    116:   if test -n "$prev"; then
1.2       frystyk   117:     case "$prev" in
                    118:     execute_dlfiles)
                    119:       eval "$prev=\"\$$prev \$arg\""
                    120:       ;;
                    121:     *)
                    122:       eval "$prev=\$arg"
                    123:       ;;
                    124:     esac
                    125: 
1.1       frystyk   126:     prev=
                    127:     prevopt=
                    128:     continue
                    129:   fi
                    130: 
                    131:   # Have we seen a non-optional argument yet?
                    132:   case "$arg" in
                    133:   --help)
                    134:     show_help=yes
                    135:     ;;
                    136: 
                    137:   --version)
1.4     ! frystyk   138:     echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
1.1       frystyk   139:     exit 0
                    140:     ;;
                    141: 
1.3       frystyk   142:   --config)
                    143:     sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
                    144:     exit 0
                    145:     ;;
                    146: 
                    147:   --debug)
                    148:     echo "$progname: enabling shell trace mode"
                    149:     set -x
                    150:     ;;
                    151: 
1.1       frystyk   152:   --dry-run | -n)
                    153:     run=:
                    154:     ;;
                    155: 
                    156:   --features)
                    157:     echo "host: $host"
                    158:     if test "$build_libtool_libs" = yes; then
                    159:       echo "enable shared libraries"
                    160:     else
                    161:       echo "disable shared libraries"
                    162:     fi
                    163:     if test "$build_old_libs" = yes; then
                    164:       echo "enable static libraries"
                    165:     else
                    166:       echo "disable static libraries"
                    167:     fi
                    168:     exit 0
                    169:     ;;
                    170: 
                    171:   --finish) mode="finish" ;;
                    172: 
                    173:   --mode) prevopt="--mode" prev=mode ;;
                    174:   --mode=*) mode="$optarg" ;;
                    175: 
1.2       frystyk   176:   --quiet | --silent)
                    177:     show=:
                    178:     ;;
                    179: 
                    180:   -dlopen)
                    181:     prevopt="-dlopen"
                    182:     prev=execute_dlfiles
                    183:     ;;
                    184: 
1.1       frystyk   185:   -*)
1.2       frystyk   186:     $echo "$modename: unrecognized option \`$arg'" 1>&2
                    187:     $echo "$help" 1>&2
1.1       frystyk   188:     exit 1
                    189:     ;;
                    190: 
                    191:   *)
                    192:     nonopt="$arg"
                    193:     break
                    194:     ;;
                    195:   esac
                    196: done
                    197: 
                    198: if test -n "$prevopt"; then
1.2       frystyk   199:   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
                    200:   $echo "$help" 1>&2
1.1       frystyk   201:   exit 1
                    202: fi
                    203: 
                    204: if test -z "$show_help"; then
                    205: 
                    206:   # Infer the operation mode.
                    207:   if test -z "$mode"; then
                    208:     case "$nonopt" in
1.2       frystyk   209:     *cc | *++ | gcc* | *-gcc*)
1.1       frystyk   210:       mode=link
                    211:       for arg
                    212:       do
1.4     ! frystyk   213:        case "$arg" in
        !           214:        -c)
        !           215:           mode=compile
        !           216:           break
        !           217:           ;;
        !           218:        esac
1.1       frystyk   219:       done
                    220:       ;;
1.3       frystyk   221:     *db | *dbx | *strace | *truss)
1.2       frystyk   222:       mode=execute
                    223:       ;;
                    224:     *install*|cp|mv)
1.1       frystyk   225:       mode=install
                    226:       ;;
                    227:     *rm)
                    228:       mode=uninstall
                    229:       ;;
                    230:     *)
1.2       frystyk   231:       # If we have no mode, but dlfiles were specified, then do execute mode.
                    232:       test -n "$execute_dlfiles" && mode=execute
                    233: 
1.1       frystyk   234:       # Just use the default operation mode.
                    235:       if test -z "$mode"; then
1.4     ! frystyk   236:        if test -n "$nonopt"; then
        !           237:          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
        !           238:        else
        !           239:          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
        !           240:        fi
1.1       frystyk   241:       fi
                    242:       ;;
                    243:     esac
                    244:   fi
                    245: 
1.2       frystyk   246:   # Only execute mode is allowed to have -dlopen flags.
                    247:   if test -n "$execute_dlfiles" && test "$mode" != execute; then
                    248:     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
                    249:     $echo "$help" 1>&2
                    250:     exit 1
                    251:   fi
                    252: 
1.1       frystyk   253:   # Change the help message to a mode-specific one.
                    254:   generic_help="$help"
1.2       frystyk   255:   help="Try \`$modename --help --mode=$mode' for more information."
1.1       frystyk   256: 
                    257:   # These modes are in order of execution frequency so that they run quickly.
                    258:   case "$mode" in
                    259:   # libtool compile mode
                    260:   compile)
1.2       frystyk   261:     modename="$modename: compile"
1.1       frystyk   262:     # Get the compilation command and the source file.
1.2       frystyk   263:     base_compile=
1.1       frystyk   264:     lastarg=
1.2       frystyk   265:     srcfile="$nonopt"
                    266:     suppress_output=
1.1       frystyk   267: 
1.4     ! frystyk   268:     user_target=no
1.1       frystyk   269:     for arg
                    270:     do
1.2       frystyk   271:       # Accept any command-line options.
1.1       frystyk   272:       case "$arg" in
1.2       frystyk   273:       -o)
1.4     ! frystyk   274:        if test "$user_target" != "no"; then
        !           275:          $echo "$modename: you cannot specify \`-o' more than once" 1>&2
        !           276:          exit 1
        !           277:        fi
        !           278:        user_target=next
1.2       frystyk   279:        ;;
                    280: 
                    281:       -static)
                    282:        build_old_libs=yes
                    283:        continue
                    284:        ;;
                    285:       esac
                    286: 
1.4     ! frystyk   287:       case "$user_target" in
        !           288:       next)
        !           289:        # The next one is the -o target name
        !           290:        user_target=yes
        !           291:        continue
        !           292:        ;;
        !           293:       yes)
        !           294:        # We got the output file
        !           295:        user_target=set
        !           296:        libobj="$arg"
        !           297:        continue
        !           298:        ;;
        !           299:       esac
        !           300: 
1.2       frystyk   301:       # Accept the current argument as the source file.
                    302:       lastarg="$srcfile"
                    303:       srcfile="$arg"
                    304: 
                    305:       # Aesthetically quote the previous argument.
                    306: 
                    307:       # Backslashify any backslashes, double quotes, and dollar signs.
                    308:       # These are the only characters that are still specially
                    309:       # interpreted inside of double-quoted scrings.
                    310:       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
                    311: 
                    312:       # Double-quote args containing other shell metacharacters.
                    313:       # Many Bourne shells cannot handle close brackets correctly in scan
                    314:       # sets, so we specify it separately.
                    315:       case "$lastarg" in
                    316:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
                    317:        lastarg="\"$lastarg\""
                    318:        ;;
1.1       frystyk   319:       esac
                    320: 
1.2       frystyk   321:       # Add the previous argument to base_compile.
                    322:       if test -z "$base_compile"; then
                    323:        base_compile="$lastarg"
                    324:       else
                    325:        base_compile="$base_compile $lastarg"
                    326:       fi
1.1       frystyk   327:     done
                    328: 
1.4     ! frystyk   329:     case "$user_target" in
        !           330:     set)
        !           331:       ;;
        !           332:     no)
        !           333:       # Get the name of the library object.
        !           334:       libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
        !           335:       ;;
        !           336:     *)
        !           337:       $echo "$modename: you must specify a target with \`-o'" 1>&2
        !           338:       exit 1
        !           339:       ;;
        !           340:     esac
1.1       frystyk   341: 
                    342:     # Recognize several different file suffixes.
1.4     ! frystyk   343:     # If the user specifies -o file.o, it is replaced with file.lo
        !           344:     xform='[cCFSfmso]'
1.1       frystyk   345:     case "$libobj" in
1.2       frystyk   346:     *.ada) xform=ada ;;
                    347:     *.adb) xform=adb ;;
                    348:     *.ads) xform=ads ;;
                    349:     *.asm) xform=asm ;;
                    350:     *.c++) xform=c++ ;;
1.1       frystyk   351:     *.cc) xform=cc ;;
                    352:     *.cpp) xform=cpp ;;
                    353:     *.cxx) xform=cxx ;;
                    354:     *.f90) xform=f90 ;;
1.2       frystyk   355:     *.for) xform=for ;;
1.1       frystyk   356:     esac
                    357: 
1.2       frystyk   358:     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1.1       frystyk   359: 
                    360:     case "$libobj" in
1.4     ! frystyk   361:     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1.1       frystyk   362:     *)
1.4     ! frystyk   363:       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1.1       frystyk   364:       exit 1
                    365:       ;;
                    366:     esac
                    367: 
                    368:     if test -z "$base_compile"; then
1.2       frystyk   369:       $echo "$modename: you must specify a compilation command" 1>&2
                    370:       $echo "$help" 1>&2
1.1       frystyk   371:       exit 1
                    372:     fi
                    373: 
                    374:     # Delete any leftover library objects.
                    375:     if test "$build_old_libs" = yes; then
1.4     ! frystyk   376:       removelist="$obj $libobj"
        !           377:     else
        !           378:       removelist="$libobj"
        !           379:     fi
        !           380: 
        !           381:     $run $rm $removelist
        !           382:     trap "$run $rm $removelist; exit 1" 1 2 15
        !           383: 
        !           384:     # Calculate the filename of the output object if compiler does
        !           385:     # not support -o with -c
        !           386:     if test "$compiler_c_o" = no; then
        !           387:       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
        !           388:       lockfile="$output_obj.lock"
        !           389:       removelist="$removelist $output_obj $lockfile"
        !           390:       trap "$run $rm $removelist; exit 1" 1 2 15
1.1       frystyk   391:     else
1.4     ! frystyk   392:       need_locks=no
        !           393:       lockfile=
        !           394:     fi
        !           395: 
        !           396:     # Lock this critical section if it is needed
        !           397:     # We use this script file to make the link, it avoids creating a new file
        !           398:     if test "$need_locks" = yes; then
        !           399:       until ln "$0" "$lockfile" 2>/dev/null; do
        !           400:        $show "Waiting for $lockfile to be removed"
        !           401:        sleep 2
        !           402:       done
        !           403:     elif test "$need_locks" = warn; then
        !           404:       if test -f "$lockfile"; then
        !           405:        echo "\
        !           406: *** ERROR, $lockfile exists and contains:
        !           407: `cat $lockfile 2>/dev/null`
        !           408: 
        !           409: This indicates that another process is trying to use the same
        !           410: temporary object file, and libtool could not work around it because
        !           411: your compiler does not support \`-c' and \`-o' together.  If you
        !           412: repeat this compilation, it may succeed, by chance, but you had better
        !           413: avoid parallel builds (make -j) in this platform, or get a better
        !           414: compiler."
        !           415: 
        !           416:        $run $rm $removelist
        !           417:        exit 1
        !           418:       fi
        !           419:       echo $srcfile > "$lockfile"
        !           420:     fi
        !           421: 
        !           422:     if test -n "$fix_srcfile_path"; then
        !           423:       eval srcfile=\"$fix_srcfile_path\"
1.1       frystyk   424:     fi
                    425: 
                    426:     # Only build a PIC object if we are building libtool libraries.
                    427:     if test "$build_libtool_libs" = yes; then
1.2       frystyk   428:       # Without this assignment, base_compile gets emptied.
                    429:       fbsd_hideous_sh_bug=$base_compile
                    430: 
1.1       frystyk   431:       # All platforms use -DPIC, to notify preprocessed assembler code.
1.4     ! frystyk   432:       command="$base_compile $pic_flag -DPIC $srcfile"
        !           433:       if test "$build_old_libs" = yes; then
        !           434:         lo_libobj="$libobj"
        !           435:        dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
        !           436:        if test "X$dir" = "X$libobj"; then
        !           437:          dir="$objdir"
        !           438:        else
        !           439:          dir="$dir/$objdir"
        !           440:        fi
        !           441:         libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
        !           442: 
        !           443:        if test -d "$dir"; then
        !           444:          $show "$rm $libobj"
        !           445:          $run $rm $libobj
        !           446:        else
        !           447:          $show "$mkdir $dir"
        !           448:          $run $mkdir $dir
        !           449:          status=$?
        !           450:          if test $status -ne 0 && test ! -d $dir; then
        !           451:            exit $status
        !           452:          fi
        !           453:        fi
        !           454:       fi
        !           455:       if test "$compiler_o_lo" = yes; then
        !           456:        output_obj="$libobj"
        !           457:        command="$command -o $output_obj"
        !           458:       elif test "$compiler_c_o" = yes; then
        !           459:        output_obj="$obj"
        !           460:        command="$command -o $output_obj"
        !           461:       fi
        !           462: 
        !           463:       $show "$command"
        !           464:       if $run eval "$command"; then :
1.1       frystyk   465:       else
1.4     ! frystyk   466:        test -n "$output_obj" && $run $rm $removelist
        !           467:        exit 1
        !           468:       fi
        !           469: 
        !           470:       if test "$need_locks" = warn &&
        !           471:         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
        !           472:        echo "\
        !           473: *** ERROR, $lockfile contains:
        !           474: `cat $lockfile 2>/dev/null`
        !           475: 
        !           476: but it should contain:
        !           477: $srcfile
        !           478: 
        !           479: This indicates that another process is trying to use the same
        !           480: temporary object file, and libtool could not work around it because
        !           481: your compiler does not support \`-c' and \`-o' together.  If you
        !           482: repeat this compilation, it may succeed, by chance, but you had better
        !           483: avoid parallel builds (make -j) in this platform, or get a better
        !           484: compiler."
        !           485: 
        !           486:        $run $rm $removelist
        !           487:        exit 1
        !           488:       fi
        !           489: 
        !           490:       # Just move the object if needed, then go on to compile the next one
        !           491:       if test x"$output_obj" != x"$libobj"; then
        !           492:        $show "$mv $output_obj $libobj"
        !           493:        if $run $mv $output_obj $libobj; then :
        !           494:        else
        !           495:          error=$?
        !           496:          $run $rm $removelist
        !           497:          exit $error
        !           498:        fi
1.1       frystyk   499:       fi
                    500: 
                    501:       # If we have no pic_flag, then copy the object into place and finish.
1.4     ! frystyk   502:       if test -z "$pic_flag" && test "$build_old_libs" = yes; then
        !           503:        # Rename the .lo from within objdir to obj
        !           504:         if test -f $obj; then
        !           505:          $show $rm $obj
        !           506:          $run $rm $obj
        !           507:        fi
        !           508: 
        !           509:        $show "$mv $libobj $obj"
        !           510:        if $run $mv $libobj $obj; then :
        !           511:        else
        !           512:          error=$?
        !           513:          $run $rm $removelist
        !           514:          exit $error
        !           515:        fi
        !           516: 
        !           517:        # Now arrange that obj and lo_libobj become the same file
        !           518:        $show "$LN_S $obj $lo_libobj"
        !           519:        if $run $LN_S $obj $lo_libobj; then
        !           520:          exit 0
        !           521:        else
        !           522:          error=$?
        !           523:          $run $rm $removelist
        !           524:          exit $error
        !           525:        fi
1.1       frystyk   526:       fi
                    527: 
1.2       frystyk   528:       # Allow error messages only from the first compilation.
                    529:       suppress_output=' >/dev/null 2>&1'
1.1       frystyk   530:     fi
                    531: 
                    532:     # Only build a position-dependent object if we build old libraries.
                    533:     if test "$build_old_libs" = yes; then
1.4     ! frystyk   534:       command="$base_compile $srcfile"
        !           535:       if test "$compiler_c_o" = yes; then
        !           536:        command="$command -o $obj"
        !           537:        output_obj="$obj"
        !           538:       fi
        !           539: 
1.2       frystyk   540:       # Suppress compiler output if we already did a PIC compilation.
1.4     ! frystyk   541:       command="$command$suppress_output"
        !           542:       $show "$command"
        !           543:       if $run eval "$command"; then :
1.1       frystyk   544:       else
1.4     ! frystyk   545:        $run $rm $removelist
        !           546:        exit 1
        !           547:       fi
        !           548: 
        !           549:       if test "$need_locks" = warn &&
        !           550:         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
        !           551:        echo "\
        !           552: *** ERROR, $lockfile contains:
        !           553: `cat $lockfile 2>/dev/null`
        !           554: 
        !           555: but it should contain:
        !           556: $srcfile
        !           557: 
        !           558: This indicates that another process is trying to use the same
        !           559: temporary object file, and libtool could not work around it because
        !           560: your compiler does not support \`-c' and \`-o' together.  If you
        !           561: repeat this compilation, it may succeed, by chance, but you had better
        !           562: avoid parallel builds (make -j) in this platform, or get a better
        !           563: compiler."
        !           564: 
        !           565:        $run $rm $removelist
        !           566:        exit 1
        !           567:       fi
        !           568: 
        !           569:       # Just move the object if needed
        !           570:       if test x"$output_obj" != x"$obj"; then
        !           571:        $show "$mv $output_obj $obj"
        !           572:        if $run $mv $output_obj $obj; then :
        !           573:        else
        !           574:          error=$?
        !           575:          $run $rm $removelist
        !           576:          exit $error
        !           577:        fi
        !           578:       fi
        !           579: 
        !           580:       # Create an invalid libtool object if no PIC, so that we do not
        !           581:       # accidentally link it into a program.
        !           582:       if test "$build_libtool_libs" != yes; then
        !           583:         $show "echo timestamp > $libobj"
        !           584:         $run eval "echo timestamp > \$libobj" || exit $?
        !           585:       else
        !           586:        # Move the .lo from within objdir
        !           587:        $show "$mv $libobj $lo_libobj"
        !           588:        if $run $mv $libobj $lo_libobj; then :
        !           589:        else
        !           590:          error=$?
        !           591:          $run $rm $removelist
        !           592:          exit $error
        !           593:        fi
1.1       frystyk   594:       fi
                    595:     fi
                    596: 
1.4     ! frystyk   597:     # Unlock the critical section if it was locked
        !           598:     if test "$need_locks" != no; then
        !           599:       $rm "$lockfile"
1.1       frystyk   600:     fi
                    601: 
                    602:     exit 0
                    603:     ;;
                    604: 
                    605:   # libtool link mode
                    606:   link)
1.2       frystyk   607:     modename="$modename: link"
1.4     ! frystyk   608:     C_compiler="$CC" # save it, to compile generated C sources
1.2       frystyk   609:     CC="$nonopt"
1.4     ! frystyk   610:     case "$host" in
        !           611:     *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
        !           612:       # It is impossible to link a dll without this setting, and
        !           613:       # we shouldn't force the makefile maintainer to figure out
        !           614:       # which system we are compiling for in order to pass an extra
        !           615:       # flag for every libtool invokation.
        !           616:       # allow_undefined=no
        !           617: 
        !           618:       # FIXME: Unfortunately, there are problems with the above when trying
        !           619:       # to make a dll which has undefined symbols, in which case not
        !           620:       # even a static library is built.  For now, we need to specify
        !           621:       # -no-undefined on the libtool link line when we can be certain
        !           622:       # that all symbols are satisfied, otherwise we get a static library.
        !           623:       allow_undefined=yes
        !           624: 
        !           625:       # This is a source program that is used to create dlls on Windows
        !           626:       # Don't remove nor modify the starting and closing comments
        !           627: # /* ltdll.c starts here */
        !           628: # #define WIN32_LEAN_AND_MEAN
        !           629: # #include <windows.h>
        !           630: # #undef WIN32_LEAN_AND_MEAN
        !           631: # #include <stdio.h>
        !           632: #
        !           633: # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
        !           634: #
        !           635: # #include <cygwin/cygwin_dll.h>
        !           636: # DECLARE_CYGWIN_DLL( DllMain );
        !           637: # HINSTANCE __hDllInstance_base;
        !           638: #
        !           639: # BOOL APIENTRY
        !           640: # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
        !           641: # {
        !           642: #   __hDllInstance_base = hInst;
        !           643: #   return TRUE;
        !           644: # }
        !           645: # /* ltdll.c ends here */
        !           646:       ;;
        !           647:     *)
        !           648:       allow_undefined=yes
        !           649:       ;;
        !           650:     esac
1.2       frystyk   651:     compile_command="$CC"
                    652:     finalize_command="$CC"
                    653: 
1.1       frystyk   654:     compile_shlibpath=
                    655:     finalize_shlibpath=
1.3       frystyk   656:     convenience=
                    657:     old_convenience=
1.1       frystyk   658:     deplibs=
1.4     ! frystyk   659: 
        !           660:     if test -n "$shlibpath_var"; then
        !           661:       # get the directories listed in $shlibpath_var
        !           662:       eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
        !           663:     else
        !           664:       libsearch_path=
        !           665:     fi
        !           666:     # now prepend the system-specific ones
        !           667:     eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
        !           668:     
        !           669:     avoid_version=no
1.2       frystyk   670:     dlfiles=
                    671:     dlprefiles=
1.1       frystyk   672:     export_dynamic=no
1.4     ! frystyk   673:     export_symbols=
1.3       frystyk   674:     generated=
1.1       frystyk   675:     hardcode_libdirs=
1.4     ! frystyk   676:     finalize_hardcode_libdirs=
1.1       frystyk   677:     libobjs=
                    678:     link_against_libtool_libs=
                    679:     ltlibs=
1.4     ! frystyk   680:     module=no
1.1       frystyk   681:     objs=
1.4     ! frystyk   682:     preload=no
1.1       frystyk   683:     prev=
                    684:     prevarg=
1.2       frystyk   685:     release=
                    686:     rpath=
1.4     ! frystyk   687:     xrpath=
1.1       frystyk   688:     perm_rpath=
                    689:     temp_rpath=
1.4     ! frystyk   690:     finalize_rpath=
1.1       frystyk   691:     vinfo=
                    692: 
                    693:     # We need to know -static, to get the right output filenames.
                    694:     for arg
                    695:     do
                    696:       case "$arg" in
1.2       frystyk   697:       -all-static | -static)
1.4     ! frystyk   698:        if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1.2       frystyk   699:            $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1.4     ! frystyk   700:        fi
        !           701:        build_libtool_libs=no
1.2       frystyk   702:        build_old_libs=yes
1.4     ! frystyk   703:        break
        !           704:        ;;
1.1       frystyk   705:       esac
                    706:     done
                    707: 
1.2       frystyk   708:     # See if our shared archives depend on static archives.
                    709:     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
                    710: 
                    711:     # Go through the arguments, transforming them on the way.
1.3       frystyk   712:     while test $# -gt 0; do
                    713:       arg="$1"
                    714:       shift
                    715: 
1.1       frystyk   716:       # If the previous option needs an argument, assign it.
                    717:       if test -n "$prev"; then
1.4     ! frystyk   718:        case "$prev" in
        !           719:        output)
        !           720:          compile_command="$compile_command @OUTPUT@"
        !           721:          finalize_command="$finalize_command @OUTPUT@"
        !           722:          ;;
        !           723:        esac
        !           724: 
        !           725:        case "$prev" in
        !           726:        dlfiles|dlprefiles)
        !           727:          if test "$preload" = no; then
        !           728:            # Add the symbol object into the linking commands.
        !           729:            compile_command="$compile_command @SYMFILE@"
        !           730:            finalize_command="$finalize_command @SYMFILE@"
        !           731:            preload=yes
        !           732:          fi
        !           733:          case "$arg" in
        !           734:          *.la | *.lo) ;;  # We handle these cases below.
        !           735:          *)
        !           736:            dlprefiles="$dlprefiles $arg"
        !           737:            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
        !           738:            prev=
        !           739:            ;;
        !           740:          esac
        !           741:          ;;
        !           742:        exportsyms)
        !           743:          export_symbols="$arg"
        !           744:          if test ! -f "$arg"; then
        !           745:            $echo "$modename: symbol file \`$arg' does not exist"
        !           746:            exit 1
        !           747:          fi
        !           748:          prev=
        !           749:          ;;
1.2       frystyk   750:        release)
                    751:          release="-$arg"
                    752:          prev=
                    753:          continue
                    754:          ;;
1.4     ! frystyk   755:        rpath)
        !           756:          rpath="$rpath $arg"
        !           757:          prev=
        !           758:          continue
        !           759:          ;;
        !           760:        xrpath)
        !           761:          xrpath="$xrpath $arg"
        !           762:          prev=
        !           763:          continue
        !           764:          ;;
        !           765:        *)
        !           766:          eval "$prev=\"\$arg\""
1.2       frystyk   767:          prev=
                    768:          continue
1.1       frystyk   769:          ;;
1.4     ! frystyk   770:        esac
1.1       frystyk   771:       fi
                    772: 
                    773:       prevarg="$arg"
                    774: 
                    775:       case "$arg" in
1.2       frystyk   776:       -all-static)
                    777:        if test -n "$link_static_flag"; then
1.4     ! frystyk   778:          compile_command="$compile_command $link_static_flag"
1.2       frystyk   779:          finalize_command="$finalize_command $link_static_flag"
1.4     ! frystyk   780:        fi
        !           781:        continue
1.2       frystyk   782:        ;;
1.1       frystyk   783: 
1.2       frystyk   784:       -allow-undefined)
                    785:        # FIXME: remove this flag sometime in the future.
                    786:        $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1.1       frystyk   787:        continue
                    788:        ;;
                    789: 
1.4     ! frystyk   790:       -avoid-version)
        !           791:        avoid_version=yes
        !           792:        continue
        !           793:        ;;
        !           794: 
1.2       frystyk   795:       -dlopen)
1.4     ! frystyk   796:        prev=dlfiles
        !           797:        continue
        !           798:        ;;
1.2       frystyk   799: 
                    800:       -dlpreopen)
1.4     ! frystyk   801:        prev=dlprefiles
        !           802:        continue
        !           803:        ;;
1.2       frystyk   804: 
                    805:       -export-dynamic)
1.4     ! frystyk   806:        if test "$export_dynamic" != yes; then
        !           807:          export_dynamic=yes
1.2       frystyk   808:          if test -n "$export_dynamic_flag_spec"; then
1.3       frystyk   809:            eval arg=\"$export_dynamic_flag_spec\"
1.2       frystyk   810:          else
                    811:            arg=
                    812:          fi
1.4     ! frystyk   813:          if test "$preload" = no; then
        !           814:            # Add the symbol object into the linking commands.
        !           815:            compile_command="$compile_command @SYMFILE@"
        !           816:            finalize_command="$finalize_command @SYMFILE@"
        !           817:            preload=yes
        !           818:          fi
        !           819:        fi
        !           820:        ;;
1.2       frystyk   821: 
1.4     ! frystyk   822:       -export-symbols)
        !           823:        if test -n "$export_symbols"; then
        !           824:          $echo "$modename: cannot have more than one -exported-symbols"
        !           825:          exit 1
        !           826:        fi
        !           827:        prev=exportsyms
        !           828:        continue
        !           829:        ;;
1.2       frystyk   830: 
1.1       frystyk   831:       -L*)
1.4     ! frystyk   832:        dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
        !           833:        case "$dir" in
        !           834:        /* | [A-Za-z]:[/\\]*)
1.2       frystyk   835:          # Add the corresponding hardcode_libdir_flag, if it is not identical.
1.4     ! frystyk   836:          ;;
        !           837:        *)
        !           838:          $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
        !           839:          exit 1
        !           840:          ;;
        !           841:        esac
        !           842:        deplibs="$deplibs $arg"
        !           843:        lib_search_path="$lib_search_path `expr $arg : '-L\(.*\)'`"
        !           844:        case "$host" in
        !           845:        *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
        !           846:          dllsearchdir="`expr $arg : '-L\(.*\)'`"
        !           847:          dllsearchdir=`cd "$dllsearchdir" && pwd || echo "$dllsearchdir"`
        !           848:          if test -n "$dllsearchpath"; then
        !           849:            dllsearchpath="$dllsearchpath:$dllsearchdir"
        !           850:          else
        !           851:            dllsearchpath="$dllsearchdir"
        !           852:          fi
        !           853:          ;;
        !           854:        esac
        !           855:        ;;
1.1       frystyk   856: 
1.4     ! frystyk   857:       -l*)
        !           858:        deplibs="$deplibs $arg"
        !           859:        ;;
1.1       frystyk   860: 
1.4     ! frystyk   861:       -module)
        !           862:        if test "$module" != yes; then
        !           863:          module=yes
        !           864:          if test -n "$export_dynamic_flag_spec"; then
        !           865:            eval arg=\"$export_dynamic_flag_spec\"
        !           866:          else
        !           867:            arg=
        !           868:          fi
        !           869:        fi
        !           870:        ;;
        !           871:        
1.2       frystyk   872:       -no-undefined)
                    873:        allow_undefined=no
                    874:        continue
                    875:        ;;
                    876: 
1.1       frystyk   877:       -o) prev=output ;;
                    878: 
1.2       frystyk   879:       -release)
                    880:        prev=release
1.1       frystyk   881:        continue
                    882:        ;;
                    883: 
1.2       frystyk   884:       -rpath)
1.4     ! frystyk   885:        prev=rpath
        !           886:        continue
        !           887:        ;;
        !           888: 
        !           889:       -R)
        !           890:        prev=xrpath
        !           891:        continue
        !           892:        ;;
        !           893: 
        !           894:       -R*)
        !           895:        xrpath="$xrpath "`echo "X$arg" | $Xsed -e 's/^-R//'`
        !           896:        continue
        !           897:        ;;
1.2       frystyk   898: 
1.1       frystyk   899:       -static)
1.2       frystyk   900:        # If we have no pic_flag, then this is the same as -all-static.
                    901:        if test -z "$pic_flag" && test -n "$link_static_flag"; then
1.4     ! frystyk   902:          compile_command="$compile_command $link_static_flag"
1.2       frystyk   903:          finalize_command="$finalize_command $link_static_flag"
1.4     ! frystyk   904:        fi
1.1       frystyk   905:        continue
                    906:        ;;
                    907: 
                    908:       -version-info)
1.4     ! frystyk   909:        prev=vinfo
        !           910:        continue
        !           911:        ;;
1.1       frystyk   912: 
1.2       frystyk   913:       # Some other compiler flag.
                    914:       -* | +*)
                    915:        # Unknown arguments in both finalize_command and compile_command need
                    916:        # to be aesthetically quoted because they are evaled later.
                    917:        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
                    918:        case "$arg" in
                    919:        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
                    920:          arg="\"$arg\""
                    921:          ;;
                    922:        esac
1.4     ! frystyk   923:        ;;
1.1       frystyk   924: 
1.4     ! frystyk   925:       *.o | *.obj | *.a | *.lib)
        !           926:        # A standard object.
        !           927:        objs="$objs $arg"
        !           928:        ;;
1.1       frystyk   929: 
                    930:       *.lo)
1.4     ! frystyk   931:        # A library object.
1.2       frystyk   932:        if test "$prev" = dlfiles; then
                    933:          dlfiles="$dlfiles $arg"
                    934:          if test "$build_libtool_libs" = yes; then
                    935:            prev=
                    936:            continue
                    937:          else
                    938:            # If libtool objects are unsupported, then we need to preload.
                    939:            prev=dlprefiles
                    940:          fi
1.1       frystyk   941:        fi
                    942: 
1.2       frystyk   943:        if test "$prev" = dlprefiles; then
                    944:          # Preload the old-style object.
1.4     ! frystyk   945:          dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1.2       frystyk   946:          prev=
1.1       frystyk   947:        fi
1.2       frystyk   948:        libobjs="$libobjs $arg"
1.4     ! frystyk   949:        ;;
1.1       frystyk   950: 
1.2       frystyk   951:       *.la)
1.4     ! frystyk   952:        # A libtool-controlled library.
1.1       frystyk   953: 
1.4     ! frystyk   954:        dlname=
        !           955:        libdir=
        !           956:        library_names=
        !           957:        old_library=
1.1       frystyk   958: 
1.4     ! frystyk   959:        # Check to see that this really is a libtool archive.
        !           960:        if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
        !           961:        else
        !           962:          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
        !           963:          exit 1
        !           964:        fi
        !           965: 
        !           966:        # If the library was installed with an old release of libtool,
        !           967:        # it will not redefine variable installed.
        !           968:        installed=yes
        !           969: 
        !           970:        # If there is no directory component, then add one.
        !           971:        case "$arg" in
        !           972:        */* | *\\*) . $arg ;;
        !           973:        *) . ./$arg ;;
        !           974:        esac
        !           975: 
        !           976:        # Get the name of the library we link against.
        !           977:        linklib=
        !           978:        for l in $old_library $library_names; do
        !           979:          linklib="$l"
        !           980:        done
        !           981: 
        !           982:        if test -z "$linklib"; then
        !           983:          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
        !           984:          exit 1
        !           985:        fi
        !           986: 
        !           987:        # Find the relevant object directory and library name.
        !           988:        name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
        !           989: 
        !           990:        if test "X$installed" = Xyes; then
        !           991:          dir="$libdir"
        !           992:        else
        !           993:          dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
        !           994:          if test "X$dir" = "X$arg"; then
        !           995:            dir="$objdir"
        !           996:          else
        !           997:            dir="$dir/$objdir"
        !           998:          fi
        !           999:        fi
        !          1000: 
        !          1001:        if test -n "$dependency_libs"; then
        !          1002:          # Extract -R from dependency_libs
        !          1003:          temp_deplibs=
        !          1004:          for deplib in $dependency_libs; do
        !          1005:            case "$deplib" in
        !          1006:            -R*) xrpath="$xrpath "`echo "X$deplib" | $Xsed -e 's/^-R//'`;;
        !          1007:            *) temp_deplibs="$temp_deplibs $deplib";;
        !          1008:            esac
        !          1009:          done
        !          1010:          dependency_libs="$temp_deplibs"
        !          1011:        fi
        !          1012: 
        !          1013:        if test -z "$libdir"; then
1.3       frystyk  1014:          # It is a libtool convenience library, so add in its objects.
1.4     ! frystyk  1015:          convenience="$convenience $dir/$old_library"
1.3       frystyk  1016:          old_convenience="$old_convenience $dir/$old_library"
1.4     ! frystyk  1017:          deplibs="$deplibs$dependency_libs"
        !          1018:          compile_command="$compile_command $dir/$old_library$dependency_libs"
        !          1019:          finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1.3       frystyk  1020:          continue
                   1021:        fi
                   1022: 
1.4     ! frystyk  1023:        # This library was specified with -dlopen.
        !          1024:        if test "$prev" = dlfiles; then
        !          1025:          dlfiles="$dlfiles $arg"
        !          1026:          if test -z "$dlname" || test "$build_libtool_libs" = no; then
        !          1027:            # If there is no dlname or we're linking statically,
        !          1028:            # we need to preload.
        !          1029:            prev=dlprefiles
        !          1030:          else
        !          1031:            # We should not create a dependency on this library, but we
1.2       frystyk  1032:            # may need any libraries it requires.
                   1033:            compile_command="$compile_command$dependency_libs"
                   1034:            finalize_command="$finalize_command$dependency_libs"
1.4     ! frystyk  1035:            prev=
        !          1036:            continue
        !          1037:          fi
        !          1038:        fi
        !          1039: 
        !          1040:        # The library was specified with -dlpreopen.
        !          1041:        if test "$prev" = dlprefiles; then
        !          1042:          # Prefer using a static library (so that no silly _DYNAMIC symbols
        !          1043:          # are required to link).
        !          1044:          if test -n "$old_library"; then
        !          1045:            dlprefiles="$dlprefiles $dir/$old_library"
        !          1046:          else
        !          1047:            dlprefiles="$dlprefiles $dir/$linklib"
        !          1048:          fi
        !          1049:          prev=
        !          1050:        fi
        !          1051: 
        !          1052:        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
        !          1053:          link_against_libtool_libs="$link_against_libtool_libs $arg"
        !          1054:          if test -n "$shlibpath_var"; then
        !          1055:            # Make sure the rpath contains only unique directories.
        !          1056:            case "$temp_rpath " in
        !          1057:            *" $dir "*) ;;
        !          1058:            *) temp_rpath="$temp_rpath $dir" ;;
        !          1059:            esac
        !          1060:          fi
1.2       frystyk  1061: 
                   1062:          # This is the magic to use -rpath.
1.4     ! frystyk  1063:          if test -n "$hardcode_libdir_flag_spec"; then
        !          1064:            saved_libdir="$libdir"
        !          1065:            libdir="$dir"
        !          1066: 
        !          1067:            # We need an absolute path.
        !          1068:            case "$libdir" in
        !          1069:            /* | [A-Za-z]:[/\\]*) ;;
        !          1070:            *)
        !          1071:              absdir=`cd "$libdir" && pwd`
        !          1072:              if test -z "$absdir"; then
        !          1073:                $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2
        !          1074:              else
        !          1075:                libdir="$absdir"
        !          1076:              fi
        !          1077:              ;;
        !          1078:            esac
        !          1079:            if test -n "$hardcode_libdir_separator"; then
        !          1080:              if test -z "$hardcode_libdirs"; then
        !          1081:                # Put the magic libdir with the hardcode flag.
        !          1082:                hardcode_libdirs="$libdir"
        !          1083:                libdir="@HARDCODE_LIBDIRS@"
        !          1084:              else
        !          1085:                # Just accumulate the unique libdirs.
1.2       frystyk  1086:                case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
                   1087:                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
                   1088:                  ;;
                   1089:                *)
                   1090:                  hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
                   1091:                  ;;
                   1092:                esac
1.4     ! frystyk  1093:                libdir=
        !          1094:              fi
        !          1095:            fi
        !          1096: 
        !          1097:            if test -n "$libdir"; then
        !          1098:              eval flag=\"$hardcode_libdir_flag_spec\"
        !          1099: 
        !          1100:              compile_command="$compile_command $flag"
        !          1101:            fi
        !          1102: 
        !          1103:            libdir="$saved_libdir"
        !          1104:            if test -n "$hardcode_libdir_separator"; then
        !          1105:              if test -z "$finalize_hardcode_libdirs"; then
        !          1106:                # Put the magic libdir with the hardcode flag.
        !          1107:                finalize_hardcode_libdirs="$libdir"
        !          1108:                libdir="@HARDCODE_LIBDIRS@"
        !          1109:              else
        !          1110:                # Just accumulate the unique libdirs.
        !          1111:                case "$hardcode_libdir_separator$finalize_hardcode_libdirs$hardcode_libdir_separator" in
        !          1112:                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
        !          1113:                  ;;
        !          1114:                *)
        !          1115:                  finalize_hardcode_libdirs="$finalize_hardcode_libdirs$hardcode_libdir_separator$libdir"
        !          1116:                  ;;
        !          1117:                esac
        !          1118:                libdir=
        !          1119:              fi
        !          1120:            fi
        !          1121: 
        !          1122:            if test -n "$libdir"; then
        !          1123:              eval flag=\"$hardcode_libdir_flag_spec\"
        !          1124: 
        !          1125:              finalize_command="$finalize_command $flag"
        !          1126:            fi
        !          1127:            # libdir is also use after "$hardcode_action" case
        !          1128:            libdir="$saved_libdir"
        !          1129:          elif test -n "$runpath_var"; then
        !          1130:            # Do the same for the permanent run path.
        !          1131:            case "$dir" in
        !          1132:            /* | [A-Za-z]:[/\\]*) absdir="$dir";;
        !          1133:            *)
        !          1134:              absdir=`cd "$dir" && pwd`
        !          1135:              if test -z "$absdir"; then
        !          1136:                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
        !          1137:                absdir="$dir"
        !          1138:              fi
        !          1139:              ;;
        !          1140:            esac
        !          1141:            case "$perm_rpath " in
        !          1142:            *" $absdir "*) ;;
        !          1143:            *) perm_rpath="$perm_rpath $absdir" ;;
        !          1144:            esac
        !          1145:            case "$finalize_perm_rpath " in
        !          1146:            *" $libdir "*) ;;
        !          1147:            *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
        !          1148:            esac
        !          1149:          fi
1.2       frystyk  1150: 
                   1151: 
1.3       frystyk  1152:          lib_linked=yes
1.4     ! frystyk  1153:          case "$hardcode_action" in
        !          1154:          immediate | unsupported)
        !          1155:            if test "$hardcode_direct" = no; then
        !          1156:              compile_command="$compile_command $dir/$linklib"
        !          1157:              deplibs="$deplibs $dir/$linklib"
        !          1158:              case "$host" in
        !          1159:              *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
        !          1160:                dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
        !          1161:                if test -n "$dllsearchpath"; then
        !          1162:                  dllsearchpath="$dllsearchpath:$dllsearchdir"
        !          1163:                else
        !          1164:                  dllsearchpath="$dllsearchdir"
        !          1165:                fi
        !          1166:                ;;
        !          1167:              esac
        !          1168:            elif test "$hardcode_minus_L" = no; then
        !          1169:              case "$host" in
        !          1170:              *-*-sunos*)
        !          1171:                compile_shlibpath="$compile_shlibpath$dir:"
        !          1172:                ;;
        !          1173:              esac
        !          1174:              compile_command="$compile_command -L$dir -l$name"
        !          1175:              deplibs="$deplibs -L$dir -l$name"
        !          1176:            elif test "$hardcode_shlibpath_var" = no; then
        !          1177:              compile_shlibpath="$compile_shlibpath$dir:"
        !          1178:              compile_command="$compile_command -l$name"
        !          1179:              deplibs="$deplibs -l$name"
1.3       frystyk  1180:            else
                   1181:              lib_linked=no
1.4     ! frystyk  1182:            fi
        !          1183:            ;;
1.2       frystyk  1184: 
1.4     ! frystyk  1185:          relink)
        !          1186:            # We need an absolute path.
        !          1187:            case "$dir" in
        !          1188:            /* | [A-Za-z]:[/\\]*) ;;
        !          1189:            *)
        !          1190:              absdir=`cd "$dir" && pwd`
        !          1191:              if test -z "$absdir"; then
        !          1192:                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
        !          1193:                exit 1
        !          1194:              fi
        !          1195:              dir="$absdir"
        !          1196:              ;;
        !          1197:            esac
        !          1198: 
        !          1199:            if test "$hardcode_direct" = yes; then
        !          1200:              compile_command="$compile_command $dir/$linklib"
        !          1201:              deplibs="$deplibs $dir/$linklib"
        !          1202:            elif test "$hardcode_minus_L" = yes; then
        !          1203:              compile_command="$compile_command -L$dir -l$name"
        !          1204:              deplibs="$deplibs -L$dir -l$name"
        !          1205:            elif test "$hardcode_shlibpath_var" = yes; then
        !          1206:              compile_shlibpath="$compile_shlibpath$dir:"
        !          1207:              compile_command="$compile_command -l$name"
        !          1208:              deplibs="$deplibs -l$name"
1.3       frystyk  1209:            else
                   1210:              lib_linked=no
1.4     ! frystyk  1211:            fi
        !          1212:            ;;
1.2       frystyk  1213: 
1.3       frystyk  1214:          *)
                   1215:            lib_linked=no
                   1216:            ;;
1.4     ! frystyk  1217:          esac
1.2       frystyk  1218: 
1.3       frystyk  1219:          if test "$lib_linked" != yes; then
                   1220:            $echo "$modename: configuration error: unsupported hardcode properties"
                   1221:            exit 1
                   1222:          fi
                   1223: 
1.4     ! frystyk  1224:          # Finalize command for both is simple: just hardcode it.
        !          1225:          if test "$hardcode_direct" = yes; then
        !          1226:            finalize_command="$finalize_command $libdir/$linklib"
        !          1227:          elif test "$hardcode_minus_L" = yes; then
        !          1228:            finalize_command="$finalize_command -L$libdir -l$name"
        !          1229:          elif test "$hardcode_shlibpath_var" = yes; then
        !          1230:            finalize_shlibpath="$finalize_shlibpath$libdir:"
        !          1231:            finalize_command="$finalize_command -l$name"
        !          1232:          else
        !          1233:            # We cannot seem to hardcode it, guess we'll fake it.
        !          1234:            finalize_command="$finalize_command -L$libdir -l$name"
        !          1235:          fi
        !          1236:        else
        !          1237:          # Transform directly to old archives if we don't build new libraries.
        !          1238:          if test -n "$pic_flag" && test -z "$old_library"; then
        !          1239:            $echo "$modename: cannot find static library for \`$arg'" 1>&2
        !          1240:            exit 1
        !          1241:          fi
1.2       frystyk  1242: 
                   1243:          # Here we assume that one of hardcode_direct or hardcode_minus_L
                   1244:          # is not unsupported.  This is valid on all known static and
                   1245:          # shared platforms.
                   1246:          if test "$hardcode_direct" != unsupported; then
                   1247:            test -n "$old_library" && linklib="$old_library"
                   1248:            compile_command="$compile_command $dir/$linklib"
                   1249:            finalize_command="$finalize_command $dir/$linklib"
                   1250:          else
                   1251:            compile_command="$compile_command -L$dir -l$name"
                   1252:            finalize_command="$finalize_command -L$dir -l$name"
1.1       frystyk  1253:          fi
1.4     ! frystyk  1254:        fi
1.2       frystyk  1255: 
                   1256:        # Add in any libraries that this one depends upon.
                   1257:        compile_command="$compile_command$dependency_libs"
                   1258:        finalize_command="$finalize_command$dependency_libs"
1.1       frystyk  1259:        continue
1.4     ! frystyk  1260:        ;;
1.1       frystyk  1261: 
1.2       frystyk  1262:       # Some other compiler argument.
1.1       frystyk  1263:       *)
1.2       frystyk  1264:        # Unknown arguments in both finalize_command and compile_command need
                   1265:        # to be aesthetically quoted because they are evaled later.
                   1266:        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
                   1267:        case "$arg" in
                   1268:        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
                   1269:          arg="\"$arg\""
                   1270:          ;;
                   1271:        esac
1.4     ! frystyk  1272:        ;;
1.1       frystyk  1273:       esac
                   1274: 
1.2       frystyk  1275:       # Now actually substitute the argument into the commands.
                   1276:       if test -n "$arg"; then
                   1277:        compile_command="$compile_command $arg"
                   1278:        finalize_command="$finalize_command $arg"
                   1279:       fi
1.1       frystyk  1280:     done
                   1281: 
                   1282:     if test -n "$prev"; then
1.2       frystyk  1283:       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
                   1284:       $echo "$help" 1>&2
1.1       frystyk  1285:       exit 1
                   1286:     fi
                   1287: 
1.4     ! frystyk  1288:     if test -n "$export_symbols" && test "$module" = yes; then
        !          1289:       $echo "$modename: \`-export-symbols' is not supported for modules"
        !          1290:       exit 1
        !          1291:     fi
        !          1292:     
1.3       frystyk  1293:     oldlibs=
1.4     ! frystyk  1294:     # calculate the name of the file, without its directory
        !          1295:     outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
        !          1296:     libobjs_save="$libobjs"
        !          1297: 
1.1       frystyk  1298:     case "$output" in
                   1299:     "")
1.2       frystyk  1300:       $echo "$modename: you must specify an output file" 1>&2
                   1301:       $echo "$help" 1>&2
1.1       frystyk  1302:       exit 1
                   1303:       ;;
                   1304: 
1.4     ! frystyk  1305:     *.a | *.lib)
1.3       frystyk  1306:       if test -n "$link_against_libtool_libs"; then
1.4     ! frystyk  1307:        $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
        !          1308:        exit 1
1.3       frystyk  1309:       fi
                   1310: 
                   1311:       if test -n "$deplibs"; then
1.4     ! frystyk  1312:        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1.3       frystyk  1313:       fi
                   1314: 
                   1315:       if test -n "$dlfiles$dlprefiles"; then
1.4     ! frystyk  1316:        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1.3       frystyk  1317:       fi
                   1318: 
                   1319:       if test -n "$rpath"; then
1.4     ! frystyk  1320:        $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
        !          1321:       fi
        !          1322: 
        !          1323:       if test -n "$xrpath"; then
        !          1324:        $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1.3       frystyk  1325:       fi
                   1326: 
                   1327:       if test -n "$vinfo"; then
1.4     ! frystyk  1328:        $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1.3       frystyk  1329:       fi
                   1330: 
                   1331:       if test -n "$release"; then
1.4     ! frystyk  1332:        $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
        !          1333:       fi
        !          1334: 
        !          1335:       if test -n "$export_symbols"; then
        !          1336:        $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1.3       frystyk  1337:       fi
                   1338: 
1.2       frystyk  1339:       # Now set the variables for building old libraries.
                   1340:       build_libtool_libs=no
1.3       frystyk  1341:       oldlibs="$output"
1.2       frystyk  1342:       ;;
                   1343: 
1.1       frystyk  1344:     *.la)
1.2       frystyk  1345:       # Make sure we only generate libraries of the form `libNAME.la'.
1.4     ! frystyk  1346:       case "$outputname" in
        !          1347:       lib*)
        !          1348:        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
        !          1349:        eval libname=\"$libname_spec\"
        !          1350:        ;;
1.2       frystyk  1351:       *)
1.4     ! frystyk  1352:        if test "$module" = no; then
        !          1353:          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
        !          1354:          $echo "$help" 1>&2
        !          1355:          exit 1
        !          1356:        fi
        !          1357:        if test "$need_lib_prefix" != no; then
        !          1358:          # Add the "lib" prefix for modules if required
        !          1359:          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
        !          1360:          eval libname=\"$libname_spec\"
        !          1361:        else
        !          1362:          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
        !          1363:        fi
1.2       frystyk  1364:        ;;
                   1365:       esac
                   1366: 
1.4     ! frystyk  1367:       if test -n "$xrpath"; then
        !          1368:        temp_xrpath=
        !          1369:        for libdir in $xrpath; do
        !          1370:          temp_xrpath="$temp_xrpath -R$libdir"
        !          1371:        done
        !          1372:        deplibs="$temp_xrpath $deplibs"
        !          1373:       fi
        !          1374: 
        !          1375:       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
        !          1376:       if test "X$output_objdir" = "X$output"; then
        !          1377:        output_objdir="$objdir"
        !          1378:       else
        !          1379:        output_objdir="$output_objdir/$objdir"
        !          1380:       fi
1.1       frystyk  1381: 
                   1382:       # All the library-specific variables (install_libdir is set above).
                   1383:       library_names=
                   1384:       old_library=
                   1385:       dlname=
                   1386: 
                   1387:       if test -n "$objs"; then
1.4     ! frystyk  1388:        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
        !          1389:        exit 1
1.1       frystyk  1390:       fi
                   1391: 
                   1392:       # How the heck are we supposed to write a wrapper for a shared library?
                   1393:       if test -n "$link_against_libtool_libs"; then
1.4     ! frystyk  1394:         $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
        !          1395:         exit 1
1.2       frystyk  1396:       fi
                   1397: 
                   1398:       if test -n "$dlfiles$dlprefiles"; then
1.4     ! frystyk  1399:        $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1.1       frystyk  1400:       fi
                   1401: 
1.2       frystyk  1402:       set dummy $rpath
                   1403:       if test $# -gt 2; then
                   1404:        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1.1       frystyk  1405:       fi
1.2       frystyk  1406:       install_libdir="$2"
1.1       frystyk  1407: 
1.4     ! frystyk  1408:       oldlibs=
1.3       frystyk  1409:       if test -z "$rpath"; then
1.4     ! frystyk  1410:        if test "$build_libtool_libs" = yes; then
        !          1411:          # Building a libtool convenience library.
        !          1412:          libext=al
        !          1413:          oldlibs="$output_objdir/$libname.$libext $oldlibs"
        !          1414:          build_libtool_libs=convenience
        !          1415:          build_old_libs=yes
        !          1416:        fi
        !          1417:        dependency_libs="$deplibs"
1.3       frystyk  1418: 
                   1419:        if test -n "$vinfo"; then
                   1420:          $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
                   1421:        fi
                   1422: 
                   1423:        if test -n "$release"; then
                   1424:          $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
                   1425:        fi
                   1426:       else
                   1427: 
                   1428:        # Parse the version information argument.
                   1429:        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
                   1430:        set dummy $vinfo 0 0 0
                   1431:        IFS="$save_ifs"
                   1432: 
                   1433:        if test -n "$8"; then
                   1434:          $echo "$modename: too many parameters to \`-version-info'" 1>&2
                   1435:          $echo "$help" 1>&2
                   1436:          exit 1
                   1437:        fi
                   1438: 
                   1439:        current="$2"
                   1440:        revision="$3"
                   1441:        age="$4"
                   1442: 
                   1443:        # Check that each of the things are valid numbers.
                   1444:        case "$current" in
                   1445:        0 | [1-9] | [1-9][0-9]*) ;;
                   1446:        *)
                   1447:          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
                   1448:          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
                   1449:          exit 1
                   1450:          ;;
                   1451:        esac
                   1452: 
                   1453:        case "$revision" in
                   1454:        0 | [1-9] | [1-9][0-9]*) ;;
                   1455:        *)
                   1456:          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
                   1457:          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
                   1458:          exit 1
                   1459:          ;;
                   1460:        esac
                   1461: 
                   1462:        case "$age" in
                   1463:        0 | [1-9] | [1-9][0-9]*) ;;
                   1464:        *)
                   1465:          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
                   1466:          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
                   1467:          exit 1
                   1468:          ;;
                   1469:        esac
1.1       frystyk  1470: 
1.3       frystyk  1471:        if test $age -gt $current; then
                   1472:          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
                   1473:          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
                   1474:          exit 1
                   1475:        fi
1.1       frystyk  1476: 
1.3       frystyk  1477:        # Calculate the version variables.
                   1478:        major=
                   1479:        versuffix=
                   1480:        verstring=
                   1481:        case "$version_type" in
                   1482:        none) ;;
                   1483: 
                   1484:        linux)
                   1485:          major=.`expr $current - $age`
                   1486:          versuffix="$major.$age.$revision"
                   1487:          ;;
1.1       frystyk  1488: 
1.3       frystyk  1489:        osf)
                   1490:          major=`expr $current - $age`
                   1491:          versuffix=".$current.$age.$revision"
                   1492:          verstring="$current.$age.$revision"
                   1493: 
                   1494:          # Add in all the interfaces that we are compatible with.
                   1495:          loop=$age
                   1496:          while test $loop != 0; do
                   1497:            iface=`expr $current - $loop`
                   1498:            loop=`expr $loop - 1`
                   1499:            verstring="$verstring:${iface}.0"
                   1500:          done
1.1       frystyk  1501: 
1.3       frystyk  1502:          # Make executables depend on our current version.
                   1503:          verstring="$verstring:${current}.0"
                   1504:          ;;
1.1       frystyk  1505: 
1.3       frystyk  1506:        sunos)
                   1507:          major=".$current"
                   1508:          versuffix=".$current.$revision"
                   1509:          ;;
1.1       frystyk  1510: 
1.4     ! frystyk  1511:        freebsd-aout)
        !          1512:          major=".$current"
        !          1513:          versuffix=".$current.$revision";
        !          1514:          ;;
        !          1515: 
        !          1516:        freebsd-elf)
        !          1517:          major=".$current"
        !          1518:          versuffix=".$current";
        !          1519:          ;;
        !          1520: 
        !          1521:        windows)
        !          1522:          # Like Linux, but with '-' rather than '.', since we only
        !          1523:          # want one extension on Windows 95.
        !          1524:          major=`expr $current - $age`
        !          1525:          versuffix="-$major-$age-$revision"
        !          1526:          ;;
        !          1527: 
1.3       frystyk  1528:        *)
                   1529:          $echo "$modename: unknown library version type \`$version_type'" 1>&2
                   1530:          echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
                   1531:          exit 1
                   1532:          ;;
                   1533:        esac
1.1       frystyk  1534: 
1.3       frystyk  1535:        # Clear the version info if we defaulted, and they specified a release.
                   1536:        if test -z "$vinfo" && test -n "$release"; then
                   1537:          major=
                   1538:          verstring="0.0"
1.4     ! frystyk  1539:          if test "$need_version" = no; then
        !          1540:            versuffix=
        !          1541:          else
        !          1542:            versuffix=".0.0"
        !          1543:          fi
1.3       frystyk  1544:        fi
1.1       frystyk  1545: 
1.4     ! frystyk  1546:        # Remove version info from name if versioning should be avoided
        !          1547:        if test "$avoid_version" = yes && test "$need_version" = no; then
        !          1548:          major=
        !          1549:          versuffix=
        !          1550:          verstring=""
        !          1551:        fi
        !          1552:        
1.3       frystyk  1553:        # Check to see if the archive will have undefined symbols.
                   1554:        if test "$allow_undefined" = yes; then
                   1555:          if test "$allow_undefined_flag" = unsupported; then
                   1556:            $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
                   1557:            build_libtool_libs=no
                   1558:            build_old_libs=yes
                   1559:          fi
                   1560:        else
                   1561:          # Don't allow undefined symbols.
                   1562:          allow_undefined_flag="$no_undefined_flag"
                   1563:        fi
1.1       frystyk  1564: 
1.3       frystyk  1565:        dependency_libs="$deplibs"
1.4     ! frystyk  1566:        case "$host" in
        !          1567:        *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
        !          1568:          # these systems don't actually have a c library (as such)!
        !          1569:          ;;
        !          1570:        *)
        !          1571:          # Add libc to deplibs on all other systems.
        !          1572:          deplibs="$deplibs -lc"
        !          1573:          ;;
        !          1574:        esac
1.3       frystyk  1575:       fi
1.1       frystyk  1576: 
                   1577:       # Create the output directory, or remove our outputs if we need to.
1.4     ! frystyk  1578:       if test -d $output_objdir; then
        !          1579:        $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
        !          1580:        $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1.1       frystyk  1581:       else
1.4     ! frystyk  1582:        $show "$mkdir $output_objdir"
        !          1583:        $run $mkdir $output_objdir
        !          1584:        status=$?
        !          1585:        if test $status -ne 0 && test ! -d $output_objdir; then
        !          1586:          exit $status
        !          1587:        fi
        !          1588:       fi
        !          1589: 
        !          1590:       # Now set the variables for building old libraries.
        !          1591:       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
        !          1592:        oldlibs="$oldlibs $output_objdir/$libname.$libext"
        !          1593: 
        !          1594:        # Transform .lo files to .o files.
        !          1595:        oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
        !          1596:       fi
        !          1597: 
        !          1598:       if test "$build_libtool_libs" = yes; then
        !          1599:        # Transform deplibs into only deplibs that can be linked in shared.
        !          1600:        ## Gordon: Do you check for the existence of the libraries in deplibs
        !          1601:        ## on the system?  That should maybe be merged in here someplace....
        !          1602:        ## Actually: I think test_compile and file_magic do this... file_regex
        !          1603:        ## sorta does this. Only pass_all needs to be changed.  -Toshio
        !          1604:        name_save=$name
        !          1605:        libname_save=$libname
        !          1606:        release_save=$release
        !          1607:        versuffix_save=$versuffix
        !          1608:        major_save=$major
        !          1609:        # I'm not sure if I'm treating the release correctly.  I think
        !          1610:        # release should show up in the -l (ie -lgmp5) so we don't want to
        !          1611:        # add it in twice.  Is that correct?
        !          1612:        release=""
        !          1613:        versuffix=""
        !          1614:        major=""
        !          1615:        newdeplibs=
        !          1616:        droppeddeps=no
        !          1617:        case "$deplibs_check_method" in
        !          1618:        pass_all)
        !          1619:          newdeplibs=$deplibs
        !          1620:                    ;; # Don't check for shared/static.  Everything works.
        !          1621:                       # This might be a little naive.  We might want to check
        !          1622:                       # whether the library exists or not.  But this is on
        !          1623:                       # osf3 & osf4 and I'm not really sure... Just
        !          1624:                       # implementing what was already the behaviour.
        !          1625:        test_compile)
        !          1626:          # This code stresses the "libraries are programs" paradigm to its
        !          1627:          # limits. Maybe even breaks it.  We compile a program, linking it
        !          1628:          # against the deplibs as a proxy for the library.  Then we can check
        !          1629:          # whether they linked in statically or dynamically with ldd.
        !          1630:          $rm conftest.c
        !          1631:          cat > conftest.c <<EOF
        !          1632:          int main() { return 0; }
        !          1633: EOF
        !          1634:          $rm conftest
        !          1635:          $C_compiler -o conftest conftest.c $deplibs
        !          1636:          if test $? -eq 0 ; then
        !          1637:            ldd_output=`ldd conftest`
        !          1638:            for i in $deplibs; do
        !          1639:              name="`expr $i : '-l\(.*\)'`"
        !          1640:              # If $name is empty we are operating on a -L argument.
        !          1641:              if test "$name" != "" ; then
        !          1642:                libname=`eval \\$echo \"$libname_spec\"`
        !          1643:                deplib_matches=`eval \\$echo \"$library_names_spec\"`
        !          1644:                set dummy $deplib_matches
        !          1645:                deplib_match=$2
        !          1646:                if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
        !          1647:                  newdeplibs="$newdeplibs $i"
        !          1648:                else
        !          1649:                  droppeddeps=yes
        !          1650:                  echo
        !          1651:                  echo "*** Warning: This library needs some functionality provided by $i."
        !          1652:                  echo "*** I have the capability to make that library automatically link in when"
        !          1653:                  echo "*** you link to this library.  But I can only do this if you have a"
        !          1654:                  echo "*** shared version of the library, which you do not appear to have."
        !          1655:                fi
        !          1656:              else
        !          1657:                newdeplibs="$newdeplibs $i"
        !          1658:              fi
        !          1659:            done
        !          1660:          else
        !          1661:            # Error occured in the first compile.  Let's try to salvage the situation:
        !          1662:            # Compile a seperate program for each library.
        !          1663:            for i in $deplibs; do
        !          1664:              name="`expr $i : '-l\(.*\)'`"
        !          1665:             # If $name is empty we are operating on a -L argument.
        !          1666:              if test "$name" != "" ; then
        !          1667:                $rm conftest
        !          1668:                $C_compiler -o conftest conftest.c $i
        !          1669:                # Did it work?
        !          1670:                if test $? -eq 0 ; then
        !          1671:                  ldd_output=`ldd conftest`
        !          1672:                    libname=`eval \\$echo \"$libname_spec\"`
        !          1673:                    deplib_matches=`eval \\$echo \"$library_names_spec\"`
        !          1674:                    set dummy $deplib_matches
        !          1675:                    deplib_match=$2
        !          1676:                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
        !          1677:                      newdeplibs="$newdeplibs $i"
        !          1678:                    else
        !          1679:                      droppeddeps=yes
        !          1680:                      echo
        !          1681:                      echo "*** Warning: This library needs some functionality provided by $i."
        !          1682:                      echo "*** I have the capability to make that library automatically link in when"
        !          1683:                      echo "*** you link to this library.  But I can only do this if you have a"
        !          1684:                      echo "*** shared version of the library, which you do not appear to have."
        !          1685:                    fi
        !          1686:                else
        !          1687:                  droppeddeps=yes
        !          1688:                  echo
        !          1689:                  echo "*** Warning!  Library $i is needed by this library but I was not able to"
        !          1690:                  echo "***  make it link in!  You will probably need to install it or some"
        !          1691:                  echo "*** library that it depends on before this library will be fully"
        !          1692:                  echo "*** functional.  Installing it before continuing would be even better."
        !          1693:                fi
        !          1694:              else
        !          1695:                newdeplibs="$newdeplibs $i"
        !          1696:              fi
        !          1697:            done
        !          1698:          fi
        !          1699:          deplibs=$newdeplibs
        !          1700:          ;;
        !          1701:        file_magic* | file_regex)
        !          1702:          set dummy $deplibs_check_method
        !          1703:          file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
        !          1704:          for a_deplib in $deplibs; do
        !          1705:            name="`expr $a_deplib : '-l\(.*\)'`"
        !          1706:            # If $name is empty we are operating on a -L argument.
        !          1707:            if test "$name" != "" ; then
        !          1708:              libname=`eval \\$echo \"$libname_spec\"`
        !          1709:              case "$deplibs_check_method" in
        !          1710:                file_magic*)
        !          1711:                  for i in $lib_search_path; do
        !          1712:                   # This needs to be more general than file_regex in order to
        !          1713:                   # catch things like glibc on linux.  Maybe file_regex
        !          1714:                   # should be more general as well, but maybe not.  Since
        !          1715:                   # library names are supposed to conform to
        !          1716:                   # library_name_spec, I think file_regex should remain
        !          1717:                   # strict.  What do you think Gordon?
        !          1718:                    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
        !          1719:                    for potent_lib in $potential_libs; do
        !          1720:                      # Follow soft links.
        !          1721:                      if ls -lLd "$potlib" 2>/dev/null \
        !          1722:                         | grep " -> " >/dev/null; then
        !          1723:                        continue 
        !          1724:                      fi
        !          1725:                      # The statement above tries to avoid entering an
        !          1726:                      # endless loop below, in case of cyclic links.
        !          1727:                      # We might still enter an endless loop, since a link
        !          1728:                      # loop can be closed while we follow links,
        !          1729:                      # but so what?
        !          1730:                      potlib="$potent_lib"
        !          1731:                      while test -h "$potlib" 2>/dev/null; do
        !          1732:                        potliblink=`ls -ld $potlib | sed 's/.* -> //'`
        !          1733:                        case "$potliblink" in
        !          1734:                        /*) potlib="$potliblink";;
        !          1735:                        *) potlib=`$echo "X$potlib" \
        !          1736:                                   | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
        !          1737:                        esac
        !          1738:                      done
        !          1739:                      file_output=`eval $file_magic_command \"\$potlib\" \
        !          1740:                                   | sed '11,$d'`
        !          1741:                      if test `expr "X$file_output" : "X.*$file_magic_regex"` -ne 0 ; then
        !          1742:                        newdeplibs="$newdeplibs $a_deplib"
        !          1743:                        a_deplib=""
        !          1744:                        break 2
        !          1745:                      fi
        !          1746:                    done
        !          1747:                  done
        !          1748:                  ;;
        !          1749:                file_regex)
        !          1750:                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
        !          1751:                  set dummy $deplib_matches
        !          1752:                  deplib_match=$2
        !          1753:                  for i in $lib_search_path; do
        !          1754:                    potential_libs=`ls $i/$deplib_match* 2>/dev/null`
        !          1755:                    if test "$potential_libs" != "" ; then
        !          1756:                      newdeplibs="$newdeplibs $a_deplib"
        !          1757:                      a_deplib=""
        !          1758:                      break
        !          1759:                    fi
        !          1760:                  done
        !          1761:                  ;;
        !          1762:              esac
        !          1763:              if test -n "$a_deplib" ; then
        !          1764:                droppeddeps=yes
        !          1765:                echo
        !          1766:                echo "*** Warning: This library needs some functionality provided by $a_deplib."
        !          1767:                echo "*** I have the capability to make that library automatically link in when"
        !          1768:                echo "*** you link to this library.  But I can only do this if you have a"
        !          1769:                echo "*** shared version of the library, which you do not appear to have."
        !          1770:              fi
        !          1771:            else
        !          1772:              # Add a -L argument.
        !          1773:              newdeplibs="$newdeplibs $a_deplib"
        !          1774:            fi
        !          1775:          done # Gone through all deplibs.
        !          1776:          ;;
        !          1777:        none | unknown | *) newdeplibs=""; droppeddeps=yes ;;
        !          1778:        esac
        !          1779:        versuffix=$versuffix_save
        !          1780:        major=$major_save
        !          1781:        release=$release_save
        !          1782:        libname=$libname_save
        !          1783:        name=$name_save
        !          1784: 
        !          1785:        if test "$module,$droppeddeps" = "yes,yes"; then
        !          1786:          echo
        !          1787:          echo "*** Warning: libtool could not satisfy all dependencies of module $libname"
        !          1788:          echo "*** Therefore, instead of creating a dynamic module that would not run, "
        !          1789:          echo "*** libtool will create a static module.  As long as the dlopening"
        !          1790:          echo "*** application is linked with the -dlopen flag, this should be enough."
        !          1791:          if test -z "$global_symbol_pipe"; then
        !          1792:            echo
        !          1793:            echo "*** However, this would only work if libtool was able to extract symbol"
        !          1794:            echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
        !          1795:            echo "*** not find such a program.  So, this module is mostly useless."
        !          1796:          fi
        !          1797:          if test "$build_old_libs" = no; then
        !          1798:            oldlibs="$output_objdir/$libname.$libext"
        !          1799:            build_libtool_libs=module
        !          1800:            build_old_libs=yes
        !          1801:          else
        !          1802:            build_libtool_libs=no
        !          1803:          fi
        !          1804:          dlname=
        !          1805:          library_names=
        !          1806:        fi
1.1       frystyk  1807:       fi
                   1808: 
1.4     ! frystyk  1809:       # test again, we may have decided not to build it any more
1.1       frystyk  1810:       if test "$build_libtool_libs" = yes; then
1.4     ! frystyk  1811:        deplibs=$newdeplibs
        !          1812:        # Done checking deplibs!
        !          1813:  
1.3       frystyk  1814:        # Get the real and link names of the library.
                   1815:        eval library_names=\"$library_names_spec\"
                   1816:        set dummy $library_names
                   1817:        realname="$2"
                   1818:        shift; shift
1.1       frystyk  1819: 
1.3       frystyk  1820:        if test -n "$soname_spec"; then
                   1821:          eval soname=\"$soname_spec\"
                   1822:        else
                   1823:          soname="$realname"
                   1824:        fi
1.1       frystyk  1825: 
1.4     ! frystyk  1826:        lib="$output_objdir/$realname"
1.1       frystyk  1827:        for link
                   1828:        do
                   1829:          linknames="$linknames $link"
                   1830:        done
                   1831: 
1.3       frystyk  1832:        # Use standard objects if they are PIC.
1.4     ! frystyk  1833:        test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
1.3       frystyk  1834: 
                   1835:        if test -n "$whole_archive_flag_spec"; then
                   1836:          if test -n "$convenience"; then
                   1837:            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
                   1838:          fi
                   1839:        else
                   1840:          for xlib in $convenience; do
                   1841:            # Extract the objects.
                   1842:            xdir="$xlib"x
                   1843:            generated="$generated $xdir"
                   1844:            xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
                   1845: 
                   1846:            $show "${rm}r $xdir"
                   1847:            $run ${rm}r "$xdir"
                   1848:            $show "mkdir $xdir"
                   1849:            $run mkdir "$xdir"
                   1850:            status=$?
                   1851:            if test $status -ne 0 && test ! -d "$xdir"; then
                   1852:              exit $status
                   1853:            fi
                   1854:            $show "(cd $xdir && $AR x ../$xlib)"
                   1855:            $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
1.1       frystyk  1856: 
1.4     ! frystyk  1857:            libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
1.3       frystyk  1858:          done
                   1859:        fi
                   1860: 
                   1861:        # Do each of the archive commands.
1.4     ! frystyk  1862:        if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
        !          1863:          eval cmds=\"$archive_sym_cmds\"
        !          1864:        else
        !          1865:          eval cmds=\"$archive_cmds\"
        !          1866:        fi
        !          1867:        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
1.3       frystyk  1868:        for cmd in $cmds; do
                   1869:          IFS="$save_ifs"
                   1870:          $show "$cmd"
                   1871:          $run eval "$cmd" || exit $?
                   1872:        done
                   1873:        IFS="$save_ifs"
1.1       frystyk  1874: 
1.3       frystyk  1875:        # Create links to the real library.
                   1876:        for linkname in $linknames; do
                   1877:          if test "$realname" != "$linkname"; then
1.4     ! frystyk  1878:            $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
        !          1879:            $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
1.3       frystyk  1880:          fi
                   1881:        done
1.1       frystyk  1882: 
1.4     ! frystyk  1883:        # If -module or -export-dynamic was specified, set the dlname.
        !          1884:        if test "$module" = yes || test "$export_dynamic" = yes; then
1.3       frystyk  1885:          # On all known operating systems, these are identical.
                   1886:          dlname="$soname"
                   1887:        fi
1.1       frystyk  1888:       fi
                   1889:       ;;
                   1890: 
1.4     ! frystyk  1891:     *.lo | *.o | *.obj)
1.1       frystyk  1892:       if test -n "$link_against_libtool_libs"; then
1.4     ! frystyk  1893:        $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
        !          1894:        exit 1
1.1       frystyk  1895:       fi
                   1896: 
                   1897:       if test -n "$deplibs"; then
1.4     ! frystyk  1898:        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
1.1       frystyk  1899:       fi
                   1900: 
1.2       frystyk  1901:       if test -n "$dlfiles$dlprefiles"; then
1.4     ! frystyk  1902:        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
1.2       frystyk  1903:       fi
                   1904: 
                   1905:       if test -n "$rpath"; then
1.4     ! frystyk  1906:        $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
        !          1907:       fi
        !          1908: 
        !          1909:       if test -n "$xrpath"; then
        !          1910:        $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
1.1       frystyk  1911:       fi
                   1912: 
                   1913:       if test -n "$vinfo"; then
1.4     ! frystyk  1914:        $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
1.2       frystyk  1915:       fi
                   1916: 
                   1917:       if test -n "$release"; then
1.4     ! frystyk  1918:        $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
1.1       frystyk  1919:       fi
                   1920: 
                   1921:       case "$output" in
                   1922:       *.lo)
1.4     ! frystyk  1923:        if test -n "$objs"; then
        !          1924:          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
        !          1925:          exit 1
        !          1926:        fi
        !          1927:        libobj="$output"
        !          1928:        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
        !          1929:        ;;
1.1       frystyk  1930:       *)
1.4     ! frystyk  1931:        libobj=
        !          1932:        obj="$output"
        !          1933:        ;;
1.1       frystyk  1934:       esac
                   1935: 
                   1936:       # Delete the old objects.
                   1937:       $run $rm $obj $libobj
                   1938: 
                   1939:       # Create the old-style object.
1.4     ! frystyk  1940:       reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
1.1       frystyk  1941: 
                   1942:       output="$obj"
1.3       frystyk  1943:       eval cmds=\"$reload_cmds\"
1.4     ! frystyk  1944:       IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
1.1       frystyk  1945:       for cmd in $cmds; do
1.4     ! frystyk  1946:        IFS="$save_ifs"
        !          1947:        $show "$cmd"
        !          1948:        $run eval "$cmd" || exit $?
1.1       frystyk  1949:       done
                   1950:       IFS="$save_ifs"
                   1951: 
                   1952:       # Exit if we aren't doing a library object file.
                   1953:       test -z "$libobj" && exit 0
                   1954: 
                   1955:       if test "$build_libtool_libs" != yes; then
1.4     ! frystyk  1956:        # Create an invalid libtool object if no PIC, so that we don't
        !          1957:        # accidentally link it into a program.
        !          1958:        $show "echo timestamp > $libobj"
        !          1959:        $run eval "echo timestamp > $libobj" || exit $?
        !          1960:        exit 0
1.1       frystyk  1961:       fi
                   1962: 
                   1963:       if test -n "$pic_flag"; then
1.4     ! frystyk  1964:        # Only do commands if we really have different PIC objects.
        !          1965:        reload_objs="$libobjs"
        !          1966:        output="$libobj"
        !          1967:        eval cmds=\"$reload_cmds\"
        !          1968:        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
        !          1969:        for cmd in $cmds; do
        !          1970:          IFS="$save_ifs"
        !          1971:          $show "$cmd"
        !          1972:          $run eval "$cmd" || exit $?
        !          1973:        done
        !          1974:        IFS="$save_ifs"
1.1       frystyk  1975:       else
1.4     ! frystyk  1976:        # Just create a symlink.
        !          1977:        $show $rm $libobj
        !          1978:        $run $rm $libobj
        !          1979:        $show "$LN_S $obj $libobj"
        !          1980:        $run $LN_S $obj $libobj || exit $?
1.1       frystyk  1981:       fi
                   1982: 
                   1983:       exit 0
                   1984:       ;;
                   1985: 
1.4     ! frystyk  1986:     # Anything else should be a program.
1.1       frystyk  1987:     *)
1.2       frystyk  1988:       if test -n "$vinfo"; then
1.4     ! frystyk  1989:        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
1.1       frystyk  1990:       fi
                   1991: 
1.2       frystyk  1992:       if test -n "$release"; then
1.4     ! frystyk  1993:        $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
1.1       frystyk  1994:       fi
                   1995: 
1.4     ! frystyk  1996:       if test -n "$rpath$xrpath"; then
1.2       frystyk  1997:        # If the user specified any rpath flags, then add them.
1.4     ! frystyk  1998:        for libdir in $rpath $xrpath; do
        !          1999:          if test -n "$hardcode_libdir_flag_spec"; then
        !          2000:            saved_libdir="$libdir"
        !          2001:            if test -n "$hardcode_libdir_separator"; then
        !          2002:              if test -z "$hardcode_libdirs"; then
        !          2003:                # Put the magic libdir with the hardcode flag.
        !          2004:                hardcode_libdirs="$libdir"
        !          2005:                libdir="@HARDCODE_LIBDIRS@"
        !          2006:              else
        !          2007:                # Just accumulate the unique libdirs.
1.2       frystyk  2008:                case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
                   2009:                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
                   2010:                  ;;
                   2011:                *)
                   2012:                  hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
                   2013:                  ;;
                   2014:                esac
1.4     ! frystyk  2015:                libdir=
        !          2016:              fi
        !          2017:            fi
        !          2018: 
        !          2019:            if test -n "$libdir"; then
        !          2020:              eval flag=\"$hardcode_libdir_flag_spec\"
        !          2021: 
        !          2022:              compile_command="$compile_command $flag"
        !          2023:            fi
        !          2024: 
        !          2025:            libdir="$saved_libdir"
        !          2026:            if test -n "$hardcode_libdir_separator"; then
        !          2027:              if test -z "$finalize_hardcode_libdirs"; then
        !          2028:                # Put the magic libdir with the hardcode flag.
        !          2029:                finalize_hardcode_libdirs="$libdir"
        !          2030:                libdir="@HARDCODE_LIBDIRS@"
        !          2031:              else
        !          2032:                # Just accumulate the unique libdirs.
        !          2033:                case "$hardcode_libdir_separator$finalize_hardcode_libdirs$hardcode_libdir_separator" in
        !          2034:                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
        !          2035:                  ;;
        !          2036:                *)
        !          2037:                  finalize_hardcode_libdirs="$finalize_hardcode_libdirs$hardcode_libdir_separator$libdir"
        !          2038:                  ;;
        !          2039:                esac
        !          2040:                libdir=
        !          2041:              fi
        !          2042:            fi
        !          2043: 
        !          2044:            if test -n "$libdir"; then
        !          2045:              eval flag=\"$hardcode_libdir_flag_spec\"
        !          2046: 
        !          2047:              finalize_command="$finalize_command $flag"
        !          2048:            fi
        !          2049:          elif test -n "$runpath_var"; then
        !          2050:            case "$perm_rpath " in
        !          2051:            *" $libdir "*) ;;
        !          2052:            *) perm_rpath="$perm_rpath $libdir" ;;
        !          2053:            esac
        !          2054:            case "$finalize_perm_rpath " in
        !          2055:            *" $libdir "*) ;;
        !          2056:            *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
        !          2057:            esac
        !          2058:          fi
1.2       frystyk  2059:        done
1.1       frystyk  2060:       fi
                   2061: 
1.2       frystyk  2062:       # Substitute the hardcoded libdirs into the compile commands.
                   2063:       if test -n "$hardcode_libdir_separator"; then
                   2064:        compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1.4     ! frystyk  2065:        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$finalize_hardcode_libdirs%g"`
        !          2066:       fi
        !          2067: 
        !          2068:       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
        !          2069:       if test "X$output_objdir" = "X$output"; then
        !          2070:        output_objdir="$objdir"
        !          2071:       else
        !          2072:        output_objdir="$output_objdir/$objdir"
1.2       frystyk  2073:       fi
                   2074: 
                   2075:       if test -n "$libobjs" && test "$build_old_libs" = yes; then
1.4     ! frystyk  2076:        # Transform all the library objects into standard objects.
        !          2077:        compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
        !          2078:        finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
1.2       frystyk  2079:       fi
                   2080: 
1.4     ! frystyk  2081:       if test "$export_dynamic" = yes || test -n "$dlfiles$dlprefiles" && test -n "$NM" && test -n "$global_symbol_pipe"; then
        !          2082:        dlsyms="${outputname}S.c"
1.2       frystyk  2083:       else
1.4     ! frystyk  2084:        dlsyms=
1.2       frystyk  2085:       fi
                   2086: 
                   2087:       if test -n "$dlsyms"; then
1.4     ! frystyk  2088:        case "$dlsyms" in
        !          2089:        "") ;;
        !          2090:        *.c)
        !          2091:          if test "$export_dynamic" = yes && test -z "$export_symbols"; then
        !          2092:            # Add our own program objects to the preloaded list.
        !          2093:            dlprefiles=`$echo "X$objs $dlprefiles" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
        !          2094:          fi
1.2       frystyk  2095: 
1.4     ! frystyk  2096:          # Discover the nlist of each of the dlfiles.
        !          2097:          nlist="$objdir/${output}.nm"
1.1       frystyk  2098: 
1.4     ! frystyk  2099:          if test -d $objdir; then
        !          2100:            $show "$rm $nlist ${nlist}T"
        !          2101:            $run $rm "$nlist" "${nlist}T"
        !          2102:          else
        !          2103:            $show "$mkdir $objdir"
        !          2104:            $run $mkdir $objdir
        !          2105:            status=$?
        !          2106:            if test $status -ne 0 && test ! -d $objdir; then
        !          2107:              exit $status
        !          2108:            fi
1.2       frystyk  2109:          fi
                   2110: 
1.4     ! frystyk  2111:          # Parse the name list into a source file.
        !          2112:          $show "creating $objdir/$dlsyms"
1.2       frystyk  2113: 
1.4     ! frystyk  2114:          $echo > "$objdir/$dlsyms" "\
        !          2115: /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
        !          2116: /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
1.2       frystyk  2117: 
                   2118: #ifdef __cplusplus
                   2119: extern \"C\" {
                   2120: #endif
                   2121: 
                   2122: /* Prevent the only kind of declaration conflicts we can make. */
1.4     ! frystyk  2123: #define lt_preloaded_symbols some_other_symbol
1.2       frystyk  2124: 
1.3       frystyk  2125: /* External symbol declarations for the compiler. */\
                   2126: "
1.2       frystyk  2127: 
1.4     ! frystyk  2128:          if test "$export_dynamic" = yes && test -n "$export_symbols"; then
        !          2129:            sed -e 's/^\(.*\)/\1 \1/' < "$export_symbols" > "$nlist"
        !          2130:          fi
        !          2131: 
        !          2132:          for arg in $dlprefiles; do
        !          2133:            $show "extracting global C symbols from \`$arg'"
        !          2134:            $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
        !          2135:          done
        !          2136: 
        !          2137:          if test -z "$run"; then
        !          2138:            # Make sure we have at least an empty file.
        !          2139:            test -f "$nlist" || : > "$nlist"
        !          2140: 
        !          2141:            # Try sorting and uniquifying the output.
        !          2142:            if sort "$nlist" | uniq > "$nlist"T; then
        !          2143:              mv -f "$nlist"T "$nlist"
        !          2144:            else
        !          2145:              $rm "$nlist"T
        !          2146:            fi
        !          2147: 
1.2       frystyk  2148:            if test -f "$nlist"; then
1.4     ! frystyk  2149:              sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms"
1.2       frystyk  2150:            else
1.4     ! frystyk  2151:              echo '/* NONE */' >> "$output_objdir/$dlsyms"
1.2       frystyk  2152:            fi
                   2153: 
1.4     ! frystyk  2154:            $echo >> "$output_objdir/$dlsyms" "\
1.3       frystyk  2155: 
1.4     ! frystyk  2156: #undef lt_preloaded_symbols
1.2       frystyk  2157: 
                   2158: #if defined (__STDC__) && __STDC__
1.4     ! frystyk  2159: # define lt_ptr_t void *
1.2       frystyk  2160: #else
1.4     ! frystyk  2161: # define lt_ptr_t char *
        !          2162: # define const
1.2       frystyk  2163: #endif
                   2164: 
                   2165: /* The mapping between symbol names and symbols. */
1.4     ! frystyk  2166: const struct {
        !          2167:   const char *name;
        !          2168:   lt_ptr_t address;
1.2       frystyk  2169: }
1.4     ! frystyk  2170: lt_preloaded_symbols[] =
1.3       frystyk  2171: {\
                   2172: "
1.2       frystyk  2173: 
1.4     ! frystyk  2174:            if test "$export_dynamic" = yes && test -n "$export_symbols"; then
        !          2175:              echo >> "$output_objdir/$dlsyms" "\
        !          2176:   {\"${output}\", (lt_ptr_t) 0},"
        !          2177:              sed 's/^\(.*\)/  {"\1", (lt_ptr_t) \&\1},/' < "$export_symbols" >> "$output_objdir/$dlsyms"
1.2       frystyk  2178:            fi
                   2179: 
1.4     ! frystyk  2180:            for arg in $dlprefiles; do
        !          2181:              name=`echo "$arg" | sed -e 's%^.*/%%'`
        !          2182:              echo >> "$output_objdir/$dlsyms" "\
        !          2183:   {\"$name\", (lt_ptr_t) 0},"
        !          2184:              eval "$NM $arg | $global_symbol_pipe > '$nlist'"
        !          2185: 
        !          2186:              if test -f "$nlist"; then
        !          2187:                sed 's/^\(.*\) \(.*\)$/  {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
        !          2188:              else
        !          2189:                echo '/* NONE */' >> "$output_objdir/$dlsyms"
        !          2190:              fi
        !          2191:            done
        !          2192: 
        !          2193:            $echo >> "$output_objdir/$dlsyms" "\
        !          2194:   {0, (lt_ptr_t) 0}
1.2       frystyk  2195: };
                   2196: 
1.4     ! frystyk  2197: /* This works around a problem in FreeBSD linker */
        !          2198: static const void *lt_preloaded_setup() {
        !          2199:   return lt_preloaded_symbols;
        !          2200: }
        !          2201: 
1.2       frystyk  2202: #ifdef __cplusplus
                   2203: }
1.3       frystyk  2204: #endif\
                   2205: "
1.4     ! frystyk  2206:          fi
1.2       frystyk  2207: 
1.4     ! frystyk  2208:          # Now compile the dynamic symbol file.
        !          2209:          # pic_flag works around a bug in FreeBSD linker
        !          2210:          $show "(cd $objdir && $C_compiler -c$no_builtin_flag $pic_flag -DPIC \"$dlsyms\")"
        !          2211:          $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag $pic_flag -DPIC "$dlsyms")' || exit $?
        !          2212: 
        !          2213:          # Transform the symbol file into the correct name.
        !          2214:          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
        !          2215:          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
        !          2216:          ;;
        !          2217:        *)
        !          2218:          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
        !          2219:          exit 1
        !          2220:          ;;
        !          2221:        esac
        !          2222:       else
        !          2223:        # We keep going just in case the user didn't refer to
        !          2224:        # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
        !          2225:        # really was required.
        !          2226:        if test -n "$dlfiles$dlprefiles"; then
        !          2227:          $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
        !          2228:        fi
1.2       frystyk  2229: 
1.4     ! frystyk  2230:        # Nullify the symbol file.
        !          2231:        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
        !          2232:        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1.2       frystyk  2233:       fi
                   2234: 
                   2235:       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
1.4     ! frystyk  2236:        # Replace the output file specification.
        !          2237:        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
        !          2238:        finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
        !          2239: 
        !          2240:        # We have no uninstalled library dependencies, so finalize right now.
        !          2241:        $show "$compile_command"
        !          2242:        $run eval "$compile_command"
        !          2243:        exit $?
1.1       frystyk  2244:       fi
                   2245: 
                   2246:       # Replace the output file specification.
1.4     ! frystyk  2247:       compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
        !          2248:       finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'`
1.1       frystyk  2249: 
                   2250:       # Create the binary in the object directory, then wrap it.
1.4     ! frystyk  2251:       if test ! -d $output_objdir; then
        !          2252:        $show "$mkdir $output_objdir"
        !          2253:        $run $mkdir $output_objdir
1.2       frystyk  2254:        status=$?
1.3       frystyk  2255:        if test $status -ne 0 && test ! -d $objdir; then
1.2       frystyk  2256:          exit $status
                   2257:        fi
1.1       frystyk  2258:       fi
                   2259: 
                   2260:       if test -n "$shlibpath_var"; then
1.4     ! frystyk  2261:        # We should set the shlibpath_var
        !          2262:        rpath=
        !          2263:        for dir in $temp_rpath; do
        !          2264:          case "$dir" in
        !          2265:          /* | [A-Za-z]:[/\\]*)
        !          2266:            # Absolute path.
        !          2267:            rpath="$rpath$dir:"
        !          2268:            ;;
        !          2269:          *)
        !          2270:            # Relative path: add a thisdir entry.
        !          2271:            rpath="$rpath\$thisdir/$dir:"
        !          2272:            ;;
        !          2273:          esac
        !          2274:        done
        !          2275:        temp_rpath="$rpath"
1.1       frystyk  2276:       fi
                   2277: 
                   2278:       # Delete the old output file.
                   2279:       $run $rm $output
                   2280: 
                   2281:       if test -n "$compile_shlibpath"; then
1.4     ! frystyk  2282:        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1.1       frystyk  2283:       fi
                   2284:       if test -n "$finalize_shlibpath"; then
1.4     ! frystyk  2285:        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1.1       frystyk  2286:       fi
                   2287: 
1.4     ! frystyk  2288:       if test -n "$runpath_var"; then
        !          2289:         if test -n "$perm_rpath"; then
        !          2290:          # We should set the runpath_var.
        !          2291:          rpath=
        !          2292:          for dir in $perm_rpath; do
        !          2293:            rpath="$rpath$dir:"
        !          2294:          done
        !          2295:          compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
        !          2296:        fi
        !          2297:         if test -n "$finalize_perm_rpath"; then
        !          2298:          # We should set the runpath_var.
        !          2299:          rpath=
        !          2300:          for dir in $finalize_perm_rpath; do
        !          2301:            rpath="$rpath$dir:"
        !          2302:          done
        !          2303:          finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
        !          2304:        fi
1.1       frystyk  2305:       fi
                   2306: 
1.3       frystyk  2307:       if test "$hardcode_action" = relink; then
1.4     ! frystyk  2308:        # AGH! Flame the AIX and HP-UX people for me, will ya?
        !          2309:        $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
        !          2310:        $echo "$modename: \`$output' will be relinked during installation" 1>&2
1.3       frystyk  2311:       fi
1.1       frystyk  2312: 
                   2313:       $show "$compile_command"
                   2314:       $run eval "$compile_command" || exit $?
                   2315: 
                   2316:       # Now create the wrapper script.
1.2       frystyk  2317:       $show "creating $output"
                   2318: 
                   2319:       # Quote the finalize command for shipping.
                   2320:       finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
                   2321: 
                   2322:       # Quote $echo for shipping.
1.4     ! frystyk  2323:       if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
        !          2324:        case "$0" in
        !          2325:        /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";;
        !          2326:        *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
        !          2327:        esac
        !          2328:        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
        !          2329:       else
        !          2330:        qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
        !          2331:       fi
1.1       frystyk  2332: 
                   2333:       # Only actually do things if our run command is non-null.
                   2334:       if test -z "$run"; then
1.4     ! frystyk  2335:        # win32 will think the script is a binary if it has
        !          2336:        # a .exe suffix, so we strip it off here.
        !          2337:        case $output in
        !          2338:          *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
        !          2339:        esac
        !          2340:        $rm $output
        !          2341:        trap "$rm $output; exit 1" 1 2 15
1.1       frystyk  2342: 
1.4     ! frystyk  2343:        $echo > $output "\
1.3       frystyk  2344: #! $SHELL
1.1       frystyk  2345: 
1.4     ! frystyk  2346: # $output - temporary wrapper script for $objdir/$outputname
        !          2347: # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1.1       frystyk  2348: #
                   2349: # The $output program cannot be directly executed until all the libtool
                   2350: # libraries that it depends on are installed.
                   2351: #
1.4     ! frystyk  2352: # This wrapper script should never be moved out of the build directory.
1.1       frystyk  2353: # If it is, it will not operate correctly.
                   2354: 
1.2       frystyk  2355: # Sed substitution that helps us do robust quoting.  It backslashifies
                   2356: # metacharacters that are still active within double-quoted strings.
1.4     ! frystyk  2357: Xsed='sed -e 1s/^X//'
1.2       frystyk  2358: sed_quote_subst='$sed_quote_subst'
                   2359: 
                   2360: # The HP-UX ksh and POSIX shell print the target directory to stdout
                   2361: # if CDPATH is set.
                   2362: if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
                   2363: 
1.1       frystyk  2364: # This environment variable determines our operation mode.
1.2       frystyk  2365: if test \"\$libtool_install_magic\" = \"$magic\"; then
1.1       frystyk  2366:   # install mode needs the following variables:
                   2367:   link_against_libtool_libs='$link_against_libtool_libs'
1.4     ! frystyk  2368:   finalize_command=\"cd `pwd | sed -e $sed_quote_subst`; $finalize_command\"
1.1       frystyk  2369: else
1.2       frystyk  2370:   # When we are sourced in execute mode, \$file and \$echo are already set.
1.3       frystyk  2371:   if test \"\$libtool_execute_magic\" != \"$magic\"; then
1.2       frystyk  2372:     echo=\"$qecho\"
                   2373:     file=\"\$0\"
1.3       frystyk  2374:     # Make sure echo works.
                   2375:     if test \"X\$1\" = X--no-reexec; then
                   2376:       # Discard the --no-reexec flag, and continue.
                   2377:       shift
                   2378:     elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
                   2379:       # Yippee, \$echo works!
                   2380:       :
                   2381:     else
                   2382:       # Restart under the correct shell, and then maybe \$echo will work.
                   2383:       exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
                   2384:     fi
                   2385:   fi\
                   2386: "
1.4     ! frystyk  2387:        $echo >> $output "\
1.2       frystyk  2388: 
1.1       frystyk  2389:   # Find the directory that this script lives in.
1.2       frystyk  2390:   thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
                   2391:   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
1.1       frystyk  2392: 
1.2       frystyk  2393:   # Follow symbolic links until we get to the real thisdir.
                   2394:   file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
                   2395:   while test -n \"\$file\"; do
                   2396:     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
                   2397: 
                   2398:     # If there was a directory component, then change thisdir.
                   2399:     if test \"x\$destdir\" != \"x\$file\"; then
                   2400:       case \"\$destdir\" in
1.3       frystyk  2401:       /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;;
1.2       frystyk  2402:       *) thisdir=\"\$thisdir/\$destdir\" ;;
                   2403:       esac
                   2404:     fi
1.1       frystyk  2405: 
1.2       frystyk  2406:     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
                   2407:     file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
                   2408:   done
1.1       frystyk  2409: 
1.2       frystyk  2410:   # Try to get the absolute directory name.
                   2411:   absdir=\`cd \"\$thisdir\" && pwd\`
                   2412:   test -n \"\$absdir\" && thisdir=\"\$absdir\"
1.1       frystyk  2413: 
1.2       frystyk  2414:   progdir=\"\$thisdir/$objdir\"
1.4     ! frystyk  2415:   program='$outputname'
1.1       frystyk  2416: 
1.2       frystyk  2417:   if test -f \"\$progdir/\$program\"; then"
1.1       frystyk  2418: 
1.4     ! frystyk  2419:        # Export our shlibpath_var if we have one.
        !          2420:        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
        !          2421:          $echo >> $output "\
1.3       frystyk  2422:     # Add our own library path to $shlibpath_var
1.2       frystyk  2423:     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
1.1       frystyk  2424: 
                   2425:     # Some systems cannot cope with colon-terminated $shlibpath_var
1.4     ! frystyk  2426:     # The second colon is a workaround for a bug in BeOS R4 sed
        !          2427:     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
1.1       frystyk  2428: 
                   2429:     export $shlibpath_var
1.2       frystyk  2430: "
1.4     ! frystyk  2431:        fi
        !          2432: 
        !          2433:        # fixup the dll searchpath if we need to.
        !          2434:        if test -n "$dllsearchpath"; then
        !          2435:          $echo >> $output "\
        !          2436:     # Add the dll search path components to the executable PATH
        !          2437:     PATH=$dllsearchpath:\$PATH
        !          2438: "
        !          2439:        fi
1.2       frystyk  2440: 
1.4     ! frystyk  2441:        $echo >> $output "\
1.3       frystyk  2442:     if test \"\$libtool_execute_magic\" != \"$magic\"; then
1.2       frystyk  2443:       # Run the actual program with our arguments.
1.4     ! frystyk  2444: "
        !          2445:        case $host in
        !          2446:        *-*-cygwin32* | *-*-mingw32 | *-*-os2*)
        !          2447:          # win32 systems need to use the prog path for dll
        !          2448:          # lookup to work
        !          2449:          $echo >> $output "\
        !          2450:       exec \$progdir\\\\\$program \${1+\"\$@\"}
        !          2451: "
        !          2452:          ;;
        !          2453:        *)
        !          2454:          $echo >> $output "\
1.2       frystyk  2455:       # Export the path to the program.
                   2456:       PATH=\"\$progdir:\$PATH\"
                   2457:       export PATH
1.1       frystyk  2458: 
1.3       frystyk  2459:       exec \$program \${1+\"\$@\"}
1.4     ! frystyk  2460: "
        !          2461:          ;;
        !          2462:        esac
        !          2463:        $echo >> $output "\
1.3       frystyk  2464:       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
1.2       frystyk  2465:       exit 1
                   2466:     fi
1.1       frystyk  2467:   else
                   2468:     # The program doesn't exist.
1.2       frystyk  2469:     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
                   2470:     \$echo \"This script is just a wrapper for \$program.\" 1>&2
                   2471:     echo \"See the $PACKAGE documentation for more information.\" 1>&2
1.1       frystyk  2472:     exit 1
                   2473:   fi
1.3       frystyk  2474: fi\
                   2475: "
1.4     ! frystyk  2476:        chmod +x $output
1.1       frystyk  2477:       fi
                   2478:       exit 0
                   2479:       ;;
                   2480:     esac
                   2481: 
                   2482:     # See if we need to build an old-fashioned archive.
1.3       frystyk  2483:     for oldlib in $oldlibs; do
                   2484: 
                   2485:       if test "$build_libtool_libs" = convenience; then
1.4     ! frystyk  2486:        oldobjs="$libobjs_save"
1.3       frystyk  2487:        addlibs="$convenience"
                   2488:        build_libtool_libs=no
                   2489:       else
1.4     ! frystyk  2490:        if test "$build_libtool_libs" = module; then
        !          2491:          oldobjs="$libobjs_save"
        !          2492:          build_libtool_libs=no
        !          2493:        else
        !          2494:          oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
        !          2495:        fi
1.3       frystyk  2496:        addlibs="$old_convenience"
                   2497:       fi
                   2498: 
                   2499:       # Add in members from convenience archives.
                   2500:       for xlib in $addlibs; do
                   2501:        # Extract the objects.
                   2502:        xdir="$xlib"x
                   2503:        generated="$generated $xdir"
                   2504:        xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
                   2505: 
                   2506:        $show "${rm}r $xdir"
                   2507:        $run ${rm}r "$xdir"
                   2508:        $show "mkdir $xdir"
                   2509:        $run mkdir "$xdir"
                   2510:        status=$?
                   2511:        if test $status -ne 0 && test ! -d "$xdir"; then
                   2512:          exit $status
                   2513:        fi
                   2514:        $show "(cd $xdir && $AR x ../$xlib)"
                   2515:        $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
                   2516: 
1.4     ! frystyk  2517:        oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
1.3       frystyk  2518:       done
1.1       frystyk  2519: 
1.2       frystyk  2520:       # Do each command in the archive commands.
                   2521:       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
1.3       frystyk  2522:        eval cmds=\"$old_archive_from_new_cmds\"
1.1       frystyk  2523:       else
1.3       frystyk  2524:        eval cmds=\"$old_archive_cmds\"
1.1       frystyk  2525:       fi
1.4     ! frystyk  2526:       IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
1.1       frystyk  2527:       for cmd in $cmds; do
1.4     ! frystyk  2528:        IFS="$save_ifs"
        !          2529:        $show "$cmd"
        !          2530:        $run eval "$cmd" || exit $?
1.1       frystyk  2531:       done
                   2532:       IFS="$save_ifs"
1.3       frystyk  2533:     done
                   2534: 
                   2535:     if test -n "$generated"; then
                   2536:       $show "${rm}r$generated"
                   2537:       $run ${rm}r$generated
1.1       frystyk  2538:     fi
                   2539: 
                   2540:     # Now create the libtool archive.
                   2541:     case "$output" in
                   2542:     *.la)
                   2543:       old_library=
1.4     ! frystyk  2544:       test "$build_old_libs" = yes && old_library="$libname.$libext"
1.2       frystyk  2545:       $show "creating $output"
1.1       frystyk  2546: 
                   2547:       # Only create the output if not a dry run.
                   2548:       if test -z "$run"; then
1.4     ! frystyk  2549:        $echo > $output "\
1.3       frystyk  2550: # $output - a libtool library file
1.4     ! frystyk  2551: # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1.1       frystyk  2552: 
                   2553: # The name that we can dlopen(3).
                   2554: dlname='$dlname'
                   2555: 
                   2556: # Names of this library.
                   2557: library_names='$library_names'
                   2558: 
                   2559: # The name of the static archive.
                   2560: old_library='$old_library'
                   2561: 
1.2       frystyk  2562: # Libraries that this one depends upon.
                   2563: dependency_libs='$dependency_libs'
                   2564: 
1.1       frystyk  2565: # Version information for $libname.
                   2566: current=$current
                   2567: age=$age
                   2568: revision=$revision
                   2569: 
1.4     ! frystyk  2570: # Is this an already installed library?
        !          2571: installed=no
        !          2572: 
1.1       frystyk  2573: # Directory that this library needs to be installed in:
1.3       frystyk  2574: libdir='$install_libdir'\
                   2575: "
1.1       frystyk  2576:       fi
                   2577: 
                   2578:       # Do a symbolic link so that the libtool archive can be found in
                   2579:       # LD_LIBRARY_PATH before the program is installed.
1.4     ! frystyk  2580:       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
        !          2581:       $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
1.1       frystyk  2582:       ;;
                   2583:     esac
                   2584:     exit 0
                   2585:     ;;
                   2586: 
                   2587:   # libtool install mode
                   2588:   install)
1.2       frystyk  2589:     modename="$modename: install"
                   2590: 
1.3       frystyk  2591:     # There may be an optional sh(1) argument at the beginning of
1.2       frystyk  2592:     # install_prog (especially on Windows NT).
1.4     ! frystyk  2593:     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
1.2       frystyk  2594:       # Aesthetically quote it.
                   2595:       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
                   2596:       case "$arg" in
                   2597:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
                   2598:        arg="\"$arg\""
                   2599:        ;;
                   2600:       esac
                   2601:       install_prog="$arg "
                   2602:       arg="$1"
                   2603:       shift
                   2604:     else
                   2605:       install_prog=
                   2606:       arg="$nonopt"
                   2607:     fi
1.1       frystyk  2608: 
1.2       frystyk  2609:     # The real first argument should be the name of the installation program.
                   2610:     # Aesthetically quote it.
                   2611:     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
                   2612:     case "$arg" in
                   2613:     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*)
                   2614:       arg="\"$arg\""
                   2615:       ;;
                   2616:     esac
                   2617:     install_prog="$install_prog$arg"
1.1       frystyk  2618: 
                   2619:     # We need to accept at least all the BSD install flags.
                   2620:     dest=
                   2621:     files=
                   2622:     opts=
                   2623:     prev=
                   2624:     install_type=
1.3       frystyk  2625:     isdir=no
1.1       frystyk  2626:     stripme=
                   2627:     for arg
                   2628:     do
                   2629:       if test -n "$dest"; then
1.4     ! frystyk  2630:        files="$files $dest"
        !          2631:        dest="$arg"
        !          2632:        continue
1.1       frystyk  2633:       fi
                   2634: 
                   2635:       case "$arg" in
                   2636:       -d) isdir=yes ;;
                   2637:       -f) prev="-f" ;;
                   2638:       -g) prev="-g" ;;
                   2639:       -m) prev="-m" ;;
                   2640:       -o) prev="-o" ;;
                   2641:       -s)
1.4     ! frystyk  2642:        stripme=" -s"
        !          2643:        continue
        !          2644:        ;;
1.1       frystyk  2645:       -*) ;;
                   2646: 
                   2647:       *)
1.4     ! frystyk  2648:        # If the previous option needed an argument, then skip it.
        !          2649:        if test -n "$prev"; then
        !          2650:          prev=
        !          2651:        else
        !          2652:          dest="$arg"
        !          2653:          continue
        !          2654:        fi
        !          2655:        ;;
1.1       frystyk  2656:       esac
1.2       frystyk  2657: 
                   2658:       # Aesthetically quote the argument.
                   2659:       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
                   2660:       case "$arg" in
                   2661:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
                   2662:        arg="\"$arg\""
                   2663:        ;;
                   2664:       esac
1.1       frystyk  2665:       install_prog="$install_prog $arg"
                   2666:     done
                   2667: 
                   2668:     if test -z "$install_prog"; then
1.2       frystyk  2669:       $echo "$modename: you must specify an install program" 1>&2
                   2670:       $echo "$help" 1>&2
1.1       frystyk  2671:       exit 1
                   2672:     fi
                   2673: 
                   2674:     if test -n "$prev"; then
1.2       frystyk  2675:       $echo "$modename: the \`$prev' option requires an argument" 1>&2
                   2676:       $echo "$help" 1>&2
1.1       frystyk  2677:       exit 1
                   2678:     fi
                   2679: 
                   2680:     if test -z "$files"; then
                   2681:       if test -z "$dest"; then
1.4     ! frystyk  2682:        $echo "$modename: no file or destination specified" 1>&2
1.1       frystyk  2683:       else
1.4     ! frystyk  2684:        $echo "$modename: you must specify a destination" 1>&2
1.1       frystyk  2685:       fi
1.2       frystyk  2686:       $echo "$help" 1>&2
1.1       frystyk  2687:       exit 1
                   2688:     fi
                   2689: 
                   2690:     # Strip any trailing slash from the destination.
1.2       frystyk  2691:     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
1.1       frystyk  2692: 
                   2693:     # Check to see that the destination is a directory.
                   2694:     test -d "$dest" && isdir=yes
1.3       frystyk  2695:     if test "$isdir" = yes; then
1.1       frystyk  2696:       destdir="$dest"
                   2697:       destname=
                   2698:     else
1.2       frystyk  2699:       destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
                   2700:       test "X$destdir" = "X$dest" && destdir=.
                   2701:       destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
1.1       frystyk  2702: 
                   2703:       # Not a directory, so check to see that there is only one file specified.
                   2704:       set dummy $files
                   2705:       if test $# -gt 2; then
1.4     ! frystyk  2706:        $echo "$modename: \`$dest' is not a directory" 1>&2
        !          2707:        $echo "$help" 1>&2
        !          2708:        exit 1
1.1       frystyk  2709:       fi
                   2710:     fi
                   2711:     case "$destdir" in
1.3       frystyk  2712:     /* | [A-Za-z]:[/\\]*) ;;
1.1       frystyk  2713:     *)
                   2714:       for file in $files; do
1.4     ! frystyk  2715:        case "$file" in
        !          2716:        *.lo) ;;
        !          2717:        *)
        !          2718:          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
        !          2719:          $echo "$help" 1>&2
        !          2720:          exit 1
        !          2721:          ;;
        !          2722:        esac
1.1       frystyk  2723:       done
                   2724:       ;;
                   2725:     esac
                   2726: 
1.2       frystyk  2727:     # This variable tells wrapper scripts just to set variables rather
                   2728:     # than running their programs.
                   2729:     libtool_install_magic="$magic"
                   2730: 
1.1       frystyk  2731:     staticlibs=
                   2732:     future_libdirs=
                   2733:     current_libdirs=
                   2734:     for file in $files; do
                   2735: 
                   2736:       # Do each installation.
                   2737:       case "$file" in
1.4     ! frystyk  2738:       *.a | *.lib)
        !          2739:        # Do the static libraries later.
        !          2740:        staticlibs="$staticlibs $file"
        !          2741:        ;;
1.1       frystyk  2742: 
                   2743:       *.la)
1.4     ! frystyk  2744:        # Check to see that this really is a libtool archive.
        !          2745:        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
        !          2746:        else
        !          2747:          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
        !          2748:          $echo "$help" 1>&2
        !          2749:          exit 1
        !          2750:        fi
        !          2751: 
        !          2752:        library_names=
        !          2753:        old_library=
        !          2754:        # If there is no directory component, then add one.
        !          2755:        case "$file" in
        !          2756:        */* | *\\*) . $file ;;
        !          2757:        *) . ./$file ;;
        !          2758:        esac
        !          2759: 
        !          2760:        # Add the libdir to current_libdirs if it is the destination.
        !          2761:        if test "X$destdir" = "X$libdir"; then
        !          2762:          case "$current_libdirs " in
        !          2763:          *" $libdir "*) ;;
        !          2764:          *) current_libdirs="$current_libdirs $libdir" ;;
        !          2765:          esac
        !          2766:        else
        !          2767:          # Note the libdir as a future libdir.
        !          2768:          case "$future_libdirs " in
        !          2769:          *" $libdir "*) ;;
        !          2770:          *) future_libdirs="$future_libdirs $libdir" ;;
        !          2771:          esac
        !          2772:        fi
        !          2773: 
        !          2774:        dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
        !          2775:        test "X$dir" = "X$file/" && dir=
        !          2776:        dir="$dir$objdir"
        !          2777: 
        !          2778:        # See the names of the shared library.
        !          2779:        set dummy $library_names
        !          2780:        if test -n "$2"; then
        !          2781:          realname="$2"
        !          2782:          shift
        !          2783:          shift
        !          2784: 
        !          2785:          # Install the shared library and build the symlinks.
        !          2786:          $show "$install_prog $dir/$realname $destdir/$realname"
        !          2787:          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
        !          2788:          test "X$dlname" = "X$realname" && dlname=
        !          2789: 
        !          2790:          if test $# -gt 0; then
        !          2791:            # Delete the old symlinks, and create new ones.
        !          2792:            for linkname
        !          2793:            do
        !          2794:              test "X$dlname" = "X$linkname" && dlname=
        !          2795:              if test "$linkname" != "$realname"; then
        !          2796:                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
        !          2797:                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
        !          2798:              fi
        !          2799:            done
        !          2800:          fi
        !          2801: 
        !          2802:          if test -n "$dlname"; then
        !          2803:            # Install the dynamically-loadable library.
        !          2804:            $show "$install_prog $dir/$dlname $destdir/$dlname"
        !          2805:            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
        !          2806:          fi
        !          2807: 
        !          2808:          # Do each command in the postinstall commands.
        !          2809:          lib="$destdir/$realname"
        !          2810:          eval cmds=\"$postinstall_cmds\"
        !          2811:          IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
        !          2812:          for cmd in $cmds; do
        !          2813:            IFS="$save_ifs"
        !          2814:            $show "$cmd"
        !          2815:            $run eval "$cmd" || exit $?
        !          2816:          done
        !          2817:          IFS="$save_ifs"
        !          2818:        fi
        !          2819: 
        !          2820:        # Install the pseudo-library for information purposes.
        !          2821:        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
        !          2822:        instname="$dir/$name"i
        !          2823:        $show "Creating $instname"
        !          2824:        $rm "$instname"
        !          2825:        sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
        !          2826:        $show "$install_prog $instname $destdir/$name"
        !          2827:        $run eval "$install_prog $instname $destdir/$name" || exit $?
        !          2828:        $show "$rm $instname"
        !          2829:        $rm "$instname"
        !          2830: 
        !          2831:        # Maybe install the static library, too.
        !          2832:        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
        !          2833:        ;;
1.1       frystyk  2834: 
                   2835:       *.lo)
1.4     ! frystyk  2836:        # Install (i.e. copy) a libtool object.
        !          2837: 
        !          2838:        # Figure out destination file name, if it wasn't already specified.
        !          2839:        if test -n "$destname"; then
        !          2840:          destfile="$destdir/$destname"
        !          2841:        else
        !          2842:          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
        !          2843:          destfile="$destdir/$destfile"
        !          2844:        fi
        !          2845: 
        !          2846:        # Deduce the name of the destination old-style object file.
        !          2847:        case "$destfile" in
        !          2848:        *.lo)
        !          2849:          staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
        !          2850:          ;;
        !          2851:        *.o | *.obj)
        !          2852:          staticdest="$destfile"
        !          2853:          destfile=
        !          2854:          ;;
        !          2855:        *)
        !          2856:          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
        !          2857:          $echo "$help" 1>&2
        !          2858:          exit 1
        !          2859:          ;;
        !          2860:        esac
        !          2861: 
        !          2862:        # Install the libtool object if requested.
        !          2863:        if test -n "$destfile"; then
        !          2864:          $show "$install_prog $file $destfile"
        !          2865:          $run eval "$install_prog $file $destfile" || exit $?
        !          2866:        fi
1.1       frystyk  2867: 
1.4     ! frystyk  2868:        # Install the old object if enabled.
        !          2869:        if test "$build_old_libs" = yes; then
        !          2870:          # Deduce the name of the old-style object file.
        !          2871:          staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
        !          2872: 
        !          2873:          $show "$install_prog $staticobj $staticdest"
        !          2874:          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
        !          2875:        fi
        !          2876:        exit 0
        !          2877:        ;;
1.1       frystyk  2878: 
                   2879:       *)
1.4     ! frystyk  2880:        # Figure out destination file name, if it wasn't already specified.
        !          2881:        if test -n "$destname"; then
        !          2882:          destfile="$destdir/$destname"
        !          2883:        else
        !          2884:          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
        !          2885:          destfile="$destdir/$destfile"
        !          2886:        fi
        !          2887: 
        !          2888:        # Do a test to see if this is really a libtool program.
        !          2889:        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
        !          2890:          link_against_libtool_libs=
        !          2891:          finalize_command=
        !          2892: 
        !          2893:          # If there is no directory component, then add one.
        !          2894:          case "$file" in
        !          2895:          */* | *\\*) . $file ;;
        !          2896:          *) . ./$file ;;
        !          2897:          esac
        !          2898: 
        !          2899:          # Check the variables that should have been set.
        !          2900:          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
        !          2901:            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
        !          2902:            exit 1
        !          2903:          fi
        !          2904: 
        !          2905:          finalize=yes
        !          2906:          for lib in $link_against_libtool_libs; do
        !          2907:            # Check to see that each library is installed.
        !          2908:            libdir=
        !          2909:            if test -f "$lib"; then
        !          2910:              # If there is no directory component, then add one.
        !          2911:              case "$lib" in
        !          2912:              */* | *\\*) . $lib ;;
        !          2913:              *) . ./$lib ;;
        !          2914:              esac
        !          2915:            fi
        !          2916:            libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
        !          2917:            if test -n "$libdir" && test ! -f "$libfile"; then
        !          2918:              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
        !          2919:              finalize=no
        !          2920:            fi
        !          2921:          done
        !          2922: 
        !          2923:          if test "$hardcode_action" = relink; then
        !          2924:            if test "$finalize" = yes; then
        !          2925:              $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
        !          2926:              $show "$finalize_command"
        !          2927:              if $run eval "$finalize_command"; then :
        !          2928:              else
        !          2929:                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
        !          2930:                continue
        !          2931:              fi
        !          2932:              file="$objdir/$file"T
        !          2933:            else
        !          2934:              $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
        !          2935:            fi
        !          2936:          else
        !          2937:            # Install the binary that we compiled earlier.
1.2       frystyk  2938:            file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
1.4     ! frystyk  2939:          fi
        !          2940:        fi
1.1       frystyk  2941: 
1.4     ! frystyk  2942:        $show "$install_prog$stripme $file $destfile"
        !          2943:        $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
        !          2944:        ;;
1.1       frystyk  2945:       esac
                   2946:     done
                   2947: 
                   2948:     for file in $staticlibs; do
1.2       frystyk  2949:       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1.1       frystyk  2950: 
                   2951:       # Set up the ranlib parameters.
                   2952:       oldlib="$destdir/$name"
                   2953: 
                   2954:       $show "$install_prog $file $oldlib"
1.2       frystyk  2955:       $run eval "$install_prog \$file \$oldlib" || exit $?
1.1       frystyk  2956: 
                   2957:       # Do each command in the postinstall commands.
1.3       frystyk  2958:       eval cmds=\"$old_postinstall_cmds\"
1.4     ! frystyk  2959:       IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
1.1       frystyk  2960:       for cmd in $cmds; do
1.4     ! frystyk  2961:        IFS="$save_ifs"
        !          2962:        $show "$cmd"
        !          2963:        $run eval "$cmd" || exit $?
1.1       frystyk  2964:       done
                   2965:       IFS="$save_ifs"
                   2966:     done
                   2967: 
                   2968:     if test -n "$future_libdirs"; then
1.2       frystyk  2969:       $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
1.1       frystyk  2970:     fi
                   2971: 
                   2972:     if test -n "$current_libdirs"; then
                   2973:       # Maybe just do a dry run.
                   2974:       test -n "$run" && current_libdirs=" -n$current_libdirs"
1.2       frystyk  2975:       exec $SHELL $0 --finish$current_libdirs
1.1       frystyk  2976:       exit 1
                   2977:     fi
                   2978: 
                   2979:     exit 0
                   2980:     ;;
                   2981: 
1.2       frystyk  2982:   # libtool finish mode
                   2983:   finish)
                   2984:     modename="$modename: finish"
                   2985:     libdirs="$nonopt"
1.3       frystyk  2986:     admincmds=
1.2       frystyk  2987: 
                   2988:     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
                   2989:       for dir
                   2990:       do
1.4     ! frystyk  2991:        libdirs="$libdirs $dir"
1.2       frystyk  2992:       done
                   2993: 
                   2994:       for libdir in $libdirs; do
                   2995:        if test -n "$finish_cmds"; then
                   2996:          # Do each command in the finish commands.
1.3       frystyk  2997:          eval cmds=\"$finish_cmds\"
1.4     ! frystyk  2998:          IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
        !          2999:          for cmd in $cmds; do
        !          3000:            IFS="$save_ifs"
        !          3001:            $show "$cmd"
        !          3002:            $run eval "$cmd" || admincmds="$admincmds
1.3       frystyk  3003:        $cmd"
1.4     ! frystyk  3004:          done
        !          3005:          IFS="$save_ifs"
1.2       frystyk  3006:        fi
                   3007:        if test -n "$finish_eval"; then
                   3008:          # Do the single finish_eval.
1.3       frystyk  3009:          eval cmds=\"$finish_eval\"
                   3010:          $run eval "$cmds" || admincmds="$admincmds
                   3011:        $cmds"
1.2       frystyk  3012:        fi
                   3013:       done
                   3014:     fi
                   3015: 
1.4     ! frystyk  3016:     # Exit here if they wanted silent mode.
        !          3017:     test "$show" = : && exit 0
        !          3018: 
1.3       frystyk  3019:     echo "----------------------------------------------------------------------"
1.2       frystyk  3020:     echo "Libraries have been installed in:"
                   3021:     for libdir in $libdirs; do
                   3022:       echo "   $libdir"
1.1       frystyk  3023:     done
1.2       frystyk  3024:     echo
1.4     ! frystyk  3025:     echo "If you ever happen to want to link against installed libraries"
        !          3026:     echo "in a given directory, LIBDIR, you must either use libtool, and"
        !          3027:     echo "specify the full pathname of the library, or use \`-LLIBDIR'"
        !          3028:     echo "flag during linking and do at least one of the following:"
1.2       frystyk  3029:     if test -n "$shlibpath_var"; then
                   3030:       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
                   3031:       echo "     during execution"
                   3032:     fi
                   3033:     if test -n "$runpath_var"; then
                   3034:       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
                   3035:       echo "     during linking"
                   3036:     fi
                   3037:     if test -n "$hardcode_libdir_flag_spec"; then
                   3038:       libdir=LIBDIR
1.3       frystyk  3039:       eval flag=\"$hardcode_libdir_flag_spec\"
1.1       frystyk  3040: 
1.2       frystyk  3041:       echo "   - use the \`$flag' linker flag"
                   3042:     fi
1.3       frystyk  3043:     if test -n "$admincmds"; then
                   3044:       echo "   - have your system administrator run these commands:$admincmds"
                   3045:     fi
1.2       frystyk  3046:     if test -f /etc/ld.so.conf; then
                   3047:       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
                   3048:     fi
                   3049:     echo
                   3050:     echo "See any operating system documentation about shared libraries for"
                   3051:     echo "more information, such as the ld(1) and ld.so(8) manual pages."
1.3       frystyk  3052:     echo "----------------------------------------------------------------------"
1.2       frystyk  3053:     exit 0
                   3054:     ;;
                   3055: 
                   3056:   # libtool execute mode
                   3057:   execute)
                   3058:     modename="$modename: execute"
                   3059: 
                   3060:     # The first argument is the command name.
                   3061:     cmd="$nonopt"
                   3062:     if test -z "$cmd"; then
                   3063:       $echo "$modename: you must specify a COMMAND" 1>&2
                   3064:       $echo "$help"
1.1       frystyk  3065:       exit 1
                   3066:     fi
                   3067: 
1.2       frystyk  3068:     # Handle -dlopen flags immediately.
                   3069:     for file in $execute_dlfiles; do
1.3       frystyk  3070:       if test ! -f "$file"; then
1.2       frystyk  3071:        $echo "$modename: \`$file' is not a file" 1>&2
                   3072:        $echo "$help" 1>&2
                   3073:        exit 1
1.1       frystyk  3074:       fi
                   3075: 
1.2       frystyk  3076:       dir=
                   3077:       case "$file" in
                   3078:       *.la)
1.4     ! frystyk  3079:        # Check to see that this really is a libtool archive.
        !          3080:        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
        !          3081:        else
        !          3082:          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
        !          3083:          $echo "$help" 1>&2
        !          3084:          exit 1
        !          3085:        fi
1.2       frystyk  3086: 
                   3087:        # Read the libtool library.
                   3088:        dlname=
                   3089:        library_names=
                   3090: 
1.4     ! frystyk  3091:        # If there is no directory component, then add one.
1.2       frystyk  3092:        case "$file" in
                   3093:        */* | *\\*) . $file ;;
1.4     ! frystyk  3094:        *) . ./$file ;;
1.2       frystyk  3095:        esac
                   3096: 
                   3097:        # Skip this library if it cannot be dlopened.
                   3098:        if test -z "$dlname"; then
                   3099:          # Warn if it was a shared library.
                   3100:          test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
                   3101:          continue
                   3102:        fi
                   3103: 
                   3104:        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
                   3105:        test "X$dir" = "X$file" && dir=.
                   3106: 
                   3107:        if test -f "$dir/$objdir/$dlname"; then
                   3108:          dir="$dir/$objdir"
                   3109:        else
                   3110:          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
                   3111:          exit 1
                   3112:        fi
                   3113:        ;;
                   3114: 
                   3115:       *.lo)
                   3116:        # Just add the directory containing the .lo file.
                   3117:        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
                   3118:        test "X$dir" = "X$file" && dir=.
                   3119:        ;;
                   3120: 
                   3121:       *)
                   3122:        $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
1.4     ! frystyk  3123:        continue
1.2       frystyk  3124:        ;;
1.1       frystyk  3125:       esac
                   3126: 
1.2       frystyk  3127:       # Get the absolute pathname.
                   3128:       absdir=`cd "$dir" && pwd`
                   3129:       test -n "$absdir" && dir="$absdir"
                   3130: 
                   3131:       # Now add the directory to shlibpath_var.
                   3132:       if eval "test -z \"\$$shlibpath_var\""; then
                   3133:        eval "$shlibpath_var=\"\$dir\""
1.1       frystyk  3134:       else
1.2       frystyk  3135:        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1.1       frystyk  3136:       fi
                   3137:     done
                   3138: 
1.2       frystyk  3139:     # This variable tells wrapper scripts just to set shlibpath_var
                   3140:     # rather than running their programs.
                   3141:     libtool_execute_magic="$magic"
                   3142: 
                   3143:     # Check if any of the arguments is a wrapper script.
                   3144:     args=
                   3145:     for file
                   3146:     do
                   3147:       case "$file" in
                   3148:       -*) ;;
                   3149:       *)
1.4     ! frystyk  3150:        # Do a test to see if this is really a libtool program.
        !          3151:        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1.2       frystyk  3152:          # If there is no directory component, then add one.
                   3153:          case "$file" in
                   3154:          */* | *\\*) . $file ;;
                   3155:          *) . ./$file ;;
                   3156:          esac
                   3157: 
                   3158:          # Transform arg to wrapped name.
                   3159:          file="$progdir/$program"
                   3160:        fi
1.4     ! frystyk  3161:        ;;
1.2       frystyk  3162:       esac
                   3163:       # Quote arguments (to preserve shell metacharacters).
                   3164:       file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
                   3165:       args="$args \"$file\""
                   3166:     done
1.1       frystyk  3167: 
1.2       frystyk  3168:     if test -z "$run"; then
                   3169:       # Export the shlibpath_var.
                   3170:       eval "export $shlibpath_var"
1.1       frystyk  3171: 
1.3       frystyk  3172:       # Restore saved enviroment variables
                   3173:       if test "${save_LC_ALL+set}" = set; then
1.4     ! frystyk  3174:        LC_ALL="$save_LC_ALL"; export LC_ALL
1.3       frystyk  3175:       fi
                   3176:       if test "${save_LANG+set}" = set; then
1.4     ! frystyk  3177:        LANG="$save_LANG"; export LANG
1.3       frystyk  3178:       fi
                   3179: 
1.2       frystyk  3180:       # Now actually exec the command.
                   3181:       eval "exec \$cmd$args"
1.1       frystyk  3182: 
1.2       frystyk  3183:       $echo "$modename: cannot exec \$cmd$args"
                   3184:       exit 1
                   3185:     else
                   3186:       # Display what would be done.
                   3187:       eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
                   3188:       $echo "export $shlibpath_var"
                   3189:       $echo "$cmd$args"
                   3190:       exit 0
1.1       frystyk  3191:     fi
                   3192:     ;;
                   3193: 
                   3194:   # libtool uninstall mode
                   3195:   uninstall)
1.2       frystyk  3196:     modename="$modename: uninstall"
1.1       frystyk  3197:     rm="$nonopt"
                   3198:     files=
                   3199: 
                   3200:     for arg
                   3201:     do
                   3202:       case "$arg" in
                   3203:       -*) rm="$rm $arg" ;;
                   3204:       *) files="$files $arg" ;;
                   3205:       esac
                   3206:     done
                   3207: 
                   3208:     if test -z "$rm"; then
1.2       frystyk  3209:       $echo "$modename: you must specify an RM program" 1>&2
                   3210:       $echo "$help" 1>&2
1.1       frystyk  3211:       exit 1
                   3212:     fi
                   3213: 
                   3214:     for file in $files; do
1.2       frystyk  3215:       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
                   3216:       test "X$dir" = "X$file" && dir=.
                   3217:       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1.1       frystyk  3218: 
                   3219:       rmfiles="$file"
                   3220: 
                   3221:       case "$name" in
                   3222:       *.la)
1.4     ! frystyk  3223:        # Possibly a libtool archive, so verify it.
        !          3224:        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
        !          3225:          . $dir/$name
        !          3226: 
        !          3227:          # Delete the libtool libraries and symlinks.
        !          3228:          for n in $library_names; do
        !          3229:            rmfiles="$rmfiles $dir/$n"
        !          3230:            test "X$n" = "X$dlname" && dlname=
        !          3231:          done
        !          3232:          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
        !          3233:          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
1.2       frystyk  3234: 
                   3235:          $show "$rm $rmfiles"
                   3236:          $run $rm $rmfiles
                   3237: 
                   3238:          if test -n "$library_names"; then
                   3239:            # Do each command in the postuninstall commands.
1.3       frystyk  3240:            eval cmds=\"$postuninstall_cmds\"
1.4     ! frystyk  3241:            IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
1.2       frystyk  3242:            for cmd in $cmds; do
                   3243:              IFS="$save_ifs"
                   3244:              $show "$cmd"
                   3245:              $run eval "$cmd"
                   3246:            done
                   3247:            IFS="$save_ifs"
                   3248:          fi
                   3249: 
1.4     ! frystyk  3250:          if test -n "$old_library"; then
1.2       frystyk  3251:            # Do each command in the old_postuninstall commands.
1.3       frystyk  3252:            eval cmds=\"$old_postuninstall_cmds\"
1.4     ! frystyk  3253:            IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
1.2       frystyk  3254:            for cmd in $cmds; do
                   3255:              IFS="$save_ifs"
                   3256:              $show "$cmd"
                   3257:              $run eval "$cmd"
                   3258:            done
                   3259:            IFS="$save_ifs"
                   3260:          fi
1.1       frystyk  3261: 
1.4     ! frystyk  3262:          # FIXME: should reinstall the best remaining shared library.
        !          3263:        fi
        !          3264:        ;;
1.1       frystyk  3265: 
                   3266:       *.lo)
1.4     ! frystyk  3267:        if test "$build_old_libs" = yes; then
        !          3268:          oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
        !          3269:          rmfiles="$rmfiles $dir/$oldobj"
        !          3270:        fi
1.2       frystyk  3271:        $show "$rm $rmfiles"
                   3272:        $run $rm $rmfiles
1.4     ! frystyk  3273:        ;;
1.2       frystyk  3274: 
                   3275:       *)
1.4     ! frystyk  3276:        $show "$rm $rmfiles"
1.2       frystyk  3277:        $run $rm $rmfiles
                   3278:        ;;
1.1       frystyk  3279:       esac
                   3280:     done
                   3281:     exit 0
                   3282:     ;;
                   3283: 
1.2       frystyk  3284:   "")
                   3285:     $echo "$modename: you must specify a MODE" 1>&2
                   3286:     $echo "$generic_help" 1>&2
1.1       frystyk  3287:     exit 1
                   3288:     ;;
                   3289:   esac
                   3290: 
1.2       frystyk  3291:   $echo "$modename: invalid operation mode \`$mode'" 1>&2
                   3292:   $echo "$generic_help" 1>&2
1.1       frystyk  3293:   exit 1
                   3294: fi # test -z "$show_help"
                   3295: 
                   3296: # We need to display help for each of the modes.
                   3297: case "$mode" in
1.2       frystyk  3298: "") $echo \
                   3299: "Usage: $modename [OPTION]... [MODE-ARG]...
1.1       frystyk  3300: 
                   3301: Provide generalized library-building support services.
                   3302: 
1.3       frystyk  3303:     --config          show all configuration variables
                   3304:     --debug           enable verbose shell tracing
1.1       frystyk  3305: -n, --dry-run         display commands without modifying any files
1.3       frystyk  3306:     --features        display basic configuration information and exit
1.1       frystyk  3307:     --finish          same as \`--mode=finish'
                   3308:     --help            display this help message and exit
                   3309:     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
1.2       frystyk  3310:     --quiet           same as \`--silent'
                   3311:     --silent          don't print informational messages
1.1       frystyk  3312:     --version         print version information
                   3313: 
                   3314: MODE must be one of the following:
                   3315: 
                   3316:       compile         compile a source file into a libtool object
1.2       frystyk  3317:       execute         automatically set library path, then run a program
1.1       frystyk  3318:       finish          complete the installation of libtool libraries
                   3319:       install         install libraries or executables
                   3320:       link            create a library or an executable
                   3321:       uninstall       remove libraries from an installed directory
                   3322: 
1.2       frystyk  3323: MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
                   3324: a more detailed description of MODE."
                   3325:   exit 0
1.1       frystyk  3326:   ;;
                   3327: 
                   3328: compile)
1.2       frystyk  3329:   $echo \
                   3330: "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1.1       frystyk  3331: 
                   3332: Compile a source file into a libtool library object.
1.3       frystyk  3333: 
                   3334: This mode accepts the following additional options:
                   3335: 
1.4     ! frystyk  3336:   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
1.3       frystyk  3337:   -static           always build a \`.o' file suitable for static linking
1.1       frystyk  3338: 
                   3339: COMPILE-COMMAND is a command to be used in creating a \`standard' object file
                   3340: from the given SOURCEFILE.
                   3341: 
                   3342: The output file name is determined by removing the directory component from
                   3343: SOURCEFILE, then substituting the C source code suffix \`.c' with the
1.2       frystyk  3344: library object suffix, \`.lo'."
1.1       frystyk  3345:   ;;
                   3346: 
1.2       frystyk  3347: execute)
                   3348:   $echo \
                   3349: "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
                   3350: 
                   3351: Automatically set library path, then run a program.
                   3352: 
                   3353: This mode accepts the following additional options:
1.1       frystyk  3354: 
1.2       frystyk  3355:   -dlopen FILE      add the directory containing FILE to the library path
1.1       frystyk  3356: 
1.2       frystyk  3357: This mode sets the library path environment variable according to \`-dlopen'
                   3358: flags.
1.1       frystyk  3359: 
1.2       frystyk  3360: If any of the ARGS are libtool executable wrappers, then they are translated
                   3361: into their corresponding uninstalled binary, and any of their required library
                   3362: directories are added to the library path.
                   3363: 
                   3364: Then, COMMAND is executed, with ARGS as arguments."
1.1       frystyk  3365:   ;;
                   3366: 
                   3367: finish)
1.2       frystyk  3368:   $echo \
                   3369: "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
1.1       frystyk  3370: 
                   3371: Complete the installation of libtool libraries.
                   3372: 
                   3373: Each LIBDIR is a directory that contains libtool libraries.
                   3374: 
                   3375: The commands that this mode executes may require superuser privileges.  Use
1.2       frystyk  3376: the \`--dry-run' option if you just want to see what would be executed."
1.1       frystyk  3377:   ;;
                   3378: 
                   3379: install)
1.2       frystyk  3380:   $echo \
                   3381: "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
1.1       frystyk  3382: 
                   3383: Install executables or libraries.
                   3384: 
                   3385: INSTALL-COMMAND is the installation command.  The first component should be
                   3386: either the \`install' or \`cp' program.
                   3387: 
                   3388: The rest of the components are interpreted as arguments to that command (only
1.2       frystyk  3389: BSD-compatible install options are recognized)."
1.1       frystyk  3390:   ;;
                   3391: 
                   3392: link)
1.2       frystyk  3393:   $echo \
                   3394: "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
1.1       frystyk  3395: 
                   3396: Link object files or libraries together to form another library, or to
                   3397: create an executable program.
                   3398: 
                   3399: LINK-COMMAND is a command using the C compiler that you would use to create
                   3400: a program from several object files.
                   3401: 
                   3402: The following components of LINK-COMMAND are treated specially:
                   3403: 
1.2       frystyk  3404:   -all-static       do not do any dynamic linking at all
1.4     ! frystyk  3405:   -avoid-version    do not add a version suffix if possible
1.2       frystyk  3406:   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
1.4     ! frystyk  3407:   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
1.1       frystyk  3408:   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1.4     ! frystyk  3409:   -export-symbols SYMFILE
        !          3410:                    try to export only the symbols listed in SYMFILE
1.1       frystyk  3411:   -LLIBDIR          search LIBDIR for required installed libraries
                   3412:   -lNAME            OUTPUT-FILE requires the installed library libNAME
1.4     ! frystyk  3413:   -module           build a library that can dlopened
1.2       frystyk  3414:   -no-undefined     declare that a library does not refer to external symbols
1.1       frystyk  3415:   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
1.2       frystyk  3416:   -release RELEASE  specify package release information
1.1       frystyk  3417:   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
1.4     ! frystyk  3418:   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
1.2       frystyk  3419:   -static           do not do any dynamic linking of libtool libraries
1.1       frystyk  3420:   -version-info CURRENT[:REVISION[:AGE]]
1.4     ! frystyk  3421:                    specify library version info [each variable defaults to 0]
1.1       frystyk  3422: 
                   3423: All other options (arguments beginning with \`-') are ignored.
                   3424: 
                   3425: Every other argument is treated as a filename.  Files ending in \`.la' are
                   3426: treated as uninstalled libtool libraries, other files are standard or library
                   3427: object files.
                   3428: 
1.4     ! frystyk  3429: If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
        !          3430: only library objects (\`.lo' files) may be specified, and \`-rpath' is
        !          3431: required, except when creating a convenience library.
1.1       frystyk  3432: 
1.4     ! frystyk  3433: If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
        !          3434: using \`ar' and \`ranlib', or on Windows using \`lib'.
1.1       frystyk  3435: 
1.4     ! frystyk  3436: If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
        !          3437: is created, otherwise an executable program is created."
1.1       frystyk  3438:   ;;
                   3439: 
                   3440: uninstall)
1.2       frystyk  3441:   $echo
                   3442: "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1.1       frystyk  3443: 
                   3444: Remove libraries from an installation directory.
                   3445: 
                   3446: RM is the name of the program to use to delete files associated with each FILE
                   3447: (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
                   3448: to RM.
                   3449: 
                   3450: If FILE is a libtool library, all the files associated with it are deleted.
1.2       frystyk  3451: Otherwise, only FILE itself is deleted using RM."
1.1       frystyk  3452:   ;;
                   3453: 
                   3454: *)
1.2       frystyk  3455:   $echo "$modename: invalid operation mode \`$mode'" 1>&2
                   3456:   $echo "$help" 1>&2
1.1       frystyk  3457:   exit 1
                   3458:   ;;
                   3459: esac
                   3460: 
1.2       frystyk  3461: echo
                   3462: $echo "Try \`$modename --help' for more information about other modes."
1.1       frystyk  3463: 
                   3464: exit 0
                   3465: 
                   3466: # Local Variables:
                   3467: # mode:shell-script
                   3468: # sh-indentation:2
                   3469: # End:

Webmaster