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

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: #
        !             4: # Copyright (C) 1996-1998 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: 
                     26: # The name of this program.
1.2     ! frystyk    27: progname=`$echo "$0" | sed 's%^.*/%%'`
        !            28: modename="$progname"
1.1       frystyk    29: 
                     30: # Constants.
                     31: PROGRAM=ltmain.sh
                     32: PACKAGE=libtool
1.2     ! frystyk    33: VERSION=1.1
1.1       frystyk    34: 
                     35: default_mode=
                     36: help="Try \`$progname --help' for more information."
                     37: magic="%%%MAGIC variable%%%"
                     38: mkdir="mkdir"
                     39: mv="mv -f"
                     40: rm="rm -f"
                     41: 
1.2     ! frystyk    42: # Sed substitution that helps us do robust quoting.  It backslashifies
        !            43: # metacharacters that are still active within double-quoted strings.
        !            44: Xsed='sed -e s/^X//'
        !            45: sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
        !            46: 
        !            47: # NLS nuisances.
        !            48: # Only set LANG and LC_ALL to C if already set.
        !            49: # These must not be set unconditionally because not all systems understand
        !            50: # e.g. LANG=C (notably SCO).
        !            51: if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
        !            52: if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
        !            53: 
1.1       frystyk    54: if test "$LTCONFIG_VERSION" != "$VERSION"; then
1.2     ! frystyk    55:   echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
1.1       frystyk    56:   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
                     57:   exit 1
                     58: fi
                     59: 
                     60: if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1.2     ! frystyk    61:   echo "$modename: not configured to build any kind of library" 1>&2
1.1       frystyk    62:   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
                     63:   exit 1
                     64: fi
                     65: 
                     66: # Global variables.
                     67: mode=$default_mode
                     68: nonopt=
                     69: prev=
                     70: prevopt=
                     71: run=
1.2     ! frystyk    72: show="$echo"
1.1       frystyk    73: show_help=
1.2     ! frystyk    74: execute_dlfiles=
1.1       frystyk    75: 
                     76: # Parse our command line options once, thoroughly.
                     77: while test $# -gt 0
                     78: do
                     79:   arg="$1"
                     80:   shift
                     81: 
                     82:   case "$arg" in
1.2     ! frystyk    83:   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
1.1       frystyk    84:   *) optarg= ;;
                     85:   esac
                     86: 
                     87:   # If the previous option needs an argument, assign it.
                     88:   if test -n "$prev"; then
1.2     ! frystyk    89:     case "$prev" in
        !            90:     execute_dlfiles)
        !            91:       eval "$prev=\"\$$prev \$arg\""
        !            92:       ;;
        !            93:     *)
        !            94:       eval "$prev=\$arg"
        !            95:       ;;
        !            96:     esac
        !            97: 
1.1       frystyk    98:     prev=
                     99:     prevopt=
                    100:     continue
                    101:   fi
                    102: 
                    103:   # Have we seen a non-optional argument yet?
                    104:   case "$arg" in
                    105:   --help)
                    106:     show_help=yes
                    107:     ;;
                    108: 
                    109:   --version)
                    110:     echo "$PROGRAM (GNU $PACKAGE) $VERSION"
                    111:     exit 0
                    112:     ;;
                    113: 
                    114:   --dry-run | -n)
                    115:     run=:
                    116:     ;;
                    117: 
                    118:   --features)
                    119:     echo "host: $host"
                    120:     if test "$build_libtool_libs" = yes; then
                    121:       echo "enable shared libraries"
                    122:     else
                    123:       echo "disable shared libraries"
                    124:     fi
                    125:     if test "$build_old_libs" = yes; then
                    126:       echo "enable static libraries"
                    127:     else
                    128:       echo "disable static libraries"
                    129:     fi
                    130:     exit 0
                    131:     ;;
                    132: 
                    133:   --finish) mode="finish" ;;
                    134: 
                    135:   --mode) prevopt="--mode" prev=mode ;;
                    136:   --mode=*) mode="$optarg" ;;
                    137: 
1.2     ! frystyk   138:   --quiet | --silent)
        !           139:     show=:
        !           140:     ;;
        !           141: 
        !           142:   -dlopen)
        !           143:     prevopt="-dlopen"
        !           144:     prev=execute_dlfiles
        !           145:     ;;
        !           146: 
1.1       frystyk   147:   -*)
1.2     ! frystyk   148:     $echo "$modename: unrecognized option \`$arg'" 1>&2
        !           149:     $echo "$help" 1>&2
1.1       frystyk   150:     exit 1
                    151:     ;;
                    152: 
                    153:   *)
                    154:     nonopt="$arg"
                    155:     break
                    156:     ;;
                    157:   esac
                    158: done
                    159: 
                    160: if test -n "$prevopt"; then
1.2     ! frystyk   161:   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
        !           162:   $echo "$help" 1>&2
1.1       frystyk   163:   exit 1
                    164: fi
                    165: 
                    166: if test -z "$show_help"; then
                    167: 
                    168:   # Infer the operation mode.
                    169:   if test -z "$mode"; then
                    170:     case "$nonopt" in
1.2     ! frystyk   171:     *cc | *++ | gcc* | *-gcc*)
1.1       frystyk   172:       mode=link
                    173:       for arg
                    174:       do
                    175:         case "$arg" in
                    176:         -c)
                    177:            mode=compile
                    178:            break
                    179:            ;;
                    180:         esac
                    181:       done
                    182:       ;;
1.2     ! frystyk   183:     *db | *dbx)
        !           184:       mode=execute
        !           185:       ;;
        !           186:     *install*|cp|mv)
1.1       frystyk   187:       mode=install
                    188:       ;;
                    189:     *rm)
                    190:       mode=uninstall
                    191:       ;;
                    192:     *)
1.2     ! frystyk   193:       # If we have no mode, but dlfiles were specified, then do execute mode.
        !           194:       test -n "$execute_dlfiles" && mode=execute
        !           195: 
1.1       frystyk   196:       # Just use the default operation mode.
                    197:       if test -z "$mode"; then
1.2     ! frystyk   198:         if test -n "$nonopt"; then
        !           199:           $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
        !           200:         else
        !           201:           $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
        !           202:         fi
1.1       frystyk   203:       fi
                    204:       ;;
                    205:     esac
                    206:   fi
                    207: 
1.2     ! frystyk   208:   # Only execute mode is allowed to have -dlopen flags.
        !           209:   if test -n "$execute_dlfiles" && test "$mode" != execute; then
        !           210:     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
        !           211:     $echo "$help" 1>&2
        !           212:     exit 1
        !           213:   fi
        !           214: 
1.1       frystyk   215:   # Change the help message to a mode-specific one.
                    216:   generic_help="$help"
1.2     ! frystyk   217:   help="Try \`$modename --help --mode=$mode' for more information."
1.1       frystyk   218: 
                    219:   # These modes are in order of execution frequency so that they run quickly.
                    220:   case "$mode" in
                    221:   # libtool compile mode
                    222:   compile)
1.2     ! frystyk   223:     modename="$modename: compile"
1.1       frystyk   224:     # Get the compilation command and the source file.
1.2     ! frystyk   225:     base_compile=
1.1       frystyk   226:     lastarg=
1.2     ! frystyk   227:     srcfile="$nonopt"
        !           228:     suppress_output=
1.1       frystyk   229: 
                    230:     for arg
                    231:     do
1.2     ! frystyk   232:       # Accept any command-line options.
1.1       frystyk   233:       case "$arg" in
1.2     ! frystyk   234:       -o)
        !           235:        $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
        !           236:        $echo "$help" 1>&2
        !           237:        exit 1
        !           238:        ;;
        !           239: 
        !           240:       -static)
        !           241:        build_libtool_libs=no
        !           242:        build_old_libs=yes
        !           243:        continue
        !           244:        ;;
        !           245:       esac
        !           246: 
        !           247:       # Accept the current argument as the source file.
        !           248:       lastarg="$srcfile"
        !           249:       srcfile="$arg"
        !           250: 
        !           251:       # Aesthetically quote the previous argument.
        !           252: 
        !           253:       # Backslashify any backslashes, double quotes, and dollar signs.
        !           254:       # These are the only characters that are still specially
        !           255:       # interpreted inside of double-quoted scrings.
        !           256:       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
        !           257: 
        !           258:       # Double-quote args containing other shell metacharacters.
        !           259:       # Many Bourne shells cannot handle close brackets correctly in scan
        !           260:       # sets, so we specify it separately.
        !           261:       case "$lastarg" in
        !           262:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
        !           263:        lastarg="\"$lastarg\""
        !           264:        ;;
1.1       frystyk   265:       esac
                    266: 
1.2     ! frystyk   267:       # Add the previous argument to base_compile.
        !           268:       if test -z "$base_compile"; then
        !           269:        base_compile="$lastarg"
        !           270:       else
        !           271:        base_compile="$base_compile $lastarg"
        !           272:       fi
1.1       frystyk   273:     done
                    274: 
                    275:     # Get the name of the library object.
1.2     ! frystyk   276:     libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1.1       frystyk   277: 
                    278:     # Recognize several different file suffixes.
1.2     ! frystyk   279:     xform='[cCFSfms]'
1.1       frystyk   280:     case "$libobj" in
1.2     ! frystyk   281:     *.ada) xform=ada ;;
        !           282:     *.adb) xform=adb ;;
        !           283:     *.ads) xform=ads ;;
        !           284:     *.asm) xform=asm ;;
        !           285:     *.c++) xform=c++ ;;
1.1       frystyk   286:     *.cc) xform=cc ;;
                    287:     *.cpp) xform=cpp ;;
                    288:     *.cxx) xform=cxx ;;
                    289:     *.f90) xform=f90 ;;
1.2     ! frystyk   290:     *.for) xform=for ;;
1.1       frystyk   291:     esac
                    292: 
1.2     ! frystyk   293:     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1.1       frystyk   294: 
                    295:     case "$libobj" in
1.2     ! frystyk   296:     *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
1.1       frystyk   297:     *)
1.2     ! frystyk   298:       $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
1.1       frystyk   299:       exit 1
                    300:       ;;
                    301:     esac
                    302: 
                    303:     if test -z "$base_compile"; then
1.2     ! frystyk   304:       $echo "$modename: you must specify a compilation command" 1>&2
        !           305:       $echo "$help" 1>&2
1.1       frystyk   306:       exit 1
                    307:     fi
                    308: 
                    309:     # Delete any leftover library objects.
                    310:     if test "$build_old_libs" = yes; then
                    311:       $run $rm $obj $libobj
                    312:       trap "$run $rm $obj $libobj; exit 1" 1 2 15
                    313:     else
                    314:       $run $rm $libobj
                    315:       trap "$run $rm $libobj; exit 1" 1 2 15
                    316:     fi
                    317: 
                    318:     # Only build a PIC object if we are building libtool libraries.
                    319:     if test "$build_libtool_libs" = yes; then
1.2     ! frystyk   320:       # Without this assignment, base_compile gets emptied.
        !           321:       fbsd_hideous_sh_bug=$base_compile
        !           322: 
1.1       frystyk   323:       # All platforms use -DPIC, to notify preprocessed assembler code.
                    324:       $show "$base_compile$pic_flag -DPIC $srcfile"
1.2     ! frystyk   325:       if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
1.1       frystyk   326:       else
1.2     ! frystyk   327:         test -n "$obj" && $run $rm $obj
        !           328:         exit 1
1.1       frystyk   329:       fi
                    330: 
                    331:       # If we have no pic_flag, then copy the object into place and finish.
                    332:       if test -z "$pic_flag"; then
1.2     ! frystyk   333:         $show "$LN_S $obj $libobj"
        !           334:         $run $LN_S $obj $libobj
        !           335:         exit $?
1.1       frystyk   336:       fi
                    337: 
                    338:       # Just move the object, then go on to compile the next one
                    339:       $show "$mv $obj $libobj"
                    340:       $run $mv $obj $libobj || exit 1
1.2     ! frystyk   341: 
        !           342:       # Allow error messages only from the first compilation.
        !           343:       suppress_output=' >/dev/null 2>&1'
1.1       frystyk   344:     fi
                    345: 
                    346:     # Only build a position-dependent object if we build old libraries.
                    347:     if test "$build_old_libs" = yes; then
1.2     ! frystyk   348:       # Suppress compiler output if we already did a PIC compilation.
        !           349:       $show "$base_compile $srcfile$suppress_output"
        !           350:       if $run eval "$base_compile \$srcfile$suppress_output"; then :
1.1       frystyk   351:       else
                    352:         $run $rm $obj $libobj
                    353:         exit 1
                    354:       fi
                    355:     fi
                    356: 
1.2     ! frystyk   357:     # Create an invalid libtool object if no PIC, so that we do not
        !           358:     # accidentally link it into a program.
1.1       frystyk   359:     if test "$build_libtool_libs" != yes; then
                    360:       $show "echo timestamp > $libobj"
1.2     ! frystyk   361:       $run eval "echo timestamp > \$libobj" || exit $?
1.1       frystyk   362:     fi
                    363: 
                    364:     exit 0
                    365:     ;;
                    366: 
                    367:   # libtool link mode
                    368:   link)
1.2     ! frystyk   369:     modename="$modename: link"
        !           370:     CC="$nonopt"
        !           371:     allow_undefined=yes
        !           372:     compile_command="$CC"
        !           373:     finalize_command="$CC"
        !           374: 
1.1       frystyk   375:     compile_shlibpath=
                    376:     finalize_shlibpath=
                    377:     deplibs=
1.2     ! frystyk   378:     dlfiles=
        !           379:     dlprefiles=
1.1       frystyk   380:     export_dynamic=no
                    381:     hardcode_libdirs=
                    382:     libobjs=
                    383:     link_against_libtool_libs=
                    384:     ltlibs=
                    385:     objs=
                    386:     prev=
                    387:     prevarg=
1.2     ! frystyk   388:     release=
        !           389:     rpath=
1.1       frystyk   390:     perm_rpath=
                    391:     temp_rpath=
                    392:     vinfo=
                    393: 
                    394:     # We need to know -static, to get the right output filenames.
                    395:     for arg
                    396:     do
                    397:       case "$arg" in
1.2     ! frystyk   398:       -all-static | -static)
        !           399:         if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
        !           400:            $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
        !           401:         fi
1.1       frystyk   402:         build_libtool_libs=no
1.2     ! frystyk   403:        build_old_libs=yes
1.1       frystyk   404:         break
                    405:         ;;
                    406:       esac
                    407:     done
                    408: 
1.2     ! frystyk   409:     # See if our shared archives depend on static archives.
        !           410:     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
        !           411: 
        !           412:     # Go through the arguments, transforming them on the way.
1.1       frystyk   413:     for arg
                    414:     do
                    415:       # If the previous option needs an argument, assign it.
                    416:       if test -n "$prev"; then
1.2     ! frystyk   417:         case "$prev" in
        !           418:         output)
        !           419:           compile_command="$compile_command @OUTPUT@"
        !           420:           finalize_command="$finalize_command @OUTPUT@"
        !           421:           ;;
        !           422:         esac
        !           423: 
        !           424:         case "$prev" in
        !           425:         dlfiles|dlprefiles)
        !           426:           case "$arg" in
        !           427:           *.la | *.lo) ;;  # We handle these cases below.
        !           428:           *)
        !           429:             dlprefiles="$dlprefiles $arg"
        !           430:             test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
        !           431:             prev=
        !           432:             ;;
        !           433:           esac
        !           434:           ;;
        !           435:        release)
        !           436:          release="-$arg"
        !           437:          prev=
        !           438:          continue
        !           439:          ;;
        !           440:         rpath)
        !           441:           rpath="$rpath $arg"
        !           442:          prev=
        !           443:          continue
1.1       frystyk   444:          ;;
1.2     ! frystyk   445:         *)
        !           446:           eval "$prev=\"\$arg\""
        !           447:           prev=
        !           448:           continue
        !           449:           ;;
        !           450:         esac
1.1       frystyk   451:       fi
                    452: 
                    453:       prevarg="$arg"
                    454: 
                    455:       case "$arg" in
1.2     ! frystyk   456:       -all-static)
        !           457:        if test -n "$link_static_flag"; then
        !           458:           compile_command="$compile_command $link_static_flag"
        !           459:          finalize_command="$finalize_command $link_static_flag"
        !           460:         fi
        !           461:         continue
        !           462:        ;;
1.1       frystyk   463: 
1.2     ! frystyk   464:       -allow-undefined)
        !           465:        # FIXME: remove this flag sometime in the future.
        !           466:        $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1.1       frystyk   467:        continue
                    468:        ;;
                    469: 
1.2     ! frystyk   470:       -dlopen)
        !           471:         prev=dlfiles
        !           472:         continue
        !           473:         ;;
        !           474: 
        !           475:       -dlpreopen)
        !           476:         prev=dlprefiles
        !           477:         continue
        !           478:         ;;
        !           479: 
        !           480:       -export-dynamic)
        !           481:         if test "$export_dynamic" != yes; then
        !           482:           export_dynamic=yes
        !           483:          if test -n "$export_dynamic_flag_spec"; then
        !           484:            arg=`eval \\$echo "$export_dynamic_flag_spec"`
        !           485:          else
        !           486:            arg=
        !           487:          fi
        !           488: 
        !           489:           # Add the symbol object into the linking commands.
        !           490:          compile_command="$compile_command @SYMFILE@"
        !           491:          finalize_command="$finalize_command @SYMFILE@"
        !           492:         fi
        !           493:         ;;
        !           494: 
1.1       frystyk   495:       -L*)
1.2     ! frystyk   496:         dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
        !           497:         case "$dir" in
        !           498:         /* | [A-Za-z]:\\*)
        !           499:          # Add the corresponding hardcode_libdir_flag, if it is not identical.
        !           500:           ;;
        !           501:         *)
        !           502:           $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
        !           503:           exit 1
        !           504:           ;;
        !           505:         esac
        !           506:         deplibs="$deplibs $arg"
        !           507:         ;;
1.1       frystyk   508: 
                    509:       -l*) deplibs="$deplibs $arg" ;;
                    510: 
1.2     ! frystyk   511:       -no-undefined)
        !           512:        allow_undefined=no
        !           513:        continue
        !           514:        ;;
        !           515: 
1.1       frystyk   516:       -o) prev=output ;;
                    517: 
1.2     ! frystyk   518:       -release)
        !           519:        prev=release
1.1       frystyk   520:        continue
                    521:        ;;
                    522: 
1.2     ! frystyk   523:       -rpath)
        !           524:         prev=rpath
        !           525:         continue
        !           526:         ;;
        !           527: 
1.1       frystyk   528:       -static)
1.2     ! frystyk   529:        # If we have no pic_flag, then this is the same as -all-static.
        !           530:        if test -z "$pic_flag" && test -n "$link_static_flag"; then
        !           531:           compile_command="$compile_command $link_static_flag"
        !           532:          finalize_command="$finalize_command $link_static_flag"
        !           533:         fi
1.1       frystyk   534:        continue
                    535:        ;;
                    536: 
                    537:       -version-info)
1.2     ! frystyk   538:         prev=vinfo
        !           539:         continue
        !           540:         ;;
1.1       frystyk   541: 
1.2     ! frystyk   542:       # Some other compiler flag.
        !           543:       -* | +*)
        !           544:        # Unknown arguments in both finalize_command and compile_command need
        !           545:        # to be aesthetically quoted because they are evaled later.
        !           546:        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        !           547:        case "$arg" in
        !           548:        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
        !           549:          arg="\"$arg\""
        !           550:          ;;
        !           551:        esac
        !           552:         ;;
1.1       frystyk   553: 
1.2     ! frystyk   554:       *.o | *.a)
        !           555:         # A standard object.
        !           556:         objs="$objs $arg"
        !           557:         ;;
1.1       frystyk   558: 
                    559:       *.lo)
1.2     ! frystyk   560:         # A library object.
        !           561:        if test "$prev" = dlfiles; then
        !           562:          dlfiles="$dlfiles $arg"
        !           563:          if test "$build_libtool_libs" = yes; then
        !           564:            prev=
        !           565:            continue
        !           566:          else
        !           567:            # If libtool objects are unsupported, then we need to preload.
        !           568:            prev=dlprefiles
        !           569:          fi
1.1       frystyk   570:        fi
                    571: 
1.2     ! frystyk   572:        if test "$prev" = dlprefiles; then
        !           573:          # Preload the old-style object.
        !           574:          dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/\.o/'`
        !           575:          prev=
1.1       frystyk   576:        fi
1.2     ! frystyk   577:        libobjs="$libobjs $arg"
        !           578:         ;;
1.1       frystyk   579: 
1.2     ! frystyk   580:       *.la)
        !           581:         # A libtool-controlled library.
1.1       frystyk   582: 
1.2     ! frystyk   583:         dlname=
        !           584:         libdir=
        !           585:         library_names=
        !           586:         old_library=
1.1       frystyk   587: 
1.2     ! frystyk   588:         # Check to see that this really is a libtool archive.
        !           589:         if (sed -e '2q' $arg | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
        !           590:         else
        !           591:           $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
        !           592:           exit 1
        !           593:         fi
1.1       frystyk   594: 
1.2     ! frystyk   595:         # If there is no directory component, then add one.
        !           596:         case "$arg" in
        !           597:         */* | *\\*) . $arg ;;
        !           598:         *) . ./$arg ;;
        !           599:         esac
1.1       frystyk   600: 
1.2     ! frystyk   601:         if test -z "$libdir"; then
        !           602:           $echo "$modename: \`$arg' contains no -rpath information" 1>&2
        !           603:           exit 1
        !           604:         fi
1.1       frystyk   605: 
1.2     ! frystyk   606:         # Get the name of the library we link against.
        !           607:         linklib=
        !           608:         for l in $old_library $library_names; do
        !           609:           linklib="$l"
        !           610:         done
1.1       frystyk   611: 
1.2     ! frystyk   612:         if test -z "$linklib"; then
        !           613:           $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
        !           614:           exit 1
        !           615:         fi
1.1       frystyk   616: 
1.2     ! frystyk   617:         # Find the relevant object directory and library name.
        !           618:         name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
        !           619:         dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
        !           620:         if test "X$dir" = "X$arg"; then
        !           621:           dir="$objdir"
        !           622:         else
        !           623:           dir="$dir/$objdir"
        !           624:         fi
1.1       frystyk   625: 
1.2     ! frystyk   626:         # This library was specified with -dlopen.
        !           627:         if test "$prev" = dlfiles; then
        !           628:           dlfiles="$dlfiles $arg"
        !           629:           if test -z "$dlname"; then
        !           630:             # If there is no dlname, we need to preload.
        !           631:             prev=dlprefiles
        !           632:           else
        !           633:             # We should not create a dependency on this library, but we
        !           634:            # may need any libraries it requires.
        !           635:            compile_command="$compile_command$dependency_libs"
        !           636:            finalize_command="$finalize_command$dependency_libs"
        !           637:             prev=
        !           638:             continue
        !           639:           fi
        !           640:         fi
1.1       frystyk   641: 
1.2     ! frystyk   642:         # The library was specified with -dlpreopen.
        !           643:         if test "$prev" = dlprefiles; then
        !           644:           # Prefer using a static library (so that no silly _DYNAMIC symbols
        !           645:           # are required to link).
        !           646:           if test -n "$old_library"; then
        !           647:             dlprefiles="$dlprefiles $dir/$old_library"
        !           648:           else
        !           649:             dlprefiles="$dlprefiles $dir/$linklib"
        !           650:           fi
        !           651:           prev=
        !           652:         fi
1.1       frystyk   653: 
1.2     ! frystyk   654:         if test "$build_libtool_libs" = yes && test -n "$library_names"; then
        !           655:           link_against_libtool_libs="$link_against_libtool_libs $arg"
        !           656:           if test -n "$shlibpath_var"; then
        !           657:             # Make sure the rpath contains only unique directories.
        !           658:             case "$temp_rpath " in
        !           659:             *" $dir "*) ;;
        !           660:             *) temp_rpath="$temp_rpath $dir" ;;
        !           661:             esac
        !           662:           fi
        !           663: 
        !           664:          # This is the magic to use -rpath.
        !           665:           if test -n "$hardcode_libdir_flag_spec"; then
        !           666:             if test -n "$hardcode_libdir_separator"; then
        !           667:               if test -z "$hardcode_libdirs"; then
        !           668:                 # Put the magic libdir with the hardcode flag.
        !           669:                 hardcode_libdirs="$libdir"
        !           670:                 libdir="@HARDCODE_LIBDIRS@"
        !           671:               else
        !           672:                 # Just accumulate the unique libdirs.
        !           673:                case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
        !           674:                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
        !           675:                  ;;
        !           676:                *)
        !           677:                  hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
        !           678:                  ;;
        !           679:                esac
        !           680:                 libdir=
        !           681:               fi
        !           682:             fi
        !           683: 
        !           684:             if test -n "$libdir"; then
        !           685:               flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
        !           686: 
        !           687:               compile_command="$compile_command $flag"
        !           688:               finalize_command="$finalize_command $flag"
        !           689:             fi
        !           690:           elif test -n "$runpath_var"; then
        !           691:             # Do the same for the permanent run path.
        !           692:             case "$perm_rpath " in
        !           693:             *" $libdir "*) ;;
        !           694:             *) perm_rpath="$perm_rpath $libdir" ;;
        !           695:             esac
        !           696:           fi
        !           697: 
        !           698: 
        !           699:           case "$hardcode_action" in
        !           700:           immediate)
        !           701:             if test "$hardcode_direct" = no; then
        !           702:               compile_command="$compile_command $dir/$linklib"
        !           703:             elif test "$hardcode_minus_L" = no; then
        !           704:               compile_command="$compile_command -L$dir -l$name"
        !           705:             elif test "$hardcode_shlibpath_var" = no; then
        !           706:               compile_shlibpath="$compile_shlibpath$dir:"
        !           707:               compile_command="$compile_command -l$name"
        !           708:             fi
        !           709:             ;;
        !           710: 
        !           711:           relink)
        !           712:             # We need an absolute path.
        !           713:             case "$dir" in
        !           714:             /* | [A-Za-z]:\\*) ;;
        !           715:             *)
        !           716:               absdir=`cd "$dir" && pwd`
        !           717:               if test -z "$absdir"; then
        !           718:                 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
        !           719:                 exit 1
        !           720:               fi
        !           721:               dir="$absdir"
        !           722:               ;;
        !           723:             esac
        !           724: 
        !           725:             if test "$hardcode_direct" = yes; then
        !           726:               compile_command="$compile_command $dir/$linklib"
        !           727:             elif test "$hardcode_minus_L" = yes; then
        !           728:               compile_command="$compile_command -L$dir -l$name"
        !           729:             elif test "$hardcode_shlibpath_var" = yes; then
        !           730:               compile_shlibpath="$compile_shlibpath$dir:"
        !           731:               compile_command="$compile_command -l$name"
        !           732:             fi
        !           733:             ;;
        !           734: 
        !           735:           *)
        !           736:             $echo "$modename: \`$hardcode_action' is an unknown hardcode action" 1>&2
        !           737:             exit 1
        !           738:             ;;
        !           739:           esac
        !           740: 
        !           741:           # Finalize command for both is simple: just hardcode it.
        !           742:           if test "$hardcode_direct" = yes; then
        !           743:             finalize_command="$finalize_command $libdir/$linklib"
        !           744:           elif test "$hardcode_minus_L" = yes; then
        !           745:             finalize_command="$finalize_command -L$libdir -l$name"
        !           746:           elif test "$hardcode_shlibpath_var" = yes; then
        !           747:             finalize_shlibpath="$finalize_shlibpath$libdir:"
        !           748:             finalize_command="$finalize_command -l$name"
1.1       frystyk   749:           else
1.2     ! frystyk   750:             # We cannot seem to hardcode it, guess we'll fake it.
        !           751:             finalize_command="$finalize_command -L$libdir -l$name"
        !           752:           fi
1.1       frystyk   753:         else
                    754:           # Transform directly to old archives if we don't build new libraries.
                    755:           if test -n "$pic_flag" && test -z "$old_library"; then
1.2     ! frystyk   756:             $echo "$modename: cannot find static library for \`$arg'" 1>&2
        !           757:             exit 1
        !           758:           fi
        !           759: 
        !           760:          # Here we assume that one of hardcode_direct or hardcode_minus_L
        !           761:          # is not unsupported.  This is valid on all known static and
        !           762:          # shared platforms.
        !           763:          if test "$hardcode_direct" != unsupported; then
        !           764:            test -n "$old_library" && linklib="$old_library"
        !           765:            compile_command="$compile_command $dir/$linklib"
        !           766:            finalize_command="$finalize_command $dir/$linklib"
        !           767:          else
        !           768:            compile_command="$compile_command -L$dir -l$name"
        !           769:            finalize_command="$finalize_command -L$dir -l$name"
1.1       frystyk   770:          fi
                    771:         fi
1.2     ! frystyk   772: 
        !           773:        # Add in any libraries that this one depends upon.
        !           774:        compile_command="$compile_command$dependency_libs"
        !           775:        finalize_command="$finalize_command$dependency_libs"
1.1       frystyk   776:        continue
1.2     ! frystyk   777:         ;;
1.1       frystyk   778: 
1.2     ! frystyk   779:       # Some other compiler argument.
1.1       frystyk   780:       *)
1.2     ! frystyk   781:        # Unknown arguments in both finalize_command and compile_command need
        !           782:        # to be aesthetically quoted because they are evaled later.
        !           783:        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        !           784:        case "$arg" in
        !           785:        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
        !           786:          arg="\"$arg\""
        !           787:          ;;
        !           788:        esac
        !           789:         ;;
1.1       frystyk   790:       esac
                    791: 
1.2     ! frystyk   792:       # Now actually substitute the argument into the commands.
        !           793:       if test -n "$arg"; then
        !           794:        compile_command="$compile_command $arg"
        !           795:        finalize_command="$finalize_command $arg"
        !           796:       fi
1.1       frystyk   797:     done
                    798: 
                    799:     if test -n "$prev"; then
1.2     ! frystyk   800:       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
        !           801:       $echo "$help" 1>&2
1.1       frystyk   802:       exit 1
                    803:     fi
                    804: 
1.2     ! frystyk   805:     if test -n "$vinfo" && test -n "$release"; then
        !           806:       $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
        !           807:       $echo "$help" 1>&2
        !           808:       exit 1
1.1       frystyk   809:     fi
                    810: 
                    811:     oldlib=
                    812:     oldobjs=
                    813:     case "$output" in
                    814:     "")
1.2     ! frystyk   815:       $echo "$modename: you must specify an output file" 1>&2
        !           816:       $echo "$help" 1>&2
1.1       frystyk   817:       exit 1
                    818:       ;;
                    819: 
1.2     ! frystyk   820:     */* | *\\*)
        !           821:       $echo "$modename: output file \`$output' must have no directory components" 1>&2
1.1       frystyk   822:       exit 1
                    823:       ;;
                    824: 
1.2     ! frystyk   825:     *.a)
        !           826:       # Now set the variables for building old libraries.
        !           827:       build_libtool_libs=no
        !           828:       build_old_libs=yes
        !           829:       oldlib="$output"
        !           830:       $show "$rm $oldlib"
        !           831:       $run $rm $oldlib
        !           832:       ;;
        !           833: 
1.1       frystyk   834:     *.la)
1.2     ! frystyk   835:       # Make sure we only generate libraries of the form `libNAME.la'.
        !           836:       case "$output" in
        !           837:       lib*) ;;
        !           838:       *)
        !           839:        $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
        !           840:        $echo "$help" 1>&2
        !           841:        exit 1
        !           842:        ;;
        !           843:       esac
        !           844: 
        !           845:       name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
        !           846:       libname=`eval \\$echo \"$libname_spec\"`
1.1       frystyk   847: 
                    848:       # All the library-specific variables (install_libdir is set above).
                    849:       library_names=
                    850:       old_library=
                    851:       dlname=
                    852:       current=0
                    853:       revision=0
                    854:       age=0
                    855: 
                    856:       if test -n "$objs"; then
1.2     ! frystyk   857:         $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
        !           858:         exit 1
1.1       frystyk   859:       fi
                    860: 
                    861:       # How the heck are we supposed to write a wrapper for a shared library?
                    862:       if test -n "$link_against_libtool_libs"; then
1.2     ! frystyk   863:         $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
        !           864:         exit 1
        !           865:       fi
        !           866: 
        !           867:       if test -n "$dlfiles$dlprefiles"; then
        !           868:         $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
        !           869:         # Nullify the symbol file.
        !           870:         compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
        !           871:         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
        !           872:       fi
        !           873: 
        !           874:       if test -z "$rpath"; then
        !           875:         $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
        !           876:        $echo "$help" 1>&2
        !           877:         exit 1
1.1       frystyk   878:       fi
                    879: 
1.2     ! frystyk   880:       set dummy $rpath
        !           881:       if test $# -gt 2; then
        !           882:        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1.1       frystyk   883:       fi
1.2     ! frystyk   884:       install_libdir="$2"
1.1       frystyk   885: 
                    886:       # Parse the version information argument.
                    887:       IFS="${IFS=      }"; save_ifs="$IFS"; IFS=':'
                    888:       set dummy $vinfo
                    889:       IFS="$save_ifs"
                    890: 
                    891:       if test -n "$5"; then
1.2     ! frystyk   892:         $echo "$modename: too many parameters to \`-version-info'" 1>&2
        !           893:         $echo "$help" 1>&2
        !           894:         exit 1
1.1       frystyk   895:       fi
                    896: 
                    897:       test -n "$2" && current="$2"
                    898:       test -n "$3" && revision="$3"
                    899:       test -n "$4" && age="$4"
                    900: 
                    901:       # Check that each of the things are valid numbers.
                    902:       case "$current" in
                    903:       0 | [1-9] | [1-9][0-9]*) ;;
                    904:       *)
1.2     ! frystyk   905:         $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
        !           906:         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1.1       frystyk   907:         exit 1
1.2     ! frystyk   908:         ;;
1.1       frystyk   909:       esac
                    910: 
                    911:       case "$revision" in
                    912:       0 | [1-9] | [1-9][0-9]*) ;;
                    913:       *)
1.2     ! frystyk   914:         $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
        !           915:         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1.1       frystyk   916:         exit 1
1.2     ! frystyk   917:         ;;
1.1       frystyk   918:       esac
                    919: 
                    920:       case "$age" in
                    921:       0 | [1-9] | [1-9][0-9]*) ;;
                    922:       *)
1.2     ! frystyk   923:         $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
        !           924:         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1.1       frystyk   925:         exit 1
1.2     ! frystyk   926:         ;;
1.1       frystyk   927:       esac
                    928: 
                    929:       if test $age -gt $current; then
1.2     ! frystyk   930:         $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
        !           931:         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1.1       frystyk   932:         exit 1
                    933:       fi
                    934: 
                    935:       # Calculate the version variables.
                    936:       version_vars="version_type current age revision"
                    937:       case "$version_type" in
                    938:       none) ;;
                    939: 
                    940:       linux)
1.2     ! frystyk   941:         version_vars="$version_vars major versuffix"
        !           942:         major=`expr $current - $age`
        !           943:         versuffix="$major.$age.$revision"
        !           944:         ;;
1.1       frystyk   945: 
                    946:       osf)
1.2     ! frystyk   947:         version_vars="$version_vars versuffix verstring"
        !           948:         major=`expr $current - $age`
        !           949:         versuffix="$current.$age.$revision"
        !           950:         verstring="$versuffix"
        !           951: 
        !           952:         # Add in all the interfaces that we are compatible with.
        !           953:         loop=$age
        !           954:         while test $loop != 0; do
        !           955:           iface=`expr $current - $loop`
        !           956:           loop=`expr $loop - 1`
        !           957:           verstring="$verstring:${iface}.0"
        !           958:         done
1.1       frystyk   959: 
1.2     ! frystyk   960:         # Make executables depend on our current version.
        !           961:         verstring="$verstring:${current}.0"
        !           962:         ;;
1.1       frystyk   963: 
                    964:       sunos)
1.2     ! frystyk   965:         version_vars="$version_vars major versuffix"
        !           966:         major="$current"
        !           967:         versuffix="$current.$revision"
        !           968:         ;;
1.1       frystyk   969: 
                    970:       *)
1.2     ! frystyk   971:         $echo "$modename: unknown library version type \`$version_type'" 1>&2
        !           972:         echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
        !           973:         exit 1
        !           974:         ;;
1.1       frystyk   975:       esac
                    976: 
                    977:       # Create the output directory, or remove our outputs if we need to.
                    978:       if test -d $objdir; then
1.2     ! frystyk   979:         $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
        !           980:         $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
1.1       frystyk   981:       else
                    982:         $show "$mkdir $objdir"
1.2     ! frystyk   983:         $run $mkdir $objdir
        !           984:        status=$?
        !           985:        if test $status -eq 0 || test -d $objdir; then :
        !           986:        else
        !           987:          exit $status
        !           988:        fi
1.1       frystyk   989:       fi
                    990: 
                    991:       # Check to see if the archive will have undefined symbols.
                    992:       if test "$allow_undefined" = yes; then
1.2     ! frystyk   993:         if test "$allow_undefined_flag" = unsupported; then
        !           994:           $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
        !           995:           build_libtool_libs=no
        !           996:          build_old_libs=yes
        !           997:         fi
1.1       frystyk   998:       else
1.2     ! frystyk   999:         # Don't allow undefined symbols.
        !          1000:         allow_undefined_flag="$no_undefined_flag"
1.1       frystyk  1001:       fi
                   1002: 
1.2     ! frystyk  1003:       # Add libc to deplibs on all systems.
        !          1004:       dependency_libs="$deplibs"
        !          1005:       deplibs="$deplibs -lc"
        !          1006: 
1.1       frystyk  1007:       if test "$build_libtool_libs" = yes; then
1.2     ! frystyk  1008:         # Get the real and link names of the library.
        !          1009:         library_names=`eval \\$echo \"$library_names_spec\"`
        !          1010:         set dummy $library_names
        !          1011:         realname="$2"
        !          1012:         shift; shift
1.1       frystyk  1013: 
1.2     ! frystyk  1014:         if test -n "$soname_spec"; then
        !          1015:           soname=`eval \\$echo \"$soname_spec\"`
        !          1016:         else
        !          1017:           soname="$realname"
        !          1018:         fi
1.1       frystyk  1019: 
1.2     ! frystyk  1020:         lib="$objdir/$realname"
1.1       frystyk  1021:        for link
                   1022:        do
                   1023:          linknames="$linknames $link"
                   1024:        done
                   1025: 
1.2     ! frystyk  1026:         # Use standard objects if they are PIC.
        !          1027:         test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
1.1       frystyk  1028: 
1.2     ! frystyk  1029:         # Do each of the archive commands.
        !          1030:         cmds=`eval \\$echo \"$archive_cmds\"`
        !          1031:         IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
        !          1032:         for cmd in $cmds; do
        !          1033:           IFS="$save_ifs"
        !          1034:           $show "$cmd"
        !          1035:           $run eval "$cmd" || exit $?
        !          1036:         done
        !          1037:         IFS="$save_ifs"
1.1       frystyk  1038: 
1.2     ! frystyk  1039:         # Create links to the real library.
        !          1040:         for linkname in $linknames; do
        !          1041:           $show "(cd $objdir && $LN_S $realname $linkname)"
        !          1042:           $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
        !          1043:         done
1.1       frystyk  1044: 
1.2     ! frystyk  1045:         # If -export-dynamic was specified, set the dlname.
        !          1046:         if test "$export_dynamic" = yes; then
        !          1047:           # On all known operating systems, these are identical.
        !          1048:           dlname="$soname"
        !          1049:         fi
1.1       frystyk  1050:       fi
1.2     ! frystyk  1051: 
        !          1052:       # Now set the variables for building old libraries.
        !          1053:       oldlib="$objdir/$libname.a"
1.1       frystyk  1054:       ;;
                   1055: 
                   1056:     *.lo | *.o)
                   1057:       if test -n "$link_against_libtool_libs"; then
1.2     ! frystyk  1058:         $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
        !          1059:         exit 1
1.1       frystyk  1060:       fi
                   1061: 
                   1062:       if test -n "$deplibs"; then
1.2     ! frystyk  1063:         $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
1.1       frystyk  1064:       fi
                   1065: 
1.2     ! frystyk  1066:       if test -n "$dlfiles$dlprefiles"; then
        !          1067:         $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
        !          1068:         # Nullify the symbol file.
        !          1069:         compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
        !          1070:         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
        !          1071:       fi
        !          1072: 
        !          1073:       if test -n "$rpath"; then
        !          1074:         $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
1.1       frystyk  1075:       fi
                   1076: 
                   1077:       if test -n "$vinfo"; then
1.2     ! frystyk  1078:         $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
        !          1079:       fi
        !          1080: 
        !          1081:       if test -n "$release"; then
        !          1082:         $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1.1       frystyk  1083:       fi
                   1084: 
                   1085:       case "$output" in
                   1086:       *.lo)
1.2     ! frystyk  1087:         if test -n "$objs"; then
        !          1088:           $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
        !          1089:           exit 1
        !          1090:         fi
        !          1091:         libobj="$output"
        !          1092:         obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
        !          1093:         ;;
1.1       frystyk  1094:       *)
                   1095:         libobj=
1.2     ! frystyk  1096:         obj="$output"
        !          1097:         ;;
1.1       frystyk  1098:       esac
                   1099: 
                   1100:       # Delete the old objects.
                   1101:       $run $rm $obj $libobj
                   1102: 
                   1103:       # Create the old-style object.
1.2     ! frystyk  1104:       reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^       ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1.1       frystyk  1105: 
                   1106:       output="$obj"
1.2     ! frystyk  1107:       cmds=`eval \\$echo \"$reload_cmds\"`
1.1       frystyk  1108:       IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
                   1109:       for cmd in $cmds; do
                   1110:         IFS="$save_ifs"
                   1111:         $show "$cmd"
1.2     ! frystyk  1112:         $run eval "$cmd" || exit $?
1.1       frystyk  1113:       done
                   1114:       IFS="$save_ifs"
                   1115: 
                   1116:       # Exit if we aren't doing a library object file.
                   1117:       test -z "$libobj" && exit 0
                   1118: 
                   1119:       if test "$build_libtool_libs" != yes; then
                   1120:         # Create an invalid libtool object if no PIC, so that we don't
                   1121:         # accidentally link it into a program.
1.2     ! frystyk  1122:         $show "echo timestamp > $libobj"
        !          1123:         $run eval "echo timestamp > $libobj" || exit $?
        !          1124:         exit 0
1.1       frystyk  1125:       fi
                   1126: 
                   1127:       if test -n "$pic_flag"; then
1.2     ! frystyk  1128:         # Only do commands if we really have different PIC objects.
        !          1129:         reload_objs="$libobjs"
        !          1130:         output="$libobj"
        !          1131:         cmds=`eval \\$echo \"$reload_cmds\"`
1.1       frystyk  1132:         IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
                   1133:         for cmd in $cmds; do
                   1134:           IFS="$save_ifs"
                   1135:           $show "$cmd"
                   1136:           $run eval "$cmd" || exit $?
                   1137:         done
                   1138:         IFS="$save_ifs"
                   1139:       else
                   1140:         # Just create a symlink.
                   1141:         $show "$LN_S $obj $libobj"
                   1142:         $run $LN_S $obj $libobj || exit 1
                   1143:       fi
                   1144: 
                   1145:       exit 0
                   1146:       ;;
                   1147: 
                   1148:     *)
1.2     ! frystyk  1149:       if test -n "$vinfo"; then
        !          1150:         $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
1.1       frystyk  1151:       fi
                   1152: 
1.2     ! frystyk  1153:       if test -n "$release"; then
        !          1154:         $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1.1       frystyk  1155:       fi
                   1156: 
1.2     ! frystyk  1157:       if test -n "$rpath"; then
        !          1158:        # If the user specified any rpath flags, then add them.
        !          1159:        for libdir in $rpath; do
        !          1160:           if test -n "$hardcode_libdir_flag_spec"; then
        !          1161:             if test -n "$hardcode_libdir_separator"; then
        !          1162:               if test -z "$hardcode_libdirs"; then
        !          1163:                 # Put the magic libdir with the hardcode flag.
        !          1164:                 hardcode_libdirs="$libdir"
        !          1165:                 libdir="@HARDCODE_LIBDIRS@"
        !          1166:               else
        !          1167:                 # Just accumulate the unique libdirs.
        !          1168:                case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
        !          1169:                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
        !          1170:                  ;;
        !          1171:                *)
        !          1172:                  hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
        !          1173:                  ;;
        !          1174:                esac
        !          1175:                 libdir=
        !          1176:               fi
        !          1177:             fi
        !          1178: 
        !          1179:             if test -n "$libdir"; then
        !          1180:               flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
        !          1181: 
        !          1182:               compile_command="$compile_command $flag"
        !          1183:               finalize_command="$finalize_command $flag"
        !          1184:             fi
        !          1185:           elif test -n "$runpath_var"; then
        !          1186:             case "$perm_rpath " in
        !          1187:             *" $libdir "*) ;;
        !          1188:             *) perm_rpath="$perm_rpath $libdir" ;;
        !          1189:             esac
        !          1190:           fi
        !          1191:        done
1.1       frystyk  1192:       fi
                   1193: 
1.2     ! frystyk  1194:       # Substitute the hardcoded libdirs into the compile commands.
        !          1195:       if test -n "$hardcode_libdir_separator"; then
        !          1196:        compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
        !          1197:        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
        !          1198:       fi
        !          1199: 
        !          1200:       if test -n "$libobjs" && test "$build_old_libs" = yes; then
        !          1201:         # Transform all the library objects into standard objects.
        !          1202:         compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
        !          1203:         finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
        !          1204:       fi
        !          1205: 
        !          1206:       if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
        !          1207:         dlsyms="${output}S.c"
        !          1208:       else
        !          1209:         dlsyms=
        !          1210:       fi
        !          1211: 
        !          1212:       if test -n "$dlsyms"; then
        !          1213:         # Add our own program objects to the preloaded list.
        !          1214:         dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
        !          1215: 
        !          1216:        # Discover the nlist of each of the dlfiles.
        !          1217:         nlist="$objdir/${output}.nm"
1.1       frystyk  1218: 
1.2     ! frystyk  1219:        if test -d $objdir; then
        !          1220:          $show "$rm $nlist ${nlist}T"
        !          1221:          $run $rm "$nlist" "${nlist}T"
        !          1222:        else
        !          1223:          $show "$mkdir $objdir"
        !          1224:          $run $mkdir $objdir
1.1       frystyk  1225:          status=$?
1.2     ! frystyk  1226:          if test $status -eq 0 || test -d $objdir; then :
        !          1227:          else
        !          1228:            exit $status
        !          1229:          fi
1.1       frystyk  1230:        fi
1.2     ! frystyk  1231: 
        !          1232:         for arg in $dlprefiles; do
        !          1233:          $show "extracting global C symbols from \`$arg'"
        !          1234:          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
        !          1235:         done
        !          1236: 
        !          1237:         # Parse the name list into a source file.
        !          1238:         $show "creating $objdir/$dlsyms"
        !          1239:         if test -z "$run"; then
        !          1240:          # Make sure we at least have an empty file.
        !          1241:          test -f "$nlist" || : > "$nlist"
        !          1242: 
        !          1243:          # Try sorting and uniquifying the output.
        !          1244:          if sort "$nlist" | uniq > "$nlist"T; then
        !          1245:            mv -f "$nlist"T "$nlist"
        !          1246:            wcout=`wc "$nlist" 2>/dev/null`
        !          1247:            count=`echo "X$wcout" | $Xsed -e 's/^[      ]*\([0-9][0-9]*\).*$/\1/'`
        !          1248:            (test "$count" -ge 0) 2>/dev/null || count=-1
        !          1249:          else
        !          1250:            $rm "$nlist"T
        !          1251:            count=-1
        !          1252:          fi
        !          1253: 
        !          1254:          case "$dlsyms" in
        !          1255:          "") ;;
        !          1256:          *.c)
        !          1257:            $echo > "$objdir/$dlsyms" \
        !          1258: "/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
        !          1259: /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
        !          1260: 
        !          1261: #ifdef __cplusplus
        !          1262: extern \"C\" {
        !          1263: #endif
        !          1264: 
        !          1265: /* Prevent the only kind of declaration conflicts we can make. */
        !          1266: #define dld_preloaded_symbol_count some_other_symbol
        !          1267: #define dld_preloaded_symbols some_other_symbol
        !          1268: 
        !          1269: /* External symbol declarations for the compiler. */"
        !          1270: 
        !          1271:            if test -f "$nlist"; then
        !          1272:              sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
        !          1273:            else
        !          1274:              echo '/* NONE */' >> "$objdir/$dlsyms"
        !          1275: EOF
        !          1276:            fi
        !          1277: 
        !          1278:            $echo >> "$objdir/$dlsyms" \
        !          1279: "
        !          1280: #undef dld_preloaded_symbol_count
        !          1281: #undef dld_preloaded_symbols
        !          1282: 
        !          1283: #if defined (__STDC__) && __STDC__
        !          1284: # define __ptr_t void *
        !          1285: #else
        !          1286: # define __ptr_t char *
        !          1287: #endif
        !          1288: 
        !          1289: /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
        !          1290: int dld_preloaded_symbol_count = $count;
        !          1291: 
        !          1292: /* The mapping between symbol names and symbols. */
        !          1293: struct {
        !          1294:   char *name;
        !          1295:   __ptr_t address;
        !          1296: }
        !          1297: dld_preloaded_symbols[] =
        !          1298: {"
        !          1299: 
        !          1300:            if test -f "$nlist"; then
        !          1301:              sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
        !          1302:            fi
        !          1303: 
        !          1304:            $echo >> "$objdir/$dlsyms" \
        !          1305: "  {0, (__ptr_t) 0}
        !          1306: };
        !          1307: 
        !          1308: #ifdef __cplusplus
        !          1309: }
        !          1310: #endif"
        !          1311:            ;;
        !          1312: 
        !          1313:          *)
        !          1314:            $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
        !          1315:            exit 1
        !          1316:            ;;
        !          1317:          esac
        !          1318:         fi
        !          1319: 
        !          1320:         # Now compile the dynamic symbol file.
        !          1321:         $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
        !          1322:         $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
        !          1323: 
        !          1324:         # Transform the symbol file into the correct name.
        !          1325:         compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
        !          1326:         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
        !          1327:       elif test "$export_dynamic" != yes; then
        !          1328:         test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
        !          1329:       else
        !          1330:         # We keep going just in case the user didn't refer to
        !          1331:         # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
        !          1332:         # really was required.
        !          1333:         $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
        !          1334: 
        !          1335:         # Nullify the symbol file.
        !          1336:         compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
        !          1337:         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
        !          1338:       fi
        !          1339: 
        !          1340:       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
        !          1341:         # Replace the output file specification.
        !          1342:         compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
        !          1343:         finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
        !          1344: 
        !          1345:         # We have no uninstalled library dependencies, so finalize right now.
        !          1346:         $show "$compile_command"
        !          1347:         $run eval "$compile_command"
        !          1348:         exit $?
1.1       frystyk  1349:       fi
                   1350: 
                   1351:       # Replace the output file specification.
1.2     ! frystyk  1352:       compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
        !          1353:       finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
1.1       frystyk  1354: 
                   1355:       # Create the binary in the object directory, then wrap it.
                   1356:       if test -d $objdir; then :
                   1357:       else
                   1358:         $show "$mkdir $objdir"
1.2     ! frystyk  1359:        $run $mkdir $objdir
        !          1360:        status=$?
        !          1361:        if test $status -eq 0 || test -d $objdir; then :
        !          1362:        else
        !          1363:          exit $status
        !          1364:        fi
1.1       frystyk  1365:       fi
                   1366: 
                   1367:       if test -n "$shlibpath_var"; then
                   1368:         # We should set the shlibpath_var
1.2     ! frystyk  1369:         rpath=
        !          1370:         for dir in $temp_rpath; do
        !          1371:           case "$dir" in
        !          1372:           /* | [A-Za-z]:\\*)
        !          1373:             # Absolute path.
        !          1374:             rpath="$rpath$dir:"
        !          1375:             ;;
        !          1376:           *)
        !          1377:             # Relative path: add a thisdir entry.
        !          1378:             rpath="$rpath\$thisdir/$dir:"
        !          1379:             ;;
        !          1380:           esac
        !          1381:         done
        !          1382:         temp_rpath="$rpath"
1.1       frystyk  1383:       fi
                   1384: 
                   1385:       # Delete the old output file.
                   1386:       $run $rm $output
                   1387: 
                   1388:       if test -n "$compile_shlibpath"; then
1.2     ! frystyk  1389:         compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1.1       frystyk  1390:       fi
                   1391:       if test -n "$finalize_shlibpath"; then
1.2     ! frystyk  1392:         finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1.1       frystyk  1393:       fi
                   1394: 
1.2     ! frystyk  1395:       if test -n "$runpath_var" && test -n "$perm_rpath"; then
        !          1396:         # We should set the runpath_var.
        !          1397:         rpath=
        !          1398:         for dir in $perm_rpath; do
        !          1399:           rpath="$rpath$dir:"
        !          1400:         done
        !          1401:         compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
        !          1402:         finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1.1       frystyk  1403:       fi
                   1404: 
                   1405:       case "$hardcode_action" in
                   1406:       relink)
1.2     ! frystyk  1407:         # AGH! Flame the AIX and HP-UX people for me, will ya?
        !          1408:         $echo "$modename: warning: using a buggy system linker" 1>&2
        !          1409:         $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
        !          1410:         ;;
1.1       frystyk  1411:       esac
                   1412: 
                   1413:       $show "$compile_command"
                   1414:       $run eval "$compile_command" || exit $?
                   1415: 
                   1416:       # Now create the wrapper script.
1.2     ! frystyk  1417:       $show "creating $output"
        !          1418: 
        !          1419:       # Quote the finalize command for shipping.
        !          1420:       finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
        !          1421: 
        !          1422:       # Quote $echo for shipping.
        !          1423:       qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
1.1       frystyk  1424: 
                   1425:       # Only actually do things if our run command is non-null.
                   1426:       if test -z "$run"; then
1.2     ! frystyk  1427:         $rm $output
        !          1428:         trap "$rm $output; exit 1" 1 2 15
1.1       frystyk  1429: 
1.2     ! frystyk  1430:         $echo > $output \
        !          1431: "#! /bin/sh
1.1       frystyk  1432: 
                   1433: # $output - temporary wrapper script for $objdir/$output
1.2     ! frystyk  1434: # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1.1       frystyk  1435: #
                   1436: # The $output program cannot be directly executed until all the libtool
                   1437: # libraries that it depends on are installed.
                   1438: #
                   1439: # This wrapper script should never be moved out of \``pwd`'.
                   1440: # If it is, it will not operate correctly.
                   1441: 
1.2     ! frystyk  1442: # Sed substitution that helps us do robust quoting.  It backslashifies
        !          1443: # metacharacters that are still active within double-quoted strings.
        !          1444: Xsed='sed -e s/^X//'
        !          1445: sed_quote_subst='$sed_quote_subst'
        !          1446: 
        !          1447: # The HP-UX ksh and POSIX shell print the target directory to stdout
        !          1448: # if CDPATH is set.
        !          1449: if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
        !          1450: 
1.1       frystyk  1451: # This environment variable determines our operation mode.
1.2     ! frystyk  1452: if test \"\$libtool_install_magic\" = \"$magic\"; then
1.1       frystyk  1453:   # install mode needs the following variables:
                   1454:   link_against_libtool_libs='$link_against_libtool_libs'
1.2     ! frystyk  1455:   finalize_command=\"$finalize_command\"
1.1       frystyk  1456: else
1.2     ! frystyk  1457:   # When we are sourced in execute mode, \$file and \$echo are already set.
        !          1458:   if test \"\$libtool_execute_magic\" = \"$magic\"; then :
        !          1459:   else
        !          1460:     echo=\"$qecho\"
        !          1461:     file=\"\$0\"
        !          1462:   fi
        !          1463: 
1.1       frystyk  1464:   # Find the directory that this script lives in.
1.2     ! frystyk  1465:   thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
        !          1466:   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
1.1       frystyk  1467: 
1.2     ! frystyk  1468:   # Follow symbolic links until we get to the real thisdir.
        !          1469:   file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
        !          1470:   while test -n \"\$file\"; do
        !          1471:     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
        !          1472: 
        !          1473:     # If there was a directory component, then change thisdir.
        !          1474:     if test \"x\$destdir\" != \"x\$file\"; then
        !          1475:       case \"\$destdir\" in
        !          1476:       /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
        !          1477:       *) thisdir=\"\$thisdir/\$destdir\" ;;
        !          1478:       esac
        !          1479:     fi
1.1       frystyk  1480: 
1.2     ! frystyk  1481:     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
        !          1482:     file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
        !          1483:   done
1.1       frystyk  1484: 
1.2     ! frystyk  1485:   # Try to get the absolute directory name.
        !          1486:   absdir=\`cd \"\$thisdir\" && pwd\`
        !          1487:   test -n \"\$absdir\" && thisdir=\"\$absdir\"
1.1       frystyk  1488: 
1.2     ! frystyk  1489:   progdir=\"\$thisdir/$objdir\"
        !          1490:   program='$output'
1.1       frystyk  1491: 
1.2     ! frystyk  1492:   if test -f \"\$progdir/\$program\"; then"
1.1       frystyk  1493: 
1.2     ! frystyk  1494:         # Export our shlibpath_var if we have one.
        !          1495:         if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
        !          1496:           $echo >> $output \
        !          1497: "    # Add our own library path to $shlibpath_var
        !          1498:     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
1.1       frystyk  1499: 
                   1500:     # Some systems cannot cope with colon-terminated $shlibpath_var
1.2     ! frystyk  1501:     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
1.1       frystyk  1502: 
                   1503:     export $shlibpath_var
1.2     ! frystyk  1504: "
        !          1505:         fi
        !          1506: 
        !          1507:         echo >> $output \
        !          1508: "    if test \"\$libtool_execute_magic\" != \"$magic\"; then
        !          1509:       # Run the actual program with our arguments.
        !          1510:       args=
        !          1511:       for arg
        !          1512:       do
        !          1513:         # Quote arguments (to preserve shell metacharacters).
        !          1514:        arg=\`\$echo \"X\$arg\" | \$Xsed -e \"\$sed_quote_subst\"\`
        !          1515:         args=\"\$args \\\"\$arg\\\"\"
        !          1516:       done
1.1       frystyk  1517: 
1.2     ! frystyk  1518:       # Export the path to the program.
        !          1519:       PATH=\"\$progdir:\$PATH\"
        !          1520:       export PATH
1.1       frystyk  1521: 
1.2     ! frystyk  1522:       eval \"exec \$program \$args\"
1.1       frystyk  1523: 
1.2     ! frystyk  1524:       \$echo \"\$0: cannot exec \$program \$args\"
        !          1525:       exit 1
        !          1526:     fi
1.1       frystyk  1527:   else
                   1528:     # The program doesn't exist.
1.2     ! frystyk  1529:     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
        !          1530:     \$echo \"This script is just a wrapper for \$program.\" 1>&2
        !          1531:     echo \"See the $PACKAGE documentation for more information.\" 1>&2
1.1       frystyk  1532:     exit 1
                   1533:   fi
1.2     ! frystyk  1534: fi"
        !          1535:         chmod +x $output
1.1       frystyk  1536:       fi
                   1537:       exit 0
                   1538:       ;;
                   1539:     esac
                   1540: 
                   1541:     # See if we need to build an old-fashioned archive.
                   1542:     if test "$build_old_libs" = "yes"; then
                   1543:       # Transform .lo files to .o files.
1.2     ! frystyk  1544:       oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1.1       frystyk  1545: 
1.2     ! frystyk  1546:       # Do each command in the archive commands.
        !          1547:       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
        !          1548:        cmds=`eval \\$echo \"$old_archive_from_new_cmds\"`
1.1       frystyk  1549:       else
1.2     ! frystyk  1550:        cmds=`eval \\$echo \"$old_archive_cmds\"`
1.1       frystyk  1551:       fi
                   1552:       IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
                   1553:       for cmd in $cmds; do
                   1554:         IFS="$save_ifs"
                   1555:         $show "$cmd"
1.2     ! frystyk  1556:         $run eval "$cmd" || exit $?
1.1       frystyk  1557:       done
                   1558:       IFS="$save_ifs"
                   1559:     fi
                   1560: 
                   1561:     # Now create the libtool archive.
                   1562:     case "$output" in
                   1563:     *.la)
                   1564:       old_library=
                   1565:       test "$build_old_libs" = yes && old_library="$libname.a"
                   1566: 
1.2     ! frystyk  1567:       $show "creating $output"
1.1       frystyk  1568: 
                   1569:       # Only create the output if not a dry run.
                   1570:       if test -z "$run"; then
1.2     ! frystyk  1571:         echo > $output \
        !          1572: "# $output - a libtool library file
        !          1573: # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1.1       frystyk  1574: 
                   1575: # The name that we can dlopen(3).
                   1576: dlname='$dlname'
                   1577: 
                   1578: # Names of this library.
                   1579: library_names='$library_names'
                   1580: 
                   1581: # The name of the static archive.
                   1582: old_library='$old_library'
                   1583: 
1.2     ! frystyk  1584: # Libraries that this one depends upon.
        !          1585: dependency_libs='$dependency_libs'
        !          1586: 
1.1       frystyk  1587: # Version information for $libname.
                   1588: current=$current
                   1589: age=$age
                   1590: revision=$revision
                   1591: 
                   1592: # Directory that this library needs to be installed in:
1.2     ! frystyk  1593: libdir='$install_libdir'"
1.1       frystyk  1594:       fi
                   1595: 
                   1596:       # Do a symbolic link so that the libtool archive can be found in
                   1597:       # LD_LIBRARY_PATH before the program is installed.
                   1598:       $show "(cd $objdir && $LN_S ../$output $output)"
                   1599:       $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
                   1600:       ;;
                   1601:     esac
                   1602:     exit 0
                   1603:     ;;
                   1604: 
                   1605:   # libtool install mode
                   1606:   install)
1.2     ! frystyk  1607:     modename="$modename: install"
        !          1608: 
        !          1609:     # There may be an optional /bin/sh argument at the beginning of
        !          1610:     # install_prog (especially on Windows NT).
        !          1611:     if test "$nonopt" = "$SHELL"; then
        !          1612:       # Aesthetically quote it.
        !          1613:       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
        !          1614:       case "$arg" in
        !          1615:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
        !          1616:        arg="\"$arg\""
        !          1617:        ;;
        !          1618:       esac
        !          1619:       install_prog="$arg "
        !          1620:       arg="$1"
        !          1621:       shift
        !          1622:     else
        !          1623:       install_prog=
        !          1624:       arg="$nonopt"
        !          1625:     fi
1.1       frystyk  1626: 
1.2     ! frystyk  1627:     # The real first argument should be the name of the installation program.
        !          1628:     # Aesthetically quote it.
        !          1629:     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        !          1630:     case "$arg" in
        !          1631:     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*)
        !          1632:       arg="\"$arg\""
        !          1633:       ;;
        !          1634:     esac
        !          1635:     install_prog="$install_prog$arg"
1.1       frystyk  1636: 
                   1637:     # We need to accept at least all the BSD install flags.
                   1638:     dest=
                   1639:     files=
                   1640:     opts=
                   1641:     prev=
                   1642:     install_type=
                   1643:     isdir=
                   1644:     stripme=
                   1645:     for arg
                   1646:     do
                   1647:       if test -n "$dest"; then
                   1648:         files="$files $dest"
1.2     ! frystyk  1649:         dest="$arg"
        !          1650:         continue
1.1       frystyk  1651:       fi
                   1652: 
                   1653:       case "$arg" in
                   1654:       -d) isdir=yes ;;
                   1655:       -f) prev="-f" ;;
                   1656:       -g) prev="-g" ;;
                   1657:       -m) prev="-m" ;;
                   1658:       -o) prev="-o" ;;
                   1659:       -s)
1.2     ! frystyk  1660:         stripme=" -s"
        !          1661:         continue
        !          1662:         ;;
1.1       frystyk  1663:       -*) ;;
                   1664: 
                   1665:       *)
1.2     ! frystyk  1666:         # If the previous option needed an argument, then skip it.
        !          1667:         if test -n "$prev"; then
        !          1668:           prev=
        !          1669:         else
        !          1670:           dest="$arg"
        !          1671:           continue
        !          1672:         fi
1.1       frystyk  1673:         ;;
                   1674:       esac
1.2     ! frystyk  1675: 
        !          1676:       # Aesthetically quote the argument.
        !          1677:       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        !          1678:       case "$arg" in
        !          1679:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
        !          1680:        arg="\"$arg\""
        !          1681:        ;;
        !          1682:       esac
1.1       frystyk  1683:       install_prog="$install_prog $arg"
                   1684:     done
                   1685: 
                   1686:     if test -z "$install_prog"; then
1.2     ! frystyk  1687:       $echo "$modename: you must specify an install program" 1>&2
        !          1688:       $echo "$help" 1>&2
1.1       frystyk  1689:       exit 1
                   1690:     fi
                   1691: 
                   1692:     if test -n "$prev"; then
1.2     ! frystyk  1693:       $echo "$modename: the \`$prev' option requires an argument" 1>&2
        !          1694:       $echo "$help" 1>&2
1.1       frystyk  1695:       exit 1
                   1696:     fi
                   1697: 
                   1698:     if test -z "$files"; then
                   1699:       if test -z "$dest"; then
1.2     ! frystyk  1700:         $echo "$modename: no file or destination specified" 1>&2
1.1       frystyk  1701:       else
1.2     ! frystyk  1702:         $echo "$modename: you must specify a destination" 1>&2
1.1       frystyk  1703:       fi
1.2     ! frystyk  1704:       $echo "$help" 1>&2
1.1       frystyk  1705:       exit 1
                   1706:     fi
                   1707: 
                   1708:     # Strip any trailing slash from the destination.
1.2     ! frystyk  1709:     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
1.1       frystyk  1710: 
                   1711:     # Check to see that the destination is a directory.
                   1712:     test -d "$dest" && isdir=yes
                   1713:     if test -n "$isdir"; then
                   1714:       destdir="$dest"
                   1715:       destname=
                   1716:     else
1.2     ! frystyk  1717:       destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
        !          1718:       test "X$destdir" = "X$dest" && destdir=.
        !          1719:       destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
1.1       frystyk  1720: 
                   1721:       # Not a directory, so check to see that there is only one file specified.
                   1722:       set dummy $files
                   1723:       if test $# -gt 2; then
1.2     ! frystyk  1724:         $echo "$modename: \`$dest' is not a directory" 1>&2
        !          1725:         $echo "$help" 1>&2
        !          1726:         exit 1
1.1       frystyk  1727:       fi
                   1728:     fi
                   1729:     case "$destdir" in
1.2     ! frystyk  1730:     /* | [A-Za-z]:\\*) ;;
1.1       frystyk  1731:     *)
                   1732:       for file in $files; do
1.2     ! frystyk  1733:         case "$file" in
        !          1734:         *.lo) ;;
        !          1735:         *)
        !          1736:           $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
        !          1737:           $echo "$help" 1>&2
        !          1738:           exit 1
        !          1739:           ;;
        !          1740:         esac
1.1       frystyk  1741:       done
                   1742:       ;;
                   1743:     esac
                   1744: 
1.2     ! frystyk  1745:     # This variable tells wrapper scripts just to set variables rather
        !          1746:     # than running their programs.
        !          1747:     libtool_install_magic="$magic"
        !          1748: 
1.1       frystyk  1749:     staticlibs=
                   1750:     future_libdirs=
                   1751:     current_libdirs=
                   1752:     for file in $files; do
                   1753: 
                   1754:       # Do each installation.
                   1755:       case "$file" in
                   1756:       *.a)
1.2     ! frystyk  1757:         # Do the static libraries later.
        !          1758:         staticlibs="$staticlibs $file"
        !          1759:         ;;
1.1       frystyk  1760: 
                   1761:       *.la)
1.2     ! frystyk  1762:         # Check to see that this really is a libtool archive.
        !          1763:         if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
        !          1764:         else
        !          1765:           $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
        !          1766:           $echo "$help" 1>&2
        !          1767:           exit 1
        !          1768:         fi
1.1       frystyk  1769: 
1.2     ! frystyk  1770:         library_names=
        !          1771:         old_library=
        !          1772:         # If there is no directory component, then add one.
        !          1773:         case "$file" in
        !          1774:         */* | *\\*) . $file ;;
        !          1775:         *) . ./$file ;;
        !          1776:         esac
1.1       frystyk  1777: 
1.2     ! frystyk  1778:         # Add the libdir to current_libdirs if it is the destination.
        !          1779:         if test "X$destdir" = "X$libdir"; then
        !          1780:           case "$current_libdirs " in
        !          1781:           *" $libdir "*) ;;
        !          1782:           *) current_libdirs="$current_libdirs $libdir" ;;
        !          1783:           esac
        !          1784:         else
        !          1785:           # Note the libdir as a future libdir.
        !          1786:           case "$future_libdirs " in
        !          1787:           *" $libdir "*) ;;
        !          1788:           *) future_libdirs="$future_libdirs $libdir" ;;
        !          1789:           esac
        !          1790:         fi
1.1       frystyk  1791: 
1.2     ! frystyk  1792:         dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
        !          1793:         test "X$dir" = "X$file/" && dir=
        !          1794:         dir="$dir$objdir"
        !          1795: 
        !          1796:         # See the names of the shared library.
        !          1797:         set dummy $library_names
        !          1798:         if test -n "$2"; then
        !          1799:           realname="$2"
        !          1800:           shift
        !          1801:           shift
        !          1802: 
        !          1803:           # Install the shared library and build the symlinks.
        !          1804:           $show "$install_prog $dir/$realname $destdir/$realname"
        !          1805:           $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
        !          1806:           test "X$dlname" = "X$realname" && dlname=
1.1       frystyk  1807: 
1.2     ! frystyk  1808:           if test $# -gt 0; then
        !          1809:             # Delete the old symlinks.
1.1       frystyk  1810:             rmcmd="$rm"
                   1811:             for linkname
                   1812:             do
                   1813:               rmcmd="$rmcmd $destdir/$linkname"
                   1814:             done
                   1815:             $show "$rmcmd"
                   1816:             $run $rmcmd
                   1817: 
1.2     ! frystyk  1818:             # ... and create new ones.
        !          1819:             for linkname
        !          1820:             do
        !          1821:               test "X$dlname" = "X$linkname" && dlname=
        !          1822:               $show "(cd $destdir && $LN_S $realname $linkname)"
        !          1823:               $run eval "(cd $destdir && $LN_S $realname $linkname)"
        !          1824:             done
        !          1825:           fi
1.1       frystyk  1826: 
1.2     ! frystyk  1827:           if test -n "$dlname"; then
        !          1828:             # Install the dynamically-loadable library.
        !          1829:             $show "$install_prog $dir/$dlname $destdir/$dlname"
        !          1830:             $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
        !          1831:           fi
        !          1832: 
        !          1833:           # Do each command in the postinstall commands.
        !          1834:           lib="$destdir/$realname"
        !          1835:           cmds=`eval \\$echo \"$postinstall_cmds\"`
        !          1836:           IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
        !          1837:           for cmd in $cmds; do
        !          1838:             IFS="$save_ifs"
        !          1839:             $show "$cmd"
        !          1840:             $run eval "$cmd" || exit $?
        !          1841:           done
        !          1842:           IFS="$save_ifs"
        !          1843:         fi
1.1       frystyk  1844: 
1.2     ! frystyk  1845:         # Install the pseudo-library for information purposes.
        !          1846:         name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
        !          1847:         $show "$install_prog $file $destdir/$name"
        !          1848:         $run eval "$install_prog $file $destdir/$name" || exit $?
1.1       frystyk  1849: 
1.2     ! frystyk  1850:         # Maybe install the static library, too.
        !          1851:         test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
        !          1852:         ;;
1.1       frystyk  1853: 
                   1854:       *.lo)
                   1855:         # Install (i.e. copy) a libtool object.
                   1856: 
                   1857:         # Figure out destination file name, if it wasn't already specified.
                   1858:         if test -n "$destname"; then
1.2     ! frystyk  1859:           destfile="$destdir/$destname"
        !          1860:         else
        !          1861:           destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
        !          1862:           destfile="$destdir/$destfile"
1.1       frystyk  1863:         fi
                   1864: 
1.2     ! frystyk  1865:         # Deduce the name of the destination old-style object file.
        !          1866:         case "$destfile" in
        !          1867:         *.lo)
        !          1868:           staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/\.o/'`
        !          1869:           ;;
        !          1870:         *.o)
        !          1871:           staticdest="$destfile"
        !          1872:           destfile=
        !          1873:           ;;
        !          1874:         *)
        !          1875:           $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
        !          1876:           $echo "$help" 1>&2
        !          1877:           exit 1
1.1       frystyk  1878:           ;;
1.2     ! frystyk  1879:         esac
1.1       frystyk  1880: 
1.2     ! frystyk  1881:         # Install the libtool object if requested.
        !          1882:         if test -n "$destfile"; then
        !          1883:           $show "$install_prog $file $destfile"
        !          1884:           $run eval "$install_prog $file $destfile" || exit $?
        !          1885:         fi
1.1       frystyk  1886: 
1.2     ! frystyk  1887:         # Install the old object if enabled.
        !          1888:         if test "$build_old_libs" = yes; then
        !          1889:           # Deduce the name of the old-style object file.
        !          1890:           staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/\.o/'`
1.1       frystyk  1891: 
1.2     ! frystyk  1892:           $show "$install_prog $staticobj $staticdest"
        !          1893:           $run eval "$install_prog \$staticobj \$staticdest" || exit $?
        !          1894:         fi
        !          1895:         exit 0
        !          1896:         ;;
1.1       frystyk  1897: 
                   1898:       *)
1.2     ! frystyk  1899:         # Do a test to see if this is really a libtool program.
        !          1900:         if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
        !          1901:           link_against_libtool_libs=
        !          1902:           finalize_command=
        !          1903: 
        !          1904:           # If there is no directory component, then add one.
        !          1905:           case "$file" in
        !          1906:           */* | *\\*) . $file ;;
        !          1907:           *) . ./$file ;;
        !          1908:           esac
        !          1909: 
        !          1910:           # Check the variables that should have been set.
        !          1911:           if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
        !          1912:             $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
        !          1913:             exit 1
        !          1914:           fi
        !          1915: 
        !          1916:           finalize=yes
        !          1917:           for lib in $link_against_libtool_libs; do
        !          1918:             # Check to see that each library is installed.
        !          1919:             libdir=
        !          1920:             if test -f "$lib"; then
        !          1921:               # If there is no directory component, then add one.
        !          1922:               case "$lib" in
        !          1923:               */* | *\\*) . $lib ;;
        !          1924:               *) . ./$lib ;;
        !          1925:               esac
        !          1926:             fi
        !          1927:             libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
        !          1928:             if test -z "$libdir"; then
        !          1929:               $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
        !          1930:             elif test -f "$libfile"; then :
        !          1931:             else
        !          1932:               $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
        !          1933:               finalize=no
        !          1934:             fi
        !          1935:           done
        !          1936: 
        !          1937:           if test "$hardcode_action" = relink; then
        !          1938:             if test "$finalize" = yes; then
        !          1939:               $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
        !          1940:               $show "$finalize_command"
        !          1941:               if $run eval "$finalize_command"; then :
        !          1942:               else
        !          1943:                 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
        !          1944:                 continue
        !          1945:               fi
        !          1946:               file="$objdir/$file"T
        !          1947:             else
        !          1948:               $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
        !          1949:             fi
        !          1950:           else
        !          1951:             # Install the binary that we compiled earlier.
        !          1952:            file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
        !          1953:           fi
        !          1954:         fi
1.1       frystyk  1955: 
1.2     ! frystyk  1956:         $show "$install_prog$stripme $file $dest"
        !          1957:         $run eval "$install_prog\$stripme \$file \$dest" || exit $?
        !          1958:         ;;
1.1       frystyk  1959:       esac
                   1960:     done
                   1961: 
                   1962:     for file in $staticlibs; do
1.2     ! frystyk  1963:       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1.1       frystyk  1964: 
                   1965:       # Set up the ranlib parameters.
                   1966:       oldlib="$destdir/$name"
                   1967: 
                   1968:       $show "$install_prog $file $oldlib"
1.2     ! frystyk  1969:       $run eval "$install_prog \$file \$oldlib" || exit $?
1.1       frystyk  1970: 
                   1971:       # Do each command in the postinstall commands.
1.2     ! frystyk  1972:       cmds=`eval \\$echo \"$old_postinstall_cmds\"`
1.1       frystyk  1973:       IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
                   1974:       for cmd in $cmds; do
                   1975:         IFS="$save_ifs"
                   1976:         $show "$cmd"
                   1977:         $run eval "$cmd" || exit $?
                   1978:       done
                   1979:       IFS="$save_ifs"
                   1980:     done
                   1981: 
                   1982:     if test -n "$future_libdirs"; then
1.2     ! frystyk  1983:       $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
1.1       frystyk  1984:     fi
                   1985: 
                   1986:     if test -n "$current_libdirs"; then
                   1987:       # Maybe just do a dry run.
                   1988:       test -n "$run" && current_libdirs=" -n$current_libdirs"
1.2     ! frystyk  1989:       exec $SHELL $0 --finish$current_libdirs
1.1       frystyk  1990:       exit 1
                   1991:     fi
                   1992: 
                   1993:     exit 0
                   1994:     ;;
                   1995: 
1.2     ! frystyk  1996:   # libtool finish mode
        !          1997:   finish)
        !          1998:     modename="$modename: finish"
        !          1999:     libdirs="$nonopt"
        !          2000: 
        !          2001:     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
        !          2002:       for dir
        !          2003:       do
        !          2004:         libdirs="$libdirs $dir"
        !          2005:       done
        !          2006: 
        !          2007:       for libdir in $libdirs; do
        !          2008:        if test -n "$finish_cmds"; then
        !          2009:          # Do each command in the finish commands.
        !          2010:          cmds=`eval \\$echo \"$finish_cmds\"`
        !          2011:           IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
        !          2012:           for cmd in $cmds; do
        !          2013:             IFS="$save_ifs"
        !          2014:             $show "$cmd"
        !          2015:             $run eval "$cmd"
        !          2016:           done
        !          2017:           IFS="$save_ifs"
        !          2018:        fi
        !          2019:        if test -n "$finish_eval"; then
        !          2020:          # Do the single finish_eval.
        !          2021:          cmds=`eval \\$echo \"$finish_eval\"`
        !          2022:          $run eval "$cmds"
        !          2023:        fi
        !          2024:       done
        !          2025:     fi
        !          2026: 
        !          2027:     echo "------------------------------------------------------------------------------"
        !          2028:     echo "Libraries have been installed in:"
        !          2029:     for libdir in $libdirs; do
        !          2030:       echo "   $libdir"
1.1       frystyk  2031:     done
1.2     ! frystyk  2032:     echo
        !          2033:     echo "To link against installed libraries in a given directory, LIBDIR,"
        !          2034:     echo "you must use the \`-LLIBDIR' flag during linking."
        !          2035:     echo
        !          2036:     echo " You will also need to do one of the following:"
        !          2037:     if test -n "$shlibpath_var"; then
        !          2038:       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
        !          2039:       echo "     during execution"
        !          2040:     fi
        !          2041:     if test -n "$runpath_var"; then
        !          2042:       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
        !          2043:       echo "     during linking"
        !          2044:     fi
        !          2045:     if test -n "$hardcode_libdir_flag_spec"; then
        !          2046:       libdir=LIBDIR
        !          2047:       flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
1.1       frystyk  2048: 
1.2     ! frystyk  2049:       echo "   - use the \`$flag' linker flag"
        !          2050:     fi
        !          2051:     if test -f /etc/ld.so.conf; then
        !          2052:       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
        !          2053:     fi
        !          2054:     echo
        !          2055:     echo "See any operating system documentation about shared libraries for"
        !          2056:     echo "more information, such as the ld(1) and ld.so(8) manual pages."
        !          2057:     echo "------------------------------------------------------------------------------"
        !          2058:     exit 0
        !          2059:     ;;
        !          2060: 
        !          2061:   # libtool execute mode
        !          2062:   execute)
        !          2063:     modename="$modename: execute"
        !          2064: 
        !          2065:     # The first argument is the command name.
        !          2066:     cmd="$nonopt"
        !          2067:     if test -z "$cmd"; then
        !          2068:       $echo "$modename: you must specify a COMMAND" 1>&2
        !          2069:       $echo "$help"
1.1       frystyk  2070:       exit 1
                   2071:     fi
                   2072: 
1.2     ! frystyk  2073:     # Handle -dlopen flags immediately.
        !          2074:     for file in $execute_dlfiles; do
        !          2075:       if test -f "$file"; then :
1.1       frystyk  2076:       else
1.2     ! frystyk  2077:        $echo "$modename: \`$file' is not a file" 1>&2
        !          2078:        $echo "$help" 1>&2
        !          2079:        exit 1
1.1       frystyk  2080:       fi
                   2081: 
1.2     ! frystyk  2082:       dir=
        !          2083:       case "$file" in
        !          2084:       *.la)
        !          2085:         # Check to see that this really is a libtool archive.
        !          2086:         if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
        !          2087:         else
        !          2088:           $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
        !          2089:           $echo "$help" 1>&2
        !          2090:           exit 1
        !          2091:         fi
        !          2092: 
        !          2093:        # Read the libtool library.
        !          2094:        dlname=
        !          2095:        library_names=
        !          2096: 
        !          2097:         # If there is no directory component, then add one.
        !          2098:        case "$file" in
        !          2099:        */* | *\\*) . $file ;;
        !          2100:         *) . ./$file ;;
        !          2101:        esac
        !          2102: 
        !          2103:        # Skip this library if it cannot be dlopened.
        !          2104:        if test -z "$dlname"; then
        !          2105:          # Warn if it was a shared library.
        !          2106:          test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
        !          2107:          continue
        !          2108:        fi
        !          2109: 
        !          2110:        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
        !          2111:        test "X$dir" = "X$file" && dir=.
        !          2112: 
        !          2113:        if test -f "$dir/$objdir/$dlname"; then
        !          2114:          dir="$dir/$objdir"
        !          2115:        else
        !          2116:          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
        !          2117:          exit 1
        !          2118:        fi
        !          2119:        ;;
        !          2120: 
        !          2121:       *.lo)
        !          2122:        # Just add the directory containing the .lo file.
        !          2123:        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
        !          2124:        test "X$dir" = "X$file" && dir=.
        !          2125:        ;;
        !          2126: 
        !          2127:       *)
        !          2128:        $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
        !          2129:         continue
        !          2130:        ;;
1.1       frystyk  2131:       esac
                   2132: 
1.2     ! frystyk  2133:       # Get the absolute pathname.
        !          2134:       absdir=`cd "$dir" && pwd`
        !          2135:       test -n "$absdir" && dir="$absdir"
        !          2136: 
        !          2137:       # Now add the directory to shlibpath_var.
        !          2138:       if eval "test -z \"\$$shlibpath_var\""; then
        !          2139:        eval "$shlibpath_var=\"\$dir\""
1.1       frystyk  2140:       else
1.2     ! frystyk  2141:        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1.1       frystyk  2142:       fi
                   2143:     done
                   2144: 
1.2     ! frystyk  2145:     # This variable tells wrapper scripts just to set shlibpath_var
        !          2146:     # rather than running their programs.
        !          2147:     libtool_execute_magic="$magic"
        !          2148: 
        !          2149:     # Check if any of the arguments is a wrapper script.
        !          2150:     args=
        !          2151:     for file
        !          2152:     do
        !          2153:       case "$file" in
        !          2154:       -*) ;;
        !          2155:       *)
        !          2156:         # Do a test to see if this is really a libtool program.
        !          2157:         if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
        !          2158:          # If there is no directory component, then add one.
        !          2159:          case "$file" in
        !          2160:          */* | *\\*) . $file ;;
        !          2161:          *) . ./$file ;;
        !          2162:          esac
        !          2163: 
        !          2164:          # Transform arg to wrapped name.
        !          2165:          file="$progdir/$program"
        !          2166:        fi
        !          2167:         ;;
        !          2168:       esac
        !          2169:       # Quote arguments (to preserve shell metacharacters).
        !          2170:       file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
        !          2171:       args="$args \"$file\""
        !          2172:     done
1.1       frystyk  2173: 
1.2     ! frystyk  2174:     if test -z "$run"; then
        !          2175:       # Export the shlibpath_var.
        !          2176:       eval "export $shlibpath_var"
1.1       frystyk  2177: 
1.2     ! frystyk  2178:       # Now actually exec the command.
        !          2179:       eval "exec \$cmd$args"
1.1       frystyk  2180: 
1.2     ! frystyk  2181:       $echo "$modename: cannot exec \$cmd$args"
        !          2182:       exit 1
        !          2183:     else
        !          2184:       # Display what would be done.
        !          2185:       eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
        !          2186:       $echo "export $shlibpath_var"
        !          2187:       $echo "$cmd$args"
        !          2188:       exit 0
1.1       frystyk  2189:     fi
                   2190:     ;;
                   2191: 
                   2192:   # libtool uninstall mode
                   2193:   uninstall)
1.2     ! frystyk  2194:     modename="$modename: uninstall"
1.1       frystyk  2195:     rm="$nonopt"
                   2196:     files=
                   2197: 
                   2198:     for arg
                   2199:     do
                   2200:       case "$arg" in
                   2201:       -*) rm="$rm $arg" ;;
                   2202:       *) files="$files $arg" ;;
                   2203:       esac
                   2204:     done
                   2205: 
                   2206:     if test -z "$rm"; then
1.2     ! frystyk  2207:       $echo "$modename: you must specify an RM program" 1>&2
        !          2208:       $echo "$help" 1>&2
1.1       frystyk  2209:       exit 1
                   2210:     fi
                   2211: 
                   2212:     for file in $files; do
1.2     ! frystyk  2213:       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
        !          2214:       test "X$dir" = "X$file" && dir=.
        !          2215:       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1.1       frystyk  2216: 
                   2217:       rmfiles="$file"
                   2218: 
                   2219:       case "$name" in
                   2220:       *.la)
1.2     ! frystyk  2221:         # Possibly a libtool archive, so verify it.
        !          2222:         if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
        !          2223:           . $dir/$name
        !          2224: 
        !          2225:           # Delete the libtool libraries and symlinks.
        !          2226:           for n in $library_names; do
        !          2227:             rmfiles="$rmfiles $dir/$n"
        !          2228:             test "X$n" = "X$dlname" && dlname=
        !          2229:           done
        !          2230:           test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
        !          2231:           test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
        !          2232: 
        !          2233:          $show "$rm $rmfiles"
        !          2234:          $run $rm $rmfiles
        !          2235: 
        !          2236:          if test -n "$library_names"; then
        !          2237:            # Do each command in the postuninstall commands.
        !          2238:            cmds=`eval \\$echo \"$postuninstall_cmds\"`
        !          2239:            IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
        !          2240:            for cmd in $cmds; do
        !          2241:              IFS="$save_ifs"
        !          2242:              $show "$cmd"
        !          2243:              $run eval "$cmd"
        !          2244:            done
        !          2245:            IFS="$save_ifs"
        !          2246:          fi
        !          2247: 
        !          2248:           if test -n "$old_library"; then
        !          2249:            # Do each command in the old_postuninstall commands.
        !          2250:            cmds=`eval \\$echo \"$old_postuninstall_cmds\"`
        !          2251:            IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
        !          2252:            for cmd in $cmds; do
        !          2253:              IFS="$save_ifs"
        !          2254:              $show "$cmd"
        !          2255:              $run eval "$cmd"
        !          2256:            done
        !          2257:            IFS="$save_ifs"
        !          2258:          fi
1.1       frystyk  2259: 
1.2     ! frystyk  2260:           # FIXME: should reinstall the best remaining shared library.
        !          2261:         fi
        !          2262:         ;;
1.1       frystyk  2263: 
                   2264:       *.lo)
1.2     ! frystyk  2265:         if test "$build_old_libs" = yes; then
        !          2266:           oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/\.o/'`
        !          2267:           rmfiles="$rmfiles $dir/$oldobj"
        !          2268:         fi
        !          2269:        $show "$rm $rmfiles"
        !          2270:        $run $rm $rmfiles
        !          2271:         ;;
        !          2272: 
        !          2273:       *)
        !          2274:        $show "$rm $rmfiles"
        !          2275:        $run $rm $rmfiles
        !          2276:        ;;
1.1       frystyk  2277:       esac
                   2278:     done
                   2279:     exit 0
                   2280:     ;;
                   2281: 
1.2     ! frystyk  2282:   "")
        !          2283:     $echo "$modename: you must specify a MODE" 1>&2
        !          2284:     $echo "$generic_help" 1>&2
1.1       frystyk  2285:     exit 1
                   2286:     ;;
                   2287:   esac
                   2288: 
1.2     ! frystyk  2289:   $echo "$modename: invalid operation mode \`$mode'" 1>&2
        !          2290:   $echo "$generic_help" 1>&2
1.1       frystyk  2291:   exit 1
                   2292: fi # test -z "$show_help"
                   2293: 
                   2294: # We need to display help for each of the modes.
                   2295: case "$mode" in
1.2     ! frystyk  2296: "") $echo \
        !          2297: "Usage: $modename [OPTION]... [MODE-ARG]...
1.1       frystyk  2298: 
                   2299: Provide generalized library-building support services.
                   2300: 
                   2301: -n, --dry-run         display commands without modifying any files
                   2302:     --features        display configuration information and exit
                   2303:     --finish          same as \`--mode=finish'
                   2304:     --help            display this help message and exit
                   2305:     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
1.2     ! frystyk  2306:     --quiet           same as \`--silent'
        !          2307:     --silent          don't print informational messages
1.1       frystyk  2308:     --version         print version information
                   2309: 
                   2310: MODE must be one of the following:
                   2311: 
                   2312:       compile         compile a source file into a libtool object
1.2     ! frystyk  2313:       execute         automatically set library path, then run a program
1.1       frystyk  2314:       finish          complete the installation of libtool libraries
                   2315:       install         install libraries or executables
                   2316:       link            create a library or an executable
                   2317:       uninstall       remove libraries from an installed directory
                   2318: 
1.2     ! frystyk  2319: MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
        !          2320: a more detailed description of MODE."
        !          2321:   exit 0
1.1       frystyk  2322:   ;;
                   2323: 
                   2324: compile)
1.2     ! frystyk  2325:   $echo \
        !          2326: "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1.1       frystyk  2327: 
                   2328: Compile a source file into a libtool library object.
                   2329: 
                   2330: COMPILE-COMMAND is a command to be used in creating a \`standard' object file
                   2331: from the given SOURCEFILE.
                   2332: 
                   2333: The output file name is determined by removing the directory component from
                   2334: SOURCEFILE, then substituting the C source code suffix \`.c' with the
1.2     ! frystyk  2335: library object suffix, \`.lo'."
1.1       frystyk  2336:   ;;
                   2337: 
1.2     ! frystyk  2338: execute)
        !          2339:   $echo \
        !          2340: "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
        !          2341: 
        !          2342: Automatically set library path, then run a program.
        !          2343: 
        !          2344: This mode accepts the following additional options:
1.1       frystyk  2345: 
1.2     ! frystyk  2346:   -dlopen FILE      add the directory containing FILE to the library path
1.1       frystyk  2347: 
1.2     ! frystyk  2348: This mode sets the library path environment variable according to \`-dlopen'
        !          2349: flags.
1.1       frystyk  2350: 
1.2     ! frystyk  2351: If any of the ARGS are libtool executable wrappers, then they are translated
        !          2352: into their corresponding uninstalled binary, and any of their required library
        !          2353: directories are added to the library path.
        !          2354: 
        !          2355: Then, COMMAND is executed, with ARGS as arguments."
1.1       frystyk  2356:   ;;
                   2357: 
                   2358: finish)
1.2     ! frystyk  2359:   $echo \
        !          2360: "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
1.1       frystyk  2361: 
                   2362: Complete the installation of libtool libraries.
                   2363: 
                   2364: Each LIBDIR is a directory that contains libtool libraries.
                   2365: 
                   2366: The commands that this mode executes may require superuser privileges.  Use
1.2     ! frystyk  2367: the \`--dry-run' option if you just want to see what would be executed."
1.1       frystyk  2368:   ;;
                   2369: 
                   2370: install)
1.2     ! frystyk  2371:   $echo \
        !          2372: "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
1.1       frystyk  2373: 
                   2374: Install executables or libraries.
                   2375: 
                   2376: INSTALL-COMMAND is the installation command.  The first component should be
                   2377: either the \`install' or \`cp' program.
                   2378: 
                   2379: The rest of the components are interpreted as arguments to that command (only
1.2     ! frystyk  2380: BSD-compatible install options are recognized)."
1.1       frystyk  2381:   ;;
                   2382: 
                   2383: link)
1.2     ! frystyk  2384:   $echo \
        !          2385: "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
1.1       frystyk  2386: 
                   2387: Link object files or libraries together to form another library, or to
                   2388: create an executable program.
                   2389: 
                   2390: LINK-COMMAND is a command using the C compiler that you would use to create
                   2391: a program from several object files.
                   2392: 
                   2393: The following components of LINK-COMMAND are treated specially:
                   2394: 
1.2     ! frystyk  2395:   -all-static       do not do any dynamic linking at all
        !          2396:   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
        !          2397:   -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
1.1       frystyk  2398:   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
                   2399:   -LLIBDIR          search LIBDIR for required installed libraries
                   2400:   -lNAME            OUTPUT-FILE requires the installed library libNAME
1.2     ! frystyk  2401:   -no-undefined     declare that a library does not refer to external symbols
1.1       frystyk  2402:   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
1.2     ! frystyk  2403:   -release RELEASE  specify package release information
1.1       frystyk  2404:   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
1.2     ! frystyk  2405:   -static           do not do any dynamic linking of libtool libraries
1.1       frystyk  2406:   -version-info CURRENT[:REVISION[:AGE]]
1.2     ! frystyk  2407:                     specify library version info [each variable defaults to 0]
1.1       frystyk  2408: 
                   2409: All other options (arguments beginning with \`-') are ignored.
                   2410: 
                   2411: Every other argument is treated as a filename.  Files ending in \`.la' are
                   2412: treated as uninstalled libtool libraries, other files are standard or library
                   2413: object files.
                   2414: 
                   2415: If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
                   2416: library objects (\`.lo' files) may be specified, and \`-rpath' is required.
                   2417: 
                   2418: If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
                   2419: and \`ranlib'.
                   2420: 
                   2421: If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
1.2     ! frystyk  2422: created, otherwise an executable program is created."
1.1       frystyk  2423:   ;;
                   2424: 
                   2425: uninstall)
1.2     ! frystyk  2426:   $echo
        !          2427: "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1.1       frystyk  2428: 
                   2429: Remove libraries from an installation directory.
                   2430: 
                   2431: RM is the name of the program to use to delete files associated with each FILE
                   2432: (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
                   2433: to RM.
                   2434: 
                   2435: If FILE is a libtool library, all the files associated with it are deleted.
1.2     ! frystyk  2436: Otherwise, only FILE itself is deleted using RM."
1.1       frystyk  2437:   ;;
                   2438: 
                   2439: *)
1.2     ! frystyk  2440:   $echo "$modename: invalid operation mode \`$mode'" 1>&2
        !          2441:   $echo "$help" 1>&2
1.1       frystyk  2442:   exit 1
                   2443:   ;;
                   2444: esac
                   2445: 
1.2     ! frystyk  2446: echo
        !          2447: $echo "Try \`$modename --help' for more information about other modes."
1.1       frystyk  2448: 
                   2449: exit 0
                   2450: 
                   2451: # Local Variables:
                   2452: # mode:shell-script
                   2453: # sh-indentation:2
                   2454: # End:

Webmaster