Ticket #2471: patch-configure

File patch-configure, 5.1 KB (added by pguyot (Paul Guyot), 20 years ago)

New patch-configure that would enable dynamic libraries on x86.

Line 
1--- configure.orig      Thu Nov 18 15:08:57 2004
2+++ configure   Thu Dec  9 10:22:07 2004
3@@ -20,6 +20,7 @@
4 bindir=''
5 libdir=''
6 mandir=''
7+destroot=''
8 manext=1
9 host_type=unknown
10 ccoption=''
11@@ -59,6 +60,8 @@
12         bindir=$2; shift;;
13     -libdir|--libdir)
14         libdir=$2; shift;;
15+    -destroot|--destroot)
16+        destroot=$2; shift;;
17     -mandir|--mandir)
18         case "$2" in
19           */man[1-9ln])
20@@ -124,6 +127,11 @@
21   "") ;;
22    *) echo "The -libdir directory must be absolute." 1>&2; exit 2;;
23 esac
24+case "$destroot" in
25+  /*) ;;
26+  "") ;;
27+   *) echo "The -destroot directory must be absolute." 1>&2; exit 2;;
28+esac
29 case "$mandir" in
30   /*) ;;
31   "") ;;
32@@ -143,6 +151,11 @@
33 # Where to install
34 
35 echo "PREFIX=$prefix" >> Makefile
36+case "$destroot" in
37+  "") echo 'DESTROOT=' >> Makefile
38+      destroot="";;
39+   *) echo "DESTROOT=$destroot" >> Makefile;;
40+esac
41 case "$bindir" in
42   "") echo 'BINDIR=$(PREFIX)/bin' >> Makefile
43       bindir="$prefix/bin";;
44@@ -534,7 +547,7 @@
45       byteccrpath="-Wl,-rpath,"
46       mksharedlibrpath="-rpath "
47       shared_libraries_supported=true;;
48-    powerpc-apple-darwin*)
49+    *-*-darwin*)
50       mksharedlib="cc -bundle -flat_namespace -undefined suppress -o"
51       bytecccompopts="$dl_defs $bytecccompopts"
52       #sharedcccompopts="-fnocommon"
53@@ -565,6 +578,9 @@
54   alpha*-*-openbsd*)            arch=alpha; system=openbsd;;
55   sparc*-*-sunos4.*)            arch=sparc; system=sunos;;
56   sparc*-*-solaris2.*)          arch=sparc; system=solaris;;
57+  sparc*-*-openbsd*)            arch=sparc; system=openbsd;;
58+  sparc*-*-freebsd*)            arch=sparc; system=freebsd;;
59+  sparc*-*-netbsd*)             arch=sparc; system=netbsd;;
60   sparc*-*-*bsd*)               arch=sparc; system=bsd;;
61   sparc*-*-linux*)              arch=sparc; system=linux;;
62   i[3456]86-*-linux*)           arch=i386; system=linux_`sh ./runtest elf.c`;;
63@@ -573,10 +589,12 @@
64   i[3456]86-*-solaris*)         arch=i386; system=solaris;;
65   i[3456]86-*-beos*)            arch=i386; system=beos;;
66   i[3456]86-*-cygwin*)          arch=i386; system=cygwin;;
67+  i[3456]86-*-rhapsody*)        arch=i386; system=rhapsody;;
68+  i[3456]86-*-darwin*)          arch=i386; system=rhapsody;;
69   mips-*-irix6*)                arch=mips; system=irix;;
70   hppa1.1-*-hpux*)              arch=hppa; system=hpux;;
71   hppa2.0*-*-hpux*)             arch=hppa; system=hpux;;
72-  hppa*-*-linux*)              arch=hppa; system=linux;;
73+  hppa*-*-linux*)               arch=hppa; system=linux;;
74   powerpc-*-linux*)             arch=power; model=ppc; system=elf;;
75   powerpc-*-netbsd*)            arch=power; model=ppc; system=bsd;;
76   powerpc-*-rhapsody*)          arch=power; model=ppc; system=rhapsody;;
77@@ -584,6 +602,7 @@
78   arm*-*-linux*)                arch=arm; system=linux;;
79   ia64-*-linux*)                arch=ia64; system=linux;;
80   ia64-*-freebsd*)              arch=ia64; system=freebsd;;
81+  ia64-*-openbsd*)              arch=ia64; system=openbsd;;
82   x86_64-*-linux*)              arch=amd64; system=linux;;
83   x86_64-*-freebsd*)            arch=amd64; system=freebsd;;
84   x86_64-*-openbsd*)            arch=amd64; system=openbsd;;
85@@ -1341,6 +1360,10 @@
86     tk_defs="-I/sw/include"
87     tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
88   fi
89+  if test -z "$tcl_version"; then
90+    tk_defs="-I/opt/local/include -I/System/Library/Frameworks/Tcl.framework/Versions/8.4/Headers/"
91+    tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
92+  fi
93   if test -n "$tcl_version"; then
94     echo "tcl.h version $tcl_version found with \"$tk_defs\"."
95     case $tcl_version in
96@@ -1393,6 +1416,9 @@
97   elif sh ./hasgot -L/sw/lib $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs \
98                    Tcl_DoOneEvent
99   then tk_libs="-L/sw/lib -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
100+  elif sh ./hasgot -L/opt/local/lib $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs \
101+                   Tcl_DoOneEvent
102+  then tk_libs="-L/opt/local/lib -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
103   else
104     echo "Tcl library not found."
105     has_tk=false
106@@ -1404,6 +1430,9 @@
107   elif sh ./hasgot -L/sw/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
108     tk_libs="-L/sw/lib $tk_libs"
109     echo "Tcl/Tk libraries found."
110+  elif sh ./hasgot -L/opt/local/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
111+    tk_libs="-L/opt/local/lib $tk_libs"
112+    echo "Tcl/Tk libraries found."
113   else
114     echo "Tcl library found."
115     echo "Tk library not found."
116@@ -1427,7 +1456,7 @@
117 # Begin Camlp4
118 (
119 cd ../../camlp4/config
120-EXE=$exe ./configure_batch -prefix "$prefix" -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -ocaml-top ../.. > /dev/null
121+EXE=$exe ./configure_batch -prefix "$prefix" -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -destroot "$destroot" -ocaml-top ../.. > /dev/null
122 )
123 
124 case $? in
125@@ -1493,6 +1522,10 @@
126 echo "        binaries.................. $bindir"
127 echo "        standard library.......... $libdir"
128 echo "        manual pages.............. $mandir (with extension .$manext)"
129+
130+if test -n "$destroot"; then
131+echo "Destroot ......................... $destroot"
132+fi
133 
134 echo "Configuration for the bytecode compiler:"
135 echo "        C compiler used........... $bytecc"