Ticket #2471: patch-configure-fix-x86

File patch-configure-fix-x86, 4.8 KB (added by pguyot (Paul Guyot), 19 years ago)

Replacement for patch-configure that should fix the problem.

Line 
1--- configure.orig      Thu Dec  9 07:44:58 2004
2+++ configure   Thu Dec  9 07:49:42 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@@ -565,6 +578,9 @@
45   alpha*-*-openbsd*)            arch=alpha; system=openbsd;;
46   sparc*-*-sunos4.*)            arch=sparc; system=sunos;;
47   sparc*-*-solaris2.*)          arch=sparc; system=solaris;;
48+  sparc*-*-openbsd*)            arch=sparc; system=openbsd;;
49+  sparc*-*-freebsd*)            arch=sparc; system=freebsd;;
50+  sparc*-*-netbsd*)             arch=sparc; system=netbsd;;
51   sparc*-*-*bsd*)               arch=sparc; system=bsd;;
52   sparc*-*-linux*)              arch=sparc; system=linux;;
53   i[3456]86-*-linux*)           arch=i386; system=linux_`sh ./runtest elf.c`;;
54@@ -573,10 +589,12 @@
55   i[3456]86-*-solaris*)         arch=i386; system=solaris;;
56   i[3456]86-*-beos*)            arch=i386; system=beos;;
57   i[3456]86-*-cygwin*)          arch=i386; system=cygwin;;
58+  i[3456]86-*-rhapsody*)        arch=i386; system=rhapsody;;
59+  i[3456]86-*-darwin*)          arch=i386; system=rhapsody;;
60   mips-*-irix6*)                arch=mips; system=irix;;
61   hppa1.1-*-hpux*)              arch=hppa; system=hpux;;
62   hppa2.0*-*-hpux*)             arch=hppa; system=hpux;;
63-  hppa*-*-linux*)              arch=hppa; system=linux;;
64+  hppa*-*-linux*)               arch=hppa; system=linux;;
65   powerpc-*-linux*)             arch=power; model=ppc; system=elf;;
66   powerpc-*-netbsd*)            arch=power; model=ppc; system=bsd;;
67   powerpc-*-rhapsody*)          arch=power; model=ppc; system=rhapsody;;
68@@ -584,6 +602,7 @@
69   arm*-*-linux*)                arch=arm; system=linux;;
70   ia64-*-linux*)                arch=ia64; system=linux;;
71   ia64-*-freebsd*)              arch=ia64; system=freebsd;;
72+  ia64-*-openbsd*)              arch=ia64; system=openbsd;;
73   x86_64-*-linux*)              arch=amd64; system=linux;;
74   x86_64-*-freebsd*)            arch=amd64; system=freebsd;;
75   x86_64-*-openbsd*)            arch=amd64; system=openbsd;;
76@@ -1341,6 +1360,10 @@
77     tk_defs="-I/sw/include"
78     tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
79   fi
80+  if test -z "$tcl_version"; then
81+    tk_defs="-I/opt/local/include -I/System/Library/Frameworks/Tcl.framework/Versions/8.4/Headers/"
82+    tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
83+  fi
84   if test -n "$tcl_version"; then
85     echo "tcl.h version $tcl_version found with \"$tk_defs\"."
86     case $tcl_version in
87@@ -1393,6 +1416,9 @@
88   elif sh ./hasgot -L/sw/lib $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs \
89                    Tcl_DoOneEvent
90   then tk_libs="-L/sw/lib -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
91+  elif sh ./hasgot -L/opt/local/lib $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs \
92+                   Tcl_DoOneEvent
93+  then tk_libs="-L/opt/local/lib -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
94   else
95     echo "Tcl library not found."
96     has_tk=false
97@@ -1404,6 +1430,9 @@
98   elif sh ./hasgot -L/sw/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
99     tk_libs="-L/sw/lib $tk_libs"
100     echo "Tcl/Tk libraries found."
101+  elif sh ./hasgot -L/opt/local/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
102+    tk_libs="-L/opt/local/lib $tk_libs"
103+    echo "Tcl/Tk libraries found."
104   else
105     echo "Tcl library found."
106     echo "Tk library not found."
107@@ -1427,7 +1456,7 @@
108 # Begin Camlp4
109 (
110 cd ../../camlp4/config
111-EXE=$exe ./configure_batch -prefix "$prefix" -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -ocaml-top ../.. > /dev/null
112+EXE=$exe ./configure_batch -prefix "$prefix" -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -destroot "$destroot" -ocaml-top ../.. > /dev/null
113 )
114 
115 case $? in
116@@ -1493,6 +1522,10 @@
117 echo "        binaries.................. $bindir"
118 echo "        standard library.......... $libdir"
119 echo "        manual pages.............. $mandir (with extension .$manext)"
120+
121+if test -n "$destroot"; then
122+echo "Destroot ......................... $destroot"
123+fi
124 
125 echo "Configuration for the bytecode compiler:"
126 echo "        C compiler used........... $bytecc"