File: libtoolfix

package info (click to toggle)
silc-toolkit 1.1.7-2%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 34,708 kB
  • ctags: 8,481
  • sloc: ansic: 79,557; sh: 8,987; cpp: 1,480; asm: 995; makefile: 187; perl: 126
file content (63 lines) | stat: -rwxr-xr-x 1,683 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
#
# No Copyright 2002 Pekka Riikonen <priikone@silcnet.org>
#
# This script fixes the fundamental problem of libtool: it is not 
# configurable in run-time.  This changes the libtool so that it becomes
# more generic and configurable in run-time.
#
# New command line options to libtool:
#
# --libtool-enable-shared	Enable shared library compilation
# --libtool-enable-static	Enable static library compilation
# --libtool-disable-shared	Disable shared library compilation
# --libtool-disable-static	Disable static library compilation
#
# If options are omitted the default libtool configuration will apply.
#

# Sanity checks
if test '!' -f ./libtool; then
  echo "./libtool does not exist"
  exit 0
fi

# Take configuration from the ./libtool
sed '/^# ltmain\.sh/q' ./libtool >./libtool.tmp

# Put our wrapper to the new libtool.  This allows the run-time
# configuration of the libtool.
ltmain=`pwd`/ltmain.sh
cat << EOF >> ./libtool.tmp
args=\`echo \$*\`
cargs=\`echo \$* | sed -e '/--libtool-enable-shared/s///' -e '/--libtool-enable-static/s///' -e '/--libtool-disable-shared/s///' -e '/--libtool-disable-static/s///'\`
for i in \$args
do
  if test "\$i" = "--libtool-enable-shared"; then
    build_libtool_libs=yes
    fast_install=yes
    continue
  fi
  if test "\$i" = "--libtool-disable-shared"; then
    build_libtool_libs=no
    continue
  fi
  if test "\$i" = "--libtool-enable-static"; then
    build_old_libs=yes
    continue
  fi
  if test "\$i" = "--libtool-disable-static"; then
    build_old_libs=no
    continue
  fi
done
if test "\$cargs" = ""; then
  cargs="--silent"
fi
. $ltmain \$cargs
EOF

mv -f ./libtool.tmp ./libtool
chmod +x ./libtool

exit 1