3 # No Copyright 2002 Pekka Riikonen <priikone@silcnet.org>
5 # This script fixes the fundamental problem of libtool: it is not
6 # configurable in run-time. This changes the libtool so that it becomes
7 # more generic and configurable in run-time.
9 # New command line options to libtool:
11 # --libtool-enable-shared Enable shared library compilation
12 # --libtool-enable-static Enable static library compilation
13 # --libtool-disable-shared Disable shared library compilation
14 # --libtool-disable-static Disable static library compilation
16 # If options are omitted the default libtool configuration will apply.
20 if test '!' -f ./libtool; then
21 echo "./libtool does not exist"
25 # Take configuration from the ./libtool
26 sed '/^# ltmain\.sh/q' ./libtool >./libtool.tmp
28 # Put our wrapper to the new libtool. This allows the run-time
29 # configuration of the libtool.
30 ltmain=`pwd`/ltmain.sh
31 cat << EOF >> ./libtool.tmp
33 cargs=\`echo \$* | sed -e '/--libtool-enable-shared/s///' -e '/--libtool-enable-static/s///' -e '/--libtool-disable-shared/s///' -e '/--libtool-disable-static/s///'\`
36 if test "\$i" = "--libtool-enable-shared"; then
37 build_libtool_libs=yes
41 if test "\$i" = "--libtool-disable-shared"; then
45 if test "\$i" = "--libtool-enable-static"; then
49 if test "\$i" = "--libtool-disable-static"; then
54 if test "\$cargs" = ""; then
60 mv -f ./libtool.tmp ./libtool