1 | dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
|
---|
2 | dnl
|
---|
3 | dnl The contents of this file are subject to the Mozilla Public
|
---|
4 | dnl License Version 1.1 (the "License"); you may not use this file
|
---|
5 | dnl except in compliance with the License. You may obtain a copy of
|
---|
6 | dnl the License at http://www.mozilla.org/MPL/
|
---|
7 | dnl
|
---|
8 | dnl Software distributed under the License is distributed on an "AS
|
---|
9 | dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
---|
10 | dnl implied. See the License for the specific language governing
|
---|
11 | dnl rights and limitations under the License.
|
---|
12 | dnl
|
---|
13 | dnl The Original Code is the Netscape Portable Runtime (NSPR).
|
---|
14 | dnl
|
---|
15 | dnl The Initial Developer of the Original Code is Netscape
|
---|
16 | dnl Communications Corporation. Portions created by Netscape are
|
---|
17 | dnl Copyright (C) 1998o-2000 Netscape Communications Corporation. All
|
---|
18 | dnl Rights Reserved.
|
---|
19 | dnl
|
---|
20 | dnl Contributor(s):
|
---|
21 | dnl Christopher Seawood <[email protected]>
|
---|
22 | dnl
|
---|
23 | dnl Alternatively, the contents of this file may be used under the
|
---|
24 | dnl terms of the GNU General Public License Version 2 or later (the
|
---|
25 | dnl "GPL"), in which case the provisions of the GPL are applicable
|
---|
26 | dnl instead of those above. If you wish to allow use of your
|
---|
27 | dnl version of this file only under the terms of the GPL and not to
|
---|
28 | dnl allow others to use your version of this file under the MPL,
|
---|
29 | dnl indicate your decision by deleting the provisions above and
|
---|
30 | dnl replace them with the notice and other provisions required by
|
---|
31 | dnl the GPL. If you do not delete the provisions above, a recipient
|
---|
32 | dnl may use your version of this file under either the MPL or the
|
---|
33 | dnl GPL.
|
---|
34 | dnl
|
---|
35 |
|
---|
36 | AC_PREREQ(2.12)
|
---|
37 | AC_INIT(config/libc_r.h)
|
---|
38 |
|
---|
39 | AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
|
---|
40 | AC_CANONICAL_SYSTEM
|
---|
41 |
|
---|
42 | dnl ========================================================
|
---|
43 | dnl = Defaults
|
---|
44 | dnl ========================================================
|
---|
45 | MOD_MAJOR_VERSION=4
|
---|
46 | MOD_MINOR_VERSION=5
|
---|
47 | MOD_PATCH_VERSION=0
|
---|
48 | NSPR_MODNAME=nspr20
|
---|
49 | _HAVE_PTHREADS=
|
---|
50 | USE_PTHREADS=
|
---|
51 | USE_USER_PTHREADS=
|
---|
52 | USE_NSPR_THREADS=
|
---|
53 | USE_N32=
|
---|
54 | USE_64=
|
---|
55 | USE_CPLUS=
|
---|
56 | USE_IPV6=
|
---|
57 | USE_MDUPDATE=
|
---|
58 | MACOS_DEPLOYMENT_TARGET=
|
---|
59 | _OPTIMIZE_FLAGS=-O
|
---|
60 | _DEBUG_FLAGS=-g
|
---|
61 | MOZ_DEBUG=1
|
---|
62 | MOZ_OPTIMIZE=
|
---|
63 | OBJDIR=.
|
---|
64 | OBJDIR_NAME=.
|
---|
65 | OBJDIR_SUFFIX=OBJ
|
---|
66 | NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
|
---|
67 | NOSUCHFILE=/no-such-file
|
---|
68 | LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
|
---|
69 | LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
|
---|
70 | CYGWIN_WRAPPER=
|
---|
71 |
|
---|
72 | dnl Link in libraries necessary to resolve all symbols for shared libs
|
---|
73 | RESOLVE_LINK_SYMBOLS=
|
---|
74 |
|
---|
75 | dnl ========================================================
|
---|
76 | dnl =
|
---|
77 | dnl = Dont change the following lines. Doing so breaks:
|
---|
78 | dnl =
|
---|
79 | dnl = CFLAGS="-foo" ./configure
|
---|
80 | dnl =
|
---|
81 | dnl ========================================================
|
---|
82 | CFLAGS="${CFLAGS=}"
|
---|
83 | CXXFLAGS="${CXXFLAGS=}"
|
---|
84 | LDFLAGS="${LDFLAGS=}"
|
---|
85 | HOST_CFLAGS="${HOST_CFLAGS=}"
|
---|
86 | HOST_LDFLAGS="${HOST_LDFLAGS=}"
|
---|
87 |
|
---|
88 | case "$target" in
|
---|
89 | *-cygwin*|*-mingw*)
|
---|
90 | # Check to see if we are really running in a msvc environemnt
|
---|
91 | _WIN32_MSVC=
|
---|
92 | AC_CHECK_PROGS(CC, cl)
|
---|
93 | if test "$CC" = "cl"; then
|
---|
94 | echo 'main() { return 0; }' > dummy.c
|
---|
95 | ${CC} -o dummy dummy.c >/dev/null 2>&1
|
---|
96 | if test $? = 0; then
|
---|
97 | _WIN32_MSVC=1
|
---|
98 | CXX=$CC
|
---|
99 | else
|
---|
100 | AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
|
---|
101 | fi
|
---|
102 | rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
|
---|
103 | fi
|
---|
104 | ;;
|
---|
105 | *-msvc*)
|
---|
106 | _WIN32_MSVC=1
|
---|
107 | ;;
|
---|
108 | *-mks*)
|
---|
109 | _WIN32_MSVC=1
|
---|
110 | ;;
|
---|
111 | esac
|
---|
112 |
|
---|
113 | if test -n "$_WIN32_MSVC"; then
|
---|
114 | SKIP_PATH_CHECKS=1
|
---|
115 | SKIP_COMPILER_CHECKS=1
|
---|
116 | SKIP_LIBRARY_CHECKS=1
|
---|
117 | fi
|
---|
118 |
|
---|
119 | dnl ========================================================
|
---|
120 | dnl =
|
---|
121 | dnl = Check options that may affect the compiler
|
---|
122 | dnl =
|
---|
123 | dnl ========================================================
|
---|
124 | dist_prefix='${MOD_DEPTH}/dist'
|
---|
125 | dist_bindir='${dist_prefix}/bin'
|
---|
126 | dist_includedir='${dist_prefix}/include/nspr'
|
---|
127 | dist_libdir='${dist_prefix}/lib'
|
---|
128 | if test "${includedir}" = '${prefix}/include'; then
|
---|
129 | includedir='${prefix}/include/nspr'
|
---|
130 | fi
|
---|
131 |
|
---|
132 | AC_ARG_WITH(dist-prefix,
|
---|
133 | [ --with-dist-prefix=DIST_PREFIX
|
---|
134 | place build files in DIST_PREFIX [dist]],
|
---|
135 | dist_prefix=$withval)
|
---|
136 |
|
---|
137 | AC_ARG_WITH(dist-bindir,
|
---|
138 | [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
|
---|
139 | dist_bindir=$withval)
|
---|
140 |
|
---|
141 | AC_ARG_WITH(dist-includedir,
|
---|
142 | [ --with-dist-includedir=DIR
|
---|
143 | build include files in DIR [DIST_PREFIX/include/nspr]],
|
---|
144 | dist_includedir=$withval)
|
---|
145 |
|
---|
146 | AC_ARG_WITH(dist-libdir,
|
---|
147 | [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
|
---|
148 | dist_libdir=$withval)
|
---|
149 |
|
---|
150 | AC_SUBST(dist_prefix)
|
---|
151 | AC_SUBST(dist_bindir)
|
---|
152 | AC_SUBST(dist_includedir)
|
---|
153 | AC_SUBST(dist_libdir)
|
---|
154 |
|
---|
155 | dnl Check if NSPR is being compiled for Mozilla
|
---|
156 | dnl Let --with-arg override environment setting
|
---|
157 | dnl
|
---|
158 | AC_ARG_WITH(mozilla,
|
---|
159 | [ --with-mozilla Compile NSPR with Mozilla support],
|
---|
160 | [ if test "$withval" = "yes"; then
|
---|
161 | AC_DEFINE(MOZILLA_CLIENT)
|
---|
162 | MOZILLA_CLIENT=1
|
---|
163 | else
|
---|
164 | MOZILLA_CLIENT=
|
---|
165 | fi],
|
---|
166 | [ if test -n "$MOZILLA_CLIENT"; then
|
---|
167 | AC_DEFINE(MOZILLA_CLIENT)
|
---|
168 | fi])
|
---|
169 |
|
---|
170 | AC_ARG_ENABLE(optimize,
|
---|
171 | [ --enable-optimize(=val) Enable code optimizations (val, ie. -O2) ],
|
---|
172 | [ if test "$enableval" != "no"; then
|
---|
173 | MOZ_OPTIMIZE=1
|
---|
174 | if test -n "$enableval" && test "$enableval" != "yes"; then
|
---|
175 | _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
|
---|
176 | _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
|
---|
177 | fi
|
---|
178 | else
|
---|
179 | MOZ_OPTIMIZE=
|
---|
180 | fi ])
|
---|
181 |
|
---|
182 | AC_ARG_ENABLE(debug,
|
---|
183 | [ --disable-debug Do not compile in debugging symbols],
|
---|
184 | [ if test "$enableval" = "no"; then
|
---|
185 | MOZ_DEBUG=
|
---|
186 | else
|
---|
187 | MOZ_DEBUG=1
|
---|
188 | fi])
|
---|
189 |
|
---|
190 | AC_ARG_ENABLE(win32-target,
|
---|
191 | [ --enable-win32-target=\$t
|
---|
192 | Specify win32 flavor. (WIN95 or WINNT)],
|
---|
193 | OS_TARGET=`echo $enableval | tr a-z A-Z`,
|
---|
194 | OS_TARGET=)
|
---|
195 |
|
---|
196 | AC_ARG_ENABLE(debug-rtl,
|
---|
197 | [ --enable-debug-rtl Use the MSVC debug runtime library],
|
---|
198 | [ if test "$enableval" = "yes"; then
|
---|
199 | USE_DEBUG_RTL=1
|
---|
200 | fi ])
|
---|
201 |
|
---|
202 | AC_ARG_ENABLE(n32,
|
---|
203 | [ --enable-n32 Enable n32 ABI support (IRIX only)],
|
---|
204 | [ if test "$enableval" = "yes"; then
|
---|
205 | USE_N32=1
|
---|
206 | else if test "$enableval" = "no"; then
|
---|
207 | USE_N32=
|
---|
208 | fi
|
---|
209 | fi ])
|
---|
210 |
|
---|
211 | AC_ARG_ENABLE(64bit,
|
---|
212 | [ --enable-64bit Enable 64-bit support (on certain platforms)],
|
---|
213 | [ if test "$enableval" = "yes"; then
|
---|
214 | USE_64=1
|
---|
215 | fi ])
|
---|
216 |
|
---|
217 | AC_ARG_ENABLE(mdupdate,
|
---|
218 | [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
|
---|
219 | [ if test "$enableval" = "yes"; then
|
---|
220 | USE_MDUPDATE=1
|
---|
221 | fi ])
|
---|
222 |
|
---|
223 | AC_ARG_ENABLE(macos-target,
|
---|
224 | [ --enable-macos-target=VER (default=10.1)
|
---|
225 | Set the minimum MacOS version needed at runtime],
|
---|
226 | [MACOS_DEPLOYMENT_TARGET_STR=$enableval],
|
---|
227 | [MACOS_DEPLOYMENT_TARGET_STR=10.1])
|
---|
228 |
|
---|
229 | dnl ========================================================
|
---|
230 | dnl =
|
---|
231 | dnl = Set the threading model
|
---|
232 | dnl =
|
---|
233 | dnl ========================================================
|
---|
234 | case "$target" in
|
---|
235 |
|
---|
236 | *-aix*)
|
---|
237 | case "${target_os}" in
|
---|
238 | aix3.2*)
|
---|
239 | USE_NSPR_THREADS=1
|
---|
240 | ;;
|
---|
241 | *)
|
---|
242 | USE_PTHREADS=1
|
---|
243 | ;;
|
---|
244 | esac
|
---|
245 | ;;
|
---|
246 |
|
---|
247 | esac
|
---|
248 |
|
---|
249 | dnl ========================================================
|
---|
250 | dnl =
|
---|
251 | dnl = Set the default C compiler
|
---|
252 | dnl =
|
---|
253 | dnl ========================================================
|
---|
254 | if test -z "$CC"; then
|
---|
255 | case "$target" in
|
---|
256 |
|
---|
257 | *-aix*)
|
---|
258 | if test -z "$USE_NSPR_THREADS"; then
|
---|
259 | CC=xlc_r
|
---|
260 | else
|
---|
261 | CC=xlc
|
---|
262 | fi
|
---|
263 | ;;
|
---|
264 |
|
---|
265 | *-hpux*)
|
---|
266 | CC=cc
|
---|
267 | ;;
|
---|
268 |
|
---|
269 | *-irix*)
|
---|
270 | CC=cc
|
---|
271 | ;;
|
---|
272 |
|
---|
273 | *-openvms*)
|
---|
274 | CC=cc
|
---|
275 | ;;
|
---|
276 |
|
---|
277 | *-osf*)
|
---|
278 | CC=cc
|
---|
279 | ;;
|
---|
280 |
|
---|
281 | *-solaris*)
|
---|
282 | CC=cc
|
---|
283 | ;;
|
---|
284 |
|
---|
285 | esac
|
---|
286 | fi
|
---|
287 |
|
---|
288 | dnl ========================================================
|
---|
289 | dnl =
|
---|
290 | dnl = Set the default C++ compiler
|
---|
291 | dnl =
|
---|
292 | dnl ========================================================
|
---|
293 | if test -z "$CXX"; then
|
---|
294 | case "$target" in
|
---|
295 |
|
---|
296 | *-aix*)
|
---|
297 | if test -z "$USE_NSPR_THREADS"; then
|
---|
298 | CXX=xlC_r
|
---|
299 | else
|
---|
300 | CXX=xlC
|
---|
301 | fi
|
---|
302 | ;;
|
---|
303 |
|
---|
304 | *-hpux*)
|
---|
305 | case "${target_os}" in
|
---|
306 | hpux10.30)
|
---|
307 | CXX=aCC
|
---|
308 | ;;
|
---|
309 | hpux11.*)
|
---|
310 | CXX=aCC
|
---|
311 | ;;
|
---|
312 | *)
|
---|
313 | CXX=CC
|
---|
314 | ;;
|
---|
315 | esac
|
---|
316 | ;;
|
---|
317 |
|
---|
318 | *-irix*)
|
---|
319 | CXX=CC
|
---|
320 | ;;
|
---|
321 |
|
---|
322 | *-openvms*)
|
---|
323 | CXX=cxx
|
---|
324 | ;;
|
---|
325 |
|
---|
326 | *-osf*)
|
---|
327 | CXX=cxx
|
---|
328 | ;;
|
---|
329 |
|
---|
330 | *-solaris*)
|
---|
331 | CXX=CC
|
---|
332 | ;;
|
---|
333 |
|
---|
334 | esac
|
---|
335 | fi
|
---|
336 |
|
---|
337 | if test -z "$SKIP_PATH_CHECKS"; then
|
---|
338 | AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
|
---|
339 | fi
|
---|
340 |
|
---|
341 | if test -n "$MOZ_DEBUG"; then
|
---|
342 | AC_DEFINE(DEBUG)
|
---|
343 | DEFINES="$DEFINES -UNDEBUG"
|
---|
344 |
|
---|
345 | case "${target_os}" in
|
---|
346 | beos*)
|
---|
347 | DEFINES="$DEFINES -DDEBUG_${USER}"
|
---|
348 | ;;
|
---|
349 | msvc*|mks*|cygwin*|mingw*|os2*)
|
---|
350 | DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
|
---|
351 | ;;
|
---|
352 | *)
|
---|
353 | DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
|
---|
354 | ;;
|
---|
355 | esac
|
---|
356 | else
|
---|
357 | AC_DEFINE(NDEBUG)
|
---|
358 | DEFINES="$DEFINES -UDEBUG"
|
---|
359 | fi
|
---|
360 |
|
---|
361 | if test -z "$SKIP_COMPILER_CHECKS"; then
|
---|
362 | dnl ========================================================
|
---|
363 | dnl Checks for compilers.
|
---|
364 | dnl ========================================================
|
---|
365 | if test "$target" != "$host"; then
|
---|
366 | echo "cross compiling from $host to $target"
|
---|
367 | cross_compiling=yes
|
---|
368 |
|
---|
369 | _SAVE_CC="$CC"
|
---|
370 | _SAVE_CFLAGS="$CFLAGS"
|
---|
371 | _SAVE_LDFLAGS="$LDFLAGS"
|
---|
372 |
|
---|
373 | AC_MSG_CHECKING([for $host compiler])
|
---|
374 | AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
|
---|
375 | if test -z "$HOST_CC"; then
|
---|
376 | AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
---|
377 | fi
|
---|
378 | AC_MSG_RESULT([$HOST_CC])
|
---|
379 | if test -z "$HOST_CFLAGS"; then
|
---|
380 | HOST_CFLAGS="$CFLAGS"
|
---|
381 | fi
|
---|
382 | if test -z "$HOST_LDFLAGS"; then
|
---|
383 | HOST_LDFLAGS="$LDFLAGS"
|
---|
384 | fi
|
---|
385 |
|
---|
386 | CC="$HOST_CC"
|
---|
387 | CFLAGS="$HOST_CFLAGS"
|
---|
388 | LDFLAGS="$HOST_LDFLAGS"
|
---|
389 |
|
---|
390 | AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
|
---|
391 | AC_TRY_COMPILE([], [return(0);],
|
---|
392 | [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
|
---|
393 | AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
|
---|
394 |
|
---|
395 | CC=$_SAVE_CC
|
---|
396 | CFLAGS=$_SAVE_CFLAGS
|
---|
397 | LDFLAGS=$_SAVE_LDFLAGS
|
---|
398 |
|
---|
399 | AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
|
---|
400 | unset ac_cv_prog_CC
|
---|
401 | AC_PROG_CC
|
---|
402 | AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
|
---|
403 | unset ac_cv_prog_CXX
|
---|
404 | AC_PROG_CXX
|
---|
405 | AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
|
---|
406 | AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
|
---|
407 | AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
|
---|
408 | AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
|
---|
409 | AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
|
---|
410 | AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
|
---|
411 |
|
---|
412 | else
|
---|
413 | AC_PROG_CXX
|
---|
414 | if test "$CXX" = "cl" -a -z "$CC"; then
|
---|
415 | CC=$CXX
|
---|
416 | else
|
---|
417 | AC_PROG_CC
|
---|
418 | fi
|
---|
419 | AC_PROG_CPP
|
---|
420 | AC_PROG_RANLIB
|
---|
421 | AC_PATH_PROGS(AS, as, $CC)
|
---|
422 | AC_PATH_PROGS(AR, ar, echo not_ar)
|
---|
423 | AC_PATH_PROGS(LD, ld link, echo not_ld)
|
---|
424 | AC_PATH_PROGS(STRIP, strip, echo not_strip)
|
---|
425 | AC_PATH_PROGS(WINDRES, windres, echo not_windres)
|
---|
426 | if test -z "$HOST_CC"; then
|
---|
427 | HOST_CC="$CC"
|
---|
428 | fi
|
---|
429 | if test -z "$HOST_CFLAGS"; then
|
---|
430 | HOST_CFLAGS="$CFLAGS"
|
---|
431 | fi
|
---|
432 | fi
|
---|
433 |
|
---|
434 | if test "$GCC" = "yes"; then
|
---|
435 | GNU_CC=1
|
---|
436 | fi
|
---|
437 | if test "$GXX" = "yes"; then
|
---|
438 | GNU_CXX=1
|
---|
439 | fi
|
---|
440 | if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
|
---|
441 | GNU_AS=1
|
---|
442 | fi
|
---|
443 | rm -f a.out
|
---|
444 |
|
---|
445 | if test "$cross_compiling" = "yes"; then
|
---|
446 | CROSS_COMPILE=1
|
---|
447 | else
|
---|
448 | CROSS_COMPILE=
|
---|
449 | fi
|
---|
450 |
|
---|
451 | dnl ========================================================
|
---|
452 | dnl Check for gcc -pipe support
|
---|
453 | dnl ========================================================
|
---|
454 | AC_MSG_CHECKING([for gcc -pipe support])
|
---|
455 | if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
|
---|
456 | echo '#include <stdio.h>' > dummy-hello.c
|
---|
457 | echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
|
---|
458 | ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
|
---|
459 | cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
|
---|
460 | if test $? = 0; then
|
---|
461 | _res_as_stdin="yes"
|
---|
462 | else
|
---|
463 | _res_as_stdin="no"
|
---|
464 | fi
|
---|
465 | if test "$_res_as_stdin" = "yes"; then
|
---|
466 | _SAVE_CFLAGS=$CFLAGS
|
---|
467 | CFLAGS="$CFLAGS -pipe"
|
---|
468 | AC_TRY_COMPILE( [ #include <stdio.h> ],
|
---|
469 | [printf("Hello World\n");],
|
---|
470 | [_res_gcc_pipe="yes"],
|
---|
471 | [_res_gcc_pipe="no"] )
|
---|
472 | CFLAGS=$_SAVE_CFLAGS
|
---|
473 | fi
|
---|
474 | if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
|
---|
475 | _res="yes";
|
---|
476 | CFLAGS="$CFLAGS -pipe"
|
---|
477 | CXXFLAGS="$CXXFLAGS -pipe"
|
---|
478 | else
|
---|
479 | _res="no"
|
---|
480 | fi
|
---|
481 | rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
|
---|
482 | AC_MSG_RESULT([$_res])
|
---|
483 | else
|
---|
484 | AC_MSG_RESULT([no])
|
---|
485 | fi
|
---|
486 |
|
---|
487 | fi # SKIP_COMPILER_CHECKS
|
---|
488 |
|
---|
489 | dnl ========================================================
|
---|
490 | dnl Checks for programs.
|
---|
491 | dnl ========================================================
|
---|
492 | if test -z "$SKIP_PATH_CHECKS"; then
|
---|
493 | AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
|
---|
494 | elif test -z "$PERL"; then
|
---|
495 | PERL=perl
|
---|
496 | fi
|
---|
497 |
|
---|
498 | dnl ========================================================
|
---|
499 | dnl Default platform specific options
|
---|
500 | dnl ========================================================
|
---|
501 | OBJ_SUFFIX=o
|
---|
502 | LIB_SUFFIX=a
|
---|
503 | DLL_SUFFIX=so
|
---|
504 | ASM_SUFFIX=s
|
---|
505 | MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
|
---|
506 | PR_MD_ASFILES=
|
---|
507 | PR_MD_CSRCS=
|
---|
508 | PR_MD_ARCH_DIR=unix
|
---|
509 | AR_FLAGS='cr $@'
|
---|
510 | AS='$(CC)'
|
---|
511 | ASFLAGS='$(CFLAGS)'
|
---|
512 |
|
---|
513 | if test -n "$CROSS_COMPILE"; then
|
---|
514 | OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
|
---|
515 | OS_RELEASE=
|
---|
516 | OS_TEST="${target_cpu}"
|
---|
517 | case "${target_os}" in
|
---|
518 | linux*) OS_ARCH=Linux ;;
|
---|
519 | solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
|
---|
520 | mingw*) OS_ARCH=WINNT ;;
|
---|
521 | esac
|
---|
522 | else
|
---|
523 | OS_ARCH=`uname -s | sed -e 's|/|_|g'`
|
---|
524 | OS_RELEASE=`uname -r`
|
---|
525 | OS_TEST=`uname -m`
|
---|
526 | fi
|
---|
527 |
|
---|
528 | if test "$OS_ARCH" = "IRIX64"; then
|
---|
529 | OS_ARCH=IRIX
|
---|
530 | fi
|
---|
531 |
|
---|
532 | if test "$OS_ARCH" = "AIX"; then
|
---|
533 | OS_RELEASE=`uname -v`.`uname -r`
|
---|
534 | fi
|
---|
535 |
|
---|
536 | if test "$OS_ARCH" = "FreeBSD"; then
|
---|
537 | OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
|
---|
538 | fi
|
---|
539 |
|
---|
540 | if test "$OS_ARCH" = "Linux"; then
|
---|
541 | OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
|
---|
542 | OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
|
---|
543 | fi
|
---|
544 |
|
---|
545 | if test "$OS_ARCH" = "OpenVMS"; then
|
---|
546 | OS_RELEASE=`uname -v`
|
---|
547 | fi
|
---|
548 |
|
---|
549 | #######################################################################
|
---|
550 | # Master "Core Components" macros for getting the OS target #
|
---|
551 | #######################################################################
|
---|
552 |
|
---|
553 | #
|
---|
554 | # Note: OS_TARGET should be specified on the command line for gmake.
|
---|
555 | # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
|
---|
556 | # The difference between the Win95 target and the WinNT target is that
|
---|
557 | # the WinNT target uses Windows NT specific features not available
|
---|
558 | # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
|
---|
559 | # at lesser performance (the Win95 target uses threads; the WinNT target
|
---|
560 | # uses fibers).
|
---|
561 | #
|
---|
562 | # When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
|
---|
563 | # is built. See: win16_3.11.mk for lots more about the Win16 target.
|
---|
564 | #
|
---|
565 | # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
|
---|
566 | # cross-compilation.
|
---|
567 | #
|
---|
568 |
|
---|
569 | #
|
---|
570 | # The following hack allows one to build on a WIN95 machine (as if
|
---|
571 | # s/he were cross-compiling on a WINNT host for a WIN95 target).
|
---|
572 | # It also accomodates for MKS's uname.exe. If you never intend
|
---|
573 | # to do development on a WIN95 machine, you don't need this hack.
|
---|
574 | #
|
---|
575 | if test "$OS_ARCH" = "WIN95"; then
|
---|
576 | OS_ARCH=WINNT
|
---|
577 | OS_TARGET=WIN95
|
---|
578 | elif test "$OS_ARCH" = 'Windows_95'; then
|
---|
579 | OS_ARCH=Windows_NT
|
---|
580 | OS_TARGET=WIN95
|
---|
581 | elif test "$OS_ARCH" = 'Windows_98'; then
|
---|
582 | OS_ARCH=Windows_NT
|
---|
583 | OS_TARGET=WIN95
|
---|
584 | elif test "`echo $OS_ARCH | egrep -c '^(CYGWIN_9|CYGWIN_ME)' 2>/dev/null`" != 0; then
|
---|
585 | OS_ARCH='CYGWIN_NT-4.0'
|
---|
586 | OS_TARGET=WIN95
|
---|
587 | elif test "$OS_ARCH" = "OS_2"; then
|
---|
588 | OS_ARCH=OS2
|
---|
589 | OS_TARGET=OS2
|
---|
590 | fi
|
---|
591 |
|
---|
592 | #
|
---|
593 | # On WIN32, we also define the variable CPU_ARCH.
|
---|
594 | #
|
---|
595 |
|
---|
596 | if test "$OS_ARCH" = "WINNT"; then
|
---|
597 | CPU_ARCH=`uname -p`
|
---|
598 | if test "$CPU_ARCH" = "I386"; then
|
---|
599 | CPU_ARCH=x86
|
---|
600 | fi
|
---|
601 | elif test "$OS_ARCH" = "Windows_NT"; then
|
---|
602 | #
|
---|
603 | # If uname -s returns "Windows_NT", we assume that we are using
|
---|
604 | # the uname.exe in MKS toolkit.
|
---|
605 | #
|
---|
606 | # The -r option of MKS uname only returns the major version number.
|
---|
607 | # So we need to use its -v option to get the minor version number.
|
---|
608 | # Moreover, it doesn't have the -p option, so we need to use uname -m.
|
---|
609 | #
|
---|
610 | OS_ARCH=WINNT
|
---|
611 | OS_MINOR_RELEASE=`uname -v`
|
---|
612 | if test "$OS_MINOR_RELEASE" = "00"; then
|
---|
613 | OS_MINOR_RELEASE=0
|
---|
614 | fi
|
---|
615 | OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
|
---|
616 | CPU_ARCH=`uname -m`
|
---|
617 | #
|
---|
618 | # MKS's uname -m returns "586" on a Pentium machine.
|
---|
619 | #
|
---|
620 | if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
|
---|
621 | CPU_ARCH=x86
|
---|
622 | fi
|
---|
623 | elif echo "$OS_ARCH" | grep -c CYGWIN_NT >/dev/null; then
|
---|
624 | #
|
---|
625 | # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
|
---|
626 | # the uname.exe in the Cygwin tools.
|
---|
627 | #
|
---|
628 | OS_RELEASE=`echo $OS_ARCH | sed 's|^CYGWIN_NT-||'`
|
---|
629 | OS_ARCH=WINNT
|
---|
630 | CPU_ARCH=`uname -m`
|
---|
631 | #
|
---|
632 | # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
|
---|
633 | #
|
---|
634 | if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
|
---|
635 | CPU_ARCH=x86
|
---|
636 | fi
|
---|
637 | elif test "$OS_ARCH" = "CYGWIN32_NT"; then
|
---|
638 | #
|
---|
639 | # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
|
---|
640 | # If uname -s returns "CYGWIN32/NT", we assume that we are using
|
---|
641 | # the uname.exe in the GNU-Win32 tools.
|
---|
642 | #
|
---|
643 | OS_ARCH=WINNT
|
---|
644 | CPU_ARCH=`uname -m`
|
---|
645 | #
|
---|
646 | # GNU-Win32's uname -m returns "i686" on a Pentium Pro machine.
|
---|
647 | #
|
---|
648 | if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
|
---|
649 | CPU_ARCH=x86
|
---|
650 | fi
|
---|
651 | fi
|
---|
652 |
|
---|
653 | if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
|
---|
654 | OS_TARGET=WIN95
|
---|
655 | if test -n "$MOZ_DEBUG"; then
|
---|
656 | USE_DEBUG_RTL=1
|
---|
657 | fi
|
---|
658 | fi
|
---|
659 | if test -z "$OS_TARGET"; then
|
---|
660 | OS_TARGET=$OS_ARCH
|
---|
661 | fi
|
---|
662 | if test "$OS_TARGET" = "WIN95"; then
|
---|
663 | OS_RELEASE="4.0"
|
---|
664 | fi
|
---|
665 | if test "$OS_TARGET" = "WIN16"; then
|
---|
666 | OS_RELEASE=
|
---|
667 | fi
|
---|
668 | OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
|
---|
669 |
|
---|
670 | dnl ========================================================
|
---|
671 |
|
---|
672 | dnl ========================================================
|
---|
673 | dnl Override of system specific host options
|
---|
674 | dnl ========================================================
|
---|
675 | case "$host" in
|
---|
676 | *-mingw*|*-cygwin*|*-msvc*|*-mks*)
|
---|
677 | NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
|
---|
678 | if test `echo "${PATH}" | grep -c \;` = 0; then
|
---|
679 | CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
|
---|
680 | fi
|
---|
681 | ;;
|
---|
682 | *-beos*)
|
---|
683 | HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
|
---|
684 | ;;
|
---|
685 | *os2*)
|
---|
686 | ;;
|
---|
687 | *)
|
---|
688 | HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
|
---|
689 | ;;
|
---|
690 | esac
|
---|
691 |
|
---|
692 | dnl ========================================================
|
---|
693 | dnl Override of system specific target options
|
---|
694 | dnl ========================================================
|
---|
695 | case "$target" in
|
---|
696 |
|
---|
697 | *-aix*)
|
---|
698 | AC_DEFINE(XP_UNIX)
|
---|
699 | AC_DEFINE(AIX)
|
---|
700 | AC_DEFINE(SYSV)
|
---|
701 | DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
|
---|
702 | AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
|
---|
703 | case "${target_os}" in
|
---|
704 | aix3.2*)
|
---|
705 | AC_DEFINE(AIX_RENAME_SELECT)
|
---|
706 | AC_DEFINE(_PR_NO_LARGE_FILES)
|
---|
707 | AIX_LINK_OPTS='-bnso -berok'
|
---|
708 | PR_MD_ASFILES=os_AIX.s
|
---|
709 | ;;
|
---|
710 | aix4.1*)
|
---|
711 | AC_DEFINE(AIX_TIMERS)
|
---|
712 | AC_DEFINE(_PR_NO_LARGE_FILES)
|
---|
713 | AC_DEFINE(AIX4_1)
|
---|
714 | MKSHLIB=
|
---|
715 | DSO_LDOPTS=
|
---|
716 | AIX_LINK_OPTS='-bnso -berok'
|
---|
717 | LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
|
---|
718 | LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
|
---|
719 | ;;
|
---|
720 | aix4.2*)
|
---|
721 | AC_DEFINE(AIX_TIMERS)
|
---|
722 | AC_DEFINE(_PR_HAVE_OFF64_T)
|
---|
723 | AIX_LINK_OPTS='-brtl -bnso -berok'
|
---|
724 | ;;
|
---|
725 | aix4.3*)
|
---|
726 | AC_DEFINE(AIX_TIMERS)
|
---|
727 | AC_DEFINE(_PR_HAVE_OFF64_T)
|
---|
728 | AC_DEFINE(AIX4_3_PLUS)
|
---|
729 | AC_DEFINE(HAVE_SOCKLEN_T)
|
---|
730 | AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
---|
731 | USE_IPV6=1
|
---|
732 | AIX_LINK_OPTS='-brtl -bnso -berok'
|
---|
733 | ;;
|
---|
734 | *)
|
---|
735 | AC_DEFINE(AIX_TIMERS)
|
---|
736 | AC_DEFINE(_PR_HAVE_OFF64_T)
|
---|
737 | AC_DEFINE(AIX4_3_PLUS)
|
---|
738 | AC_DEFINE(HAVE_SOCKLEN_T)
|
---|
739 | AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
---|
740 | USE_IPV6=1
|
---|
741 | AIX_LINK_OPTS='-brtl -bnso -berok'
|
---|
742 | ;;
|
---|
743 | esac
|
---|
744 | CFLAGS="$CFLAGS -qro -qroconst"
|
---|
745 | AIX_WRAP='$(DIST)/lib/aixwrap.o'
|
---|
746 | AIX_TMP='./_aix_tmp.o'
|
---|
747 | if test -n "$USE_64"; then
|
---|
748 | MDCPUCFG_H=_aix64.cfg
|
---|
749 | OBJECT_MODE=64
|
---|
750 | else
|
---|
751 | MDCPUCFG_H=_aix32.cfg
|
---|
752 | fi
|
---|
753 | PR_MD_CSRCS=aix.c
|
---|
754 | RESOLVE_LINK_SYMBOLS=1
|
---|
755 | ;;
|
---|
756 |
|
---|
757 | *-beos*)
|
---|
758 | AC_DEFINE(XP_BEOS)
|
---|
759 | AC_DEFINE(BeOS)
|
---|
760 | AC_DEFINE(BEOS)
|
---|
761 | AC_DEFINE(_POSIX_SOURCE)
|
---|
762 | DSO_LDOPTS=-nostart
|
---|
763 | MDCPUCFG_H=_beos.cfg
|
---|
764 | USE_BTHREADS=1
|
---|
765 | PR_MD_ARCH_DIR=beos
|
---|
766 | RESOLVE_LINK_SYMBOLS=1
|
---|
767 | case "${target_cpu}" in
|
---|
768 | i*86)
|
---|
769 | _OPTIMIZE_FLAGS=-O2
|
---|
770 | _DEBUG_FLAGS='-gdwarf-2 -O0'
|
---|
771 | MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
|
---|
772 | AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
|
---|
773 | ;;
|
---|
774 | powerpc)
|
---|
775 | CC=mwcc
|
---|
776 | CCC=mwcc
|
---|
777 | LD=mwld
|
---|
778 | DSO_LDOPTS='-xms -export pragma -init _init_routine_ -term _term_routine_ -lroot -lnet /boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o /boot/develop/lib/ppc/start_dyn.o'
|
---|
779 | _OPTIMIZE_FLAGS=-O2
|
---|
780 | _DEBUG_FLAGS='-g -O0'
|
---|
781 | ;;
|
---|
782 | esac
|
---|
783 | ;;
|
---|
784 |
|
---|
785 | *-bsdi*)
|
---|
786 | AC_DEFINE(XP_UNIX)
|
---|
787 | AC_DEFINE(BSDI)
|
---|
788 | AC_DEFINE(NEED_BSDREGEX)
|
---|
789 |
|
---|
790 | CFLAGS="$CFLAGS -Wall -Wno-format"
|
---|
791 | CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
|
---|
792 |
|
---|
793 | if echo "$OS_TEST" | grep -c 86 >/dev/null; then
|
---|
794 | CPU_ARCH=x86
|
---|
795 | elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
|
---|
796 | CPU_ARCH=sparc
|
---|
797 | fi
|
---|
798 |
|
---|
799 | MDCPUCFG_H=_bsdi.cfg
|
---|
800 | PR_MD_CSRCS=bsdi.c
|
---|
801 |
|
---|
802 | DSO_LDOPTS=-r
|
---|
803 |
|
---|
804 | case "$target_os" in
|
---|
805 | bsdi1.1*)
|
---|
806 | AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
|
---|
807 | AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
|
---|
808 | AC_DEFINE(_PR_NEED_H_ERRNO)
|
---|
809 | MKSHLIB=
|
---|
810 | DSO_CFLAGS=
|
---|
811 | DSO_LDOPTS=
|
---|
812 | ;;
|
---|
813 |
|
---|
814 | bsdi2.1*)
|
---|
815 | AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
|
---|
816 | AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
|
---|
817 | AC_DEFINE(HAVE_DLL)
|
---|
818 | AC_DEFINE(USE_DLFCN)
|
---|
819 | AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
|
---|
820 | PR_MD_ASFILES=os_BSD_OS_386_2.s
|
---|
821 | ;;
|
---|
822 |
|
---|
823 | bsdi4.* | bsdi5.*)
|
---|
824 | AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
|
---|
825 | AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
|
---|
826 | AC_DEFINE(HAVE_DLL)
|
---|
827 | AC_DEFINE(USE_DLFCN)
|
---|
828 | AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
|
---|
829 | MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
|
---|
830 | DSO_CFLAGS=-fPIC
|
---|
831 | DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
|
---|
832 | STRIP="$STRIP -d"
|
---|
833 | case "$target_os" in
|
---|
834 | bsdi4.2* | bsdi4.3* | bsdi5.*)
|
---|
835 | AC_DEFINE(_PR_HAVE_GETPROTO_R)
|
---|
836 | AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
|
---|
837 | ;;
|
---|
838 | esac
|
---|
839 | ;;
|
---|
840 | *)
|
---|
841 | AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
|
---|
842 | AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
|
---|
843 | AC_DEFINE(HAVE_DLL)
|
---|
844 | AC_DEFINE(USE_DLFCN)
|
---|
845 | AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
|
---|
846 | ;;
|
---|
847 | esac
|
---|
848 |
|
---|
849 | ;;
|
---|
850 |
|
---|
851 | *-darwin*)
|
---|
852 | AC_DEFINE(XP_UNIX)
|
---|
853 | AC_DEFINE(DARWIN)
|
---|
854 | AC_DEFINE(HAVE_BSD_FLOCK)
|
---|
855 | CFLAGS="$CFLAGS -Wmost -fno-common"
|
---|
856 | if echo $OS_TEST | grep -c 86 2>/dev/null; then
|
---|
857 | AC_DEFINE(i386)
|
---|
858 | CPU_ARCH=i386
|
---|
859 | else
|
---|
860 | AC_DEFINE(ppc)
|
---|
861 | CPU_ARCH=ppc
|
---|
862 | fi
|
---|
863 | DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
|
---|
864 | # Use the standard preprocessor (cpp)
|
---|
865 | CFLAGS="$CFLAGS -no-cpp-precomp"
|
---|
866 | MKSHLIB='$(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS) -o $@'
|
---|
867 | STRIP="$STRIP -x -S"
|
---|
868 | DLL_SUFFIX=dylib
|
---|
869 | USE_PTHREADS=1
|
---|
870 | MDCPUCFG_H=_darwin.cfg
|
---|
871 | PR_MD_CSRCS=darwin.c
|
---|
872 | if test "$CPU_ARCH" = "ppc"; then
|
---|
873 | PR_MD_ASFILES=os_Darwin_ppc.s
|
---|
874 | fi
|
---|
875 |
|
---|
876 | # Add Mac OS X support for loading CFM & CFBundle plugins
|
---|
877 | if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
|
---|
878 | AC_DEFINE(XP_MACOSX)
|
---|
879 | OS_TARGET=MacOSX
|
---|
880 |
|
---|
881 | dnl The C preprocessor can only handle integers in comparisons, so
|
---|
882 | dnl convert the version to the form AABBCC where AA=major release,
|
---|
883 | dnl BB=minor release, and CC=point/micro release.
|
---|
884 |
|
---|
885 | MACOS_VERSION_MAJOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 1`
|
---|
886 | MACOS_VERSION_MINOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 2`
|
---|
887 | MACOS_VERSION_MICRO=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 3`
|
---|
888 | if test -z "$MACOS_VERSION_MINOR"; then
|
---|
889 | MACOS_VERSION_MINOR=0
|
---|
890 | fi
|
---|
891 | if test -z "$MACOS_VERSION_MICRO"; then
|
---|
892 | MACOS_VERSION_MICRO=0
|
---|
893 | fi
|
---|
894 | MACOS_DEPLOYMENT_TARGET=`printf "%02d%02d%02d" "$MACOS_VERSION_MAJOR" "$MACOS_VERSION_MINOR" "$MACOS_VERSION_MICRO"`
|
---|
895 | AC_DEFINE_UNQUOTED(MACOS_DEPLOYMENT_TARGET, $MACOS_DEPLOYMENT_TARGET)
|
---|
896 | fi
|
---|
897 |
|
---|
898 | # do the right thing for panther SDK support
|
---|
899 | if test "$NEXT_ROOT"; then
|
---|
900 | CFLAGS="-I${NEXT_ROOT}/usr/include $CFLAGS"
|
---|
901 | CXXFLAGS="-I${NEXT_ROOT}/usr/include $CXXFLAGS"
|
---|
902 | fi
|
---|
903 | ;;
|
---|
904 |
|
---|
905 | *-dgux*)
|
---|
906 | AC_DEFINE(XP_UNIX)
|
---|
907 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
908 | AC_DEFINE(SVR4)
|
---|
909 | AC_DEFINE(SYSV)
|
---|
910 | AC_DEFINE(DGUX)
|
---|
911 | AC_DEFINE(_DGUX_SOURCE)
|
---|
912 | AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
|
---|
913 | DSO_LDOPTS=-G
|
---|
914 | _OPTIMIZE_FLAGS=-O2
|
---|
915 | _DEBUG_FLAGS=
|
---|
916 | MDCPUCFG_H=_dgux.cfg
|
---|
917 | PR_MD_CSRCS=dgux.c
|
---|
918 | ;;
|
---|
919 |
|
---|
920 | *-freebsd*)
|
---|
921 | if test -z "$USE_NSPR_THREADS"; then
|
---|
922 | USE_PTHREADS=1
|
---|
923 | fi
|
---|
924 | AC_DEFINE(XP_UNIX)
|
---|
925 | AC_DEFINE(FREEBSD)
|
---|
926 | AC_DEFINE(HAVE_BSD_FLOCK)
|
---|
927 | AC_DEFINE(HAVE_SOCKLEN_T)
|
---|
928 | CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
|
---|
929 | MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
|
---|
930 | if test "$MOZ_OBJFORMAT" = "elf"; then
|
---|
931 | DLL_SUFFIX=so
|
---|
932 | else
|
---|
933 | DLL_SUFFIX=so.1.0
|
---|
934 | fi
|
---|
935 | MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
|
---|
936 | DSO_CFLAGS=-fPIC
|
---|
937 | DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
|
---|
938 | MDCPUCFG_H=_freebsd.cfg
|
---|
939 | PR_MD_CSRCS=freebsd.c
|
---|
940 | ;;
|
---|
941 |
|
---|
942 | *-hpux*)
|
---|
943 | AC_DEFINE(XP_UNIX)
|
---|
944 | AC_DEFINE(HPUX)
|
---|
945 | AC_DEFINE(_HPUX_SOURCE)
|
---|
946 | AC_DEFINE(hppa)
|
---|
947 | # OSF1 and HPUX report the POLLHUP event for a socket when the
|
---|
948 | # shutdown(SHUT_WR) operation is called for the remote end, even though
|
---|
949 | # the socket is still writeable. Use select(), instead of poll(), to
|
---|
950 | # workaround this problem.
|
---|
951 | AC_DEFINE(_PR_POLL_WITH_SELECT)
|
---|
952 | AC_DEFINE(_USE_BIG_FDS)
|
---|
953 | DLL_SUFFIX=sl
|
---|
954 | DSO_LDOPTS='-b +h $(notdir $@)'
|
---|
955 | PR_MD_CSRCS=hpux.c
|
---|
956 | if test "$OS_TEST" != "ia64"; then
|
---|
957 | PR_MD_ASFILES=os_HPUX.s
|
---|
958 | fi
|
---|
959 | if test -n "$USE_64"; then
|
---|
960 | MDCPUCFG_H=_hpux64.cfg
|
---|
961 | else
|
---|
962 | MDCPUCFG_H=_hpux32.cfg
|
---|
963 | fi
|
---|
964 | if test -z "$GNU_CC"; then
|
---|
965 | CC="$CC -Ae"
|
---|
966 | CXX="$CXX -ext"
|
---|
967 | DSO_CFLAGS=+Z
|
---|
968 | else
|
---|
969 | DSO_CFLAGS=-fPIC
|
---|
970 | fi
|
---|
971 |
|
---|
972 | if test -n "$MOZILLA_CLIENT"; then
|
---|
973 | DEFAULT_IMPL_STRATEGY=_EMU
|
---|
974 | fi
|
---|
975 |
|
---|
976 | if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
|
---|
977 | AC_DEFINE(_PR_NEED_H_ERRNO)
|
---|
978 | AC_DEFINE(HPUX9)
|
---|
979 | DEFAULT_IMPL_STRATEGY=_EMU
|
---|
980 | USE_NSPR_THREADS=1
|
---|
981 | fi
|
---|
982 |
|
---|
983 | if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
|
---|
984 | AC_DEFINE(_PR_NO_LARGE_FILES)
|
---|
985 | fi
|
---|
986 |
|
---|
987 | if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
|
---|
988 | AC_DEFINE(_PR_NEED_H_ERRNO)
|
---|
989 | fi
|
---|
990 |
|
---|
991 | if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
|
---|
992 | AC_DEFINE(HAVE_INT_LOCALTIME_R)
|
---|
993 | fi
|
---|
994 |
|
---|
995 | if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
|
---|
996 | AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
---|
997 | fi
|
---|
998 |
|
---|
999 | # HP-UX 11i (B.11.11) or higher
|
---|
1000 | changequote(<<,>>)
|
---|
1001 | case "$OS_RELEASE" in
|
---|
1002 | [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[2-9]*|B.11.1[1-9]*)
|
---|
1003 | USE_IPV6=1
|
---|
1004 | ;;
|
---|
1005 | esac
|
---|
1006 | changequote([,])
|
---|
1007 |
|
---|
1008 | if test "$OS_RELEASE" = "B.10.01"; then
|
---|
1009 | AC_DEFINE(HPUX10)
|
---|
1010 | DEFAULT_IMPL_STRATEGY=_EMU
|
---|
1011 | fi
|
---|
1012 |
|
---|
1013 | if test "$OS_RELEASE" = "B.10.10"; then
|
---|
1014 | AC_DEFINE(HPUX10)
|
---|
1015 | AC_DEFINE(HPUX10_10)
|
---|
1016 | DEFAULT_IMPL_STRATEGY=_PTH
|
---|
1017 | fi
|
---|
1018 |
|
---|
1019 | if test "$OS_RELEASE" = "B.10.20"; then
|
---|
1020 | AC_DEFINE(HPUX10)
|
---|
1021 | AC_DEFINE(HPUX10_20)
|
---|
1022 | if test -z "$GNU_CC"; then
|
---|
1023 | CFLAGS="$CFLAGS +DAportable +DS1.1"
|
---|
1024 | CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
|
---|
1025 | fi
|
---|
1026 | DEFAULT_IMPL_STRATEGY=_PTH
|
---|
1027 | fi
|
---|
1028 |
|
---|
1029 | if test "$OS_RELEASE" = "B.10.30"; then
|
---|
1030 | AC_DEFINE(HPUX10)
|
---|
1031 | AC_DEFINE(HPUX10_30)
|
---|
1032 | if test -z "$GNU_CC"; then
|
---|
1033 | CFLAGS="$CFLAGS +DAportable +DS1.1"
|
---|
1034 | CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
|
---|
1035 | fi
|
---|
1036 | DEFAULT_IMPL_STRATEGY=_PTH
|
---|
1037 | fi
|
---|
1038 |
|
---|
1039 | if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
|
---|
1040 | AC_DEFINE(HPUX10)
|
---|
1041 | AC_DEFINE(HPUX11)
|
---|
1042 | AC_DEFINE(_LARGEFILE64_SOURCE)
|
---|
1043 | AC_DEFINE(_PR_HAVE_OFF64_T)
|
---|
1044 | AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
---|
1045 | if test -z "$GNU_CC"; then
|
---|
1046 | if test -z "$USE_64"; then
|
---|
1047 | if test "$OS_TEST" = "ia64"; then
|
---|
1048 | CFLAGS="$CFLAGS +DD32"
|
---|
1049 | CXXFLAGS="$CXXFLAGS +DD32"
|
---|
1050 | else
|
---|
1051 | CFLAGS="$CFLAGS +DAportable +DS2.0"
|
---|
1052 | CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
|
---|
1053 | fi
|
---|
1054 | else
|
---|
1055 | if test "$OS_TEST" = "ia64"; then
|
---|
1056 | CFLAGS="$CFLAGS +DD64"
|
---|
1057 | CXXFLAGS="$CXXFLAGS +DD64"
|
---|
1058 | else
|
---|
1059 | CFLAGS="$CFLAGS +DA2.0W +DS2.0"
|
---|
1060 | CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
|
---|
1061 | fi
|
---|
1062 | fi
|
---|
1063 | fi
|
---|
1064 | DEFAULT_IMPL_STRATEGY=_PTH
|
---|
1065 | fi
|
---|
1066 |
|
---|
1067 | if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
|
---|
1068 | USE_NSPR_THREADS=1
|
---|
1069 | USE_PTHREADS=
|
---|
1070 | USE_USER_THREADS=
|
---|
1071 | elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
|
---|
1072 | USE_PTHREADS=1
|
---|
1073 | if test "$USE_NSPR_THREADS"; then
|
---|
1074 | USE_PTHREADS=
|
---|
1075 | fi
|
---|
1076 | if test "$USE_USER_PTHREADS"; then
|
---|
1077 | USE_PTHREADS=
|
---|
1078 | fi
|
---|
1079 | fi
|
---|
1080 | ;;
|
---|
1081 |
|
---|
1082 | *-irix*)
|
---|
1083 | AC_DEFINE(XP_UNIX)
|
---|
1084 | AC_DEFINE(IRIX)
|
---|
1085 | AC_DEFINE(SVR4)
|
---|
1086 | AC_DEFINE(_SGI_MP_SOURCE)
|
---|
1087 | AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
---|
1088 | PR_MD_CSRCS=irix.c
|
---|
1089 | PR_MD_ASFILES=os_Irix.s
|
---|
1090 | MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
|
---|
1091 | STRIP="$STRIP -f"
|
---|
1092 | RESOLVE_LINK_SYMBOLS=1
|
---|
1093 | if test -n "$USE_64"; then
|
---|
1094 | MDCPUCFG_H=_irix64.cfg
|
---|
1095 | else
|
---|
1096 | MDCPUCFG_H=_irix32.cfg
|
---|
1097 | fi
|
---|
1098 | case "${target_os}" in
|
---|
1099 | irix6*)
|
---|
1100 | AC_DEFINE(IRIX6)
|
---|
1101 | USE_PTHREADS=1
|
---|
1102 | USE_N32=1
|
---|
1103 | COMPILER_TAG=_n32
|
---|
1104 | IMPL_STRATEGY=_PTH
|
---|
1105 | ;;
|
---|
1106 | irix5*)
|
---|
1107 | AC_DEFINE(IRIX5)
|
---|
1108 | USE_NSPR_THREADS=1
|
---|
1109 | ;;
|
---|
1110 | *)
|
---|
1111 | USE_PTHREADS=1
|
---|
1112 | USE_N32=1
|
---|
1113 | ;;
|
---|
1114 | esac
|
---|
1115 | if test "$GNU_CC"; then
|
---|
1116 | dnl
|
---|
1117 | dnl If we are using gcc with native binutils, we need to
|
---|
1118 | dnl suppress the
|
---|
1119 | dnl #lineno "filename" num num
|
---|
1120 | dnl lines, which confuse IRIX native as. Add -Wp,-P to the
|
---|
1121 | dnl gcc command line, which passes -P to the preprocessor.
|
---|
1122 | dnl
|
---|
1123 | AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
|
---|
1124 | CFLAGS="$CFLAGS -Wall -Wno-format"
|
---|
1125 | _OPTIMIZE_FLAGS="-O6"
|
---|
1126 | else
|
---|
1127 | if test -n "$USE_N32"; then
|
---|
1128 | AS='as -D_ASM $(INCLUDES) -n32'
|
---|
1129 | else
|
---|
1130 | AS='as -D_ASM $(INCLUDES)'
|
---|
1131 | fi
|
---|
1132 | CFLAGS="$CFLAGS -fullwarn -xansi"
|
---|
1133 | if test "$USE_N32"; then
|
---|
1134 | _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
|
---|
1135 | else
|
---|
1136 | _OPTIMIZE_FLAGS="-O -Olimit 4000"
|
---|
1137 | fi
|
---|
1138 | if test "$USE_MDUPDATE"; then
|
---|
1139 | CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
|
---|
1140 | fi
|
---|
1141 | case "${target}" in
|
---|
1142 | *-irix6.*)
|
---|
1143 | CFLAGS="$CFLAGS -multigot"
|
---|
1144 | DSO_LDOPTS="-no_unresolved"
|
---|
1145 | if test "$USE_N32"; then
|
---|
1146 | CFLAGS="$CFLAGS -n32 -woff 1209"
|
---|
1147 | DSO_LDOPTS="$DSO_LDOPTS -n32"
|
---|
1148 | else
|
---|
1149 | if test "$USE_64"; then
|
---|
1150 | CFLAGS="$CFLAGS -64"
|
---|
1151 | else
|
---|
1152 | CFLAGS="$CFLAGS -32"
|
---|
1153 | fi
|
---|
1154 | fi
|
---|
1155 | ;;
|
---|
1156 | *)
|
---|
1157 | CFLAGS="$CFLAGS -xgot"
|
---|
1158 | ;;
|
---|
1159 | esac
|
---|
1160 | fi
|
---|
1161 | if test "${target_os}" = "irix5.3"; then
|
---|
1162 | AC_DEFINE(IRIX5_3)
|
---|
1163 | fi
|
---|
1164 | case "${target_os}" in
|
---|
1165 | irix6.5)
|
---|
1166 | if test -z "$GNU_CC"; then
|
---|
1167 | CFLAGS="$CFLAGS -mips3"
|
---|
1168 | fi
|
---|
1169 | AC_DEFINE(_PR_HAVE_GETPROTO_R)
|
---|
1170 | AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
|
---|
1171 | AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
|
---|
1172 | ;;
|
---|
1173 | irix5*)
|
---|
1174 | ;;
|
---|
1175 | *)
|
---|
1176 | AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
|
---|
1177 | ;;
|
---|
1178 | esac
|
---|
1179 | ;;
|
---|
1180 |
|
---|
1181 | *-linux*)
|
---|
1182 | if test -z "$USE_NSPR_THREADS"; then
|
---|
1183 | USE_PTHREADS=1
|
---|
1184 | IMPL_STRATEGY=_PTH
|
---|
1185 | fi
|
---|
1186 | AC_DEFINE(XP_UNIX)
|
---|
1187 | AC_DEFINE(_POSIX_SOURCE)
|
---|
1188 | AC_DEFINE(_BSD_SOURCE)
|
---|
1189 | AC_DEFINE(_SVID_SOURCE)
|
---|
1190 | AC_DEFINE(_LARGEFILE64_SOURCE)
|
---|
1191 | AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
---|
1192 | AC_DEFINE(LINUX)
|
---|
1193 | CFLAGS="$CFLAGS -ansi -Wall"
|
---|
1194 | CXXFLAGS="$CXXFLAGS -ansi -Wall"
|
---|
1195 | MDCPUCFG_H=_linux.cfg
|
---|
1196 | PR_MD_CSRCS=linux.c
|
---|
1197 | MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
|
---|
1198 | DSO_CFLAGS=-fPIC
|
---|
1199 | DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
|
---|
1200 | _OPTIMIZE_FLAGS=-O2
|
---|
1201 | _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
|
---|
1202 | # combo is not yet good at debugging inlined
|
---|
1203 | # functions (even when using DWARF2 as the
|
---|
1204 | # debugging format)
|
---|
1205 | COMPILER_TAG=_glibc
|
---|
1206 | if echo "$OS_TEST" | grep -c 86 >/dev/null; then
|
---|
1207 | CPU_ARCH=x86
|
---|
1208 | else
|
---|
1209 | CPU_ARCH=$OS_TEST
|
---|
1210 | fi
|
---|
1211 | CPU_ARCH_TAG=_${CPU_ARCH}
|
---|
1212 | case "${target_cpu}" in
|
---|
1213 | alpha)
|
---|
1214 | AC_DEFINE(_ALPHA_)
|
---|
1215 | AC_DEFINE(__alpha)
|
---|
1216 | CFLAGS="$CFLAGS -mieee"
|
---|
1217 | CXXFLAGS="$CXXFLAGS -mieee"
|
---|
1218 | ;;
|
---|
1219 | i*86)
|
---|
1220 | AC_DEFINE(i386)
|
---|
1221 | PR_MD_ASFILES=os_Linux_x86.s
|
---|
1222 | ;;
|
---|
1223 | ia64)
|
---|
1224 | PR_MD_ASFILES=os_Linux_ia64.s
|
---|
1225 | ;;
|
---|
1226 | x86_64)
|
---|
1227 | PR_MD_ASFILES=os_Linux_x86_64.s
|
---|
1228 | ;;
|
---|
1229 | m68k)
|
---|
1230 | CFLAGS="$CFLAGS -m68020-60"
|
---|
1231 | CXXFLAGS="$CXXFLAGS -m68020-60"
|
---|
1232 | ;;
|
---|
1233 | esac
|
---|
1234 | ;;
|
---|
1235 |
|
---|
1236 | *-mingw*|*-cygwin*|*-msvc*|*-mks*)
|
---|
1237 | AC_DEFINE(XP_PC)
|
---|
1238 | AC_DEFINE(WIN32)
|
---|
1239 | PR_MD_ARCH_DIR=windows
|
---|
1240 | RESOLVE_LINK_SYMBOLS=1
|
---|
1241 |
|
---|
1242 | if test -n "$GNU_CC"; then
|
---|
1243 | CC="$CC -mno-cygwin"
|
---|
1244 | CXX="$CXX -mno-cygwin"
|
---|
1245 | DLL_SUFFIX=dll
|
---|
1246 | MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
|
---|
1247 | RC=$WINDRES
|
---|
1248 | # Use temp file for windres (bug 213281)
|
---|
1249 | RCFLAGS='-O coff --use-temp-file'
|
---|
1250 | else
|
---|
1251 | CC=cl
|
---|
1252 | CXX=cl
|
---|
1253 | LD=link
|
---|
1254 | AR='lib -NOLOGO -OUT:"$@"'
|
---|
1255 | AR_FLAGS=
|
---|
1256 | RANLIB='echo not_ranlib'
|
---|
1257 | STRIP='echo not_strip'
|
---|
1258 | RC=rc.exe
|
---|
1259 | GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
|
---|
1260 | OBJ_SUFFIX=obj
|
---|
1261 | LIB_SUFFIX=lib
|
---|
1262 | DLL_SUFFIX=dll
|
---|
1263 |
|
---|
1264 | # Determine compiler version
|
---|
1265 | CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'`
|
---|
1266 | _CC_MAJOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $1 }'`
|
---|
1267 | _CC_MINOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $2 }'`
|
---|
1268 | MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
|
---|
1269 |
|
---|
1270 | CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
|
---|
1271 | DLLFLAGS='-OUT:"$@"'
|
---|
1272 | _DEBUG_FLAGS=-Z7
|
---|
1273 | _OPTIMIZE_FLAGS=-O2
|
---|
1274 | if test -z "$MOZ_OPTIMIZE"; then
|
---|
1275 | CFLAGS="$CFLAGS -Od"
|
---|
1276 | fi
|
---|
1277 |
|
---|
1278 | if test -n "$USE_DEBUG_RTL"; then
|
---|
1279 | CFLAGS="$CFLAGS -MDd"
|
---|
1280 | else
|
---|
1281 | CFLAGS="$CFLAGS -MD"
|
---|
1282 | fi
|
---|
1283 |
|
---|
1284 | if test -n "$MOZ_DEBUG"; then
|
---|
1285 | AC_DEFINE(_DEBUG)
|
---|
1286 | else
|
---|
1287 | DEFINES="$DEFINES -U_DEBUG"
|
---|
1288 | fi
|
---|
1289 |
|
---|
1290 | if test -n "$MOZ_OPTIMIZE"; then
|
---|
1291 | if test -n "$MOZ_PROFILE"; then
|
---|
1292 | _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Z7"
|
---|
1293 | fi
|
---|
1294 | if test -n "$MOZ_DEBUG_SYMBOLS"; then
|
---|
1295 | _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Zi"
|
---|
1296 | fi
|
---|
1297 | if test -n "$MOZ_PROFILE" -o -n "$MOZ_DEBUG_SYMBOLS"; then
|
---|
1298 | DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
|
---|
1299 | LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
|
---|
1300 | fi
|
---|
1301 | fi
|
---|
1302 |
|
---|
1303 | if test -n "$MOZ_DEBUG"; then
|
---|
1304 | DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
|
---|
1305 | LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
|
---|
1306 | fi
|
---|
1307 |
|
---|
1308 | if test "$OS_TARGET" = "WINNT"; then
|
---|
1309 | CFLAGS="$CFLAGS -GT"
|
---|
1310 | if test "$CPU_ARCH" = "x86"; then
|
---|
1311 | CFLAGS="$CFLAGS -G5"
|
---|
1312 | fi
|
---|
1313 | LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
|
---|
1314 | LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
|
---|
1315 | else
|
---|
1316 | LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
|
---|
1317 | LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
|
---|
1318 | fi
|
---|
1319 | fi # GNU_CC
|
---|
1320 |
|
---|
1321 | if test -n "$USE_STATIC_TLS"; then
|
---|
1322 | AC_DEFINE(_PR_USE_STATIC_TLS)
|
---|
1323 | fi
|
---|
1324 |
|
---|
1325 | if test "$OS_TARGET" = "WINNT"; then
|
---|
1326 | AC_DEFINE(WINNT)
|
---|
1327 | else
|
---|
1328 | AC_DEFINE(WIN95)
|
---|
1329 | # undefine WINNT as some versions of mingw gcc define it by default
|
---|
1330 | DEFINES="$DEFINES -UWINNT"
|
---|
1331 | AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
|
---|
1332 | fi
|
---|
1333 |
|
---|
1334 | if test "$CPU_ARCH" = "x86"; then
|
---|
1335 | CPU_ARCH_TAG=
|
---|
1336 | else
|
---|
1337 | CPU_ARCH_TAG=$CPU_ARCH
|
---|
1338 | fi
|
---|
1339 |
|
---|
1340 | if test -n "$USE_DEBUG_RTL"; then
|
---|
1341 | OBJDIR_SUFFIX=OBJD
|
---|
1342 | fi
|
---|
1343 |
|
---|
1344 | OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
|
---|
1345 | if test "$MSC_VER" = "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
|
---|
1346 | OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
|
---|
1347 | fi
|
---|
1348 |
|
---|
1349 | case "$OS_TARGET" in
|
---|
1350 | WINNT)
|
---|
1351 | MDCPUCFG_H=_winnt.cfg
|
---|
1352 | ;;
|
---|
1353 | WIN95)
|
---|
1354 | MDCPUCFG_H=_win95.cfg
|
---|
1355 | ;;
|
---|
1356 | WIN16)
|
---|
1357 | MDCPUCFG_H=_win16.cfg
|
---|
1358 | ;;
|
---|
1359 | *)
|
---|
1360 | AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
|
---|
1361 | ;;
|
---|
1362 | esac
|
---|
1363 |
|
---|
1364 | case "$target_cpu" in
|
---|
1365 | i*86)
|
---|
1366 | AC_DEFINE(_X86_)
|
---|
1367 | ;;
|
---|
1368 | alpha)
|
---|
1369 | AC_DEFINE(_ALPHA_)
|
---|
1370 | ;;
|
---|
1371 | mips)
|
---|
1372 | AC_DEFINE(_MIPS_)
|
---|
1373 | ;;
|
---|
1374 | *)
|
---|
1375 | AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
|
---|
1376 | ;;
|
---|
1377 | esac
|
---|
1378 |
|
---|
1379 | ;;
|
---|
1380 |
|
---|
1381 | *-ncr-sysv*)
|
---|
1382 | AC_DEFINE(XP_UNIX)
|
---|
1383 | AC_DEFINE(SVR4)
|
---|
1384 | AC_DEFINE(SYSV)
|
---|
1385 | AC_DEFINE(NCR)
|
---|
1386 | USE_NSPR_THREADS=1
|
---|
1387 | if test "$OS_RELEASE" = "2.03"; then
|
---|
1388 | AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
|
---|
1389 | else
|
---|
1390 | AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
|
---|
1391 | fi
|
---|
1392 |
|
---|
1393 | if test -z "$GNU_CC"; then
|
---|
1394 | CFLAGS="$CFLAGS -Hnocopyr"
|
---|
1395 | CXXFLAGS="$CXXFLAGS -Hnocopyr"
|
---|
1396 | else
|
---|
1397 | CFLAGS="$CFLAGS -fPIC -Wall"
|
---|
1398 | CXXFLAGS="$CXXFLAGS -fPIC -Wall"
|
---|
1399 | DSO_LDOPTS=-G
|
---|
1400 | fi
|
---|
1401 | MDCPUCFG_H=_ncr.cfg
|
---|
1402 | PR_MD_CSRCS=ncr.c
|
---|
1403 | ;;
|
---|
1404 |
|
---|
1405 | mips-nec-sysv*)
|
---|
1406 | AC_DEFINE(XP_UNIX)
|
---|
1407 | AC_DEFINE(SVR4)
|
---|
1408 | AC_DEFINE(__SVR4)
|
---|
1409 | AC_DEFINE(NEC)
|
---|
1410 | AC_DEFINE(nec_ews)
|
---|
1411 | USE_NSPR_THREADS=1
|
---|
1412 | if test -z "$GNU_CC"; then
|
---|
1413 | CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
|
---|
1414 | CXX=g++
|
---|
1415 | fi
|
---|
1416 | OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
|
---|
1417 | DSO_LDOPTS=-G
|
---|
1418 | MDCPUCFG_H=_nec.cfg
|
---|
1419 | PR_MD_CSRCS=nec.c
|
---|
1420 | ;;
|
---|
1421 |
|
---|
1422 | *-netbsd*)
|
---|
1423 | AC_DEFINE(XP_UNIX)
|
---|
1424 | AC_DEFINE(NETBSD)
|
---|
1425 | AC_DEFINE(HAVE_BSD_FLOCK)
|
---|
1426 | USE_NSPR_THREADS=1
|
---|
1427 | MDCPUCFG_H=_netbsd.cfg
|
---|
1428 | PR_MD_CSRCS=netbsd.c
|
---|
1429 |
|
---|
1430 | DSO_CFLAGS='-fPIC -DPIC'
|
---|
1431 | CFLAGS="$CFLAGS -ansi -Wall"
|
---|
1432 | CXXFLAGS="$CXXFLAGS -ansi -Wall"
|
---|
1433 | MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
|
---|
1434 |
|
---|
1435 | if test -z "$OBJECT_FMT"; then
|
---|
1436 | if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
|
---|
1437 | OBJECT_FMT=a.out
|
---|
1438 | DLL_SUFFIX=so.1.0
|
---|
1439 | DSO_LDOPTS='-shared'
|
---|
1440 | else
|
---|
1441 | OBJECT_FMT=ELF
|
---|
1442 | DLL_SUFFIX=so
|
---|
1443 | DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
|
---|
1444 | fi
|
---|
1445 | fi
|
---|
1446 |
|
---|
1447 | if test "$LIBRUNPATH"; then
|
---|
1448 | DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
|
---|
1449 | fi
|
---|
1450 | ;;
|
---|
1451 |
|
---|
1452 | mips-sony-newsos*)
|
---|
1453 | AC_DEFINE(XP_UNIX)
|
---|
1454 | AC_DEFINE(SONY)
|
---|
1455 | AC_DEFINE(SYSV)
|
---|
1456 | AC_DEFINE(SVR4)
|
---|
1457 | AC_DEFINE(__svr4)
|
---|
1458 | AC_DEFINE(__svr4__)
|
---|
1459 | AC_DEFINE(HAVE_SVID_GETTOD)
|
---|
1460 | USE_NSPR_THREADS=1
|
---|
1461 | CFLAGS="$CFLAGS -Xa -fullwarn"
|
---|
1462 | CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
|
---|
1463 | DSO_LDOPTS=-G
|
---|
1464 | MDCPUCFG_H=_sony.cfg
|
---|
1465 | PR_MD_CSRCS=sony.c
|
---|
1466 | ;;
|
---|
1467 |
|
---|
1468 | *-nextstep*|*-openstep*)
|
---|
1469 | AC_DEFINE(XP_UNIX)
|
---|
1470 | AC_DEFINE(NEXTSTEP)
|
---|
1471 | AC_DEFINE(HAVE_BSD_FLOCK)
|
---|
1472 | AC_DEFINE(_POSIX_SOURCE)
|
---|
1473 | CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
|
---|
1474 | CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
|
---|
1475 | USE_NSPR_THREADS=1
|
---|
1476 | DLL_SUFFIX=dylib
|
---|
1477 | MDCPUCFG_H=_nextstep.cfg
|
---|
1478 | PR_MD_CSRCS=nextstep.c
|
---|
1479 | ;;
|
---|
1480 |
|
---|
1481 |
|
---|
1482 | *-nto*)
|
---|
1483 | AC_DEFINE(XP_UNIX)
|
---|
1484 | AC_DEFINE(NTO)
|
---|
1485 | AC_DEFINE(_QNX_SOURCE)
|
---|
1486 | AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
---|
1487 | MDCPUCFG_H=_nto.cfg
|
---|
1488 | PR_MD_CSRCS=nto.c
|
---|
1489 | MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
|
---|
1490 | DSO_CFLAGS=-fPIC
|
---|
1491 | DSO_LDOPTS=-shared
|
---|
1492 | OS_LIBS="$OS_LIBS -lsocket"
|
---|
1493 | _OPTIMIZE_FLAGS="-O1"
|
---|
1494 | _DEBUG_FLAGS="-gstabs"
|
---|
1495 | ;;
|
---|
1496 |
|
---|
1497 | *-openbsd*)
|
---|
1498 | AC_DEFINE(XP_UNIX)
|
---|
1499 | AC_DEFINE(OPENBSD)
|
---|
1500 | AC_DEFINE(HAVE_BSD_FLOCK)
|
---|
1501 | AC_DEFINE(HAVE_SOCKLEN_T)
|
---|
1502 | CFLAGS="$CFLAGS -ansi -Wall"
|
---|
1503 | CXXFLAGS="$CXXFLAGS -ansi -Wall"
|
---|
1504 | DLL_SUFFIX=so.1.0
|
---|
1505 | DSO_CFLAGS=-fPIC
|
---|
1506 | MDCPUCFG_H=_openbsd.cfg
|
---|
1507 | PR_MD_CSRCS=openbsd.c
|
---|
1508 | USE_NSPR_THREADS=1
|
---|
1509 | DSO_LDOPTS='-shared -fPIC'
|
---|
1510 | MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
|
---|
1511 | ;;
|
---|
1512 |
|
---|
1513 | *-openvms*)
|
---|
1514 | AC_DEFINE(XP_UNIX)
|
---|
1515 | AC_DEFINE(VMS)
|
---|
1516 | AC_DEFINE(PR_GETIPNODE_NOT_THREADSAFE)
|
---|
1517 | RESOLVE_LINK_SYMBOLS=1
|
---|
1518 | AR_FLAGS='c $@'
|
---|
1519 | MDCPUCFG_H=_openvms.cfg
|
---|
1520 | PR_MD_CSRCS=openvms.c
|
---|
1521 | DSO_LDOPTS='-shared -auto_symvec $(LDFLAGS)'
|
---|
1522 | if test -n "$MOZ_DEBUG"; then
|
---|
1523 | DSO_LDOPTS="$DSO_LDOPTS $_DEBUG_FLAGS"
|
---|
1524 | else
|
---|
1525 | DSO_LDOPTS="$DSO_LDOPTS $_OPTIMIZE_FLAGS"
|
---|
1526 | fi
|
---|
1527 | ;;
|
---|
1528 |
|
---|
1529 | *-osf*)
|
---|
1530 | SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
|
---|
1531 | AC_DEFINE(XP_UNIX)
|
---|
1532 | AC_DEFINE(OSF1)
|
---|
1533 | AC_DEFINE(_REENTRANT)
|
---|
1534 | # OSF1 and HPUX report the POLLHUP event for a socket when the
|
---|
1535 | # shutdown(SHUT_WR) operation is called for the remote end, even though
|
---|
1536 | # the socket is still writeable. Use select(), instead of poll(), to
|
---|
1537 | # workaround this problem.
|
---|
1538 | AC_DEFINE(_PR_POLL_WITH_SELECT)
|
---|
1539 |
|
---|
1540 | if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
|
---|
1541 | USE_NSPR_THREADS=1
|
---|
1542 | fi
|
---|
1543 |
|
---|
1544 | if test -z "$GNU_CC"; then
|
---|
1545 | CC="$CC -std1 -ieee_with_inexact"
|
---|
1546 | if test "$OS_RELEASE" != "V2.0"; then
|
---|
1547 | CC="$CC -readonly_strings"
|
---|
1548 | fi
|
---|
1549 | _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
|
---|
1550 | AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
|
---|
1551 | else
|
---|
1552 | CFLAGS="$CFLAGS -mieee"
|
---|
1553 | CXXFLAGS="$CXXFLAGS -mieee"
|
---|
1554 | fi
|
---|
1555 |
|
---|
1556 | if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
|
---|
1557 | AC_DEFINE(HAVE_INT_LOCALTIME_R)
|
---|
1558 | else
|
---|
1559 | AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
---|
1560 | AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
---|
1561 | fi
|
---|
1562 | if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
|
---|
1563 | AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
|
---|
1564 | fi
|
---|
1565 | DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
|
---|
1566 | MDCPUCFG_H=_osf1.cfg
|
---|
1567 | PR_MD_CSRCS=osf1.c
|
---|
1568 | ;;
|
---|
1569 |
|
---|
1570 | *-qnx*)
|
---|
1571 | AC_DEFINE(XP_UNIX)
|
---|
1572 | AC_DEFINE(QNX)
|
---|
1573 | AC_DEFINE(_PR_NEED_H_ERRNO)
|
---|
1574 | USE_NSPR_THREADS=1
|
---|
1575 | MDCPUCFG_H=_qnx.cfg
|
---|
1576 | PR_MD_CSRCS=qnx.c
|
---|
1577 | ;;
|
---|
1578 |
|
---|
1579 | *-*-sco*)
|
---|
1580 | AC_DEFINE(XP_UNIX)
|
---|
1581 | AC_DEFINE(SCO)
|
---|
1582 | AC_DEFINE(sco)
|
---|
1583 | AC_DEFINE(SYSV)
|
---|
1584 | AC_DEFINE(_SVID3)
|
---|
1585 | AC_DEFINE(_PR_NEED_H_ERRNO)
|
---|
1586 | CC='cc -b elf -KPIC'
|
---|
1587 | CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
|
---|
1588 | USE_NSPR_THREADS=1
|
---|
1589 | CPU_ARCH=x86
|
---|
1590 | DSO_LDOPTS='-b elf -G'
|
---|
1591 | MDCPUCFG_H=_scoos.cfg
|
---|
1592 | PR_MD_SRCS=scoos.c
|
---|
1593 | ;;
|
---|
1594 |
|
---|
1595 | *-sinix*)
|
---|
1596 | AC_DEFINE(XP_UNIX)
|
---|
1597 | AC_DEFINE(SVR4)
|
---|
1598 | AC_DEFINE(SNI)
|
---|
1599 | AC_DEFINE(RELIANTUNIX)
|
---|
1600 | AC_DEFINE(sinix)
|
---|
1601 | AC_DEFINE(HAVE_SVID_GETTOD)
|
---|
1602 | if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
|
---|
1603 | AC_DEFINE(i386)
|
---|
1604 | CPU_ARCH=x86
|
---|
1605 | else
|
---|
1606 | CPU_ARCH=mips
|
---|
1607 | fi
|
---|
1608 |
|
---|
1609 | if test "$GNU_CC"; then
|
---|
1610 | AS='$(CC) -x assembler-with-cpp'
|
---|
1611 | if test "$CPU_ARCH" = "mips"; then
|
---|
1612 | LD=gld
|
---|
1613 | fi
|
---|
1614 | CFLAGS="$CFLAGS -Wall -Wno-format"
|
---|
1615 | else
|
---|
1616 | AS='/usr/bin/cc'
|
---|
1617 | _OPTIMIZE_FLAGS='-O -F Olimit,4000'
|
---|
1618 | fi
|
---|
1619 |
|
---|
1620 | DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
|
---|
1621 |
|
---|
1622 | if test "$OS_RELEASE" = "5.43"; then
|
---|
1623 | AC_DEFINE(IP_MULTICAST)
|
---|
1624 | fi
|
---|
1625 |
|
---|
1626 | OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
|
---|
1627 | USE_NSPR_THREADS=1
|
---|
1628 | MDCPUCFG_H=_reliantunix.cfg
|
---|
1629 | PR_MD_CSRCS=reliantunix.c
|
---|
1630 | if test "${OS_ARCH}" = "mips"; then
|
---|
1631 | PR_MD_ASFILES=os_ReliantUNIX.s
|
---|
1632 | fi
|
---|
1633 | ;;
|
---|
1634 |
|
---|
1635 | *-sunos*)
|
---|
1636 | AC_DEFINE(XP_UNIX)
|
---|
1637 | AC_DEFINE(SUNOS4)
|
---|
1638 | CFLAGS="$CFLAGS -Wall -Wno-format"
|
---|
1639 | if test "$USE_MDUPDATE"; then
|
---|
1640 | CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
|
---|
1641 | fi
|
---|
1642 | CPU_ARCH=sparc
|
---|
1643 | DLL_SUFFIX=so.1.0
|
---|
1644 | DSO_LDOPTS=
|
---|
1645 | DSO_CFLAGS=-fPIC
|
---|
1646 | USE_NSPR_THREADS=1
|
---|
1647 | if test "$OS_RELEASE" = "4.1.3_U1"; then
|
---|
1648 | _OPTIMIZE_FLAGS=
|
---|
1649 | OS_LIBS="$OS_LIBS -lm"
|
---|
1650 | fi
|
---|
1651 | MDCPUCFG_H=_sunos4.cfg
|
---|
1652 | PR_MD_CSRCS=sunos4.c
|
---|
1653 | ;;
|
---|
1654 |
|
---|
1655 | *-solaris*)
|
---|
1656 | if test -z "$USE_USER_THREADS" && test -z "$USE_NATIVE_THREADS"; then
|
---|
1657 | USE_PTHREADS=1
|
---|
1658 | fi
|
---|
1659 | AC_DEFINE(XP_UNIX)
|
---|
1660 | AC_DEFINE(SVR4)
|
---|
1661 | AC_DEFINE(SYSV)
|
---|
1662 | AC_DEFINE(__svr4)
|
---|
1663 | AC_DEFINE(__svr4__)
|
---|
1664 | AC_DEFINE(SOLARIS)
|
---|
1665 | AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
|
---|
1666 | if test -n "$USE_64"; then
|
---|
1667 | MDCPUCFG_H=_solaris64.cfg
|
---|
1668 | else
|
---|
1669 | MDCPUCFG_H=_solaris32.cfg
|
---|
1670 | fi
|
---|
1671 | PR_MD_CSRCS=solaris.c
|
---|
1672 | LD=/usr/ccs/bin/ld
|
---|
1673 | MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
|
---|
1674 | RESOLVE_LINK_SYMBOLS=1
|
---|
1675 | if test -n "$GNU_CC"; then
|
---|
1676 | DSO_CFLAGS=-fPIC
|
---|
1677 | if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
|
---|
1678 | GCC_USE_GNU_LD=1
|
---|
1679 | fi
|
---|
1680 | DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs'
|
---|
1681 | else
|
---|
1682 | DSO_CFLAGS=-KPIC
|
---|
1683 | DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs'
|
---|
1684 | fi
|
---|
1685 | if test -z "$GNU_AS"; then
|
---|
1686 | ASFLAGS="$ASFLAGS -Wa,-P"
|
---|
1687 | fi
|
---|
1688 | if test -n "$GNU_CC"; then
|
---|
1689 | CFLAGS="$CFLAGS -Wall"
|
---|
1690 | CXXFLAGS="$CXXFLAGS -Wall"
|
---|
1691 | if test -n "$USE_MDUPDATE"; then
|
---|
1692 | CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
|
---|
1693 | CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
|
---|
1694 | fi
|
---|
1695 | else
|
---|
1696 | CFLAGS="$CFLAGS -xstrconst"
|
---|
1697 | CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
|
---|
1698 | if test -z "$MOZ_OPTIMIZE"; then
|
---|
1699 | CFLAGS="$CFLAGS -xs"
|
---|
1700 | CXXFLAGS="$CXXFLAGS -xs"
|
---|
1701 | fi
|
---|
1702 | _OPTIMIZE_FLAGS=-xO4
|
---|
1703 | fi
|
---|
1704 | if test -n "$USE_64"; then
|
---|
1705 | if test -n "$GNU_CC"; then
|
---|
1706 | CC="$CC -m64"
|
---|
1707 | CXX="$CXX -m64"
|
---|
1708 | else
|
---|
1709 | CC="$CC -xarch=v9"
|
---|
1710 | CXX="$CXX -xarch=v9"
|
---|
1711 | fi
|
---|
1712 | fi
|
---|
1713 | if test "$OS_TEST" = "i86pc"; then
|
---|
1714 | AC_DEFINE(i386)
|
---|
1715 | CPU_ARCH_TAG=_$OS_TEST
|
---|
1716 | # The default debug format, DWARF (-g), is not supported by gcc
|
---|
1717 | # on i386-ANY-sysv4/solaris, but the stabs format is. It is
|
---|
1718 | # assumed that the Solaris assembler /usr/ccs/bin/as is used.
|
---|
1719 | # If your gcc uses GNU as, you do not need the -Wa,-s option.
|
---|
1720 | if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
|
---|
1721 | _DEBUG_FLAGS=-gstabs
|
---|
1722 | if test -z "$GNU_AS"; then
|
---|
1723 | _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
|
---|
1724 | fi
|
---|
1725 | fi
|
---|
1726 | fi
|
---|
1727 | case "${target_os}" in
|
---|
1728 | solaris2.3*)
|
---|
1729 | AC_DEFINE(_PR_NO_LARGE_FILES)
|
---|
1730 | ;;
|
---|
1731 | solaris2.4*)
|
---|
1732 | AC_DEFINE(_PR_NO_LARGE_FILES)
|
---|
1733 | ;;
|
---|
1734 | solaris2.5*)
|
---|
1735 | AC_DEFINE(SOLARIS2_5)
|
---|
1736 | ;;
|
---|
1737 | *)
|
---|
1738 | AC_DEFINE(_PR_HAVE_OFF64_T)
|
---|
1739 | # The lfcompile64(5) man page on Solaris 2.6 says:
|
---|
1740 | # For applications that do not wish to conform to the POSIX or
|
---|
1741 | # X/Open specifications, the 64-bit transitional interfaces
|
---|
1742 | # are available by default. No compile-time flags need to be
|
---|
1743 | # set.
|
---|
1744 | # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
|
---|
1745 | # The native compiler, gcc 2.8.x, and egcs don't have this problem.
|
---|
1746 | if test -n "$GNU_CC"; then
|
---|
1747 | AC_DEFINE(_LARGEFILE64_SOURCE)
|
---|
1748 | fi
|
---|
1749 | ;;
|
---|
1750 | esac
|
---|
1751 | case "${target_os}" in
|
---|
1752 | solaris2.3*)
|
---|
1753 | ;;
|
---|
1754 | solaris2.4*)
|
---|
1755 | ;;
|
---|
1756 | solaris2.5*)
|
---|
1757 | ;;
|
---|
1758 | solaris2.6*)
|
---|
1759 | ;;
|
---|
1760 | solaris2.7*)
|
---|
1761 | ;;
|
---|
1762 | *)
|
---|
1763 | # Solaris 8 or higher has IPv6.
|
---|
1764 | AC_DEFINE(_PR_INET6)
|
---|
1765 | ;;
|
---|
1766 | esac
|
---|
1767 | if test "$OS_TEST" = "sun4u"; then
|
---|
1768 | # 64-bit Solaris requires SPARC V9 architecture, so the following
|
---|
1769 | # is not needed.
|
---|
1770 | if test -z "$USE_64"; then
|
---|
1771 | ULTRASPARC_LIBRARY=nspr_flt
|
---|
1772 | fi
|
---|
1773 | fi
|
---|
1774 | # Purify requires that binaries linked against nspr also
|
---|
1775 | # be linked against -lrt (or -lposix4) so add it to OS_LIBS
|
---|
1776 | _rev=`uname -r`
|
---|
1777 | _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
|
---|
1778 | OS_LIBS="$OS_LIBS $_librt"
|
---|
1779 | ;;
|
---|
1780 |
|
---|
1781 | *-sco-sysv5*)
|
---|
1782 | AC_DEFINE(XP_UNIX)
|
---|
1783 | AC_DEFINE(UNIXWARE)
|
---|
1784 | AC_DEFINE(SVR4)
|
---|
1785 | AC_DEFINE(SYSV)
|
---|
1786 | USE_NSPR_THREADS=1
|
---|
1787 | if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
|
---|
1788 | AC_DEFINE(_PR_NO_LARGE_FILES)
|
---|
1789 | CC='$(NSDEPTH)/build/hcc cc'
|
---|
1790 | CXX='$(NSDEPTH)/build/hcpp CC'
|
---|
1791 | MDCPUCFG_H=_unixware.cfg
|
---|
1792 | else
|
---|
1793 | AC_DEFINE(_LARGEFILE64_SOURCE)
|
---|
1794 | AC_DEFINE(_PR_HAVE_OFF64_T)
|
---|
1795 | AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
|
---|
1796 | MDCPUCFG_H=_unixware7.cfg
|
---|
1797 | fi
|
---|
1798 | PR_MD_CSRCS=unixware.c
|
---|
1799 | DSO_LDOPTS=-G
|
---|
1800 | CPU_ARCH=x86
|
---|
1801 | ;;
|
---|
1802 |
|
---|
1803 | *-os2*)
|
---|
1804 | AC_DEFINE(XP_OS2)
|
---|
1805 | AC_DEFINE(XP_PC)
|
---|
1806 | AC_DEFINE(BSD_SELECT)
|
---|
1807 | AC_DEFINE(TCPV40HDRS)
|
---|
1808 | LIB_SUFFIX=lib
|
---|
1809 | DLL_SUFFIX=dll
|
---|
1810 | RC=rc.exe
|
---|
1811 | PR_MD_ARCH_DIR=os2
|
---|
1812 | PROG_SUFFIX=.exe
|
---|
1813 | NSINSTALL=nsinstall
|
---|
1814 | MDCPUCFG_H=_os2.cfg
|
---|
1815 | RESOLVE_LINK_SYMBOLS=1
|
---|
1816 |
|
---|
1817 | # EMX/GCC build
|
---|
1818 | if test -n "$GNU_CC"; then
|
---|
1819 | AC_DEFINE(XP_OS2_EMX)
|
---|
1820 | AC_DEFINE(OS2)
|
---|
1821 | AR=emxomfar
|
---|
1822 | AR_FLAGS='r $@'
|
---|
1823 | CFLAGS="$CFLAGS -Wall -Zomf"
|
---|
1824 | CXXFLAGS="$CFLAGS -Wall -Zomf"
|
---|
1825 | MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
|
---|
1826 | DSO_CFLAGS=
|
---|
1827 | DSO_LDOPTS='-Zomf -Zdll -Zmap'
|
---|
1828 | LDFLAGS='-Zmap'
|
---|
1829 | _OPTIMIZE_FLAGS="-O2 -s"
|
---|
1830 | _DEBUG_FLAGS="-g -fno-inline"
|
---|
1831 | if test -n "$MOZ_OPTIMIZE"; then
|
---|
1832 | DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
|
---|
1833 | fi
|
---|
1834 | OS_LIBS="-lsocket"
|
---|
1835 | IMPLIB='emximp -o'
|
---|
1836 | FILTER='emxexp -o'
|
---|
1837 |
|
---|
1838 | # GCC for OS/2 currently predefines these, but we don't want them
|
---|
1839 | DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
|
---|
1840 |
|
---|
1841 | # Visual Age C++ build
|
---|
1842 | elif test "$VACPP" = "yes"; then
|
---|
1843 | AC_DEFINE(XP_OS2_VACPP)
|
---|
1844 | AC_DEFINE(OS2,4)
|
---|
1845 | AC_DEFINE(_X86_)
|
---|
1846 | OBJ_SUFFIX=obj
|
---|
1847 | AS=alp
|
---|
1848 | ASFLAGS='-Mb'
|
---|
1849 | ASM_SUFFIX=asm
|
---|
1850 | AR=-ilib
|
---|
1851 | AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
|
---|
1852 | CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
|
---|
1853 | HOST_CFLAGS="$CFLAGS"
|
---|
1854 | OS_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
|
---|
1855 | OS_EXE_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
|
---|
1856 | CXXFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
|
---|
1857 | OS_LIBS='so32dll.lib tcp32dll.lib'
|
---|
1858 | LD='-ilink'
|
---|
1859 | MKSHLIB='$(LD) $(DSO_LDOPTS)'
|
---|
1860 | IMPLIB='implib -nologo -noignorecase'
|
---|
1861 | FILTER='cppfilt -q -B -P'
|
---|
1862 | _OPTIMIZE_FLAGS='/O+ /Gl+ /qtune=pentium /qarch=pentium'
|
---|
1863 | _DEBUG_FLAGS='/Ti+ '
|
---|
1864 | LDFLAGS='/NOL /M /L'
|
---|
1865 | DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /L /NOL'
|
---|
1866 | EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /L /NOL'
|
---|
1867 | if test -n "$MOZ_DEBUG"; then
|
---|
1868 | LDFLAGS="$LDFLAGS /DE"
|
---|
1869 | DLLFLAGS="$DLLFLAGS /DE"
|
---|
1870 | EXEFLAGS="$EXEFLAGS /DE"
|
---|
1871 | fi
|
---|
1872 | if test -n "$MOZ_OPTIMIZE"; then
|
---|
1873 | LDFLAGS="$LDFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
|
---|
1874 | DLLFLAGS="$DLLFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
|
---|
1875 | EXEFLAGS="$EXEFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
|
---|
1876 | fi
|
---|
1877 | LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
|
---|
1878 | LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
|
---|
1879 | fi
|
---|
1880 | ;;
|
---|
1881 |
|
---|
1882 | *)
|
---|
1883 | AC_DEFINE(XP_UNIX)
|
---|
1884 | ;;
|
---|
1885 |
|
---|
1886 | esac
|
---|
1887 |
|
---|
1888 | if test -z "$SKIP_LIBRARY_CHECKS"; then
|
---|
1889 | dnl ========================================================
|
---|
1890 | dnl Check for system libraries
|
---|
1891 | dnl ========================================================
|
---|
1892 | dnl AC_CHECK_LIB(C, main)
|
---|
1893 | dnl AC_CHECK_LIB(C_r, main)
|
---|
1894 | dnl AC_CHECK_LIB(c, main)
|
---|
1895 | dnl AC_CHECK_LIB(c_r, main)
|
---|
1896 | dnl AC_CHECK_LIB(dce, main)
|
---|
1897 | dnl AC_CHECK_LIB(dl, main)
|
---|
1898 | dnl AC_CHECK_LIB(dld, main)
|
---|
1899 | dnl AC_CHECK_LIB(gen, main)
|
---|
1900 | dnl AC_CHECK_LIB(ip6, main)
|
---|
1901 | dnl AC_CHECK_LIB(l, main)
|
---|
1902 | dnl AC_CHECK_LIB(m, main)
|
---|
1903 | dnl AC_CHECK_LIB(nsl, main)
|
---|
1904 | dnl AC_CHECK_LIB(posix4, main)
|
---|
1905 | dnl AC_CHECK_LIB(prstrms, main)
|
---|
1906 | dnl AC_CHECK_LIB(prstrms_shr, main)
|
---|
1907 | dnl AC_CHECK_LIB(pthread, main)
|
---|
1908 | dnl AC_CHECK_LIB(pthreads, main)
|
---|
1909 | dnl AC_CHECK_LIB(resolv, main)
|
---|
1910 | dnl AC_CHECK_LIB(rt, main)
|
---|
1911 | dnl AC_CHECK_LIB(socket, main)
|
---|
1912 | dnl AC_CHECK_LIB(svld, main)
|
---|
1913 | dnl AC_CHECK_LIB(thread, main)
|
---|
1914 | dnl AC_CHECK_LIB(vms_jackets, main)
|
---|
1915 |
|
---|
1916 |
|
---|
1917 | dnl We don't want anything to link with libdl even if it's present on OS X,
|
---|
1918 | dnl since it's not used and not part of the default installation.
|
---|
1919 |
|
---|
1920 | case $target in
|
---|
1921 | *-darwin*)
|
---|
1922 | ;;
|
---|
1923 | *)
|
---|
1924 | AC_CHECK_LIB(dl, dlopen,
|
---|
1925 | AC_CHECK_HEADER(dlfcn.h,
|
---|
1926 | OS_LIBS="-ldl $OS_LIBS"))
|
---|
1927 | ;;
|
---|
1928 | esac
|
---|
1929 |
|
---|
1930 |
|
---|
1931 | dnl ========================================================
|
---|
1932 | dnl Check for system header files.
|
---|
1933 | dnl ========================================================
|
---|
1934 | dnl AC_HEADER_DIRENT
|
---|
1935 | dnl AC_HEADER_STDC
|
---|
1936 | dnl AC_HEADER_SYS_WAIT
|
---|
1937 | dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
|
---|
1938 |
|
---|
1939 | dnl ========================================================
|
---|
1940 | dnl Check for typedefs and structs
|
---|
1941 | dnl ========================================================
|
---|
1942 | dnl AC_C_CONST
|
---|
1943 | dnl AC_TYPE_UID_T
|
---|
1944 | dnl AC_TYPE_MODE_T
|
---|
1945 | dnl AC_TYPE_OFF_T
|
---|
1946 | dnl AC_TYPE_PID_T
|
---|
1947 | dnl AC_TYPE_SIZE_T
|
---|
1948 | dnl AC_STRUCT_ST_BLKSIZE
|
---|
1949 | dnl AC_STRUCT_ST_BLOCKS
|
---|
1950 | dnl AC_STRUCT_ST_RDEV
|
---|
1951 | dnl AC_HEADER_TIME
|
---|
1952 | dnl AC_STRUCT_TM
|
---|
1953 |
|
---|
1954 | dnl ========================================================
|
---|
1955 | dnl Checks for library functions.
|
---|
1956 | dnl ========================================================
|
---|
1957 | AC_PROG_GCC_TRADITIONAL
|
---|
1958 | AC_CHECK_FUNCS(lchown strerror)
|
---|
1959 |
|
---|
1960 | dnl AC_FUNC_MEMCMP
|
---|
1961 | dnl AC_FUNC_MMAP
|
---|
1962 | dnl AC_FUNC_SETVBUF_REVERSED
|
---|
1963 | dnl AC_FUNC_STRCOLL
|
---|
1964 | dnl AC_FUNC_STRFTIME
|
---|
1965 | dnl AC_FUNC_UTIME_NULL
|
---|
1966 | dnl AC_FUNC_VPRINTF
|
---|
1967 | dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
|
---|
1968 |
|
---|
1969 | dnl ========================================================
|
---|
1970 | dnl Check options
|
---|
1971 | dnl ========================================================
|
---|
1972 |
|
---|
1973 | dnl ========================================================
|
---|
1974 | dnl =
|
---|
1975 | dnl = --enable-strip
|
---|
1976 | dnl =
|
---|
1977 | dnl = Enable stripping of libs and executables
|
---|
1978 | dnl =
|
---|
1979 | dnl ========================================================
|
---|
1980 | AC_ARG_ENABLE(strip,
|
---|
1981 | [ --enable-strip Enable stripping of shared libs and programs],
|
---|
1982 | [ if test "$enableval" = "yes"; then
|
---|
1983 | ENABLE_STRIP=1
|
---|
1984 | fi ])
|
---|
1985 |
|
---|
1986 | dnl Check for hpux options
|
---|
1987 | case "${target_os}" in
|
---|
1988 | hpux*)
|
---|
1989 | if test -z "$GNU_CC"; then
|
---|
1990 |
|
---|
1991 | AC_CACHE_CHECK(for +Olit support,
|
---|
1992 | ac_cv_hpux_usable_olit_option,
|
---|
1993 | dnl since aCC doesn't throw an error on invalid options,
|
---|
1994 | dnl we have to test this the hard way
|
---|
1995 | [ac_cv_hpux_usable_olit_option=no
|
---|
1996 | rm -f conftest*
|
---|
1997 | echo 'int main() { return 0; }' | cat > conftest.c
|
---|
1998 | ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
|
---|
1999 | if test $? -eq 0; then
|
---|
2000 | if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
|
---|
2001 | ac_cv_hpux_usable_olit_option=yes
|
---|
2002 | fi
|
---|
2003 | fi
|
---|
2004 | rm -f conftest*
|
---|
2005 | ])
|
---|
2006 |
|
---|
2007 | if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
|
---|
2008 | CFLAGS="$CFLAGS +Olit=all"
|
---|
2009 | CXXFLAGS="$CXXFLAGS +Olit=all"
|
---|
2010 | else
|
---|
2011 | CFLAGS="$CFLAGS +ESlit"
|
---|
2012 | CXXFLAGS="$CXXFLAGS +ESlit"
|
---|
2013 | fi
|
---|
2014 | fi
|
---|
2015 | ;;
|
---|
2016 | esac
|
---|
2017 |
|
---|
2018 | dnl
|
---|
2019 | dnl Apparently, some systems cannot properly check for the pthread
|
---|
2020 | dnl library unless <pthread.h> is included so we need to test
|
---|
2021 | dnl using it
|
---|
2022 | dnl
|
---|
2023 | dnl MOZ_CHECK_PTHREADS(lib, success, failure)
|
---|
2024 | AC_DEFUN(MOZ_CHECK_PTHREADS,
|
---|
2025 | [
|
---|
2026 | AC_MSG_CHECKING([for pthread_create in -l$1])
|
---|
2027 | echo "
|
---|
2028 | #include <pthread.h>
|
---|
2029 | void *foo(void *v) { return v; }
|
---|
2030 | int main() {
|
---|
2031 | pthread_t t;
|
---|
2032 | if (!pthread_create(&t, 0, &foo, 0)) {
|
---|
2033 | pthread_join(t, 0);
|
---|
2034 | }
|
---|
2035 | return 0;
|
---|
2036 | }" > dummy.c ;
|
---|
2037 | echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
|
---|
2038 | ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
|
---|
2039 | _res=$? ;
|
---|
2040 | rm -f dummy.c dummy${ac_exeext} ;
|
---|
2041 | if test "$_res" = "0"; then
|
---|
2042 | AC_MSG_RESULT([yes])
|
---|
2043 | [$2]
|
---|
2044 | else
|
---|
2045 | AC_MSG_RESULT([no])
|
---|
2046 | [$3]
|
---|
2047 | fi
|
---|
2048 | ])
|
---|
2049 |
|
---|
2050 | MOZ_CHECK_PTHREADS(pthreads,
|
---|
2051 | _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
|
---|
2052 | MOZ_CHECK_PTHREADS(pthread,
|
---|
2053 | _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
|
---|
2054 | MOZ_CHECK_PTHREADS(c_r,
|
---|
2055 | _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
|
---|
2056 | MOZ_CHECK_PTHREADS(c,
|
---|
2057 | _HAVE_PTHREADS=1
|
---|
2058 | )
|
---|
2059 | )
|
---|
2060 | )
|
---|
2061 | )
|
---|
2062 |
|
---|
2063 | AC_ARG_WITH(pthreads,
|
---|
2064 | [ --with-pthreads Use system pthreads library as thread subsystem],
|
---|
2065 | [ if test "$withval" = "yes"; then
|
---|
2066 | if test -n "$_HAVE_PTHREADS"; then
|
---|
2067 | USE_PTHREADS=1
|
---|
2068 | USE_USER_PTHREADS=
|
---|
2069 | USE_NSPR_THREADS=
|
---|
2070 | else
|
---|
2071 | AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
|
---|
2072 | fi
|
---|
2073 | else
|
---|
2074 | USE_PTHREADS=
|
---|
2075 | _PTHREAD_LDFLAGS=
|
---|
2076 | fi],
|
---|
2077 | [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
|
---|
2078 | USE_PTHREADS=1
|
---|
2079 | USE_USER_PTHREADS=
|
---|
2080 | USE_NSPR_THREADS=
|
---|
2081 | fi])
|
---|
2082 |
|
---|
2083 | AC_ARG_ENABLE(user-pthreads,
|
---|
2084 | [ --enable-user-pthreads Build using userland pthreads],
|
---|
2085 | [ if test "$enableval" = "yes"; then
|
---|
2086 | if test -n "$_HAVE_PTHREADS"; then
|
---|
2087 | USE_PTHREADS=
|
---|
2088 | USE_USER_PTHREADS=1
|
---|
2089 | USE_NSPR_THREADS=
|
---|
2090 | else
|
---|
2091 | AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
|
---|
2092 | fi
|
---|
2093 | fi])
|
---|
2094 |
|
---|
2095 | AC_ARG_ENABLE(nspr-threads,
|
---|
2096 | [ --enable-nspr-threads Build using classic nspr threads],
|
---|
2097 | [ if test "$enableval" = "yes"; then
|
---|
2098 | USE_PTHREADS=
|
---|
2099 | USE_USER_PTHREADS=
|
---|
2100 | USE_NSPR_THREADS=1
|
---|
2101 | fi])
|
---|
2102 |
|
---|
2103 | case "$target" in
|
---|
2104 | *-beos*)
|
---|
2105 | AC_ARG_WITH(bthreads,
|
---|
2106 | [ --with-bthreads Use system bthreads library as thread subsystem (BeOS only)],
|
---|
2107 | [ if test "$withval" = "yes"; then
|
---|
2108 | USE_BTHREADS=1
|
---|
2109 | USE_USER_PTHREADS=
|
---|
2110 | USE_PTHREADS=
|
---|
2111 | fi])
|
---|
2112 | ;;
|
---|
2113 |
|
---|
2114 | *-solaris*)
|
---|
2115 | AC_ARG_WITH(native-threads,
|
---|
2116 | [ --with-native-threads Use native system threads as thread subsystem (Solaris only)],
|
---|
2117 | [ if test "$withval" = "yes"; then
|
---|
2118 | USE_NATIVE_THREADS=1
|
---|
2119 | USE_USER_PTHREADS=
|
---|
2120 | USE_PTHREADS=
|
---|
2121 | fi])
|
---|
2122 | ;;
|
---|
2123 | esac
|
---|
2124 |
|
---|
2125 | fi # SKIP_LIBRARY_CHECKS
|
---|
2126 |
|
---|
2127 | AC_ARG_ENABLE(cplus,
|
---|
2128 | [ --enable-cplus Enable some c++ api routines],
|
---|
2129 | [ if test "$enableval" = "yes"; then
|
---|
2130 | USE_CPLUS=1
|
---|
2131 | fi])
|
---|
2132 |
|
---|
2133 | AC_ARG_ENABLE(ipv6,
|
---|
2134 | [ --enable-ipv6 Compile ipv6 support],
|
---|
2135 | [ if test "$enableval" = "yes"; then
|
---|
2136 | USE_IPV6=1
|
---|
2137 | else
|
---|
2138 | USE_IPV6=
|
---|
2139 | fi])
|
---|
2140 |
|
---|
2141 |
|
---|
2142 | AC_ARG_ENABLE(boehm,
|
---|
2143 | [ --enable-boehm Enable the Boehm Garbage Collector],
|
---|
2144 | [ if test "$enableval" = "yes"; then
|
---|
2145 | AC_DEFINE(GC_LEAK_DETECTOR)
|
---|
2146 | GC_LEAK_DETECTOR=1
|
---|
2147 | fi])
|
---|
2148 |
|
---|
2149 | if test -n "$USE_PTHREADS"; then
|
---|
2150 | dnl See if -pthread is supported.
|
---|
2151 | rm -f conftest*
|
---|
2152 | ac_cv_have_dash_pthread=no
|
---|
2153 | AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
|
---|
2154 | echo 'int main() { return 0; }' | cat > conftest.c
|
---|
2155 | ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
|
---|
2156 | if test $? -eq 0; then
|
---|
2157 | if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
|
---|
2158 | ac_cv_have_dash_pthread=yes
|
---|
2159 | case "$target_os" in
|
---|
2160 | freebsd*)
|
---|
2161 | # Freebsd doesn't use -pthread for compiles, it uses them for linking
|
---|
2162 | ;;
|
---|
2163 | *)
|
---|
2164 | CFLAGS="$CFLAGS -pthread"
|
---|
2165 | CXXFLAGS="$CXXFLAGS -pthread"
|
---|
2166 | ;;
|
---|
2167 | esac
|
---|
2168 | fi
|
---|
2169 | fi
|
---|
2170 | rm -f conftest*
|
---|
2171 | AC_MSG_RESULT($ac_cv_have_dash_pthread)
|
---|
2172 |
|
---|
2173 | dnl
|
---|
2174 | dnl See if -pthreads is supported.
|
---|
2175 | dnl
|
---|
2176 | ac_cv_have_dash_pthreads=no
|
---|
2177 | if test "$ac_cv_have_dash_pthread" = "no"; then
|
---|
2178 | AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
|
---|
2179 | echo 'int main() { return 0; }' | cat > conftest.c
|
---|
2180 | ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
|
---|
2181 | if test $? -eq 0; then
|
---|
2182 | if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
|
---|
2183 | ac_cv_have_dash_pthreads=yes
|
---|
2184 | CFLAGS="$CFLAGS -pthreads"
|
---|
2185 | CXXFLAGS="$CXXFLAGS -pthreads"
|
---|
2186 | fi
|
---|
2187 | fi
|
---|
2188 | rm -f conftest*
|
---|
2189 | AC_MSG_RESULT($ac_cv_have_dash_pthreads)
|
---|
2190 | fi
|
---|
2191 |
|
---|
2192 | case "$target" in
|
---|
2193 | *-solaris*)
|
---|
2194 | if test "$ac_cv_have_dash_pthreads" = "yes"; then
|
---|
2195 | _PTHREAD_LDFLAGS=
|
---|
2196 | fi
|
---|
2197 | ;;
|
---|
2198 | *-freebsd*)
|
---|
2199 | AC_DEFINE(_REENTRANT)
|
---|
2200 | AC_DEFINE(_THREAD_SAFE)
|
---|
2201 | dnl -pthread links in -lc_r, so don't specify it explicitly.
|
---|
2202 | if test "$ac_cv_have_dash_pthread" = "yes"; then
|
---|
2203 | _PTHREAD_LDFLAGS="-pthread"
|
---|
2204 | else
|
---|
2205 | _PTHREAD_LDFLAGS="-lc_r"
|
---|
2206 | fi
|
---|
2207 | ;;
|
---|
2208 | *-netbsd*)
|
---|
2209 | if test "$ac_cv_have_dash_pthread" = "yes"; then
|
---|
2210 | _PTHREAD_LDFLAGS="-pthread"
|
---|
2211 | fi
|
---|
2212 | ;;
|
---|
2213 | *-bsdi*)
|
---|
2214 | AC_DEFINE(_THREAD_SAFE)
|
---|
2215 | dnl -pthread links in -lc_r, so don't specify it explicitly.
|
---|
2216 | if test "$ac_cv_have_dash_pthread" = "yes"; then
|
---|
2217 | _PTHREAD_LDFLAGS=
|
---|
2218 | fi
|
---|
2219 | ;;
|
---|
2220 | *-openbsd*)
|
---|
2221 | if test "$ac_cv_have_dash_pthread" = "yes"; then
|
---|
2222 | _PTHREAD_LDFLAGS=-pthread
|
---|
2223 | fi
|
---|
2224 | ;;
|
---|
2225 | *-linux*)
|
---|
2226 | AC_DEFINE(_REENTRANT)
|
---|
2227 | ;;
|
---|
2228 | esac
|
---|
2229 |
|
---|
2230 | else
|
---|
2231 | if test -n "$USE_USER_PTHREADS"; then
|
---|
2232 | USE_PTHREADS=
|
---|
2233 | USE_NSPR_THREADS=
|
---|
2234 | else
|
---|
2235 | _PTHREAD_LDFLAGS=
|
---|
2236 | fi
|
---|
2237 | fi
|
---|
2238 | dnl Special thread exceptions
|
---|
2239 |
|
---|
2240 | case "$target" in
|
---|
2241 | *-aix*)
|
---|
2242 | if test -n "$USE_NSPR_THREADS"; then
|
---|
2243 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
2244 | fi
|
---|
2245 | case "$target_os" in
|
---|
2246 | aix4.1*)
|
---|
2247 | if test -z "$USE_PTHREADS"; then
|
---|
2248 | AC_DEFINE(AIX_RENAME_SELECT)
|
---|
2249 | fi
|
---|
2250 | ;;
|
---|
2251 | aix4.2*)
|
---|
2252 | if test -z "$USE_NSPR_THREADS"; then
|
---|
2253 | AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
---|
2254 | fi
|
---|
2255 | ;;
|
---|
2256 | aix4.3*)
|
---|
2257 | if test -z "$USE_NSPR_THREADS"; then
|
---|
2258 | AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
---|
2259 | fi
|
---|
2260 | if test -n "$USE_PTHREADS"; then
|
---|
2261 | AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
|
---|
2262 | fi
|
---|
2263 | ;;
|
---|
2264 | *)
|
---|
2265 | if test -z "$USE_NSPR_THREADS"; then
|
---|
2266 | AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
---|
2267 | fi
|
---|
2268 | if test -n "$USE_PTHREADS"; then
|
---|
2269 | AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
|
---|
2270 | fi
|
---|
2271 | ;;
|
---|
2272 | esac
|
---|
2273 | ;;
|
---|
2274 | *-bsdi*)
|
---|
2275 | if test -n "$USE_PTHREADS"; then
|
---|
2276 | AC_DEFINE(_PR_NEED_PTHREAD_INIT)
|
---|
2277 | fi
|
---|
2278 | ;;
|
---|
2279 | *-freebsd*)
|
---|
2280 | if test -n "$USE_NSPR_THREADS"; then
|
---|
2281 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
2282 | fi
|
---|
2283 | ;;
|
---|
2284 | *-hpux*)
|
---|
2285 | if test -n "$USE_NSPR_THREADS"; then
|
---|
2286 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
2287 | fi
|
---|
2288 | if test "$USE_PTHREADS"; then
|
---|
2289 | if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
|
---|
2290 | AC_DEFINE(_REENTRANT)
|
---|
2291 | AC_DEFINE(_PR_DCETHREADS)
|
---|
2292 | else
|
---|
2293 | AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
|
---|
2294 | AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
|
---|
2295 | fi
|
---|
2296 | fi
|
---|
2297 | if test "$USE_USER_PTHREADS"; then
|
---|
2298 | AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
|
---|
2299 | fi
|
---|
2300 | ;;
|
---|
2301 | *-irix*)
|
---|
2302 | if test "${target_os}" = "irix6.5"; then
|
---|
2303 | if test -n "$USE_PTHREADS"; then
|
---|
2304 | AC_DEFINE(_PR_HAVE_GETHOST_R)
|
---|
2305 | AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
|
---|
2306 | fi
|
---|
2307 | fi
|
---|
2308 | ;;
|
---|
2309 | *-linux*)
|
---|
2310 | if test -n "$USE_NSPR_THREADS"; then
|
---|
2311 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
2312 | fi
|
---|
2313 | ;;
|
---|
2314 | *-mingw*|*-cygwin*|*-msvc*|*-mks*)
|
---|
2315 | dnl win32 does not use pthreads
|
---|
2316 | USE_PTHREADS=
|
---|
2317 | _PTHREAD_LDFLAGS=
|
---|
2318 | USE_USER_PTHREADS=
|
---|
2319 | ;;
|
---|
2320 | *-netbsd*|*-openbsd*)
|
---|
2321 | if test -n "$USE_NSPR_THREADS"; then
|
---|
2322 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
2323 | fi
|
---|
2324 | ;;
|
---|
2325 | *-osf*)
|
---|
2326 | if test -n "$USE_NSPR_THREADS"; then
|
---|
2327 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
2328 | fi
|
---|
2329 | if test -n "$USE_PTHREADS"; then
|
---|
2330 | if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
|
---|
2331 | :
|
---|
2332 | else
|
---|
2333 | AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
|
---|
2334 | fi
|
---|
2335 | fi
|
---|
2336 | ;;
|
---|
2337 | *-solaris*)
|
---|
2338 | if test -n "$USE_NATIVE_THREADS"; then
|
---|
2339 | AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
|
---|
2340 | else
|
---|
2341 | if test -n "$USE_NSPR_THREADS"; then
|
---|
2342 | AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
---|
2343 | fi
|
---|
2344 | fi
|
---|
2345 | if test -z "$USE_NSPR_THREADS"; then
|
---|
2346 | AC_DEFINE(_REENTRANT)
|
---|
2347 | AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
---|
2348 | if test "$OS_TEST" = "i86pc"; then
|
---|
2349 | PR_MD_ASFILES=os_SunOS_x86.s
|
---|
2350 | else
|
---|
2351 | PR_MD_ASFILES=os_SunOS.s
|
---|
2352 | if test -n "$USE_64"; then
|
---|
2353 | PR_MD_ASFILES="$PR_MD_ASFILES os_SunOS_sparcv9.s"
|
---|
2354 | fi
|
---|
2355 | fi
|
---|
2356 | fi
|
---|
2357 | ;;
|
---|
2358 | *-nto*)
|
---|
2359 | if test -n "$USE_PTHREADS"; then
|
---|
2360 | AC_DEFINE(_PR_HAVE_GETHOST_R)
|
---|
2361 | AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
|
---|
2362 | fi
|
---|
2363 | ;;
|
---|
2364 | esac
|
---|
2365 |
|
---|
2366 | OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
|
---|
2367 |
|
---|
2368 | dnl If the user passed in arg to --enable-optimize,
|
---|
2369 | dnl make sure that we use it.
|
---|
2370 | if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
|
---|
2371 | _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
|
---|
2372 | fi
|
---|
2373 |
|
---|
2374 | if test -n "$MOZ_OPTIMIZE"; then
|
---|
2375 | CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
|
---|
2376 | CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
|
---|
2377 | fi
|
---|
2378 |
|
---|
2379 | if test -n "$MOZ_DEBUG"; then
|
---|
2380 | CFLAGS="$CFLAGS $_DEBUG_FLAGS"
|
---|
2381 | CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
|
---|
2382 | fi
|
---|
2383 |
|
---|
2384 | if test -n "$MOZ_OPTIMIZE"; then
|
---|
2385 | OBJDIR_TAG=_OPT
|
---|
2386 | else
|
---|
2387 | OBJDIR_TAG=_DBG
|
---|
2388 | fi
|
---|
2389 |
|
---|
2390 | if test -n "$USE_64"; then
|
---|
2391 | COMPILER_TAG=_64
|
---|
2392 | fi
|
---|
2393 |
|
---|
2394 | RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
|
---|
2395 |
|
---|
2396 | dnl ========================================================
|
---|
2397 | dnl Use cygwin wrapper for win32 builds
|
---|
2398 | dnl ========================================================
|
---|
2399 | case "$target_os" in
|
---|
2400 | mingw*|cygwin*|msvc*|mks*)
|
---|
2401 | CC="\$(CYGWIN_WRAPPER) $CC"
|
---|
2402 | CXX="\$(CYGWIN_WRAPPER) $CXX"
|
---|
2403 | RC="\$(CYGWIN_WRAPPER) $RC"
|
---|
2404 | ;;
|
---|
2405 | esac
|
---|
2406 |
|
---|
2407 | dnl ========================================================
|
---|
2408 | dnl Substitution of found variables.
|
---|
2409 | dnl ========================================================
|
---|
2410 | AC_SUBST(SHELL_OVERRIDE)
|
---|
2411 |
|
---|
2412 | AC_SUBST(MOZILLA_CLIENT)
|
---|
2413 | AC_SUBST(CC)
|
---|
2414 | AC_SUBST(CXX)
|
---|
2415 | AC_SUBST(CFLAGS)
|
---|
2416 | AC_SUBST(CXXFLAGS)
|
---|
2417 | AC_SUBST(CPPFLAGS)
|
---|
2418 | AC_SUBST(HOST_CC)
|
---|
2419 | AC_SUBST(HOST_CFLAGS)
|
---|
2420 | AC_SUBST(LDFLAGS)
|
---|
2421 | AC_SUBST(GNU_CC)
|
---|
2422 | AC_SUBST(GCC_USE_GNU_LD)
|
---|
2423 | AC_SUBST(MSC_VER)
|
---|
2424 | AC_SUBST(CROSS_COMPILE)
|
---|
2425 |
|
---|
2426 | AC_SUBST(MOZ_OPTIMIZE)
|
---|
2427 |
|
---|
2428 | AC_SUBST(USE_CPLUS)
|
---|
2429 | AC_SUBST(USE_IPV6)
|
---|
2430 | AC_SUBST(USE_N32)
|
---|
2431 | AC_SUBST(USE_64)
|
---|
2432 | AC_SUBST(OBJECT_MODE)
|
---|
2433 | AC_SUBST(GC_LEAK_DETECTOR)
|
---|
2434 | AC_SUBST(ENABLE_STRIP)
|
---|
2435 |
|
---|
2436 | AC_SUBST(USE_PTHREADS)
|
---|
2437 | AC_SUBST(USE_BTHREADS)
|
---|
2438 | AC_SUBST(USE_USER_PTHREADS)
|
---|
2439 | AC_SUBST(USE_NATIVE_THREADS)
|
---|
2440 | AC_SUBST(USE_NSPR_THREADS)
|
---|
2441 |
|
---|
2442 | AC_SUBST(LIBNSPR)
|
---|
2443 | AC_SUBST(LIBPLC)
|
---|
2444 |
|
---|
2445 | AC_SUBST(MOD_MAJOR_VERSION)
|
---|
2446 | AC_SUBST(MOD_MINOR_VERSION)
|
---|
2447 | AC_SUBST(MOD_PATCH_VERSION)
|
---|
2448 | AC_SUBST(NSPR_MODNAME)
|
---|
2449 | AC_SUBST(MDCPUCFG_H)
|
---|
2450 | AC_SUBST(PR_MD_CSRCS)
|
---|
2451 | AC_SUBST(PR_MD_ASFILES)
|
---|
2452 | AC_SUBST(PR_MD_ARCH_DIR)
|
---|
2453 | AC_SUBST(CPU_ARCH)
|
---|
2454 |
|
---|
2455 | AC_SUBST(OBJ_SUFFIX)
|
---|
2456 | AC_SUBST(LIB_SUFFIX)
|
---|
2457 | AC_SUBST(DLL_SUFFIX)
|
---|
2458 | AC_SUBST(ASM_SUFFIX)
|
---|
2459 | AC_SUBST(MKSHLIB)
|
---|
2460 | AC_SUBST(DSO_CFLAGS)
|
---|
2461 | AC_SUBST(DSO_LDOPTS)
|
---|
2462 |
|
---|
2463 | AC_SUBST(OS_TARGET)
|
---|
2464 | AC_SUBST(OS_ARCH)
|
---|
2465 | AC_SUBST(OS_RELEASE)
|
---|
2466 | AC_SUBST(OS_TEST)
|
---|
2467 | AC_SUBST(MACOS_DEPLOYMENT_TARGET)
|
---|
2468 |
|
---|
2469 | AC_SUBST(DEFINES)
|
---|
2470 | AC_SUBST(DEFS)
|
---|
2471 | AC_SUBST(AR)
|
---|
2472 | AC_SUBST(AR_FLAGS)
|
---|
2473 | AC_SUBST(AS)
|
---|
2474 | AC_SUBST(ASFLAGS)
|
---|
2475 | AC_SUBST(LD)
|
---|
2476 | AC_SUBST(RANLIB)
|
---|
2477 | AC_SUBST(PERL)
|
---|
2478 | AC_SUBST(STRIP)
|
---|
2479 | AC_SUBST(FILTER)
|
---|
2480 | AC_SUBST(IMPLIB)
|
---|
2481 |
|
---|
2482 | AC_SUBST(OS_LIBS)
|
---|
2483 | AC_SUBST(RESOLVE_LINK_SYMBOLS)
|
---|
2484 | AC_SUBST(AIX_LINK_OPTS)
|
---|
2485 | AC_SUBST(NOSUCHFILE)
|
---|
2486 | AC_SUBST(MOZ_OBJFORMAT)
|
---|
2487 | AC_SUBST(ULTRASPARC_LIBRARY)
|
---|
2488 |
|
---|
2489 | AC_SUBST(OBJDIR)
|
---|
2490 | AC_SUBST(OBJDIR_NAME)
|
---|
2491 | AC_SUBST(RELEASE_OBJDIR_NAME)
|
---|
2492 | AC_SUBST(NSINSTALL)
|
---|
2493 | AC_SUBST(OPTIMIZER)
|
---|
2494 | AC_SUBST(RC)
|
---|
2495 | AC_SUBST(RCFLAGS)
|
---|
2496 | AC_SUBST(DLLFLAGS)
|
---|
2497 | AC_SUBST(EXEFLAGS)
|
---|
2498 | AC_SUBST(OS_DLLFLAGS)
|
---|
2499 | AC_SUBST(CYGWIN_WRAPPER)
|
---|
2500 |
|
---|
2501 | dnl ========================================================
|
---|
2502 | dnl Generate output files.
|
---|
2503 | dnl ========================================================
|
---|
2504 | MAKEFILES="
|
---|
2505 | Makefile
|
---|
2506 | config/Makefile
|
---|
2507 | config/autoconf.mk
|
---|
2508 | config/nsprincl.mk
|
---|
2509 | config/nsprincl.sh
|
---|
2510 | config/nspr-config
|
---|
2511 | lib/Makefile
|
---|
2512 | lib/ds/Makefile
|
---|
2513 | lib/libc/Makefile
|
---|
2514 | lib/libc/include/Makefile
|
---|
2515 | lib/libc/src/Makefile
|
---|
2516 | lib/tests/Makefile
|
---|
2517 | pkg/Makefile
|
---|
2518 | pkg/linux/Makefile
|
---|
2519 | pkg/solaris/Makefile
|
---|
2520 | pkg/solaris/SUNWpr/Makefile
|
---|
2521 | pkg/solaris/SUNWprx/Makefile
|
---|
2522 | pr/Makefile
|
---|
2523 | pr/include/Makefile
|
---|
2524 | pr/include/md/Makefile
|
---|
2525 | pr/include/obsolete/Makefile
|
---|
2526 | pr/include/private/Makefile
|
---|
2527 | pr/src/Makefile
|
---|
2528 | pr/src/io/Makefile
|
---|
2529 | pr/src/linking/Makefile
|
---|
2530 | pr/src/malloc/Makefile
|
---|
2531 | pr/src/md/Makefile
|
---|
2532 | pr/src/md/${PR_MD_ARCH_DIR}/Makefile
|
---|
2533 | pr/src/memory/Makefile
|
---|
2534 | pr/src/misc/Makefile
|
---|
2535 | pr/src/threads/Makefile
|
---|
2536 | pr/tests/Makefile
|
---|
2537 | pr/tests/dll/Makefile
|
---|
2538 | "
|
---|
2539 |
|
---|
2540 | dnl lib/tests/Makefile
|
---|
2541 | dnl pr/tests/w16gui/Makefile
|
---|
2542 | dnl tools/Makefile
|
---|
2543 |
|
---|
2544 | if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
|
---|
2545 | MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
|
---|
2546 | elif test -n "$USE_PTHREADS"; then
|
---|
2547 | MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
|
---|
2548 | elif test -n "$USE_BTHREADS"; then
|
---|
2549 | MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
|
---|
2550 | fi
|
---|
2551 |
|
---|
2552 | if test -n "$USE_CPLUS"; then
|
---|
2553 | MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
|
---|
2554 | fi
|
---|
2555 |
|
---|
2556 | AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])
|
---|