2
# 01-libtoolise.dpatch by Peter Collingbourne <peter@peter.uk.to>
3
# DP: Libtoolises the makefiles, removes -lm where not necessary.
4
# DP: Original version by Heinz Wiesinger <pprkut@liwjatan.at>
6
PATCHED_DIRS=". apps.src ladr mace4.src provers.src test.src"
8
if [ "x$2" = "x" ]; then
14
# $1 = path to source directory ($DIR)
16
sed -i "s/\$(MAKE) lib/\$(MAKE) lib XFLAGS+=-D_REENTRANT/" "$1/Makefile"
18
for i in apps.src mace4.src; do
19
sed -i "s|/bin/mv|libtool --mode=install /bin/cp|" "$1/$i/Makefile"
22
for i in apps.src mace4.src provers.src; do
23
sed -i "s| ../bin| \`pwd\`/../bin|" "$1/$i/Makefile"
26
for i in apps.src ladr mace4.src provers.src test.src; do
27
if [ "$i" = "provers.src" ]; then
28
sed -i "s|/bin/rm -f \*.o|libtool --mode=clean /bin/rm -f \*.o|g" "$1/$i/Makefile"
29
sed -i "s|/bin/cp|libtool --mode=install /bin/cp|" "$1/$i/Makefile"
31
sed -i "s|/bin/rm -f|libtool --mode=clean /bin/rm -f|g" "$1/$i/Makefile"
34
if [ "$i" = "mace4.src" ]; then
35
sed -i "s/libladr.a/libladr.la/" "$1/$i/Makefile"
37
sed -i "s/\.a/\.la/g" "$1/$i/Makefile"
40
if [ "$i" = "ladr" ]; then
41
sed -i "s/\.o/\.lo/g" "$1/$i/Makefile"
43
sed -i "s/\$(CC)/libtool --mode=link \$(CC)/" "$1/$i/Makefile"
47
patch -p1 -d "$1" <<"EOP"
48
diff -U 3 -H -b -B -d -r -N -- LADR-2008-06A-orig/ladr/Makefile LADR-2008-06A/ladr/Makefile
49
--- LADR-2008-06A-orig/ladr/Makefile 2008-06-12 16:39:09.000000000 +0200
50
+++ LADR-2008-06A/ladr/Makefile 2008-08-03 15:23:06.214318210 +0200
52
$(INFE_OBJ) $(MODL_OBJ) $(MISC_OBJ)
54
libladr.la: $(OBJECTS)
55
- $(AR) rs libladr.la $(OBJECTS)
56
+ libtool --mode=link gcc -rpath /usr/lib -version-info 4:0:0 -o libladr.la $(OBJECTS) -lm
59
+ libtool --mode=compile gcc -c $(CFLAGS) $(XFLAGS) -o $@ $<
61
##############################################################################
67
# $1 = path to source directory ($DIR)
71
if [ "$2" = "Makefile" ]; then
76
for i in . apps.src ladr mace4.src provers.src test.src; do
77
$CMD "$1/$i/$2" "$1/$i/$3"
82
if [ "$1" = "-patch" ]; then
83
move_makefiles $DIR "Makefile" "Makefile.pre-libtool-patch"
85
elif [ "$1" = "-unpatch" ]; then
86
move_makefiles $DIR "Makefile.pre-libtool-patch" "Makefile"
87
elif [ "$1" = "--patch" ]; then
90
echo "Unrecognised parameter: $1"