| @@ -1,18 +1,19 @@ | | | @@ -1,18 +1,19 @@ |
1 | $NetBSD: patch-configure,v 1.12 2015/08/22 10:45:13 jaapb Exp $ | | 1 | $NetBSD: patch-configure,v 1.13 2016/02/29 13:53:58 jperkin Exp $ |
2 | | | 2 | |
3 | Several configure changes to work on and detect NetBSD (and some other OSes) | | 3 | Several configure changes to work on and detect NetBSD (and some other OSes) |
4 | | | 4 | |
5 | See also: <http://caml.inria.fr/mantis/view.php?id=6900> | | 5 | See also: <http://caml.inria.fr/mantis/view.php?id=6900> |
| | | 6 | |
6 | --- configure.orig 2015-05-12 14:46:37.000000000 +0000 | | 7 | --- configure.orig 2015-05-12 14:46:37.000000000 +0000 |
7 | +++ configure | | 8 | +++ configure |
8 | @@ -328,11 +328,11 @@ TOOLCHAIN="cc" | | 9 | @@ -328,11 +328,11 @@ TOOLCHAIN="cc" |
9 | case "$bytecc,$target" in | | 10 | case "$bytecc,$target" in |
10 | cc,*-*-nextstep*) | | 11 | cc,*-*-nextstep*) |
11 | # GNU C extensions disabled, but __GNUC__ still defined! | | 12 | # GNU C extensions disabled, but __GNUC__ still defined! |
12 | - bytecccompopts="-fno-defer-pop $gcc_warnings -U__GNUC__ -posix" | | 13 | - bytecccompopts="-fno-defer-pop $gcc_warnings -U__GNUC__ -posix" |
13 | + bytecccompopts="$gcc_warnings -U__GNUC__ -posix" | | 14 | + bytecccompopts="$gcc_warnings -U__GNUC__ -posix" |
14 | bytecclinkopts="-posix";; | | 15 | bytecclinkopts="-posix";; |
15 | *,*-*-rhapsody*) | | 16 | *,*-*-rhapsody*) |
16 | # Almost the same as NeXTStep | | 17 | # Almost the same as NeXTStep |
17 | - bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC" | | 18 | - bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC" |
18 | + bytecccompopts="$gcc_warnings -DSHRINKED_GNUC" | | 19 | + bytecccompopts="$gcc_warnings -DSHRINKED_GNUC" |
| @@ -103,120 +104,121 @@ See also: | | @@ -103,120 +104,121 @@ See also: | |
103 | @@ -783,11 +783,7 @@ if test $with_sharedlibs = "yes"; then | | 104 | @@ -783,11 +783,7 @@ if test $with_sharedlibs = "yes"; then |
104 | i[3456]86-*-linux*) natdynlink=true;; | | 105 | i[3456]86-*-linux*) natdynlink=true;; |
105 | i[3456]86-*-gnu*) natdynlink=true;; | | 106 | i[3456]86-*-gnu*) natdynlink=true;; |
106 | x86_64-*-linux*) natdynlink=true;; | | 107 | x86_64-*-linux*) natdynlink=true;; |
107 | - i[3456]86-*-darwin[89].*) natdynlink=true;; | | 108 | - i[3456]86-*-darwin[89].*) natdynlink=true;; |
108 | - i[3456]86-*-darwin*) | | 109 | - i[3456]86-*-darwin*) |
109 | - if test $arch64 == true; then | | 110 | - if test $arch64 == true; then |
110 | - natdynlink=true | | 111 | - natdynlink=true |
111 | - fi;; | | 112 | - fi;; |
112 | + i[3456]86-*-darwin*) natdynlink=true;; | | 113 | + i[3456]86-*-darwin*) natdynlink=true;; |
113 | x86_64-*-darwin*) natdynlink=true;; | | 114 | x86_64-*-darwin*) natdynlink=true;; |
114 | powerpc*-*-linux*) natdynlink=true;; | | 115 | powerpc*-*-linux*) natdynlink=true;; |
115 | sparc*-*-linux*) natdynlink=true;; | | 116 | sparc*-*-linux*) natdynlink=true;; |
116 | @@ -799,6 +795,8 @@ if test $with_sharedlibs = "yes"; then | | 117 | @@ -799,6 +795,9 @@ if test $with_sharedlibs = "yes"; then |
117 | x86_64-*-openbsd*) natdynlink=true;; | | 118 | x86_64-*-openbsd*) natdynlink=true;; |
118 | i[3456]86-*-netbsd*) natdynlink=true;; | | 119 | i[3456]86-*-netbsd*) natdynlink=true;; |
119 | x86_64-*-netbsd*) natdynlink=true;; | | 120 | x86_64-*-netbsd*) natdynlink=true;; |
120 | + i[3456]86-*-dragonfly*) natdynlink=true;; | | 121 | + i[3456]86-*-dragonfly*) natdynlink=true;; |
121 | + x86_64-*-dragonfly*) natdynlink=true;; | | 122 | + x86_64-*-dragonfly*) natdynlink=true;; |
| | | 123 | + *-*-solaris*) natdynlink=true;; |
122 | i386-*-gnu0.3) natdynlink=true;; | | 124 | i386-*-gnu0.3) natdynlink=true;; |
123 | i[3456]86-*-haiku*) natdynlink=true;; | | 125 | i[3456]86-*-haiku*) natdynlink=true;; |
124 | arm*-*-linux*) natdynlink=true;; | | 126 | arm*-*-linux*) natdynlink=true;; |
125 | @@ -827,6 +825,7 @@ case "$target" in | | 127 | @@ -827,6 +826,7 @@ case "$target" in |
126 | sparc*-*-gnu*) arch=sparc; system=gnu;; | | 128 | sparc*-*-gnu*) arch=sparc; system=gnu;; |
127 | i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;; | | 129 | i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;; |
128 | i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;; | | 130 | i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;; |
129 | + i[3456]86-*-dragonfly*) arch=i386; system=bsd_`sh ./runtest elf.c`;; | | 131 | + i[3456]86-*-dragonfly*) arch=i386; system=bsd_`sh ./runtest elf.c`;; |
130 | i[3456]86-*-nextstep*) arch=i386; system=nextstep;; | | 132 | i[3456]86-*-nextstep*) arch=i386; system=nextstep;; |
131 | i[3456]86-*-solaris*) if $arch64; then | | 133 | i[3456]86-*-solaris*) if $arch64; then |
132 | arch=amd64; system=solaris | | 134 | arch=amd64; system=solaris |
133 | @@ -836,6 +835,7 @@ case "$target" in | | 135 | @@ -836,6 +836,7 @@ case "$target" in |
134 | i[3456]86-*-haiku*) arch=i386; system=beos;; | | 136 | i[3456]86-*-haiku*) arch=i386; system=beos;; |
135 | i[3456]86-*-beos*) arch=i386; system=beos;; | | 137 | i[3456]86-*-beos*) arch=i386; system=beos;; |
136 | i[3456]86-*-cygwin*) arch=i386; system=cygwin;; | | 138 | i[3456]86-*-cygwin*) arch=i386; system=cygwin;; |
137 | + i[3456]86-*-interix3*) arch=i386; system=interix3;; | | 139 | + i[3456]86-*-interix3*) arch=i386; system=interix3;; |
138 | i[3456]86-*-darwin*) if $arch64; then | | 140 | i[3456]86-*-darwin*) if $arch64; then |
139 | arch=amd64; system=macosx | | 141 | arch=amd64; system=macosx |
140 | else | | 142 | else |
141 | @@ -849,6 +849,7 @@ case "$target" in | | 143 | @@ -849,6 +850,7 @@ case "$target" in |
142 | powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;; | | 144 | powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;; |
143 | powerpc-*-darwin*) arch=power; system=rhapsody | | 145 | powerpc-*-darwin*) arch=power; system=rhapsody |
144 | if $arch64;then model=ppc64;else model=ppc;fi;; | | 146 | if $arch64;then model=ppc64;else model=ppc;fi;; |
145 | + arm*-*-netbsd) arch=arm; system=netbsd;; | | 147 | + arm*-*-netbsd) arch=arm; system=netbsd;; |
146 | armv6*-*-linux-gnueabihf) arch=arm; model=armv6; system=linux_eabihf;; | | 148 | armv6*-*-linux-gnueabihf) arch=arm; model=armv6; system=linux_eabihf;; |
147 | arm*-*-linux-gnueabihf) arch=arm; system=linux_eabihf;; | | 149 | arm*-*-linux-gnueabihf) arch=arm; system=linux_eabihf;; |
148 | armv7*-*-linux-gnueabi) arch=arm; model=armv7; system=linux_eabi;; | | 150 | armv7*-*-linux-gnueabi) arch=arm; model=armv7; system=linux_eabi;; |
149 | @@ -864,6 +865,8 @@ case "$target" in | | 151 | @@ -864,6 +866,8 @@ case "$target" in |
150 | x86_64-*-gnu*) arch=amd64; system=gnu;; | | 152 | x86_64-*-gnu*) arch=amd64; system=gnu;; |
151 | x86_64-*-freebsd*) arch=amd64; system=freebsd;; | | 153 | x86_64-*-freebsd*) arch=amd64; system=freebsd;; |
152 | x86_64-*-netbsd*) arch=amd64; system=netbsd;; | | 154 | x86_64-*-netbsd*) arch=amd64; system=netbsd;; |
153 | + x86_64-*-dragonfly*) arch=amd64; system=dragonfly;; | | 155 | + x86_64-*-dragonfly*) arch=amd64; system=dragonfly;; |
154 | + x86_64-*-solaris*) arch=amd64; system=solaris;; | | 156 | + x86_64-*-solaris*) arch=amd64; system=solaris;; |
155 | x86_64-*-openbsd*) arch=amd64; system=openbsd;; | | 157 | x86_64-*-openbsd*) arch=amd64; system=openbsd;; |
156 | x86_64-*-darwin*) arch=amd64; system=macosx;; | | 158 | x86_64-*-darwin*) arch=amd64; system=macosx;; |
157 | x86_64-*-mingw*) arch=amd64; system=mingw;; | | 159 | x86_64-*-mingw*) arch=amd64; system=mingw;; |
158 | @@ -903,7 +906,7 @@ case "$arch,$nativecc,$system,$target" i | | 160 | @@ -903,7 +907,7 @@ case "$arch,$nativecc,$system,$target" i |
159 | if $arch64; then partialld="ld -r -arch ppc64"; fi;; | | 161 | if $arch64; then partialld="ld -r -arch ppc64"; fi;; |
160 | *,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";; | | 162 | *,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";; |
161 | amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";; | | 163 | amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";; |
162 | - amd64,gcc*,solaris,*) partialld="ld -r -m elf_x86_64";; | | 164 | - amd64,gcc*,solaris,*) partialld="ld -r -m elf_x86_64";; |
163 | + amd64,gcc*,solaris,*) partialld="ld -r -64";; | | 165 | + amd64,gcc*,solaris,*) partialld="ld -r -64";; |
164 | *,gcc*,*,*) nativecccompopts="$gcc_warnings";; | | 166 | *,gcc*,*,*) nativecccompopts="$gcc_warnings";; |
165 | esac | | 167 | esac |
166 | | | 168 | |
167 | @@ -920,7 +923,7 @@ case "$arch,$system" in | | 169 | @@ -920,7 +924,7 @@ case "$arch,$system" in |
168 | amd64,solaris) as="${TOOLPREF}as --64" | | 170 | amd64,solaris) as="${TOOLPREF}as --64" |
169 | aspp="${TOOLPREF}gcc -m64 -c";; | | 171 | aspp="${TOOLPREF}gcc -m64 -c";; |
170 | i386,solaris) as="${TOOLPREF}as" | | 172 | i386,solaris) as="${TOOLPREF}as" |
171 | - aspp="/usr/ccs/bin/${TOOLPREF}as -P";; | | 173 | - aspp="/usr/ccs/bin/${TOOLPREF}as -P";; |
172 | + aspp="gcc -traditional -c";; | | 174 | + aspp="gcc -traditional -c";; |
173 | power,elf) as="${TOOLPREF}as -u -m ppc" | | 175 | power,elf) as="${TOOLPREF}as -u -m ppc" |
174 | aspp="${TOOLPREF}gcc -c";; | | 176 | aspp="${TOOLPREF}gcc -c";; |
175 | power,rhapsody) as="${TOOLPREF}as -arch $model" | | 177 | power,rhapsody) as="${TOOLPREF}as -arch $model" |
176 | @@ -961,6 +964,7 @@ case "$arch,$system" in | | 178 | @@ -961,6 +965,7 @@ case "$arch,$system" in |
177 | arm,linux*) profiling='prof';; | | 179 | arm,linux*) profiling='prof';; |
178 | power,elf) profiling='prof';; | | 180 | power,elf) profiling='prof';; |
179 | power,bsd*) profiling='prof';; | | 181 | power,bsd*) profiling='prof';; |
180 | + *,*,dragonfly) profiling='prof';; | | 182 | + *,*,dragonfly) profiling='prof';; |
181 | *) profiling='noprof';; | | 183 | *) profiling='noprof';; |
182 | esac | | 184 | esac |
183 | | | 185 | |
184 | @@ -1475,6 +1479,8 @@ fi | | 186 | @@ -1475,6 +1480,8 @@ fi |
185 | x11_include="not found" | | 187 | x11_include="not found" |
186 | x11_link="not found" | | 188 | x11_link="not found" |
187 | | | 189 | |
188 | +if test "$disable_x11" != "yes"; then | | 190 | +if test "$disable_x11" != "yes"; then |
189 | + | | 191 | + |
190 | if test -z "$x11_include_dir" -a -z "$x11_lib_dir"; then | | 192 | if test -z "$x11_include_dir" -a -z "$x11_lib_dir"; then |
191 | if pkg-config --exists x11 2>/dev/null; then | | 193 | if pkg-config --exists x11 2>/dev/null; then |
192 | x11_include=`pkg-config --cflags x11` | | 194 | x11_include=`pkg-config --cflags x11` |
193 | @@ -1521,6 +1527,7 @@ if test "$x11_include" = "not found"; th | | 195 | @@ -1521,6 +1528,7 @@ if test "$x11_include" = "not found"; th |
194 | /usr/XFree86/include/X11 \ | | 196 | /usr/XFree86/include/X11 \ |
195 | \ | | 197 | \ |
196 | /usr/include \ | | 198 | /usr/include \ |
197 | + /usr/pkg/include \ | | 199 | + /usr/pkg/include \ |
198 | /usr/local/include \ | | 200 | /usr/local/include \ |
199 | /usr/unsupported/include \ | | 201 | /usr/unsupported/include \ |
200 | /usr/athena/include \ | | 202 | /usr/athena/include \ |
201 | @@ -1578,6 +1585,7 @@ if test "$x11_include" = "not found"; th | | 203 | @@ -1578,6 +1586,7 @@ if test "$x11_include" = "not found"; th |
202 | \ | | 204 | \ |
203 | /usr/lib64 \ | | 205 | /usr/lib64 \ |
204 | /usr/lib \ | | 206 | /usr/lib \ |
205 | + /usr/pkg/lib \ | | 207 | + /usr/pkg/lib \ |
206 | /usr/local/lib \ | | 208 | /usr/local/lib \ |
207 | /usr/unsupported/lib \ | | 209 | /usr/unsupported/lib \ |
208 | /usr/athena/lib \ | | 210 | /usr/athena/lib \ |
209 | @@ -1599,18 +1607,16 @@ if test "$x11_include" = "not found"; th | | 211 | @@ -1599,18 +1608,16 @@ if test "$x11_include" = "not found"; th |
210 | if test $dir = /usr/lib; then | | 212 | if test $dir = /usr/lib; then |
211 | x11_link="-lX11" | | 213 | x11_link="-lX11" |
212 | else | | 214 | else |
213 | - x11_libs="-L$dir" | | 215 | - x11_libs="-L$dir" |
214 | - case "$target" in | | 216 | - case "$target" in |
215 | - *-kfreebsd*-gnu) x11_link="-L$dir -lX11";; | | 217 | - *-kfreebsd*-gnu) x11_link="-L$dir -lX11";; |
216 | - *-*-*bsd*) x11_link="-R$dir -L$dir -lX11";; | | 218 | - *-*-*bsd*) x11_link="-R$dir -L$dir -lX11";; |
217 | - *) x11_link="-L$dir -lX11";; | | 219 | - *) x11_link="-L$dir -lX11";; |
218 | - esac | | 220 | - esac |
219 | + x11_libs="-L$dir ${COMPILER_RPATH_FLAG}$dir" | | 221 | + x11_libs="-L$dir ${COMPILER_RPATH_FLAG}$dir" |
220 | + x11_link="-L$dir ${COMPILER_RPATH_FLAG}$dir -lX11" | | 222 | + x11_link="-L$dir ${COMPILER_RPATH_FLAG}$dir -lX11" |
221 | fi | | 223 | fi |
222 | break | | 224 | break |