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. It is possible to specify
8 # how the libtool should behave by environment variables.
10 # Environment variables:
12 # LIBTOOL_ENABLE_SHARED
13 # LIBTOOL_ENABLE_STATIC
15 # Set either to "yes" or "no" value. "no" is equivalent to being disabled.
16 # If environment variables are not given then the default settings 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. This could include a lot of other
30 # things like command line arguments too.
31 cat << EOF >> ./libtool.tmp
32 if test "\$LIBTOOL_ENABLE_SHARED" != ""; then
33 build_libtool_libs=\$LIBTOOL_ENABLE_SHARED
35 if test "\$LIBTOOL_ENABLE_STATIC" != ""; then
36 build_old_libs=\$LIBTOOL_ENABLE_STATIC
40 # Do a trick with the ltmain.sh to make these settings valid
41 ltmain=`pwd`/ltmain.sh
42 echo ". $ltmain" >> ./libtool.tmp
43 mv ./libtool ./libtool.orig
44 mv ./libtool.tmp ./libtool