1999-11-22 18:40:10 +03:00
|
|
|
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
|
|
|
|
dnl The contents of this file are subject to the Mozilla Public
|
|
|
|
dnl License Version 1.1 (the "License"); you may not use this file
|
|
|
|
dnl except in compliance with the License. You may obtain a copy of
|
|
|
|
dnl the License at http://www.mozilla.org/MPL/
|
|
|
|
dnl
|
|
|
|
dnl Software distributed under the License is distributed on an "AS
|
|
|
|
dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
dnl implied. See the License for the specific language governing
|
|
|
|
dnl rights and limitations under the License.
|
|
|
|
dnl
|
|
|
|
dnl The Original Code is the configure.in script for NSPR.
|
|
|
|
dnl
|
|
|
|
dnl The Initial Developer of the Original Code is Christopher
|
|
|
|
dnl Seawood. Portions created by Christopher Seawood are
|
|
|
|
dnl Copyright (C) 1999 Christopher Seawood. All
|
|
|
|
dnl Rights Reserved.
|
|
|
|
dnl
|
|
|
|
dnl Contributor(s):
|
|
|
|
dnl
|
1999-10-14 19:09:11 +04:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
1999-11-22 18:40:10 +03:00
|
|
|
dnl
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_PREREQ(2.12)
|
|
|
|
AC_INIT(config/libc_r.h)
|
|
|
|
|
|
|
|
d=`pwd`
|
|
|
|
if test "${srcdir}" = "$d" || test "${srcdir}" = "." ; then
|
|
|
|
echo "Do not build in the srcdir as it will override Makefiles used by non-autoconf build."
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
AC_VALIDATE_CACHED_SYSTEM_TUPLE
|
|
|
|
AC_PREFIX_DEFAULT(\${MOD_DEPTH}/dist)
|
|
|
|
|
|
|
|
dnl Set this define to make fixes w/o breaking anything else.
|
|
|
|
AC_DEFINE(USE_AUTOCONF)
|
|
|
|
|
|
|
|
dnl ========================================================
|
1999-11-22 18:24:12 +03:00
|
|
|
dnl = Defaults
|
1999-10-14 19:09:11 +04:00
|
|
|
dnl ========================================================
|
2000-02-24 02:38:19 +03:00
|
|
|
NSPR_VERSION=4
|
1999-10-14 19:09:11 +04:00
|
|
|
NSPR_MODNAME=nspr20
|
|
|
|
_HAVE_PTHREADS=
|
|
|
|
USE_PTHREADS=
|
|
|
|
USE_USER_PTHREADS=
|
|
|
|
USE_NSPR_THREADS=
|
1999-11-22 18:24:12 +03:00
|
|
|
USE_N32=
|
|
|
|
USE_64=
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_CPLUS=
|
|
|
|
USE_IPV6=
|
1999-11-22 18:24:12 +03:00
|
|
|
USE_MDUPDATE=
|
|
|
|
_OPTIMIZE_FLAGS=-O
|
|
|
|
_DEBUG_FLAGS=-g
|
|
|
|
MOZ_DEBUG=1
|
|
|
|
MOZ_OPTIMIZE=
|
1999-12-22 03:07:07 +03:00
|
|
|
dnl Link in libraries necessary to resolve all symbols for shared libs
|
|
|
|
RESOLVE_LINK_SYMBOLS=
|
1999-10-14 19:09:11 +04:00
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl =
|
|
|
|
dnl = Dont change the following lines. Doing so breaks:
|
|
|
|
dnl =
|
|
|
|
dnl = CFLAGS="-foo" ./configure
|
|
|
|
dnl =
|
|
|
|
dnl ========================================================
|
|
|
|
CFLAGS="${CFLAGS=}"
|
|
|
|
CXXFLAGS="${CXXFLAGS=}"
|
|
|
|
LDFLAGS="${LDFLAGS=}"
|
|
|
|
HOST_CFLAGS="${HOST_CFLAGS=}"
|
|
|
|
HOST_LDFLAGS="${HOST_LDFLAGS=}"
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl =
|
|
|
|
dnl = Check options that may affect the compiler
|
|
|
|
dnl =
|
|
|
|
dnl ========================================================
|
1999-11-29 05:15:22 +03:00
|
|
|
dnl Check if NSPR is being compiled for Mozilla
|
|
|
|
dnl Let --with-arg override environment setting
|
|
|
|
dnl
|
|
|
|
AC_ARG_WITH(mozilla,
|
|
|
|
[ --with-mozilla Compile NSPR with Mozilla support],
|
|
|
|
[ if test "$withval" = "yes"; then
|
|
|
|
AC_DEFINE(MOZILLA_CLIENT)
|
|
|
|
MOZILLA_CLIENT=1
|
|
|
|
else
|
|
|
|
MOZILLA_CLIENT=
|
|
|
|
fi],
|
|
|
|
[ if test -n "$MOZILLA_CLIENT"; then
|
|
|
|
AC_DEFINE(MOZILLA_CLIENT)
|
|
|
|
fi])
|
|
|
|
|
1999-11-22 18:24:12 +03:00
|
|
|
AC_ARG_ENABLE(optimize,
|
|
|
|
[ --enable-optimize Enable code optimizations],
|
|
|
|
MOZ_OPTIMIZE=1)
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --disable-debug Do not compile in debugging symbols],
|
|
|
|
[ if test "$enableval" = "no"; then
|
|
|
|
MOZ_DEBUG=
|
1999-11-29 05:15:22 +03:00
|
|
|
fi])
|
1999-10-14 19:09:11 +04:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(shared,
|
|
|
|
[ --disable-shared Do not compile into shared libraries])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(target,
|
|
|
|
[ --enable-target=\$t Turn on features for target \$t when build has multiple targets],
|
|
|
|
MOZ_TARGET=`echo $enableval | tr a-z A-Z`,
|
|
|
|
MOZ_TARGET=)
|
|
|
|
|
1999-11-22 18:24:12 +03:00
|
|
|
AC_ARG_ENABLE(n32,
|
|
|
|
[ --enable-n32 Enable n32 support (IRIX only)],
|
|
|
|
[ if test "$enableval" = "yes"; then
|
|
|
|
USE_N32=1
|
|
|
|
fi ])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(64bit,
|
|
|
|
[ --enable-64bit Enable 64-bit support (on certain platforms)],
|
|
|
|
[ if test "$enableval" = "yes"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_64=1
|
|
|
|
fi ])
|
1999-11-22 18:24:12 +03:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(mdupdate,
|
|
|
|
[ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
|
|
|
|
[ if test "$enableval" = "yes"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_MDUPDATE=1
|
|
|
|
fi ])
|
1999-11-22 18:24:12 +03:00
|
|
|
|
1999-11-22 18:40:10 +03:00
|
|
|
AC_PATH_PROG(WHOAMI, whoami, :)
|
1999-10-14 19:09:11 +04:00
|
|
|
if test -n "$MOZ_DEBUG"; then
|
1999-11-22 18:40:10 +03:00
|
|
|
AC_DEFINE(DEBUG)
|
|
|
|
AC_DEFINE_UNQUOTED(DEBUG_`$WHOAMI`)
|
|
|
|
DEFINES="$DEFINES -UNDEBUG"
|
1999-11-16 07:21:08 +03:00
|
|
|
else
|
1999-11-22 18:40:10 +03:00
|
|
|
AC_DEFINE(NDEBUG)
|
|
|
|
DEFINES="$DEFINES -UDEBUG"
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Checks for compilers.
|
|
|
|
dnl ========================================================
|
|
|
|
if test "$target" != "$host"; then
|
|
|
|
echo "cross compiling from $host to $target"
|
|
|
|
cross_compiling=yes
|
|
|
|
|
|
|
|
_SAVE_CC="$CC"
|
|
|
|
_SAVE_CFLAGS="$CFLAGS"
|
|
|
|
_SAVE_LDFLAGS="$LDFLAGS"
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for $host compiler])
|
|
|
|
if test -z "$HOST_CC"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(HOST_CC, gcc cc /usr/ucb/cc, "")
|
|
|
|
if test -z "$HOST_CC"; then
|
|
|
|
AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
|
|
|
fi
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$HOST_CC])
|
|
|
|
if test -z "$HOST_CFLAGS"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
HOST_CFLAGS="$CFLAGS"
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
if test -z "$HOST_LDFLAGS"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
HOST_LDFLAGS="$LDFLAGS"
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
CC="$HOST_CC"
|
|
|
|
CFLAGS="$HOST_CFLAGS"
|
|
|
|
LDFLAGS="$HOST_LDFLAGS"
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
|
|
|
|
AC_TRY_COMPILE([], [return(0);],
|
|
|
|
[ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
|
|
|
|
AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
|
|
|
|
|
|
|
|
CC=$_SAVE_CC
|
|
|
|
CFLAGS=$_SAVE_CFLAGS
|
|
|
|
LDFLAGS=$_SAVE_LDFLAGS
|
|
|
|
|
|
|
|
if test -z "$CC"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(CC, "${target_alias}-gcc" "${target}-gcc", :)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
unset ac_cv_prog_CC
|
|
|
|
AC_PROG_CC
|
|
|
|
if test -z "$CXX"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(CXX, "${target_alias}-g++" "${target}-g++", :)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
unset ac_cv_prog_CXX
|
|
|
|
AC_PROG_CXX
|
|
|
|
if test -z "$RANLIB"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(RANLIB, "${target_alias}-ranlib" "${target}-ranlib", :)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
if test -z "$AR"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(AR, "${target_alias}-ar" "${target}-ar", :)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
if test -z "$AS"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(AS, "${target_alias}-as" "${target}-as", :)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
2000-02-24 02:38:19 +03:00
|
|
|
if test -z "$LD"; then
|
|
|
|
AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", :)
|
|
|
|
fi
|
1999-10-14 19:09:11 +04:00
|
|
|
if test -z "$DLLTOOL"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(DLLTOOL, "${target_alias}-dlltool" "${target}-dlltool", :)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
if test -z "$WINDRES"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", :)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AC_PATH_PROGS(AS, as, $CC)
|
|
|
|
AC_PATH_PROGS(AR, ar, :)
|
2000-02-24 02:38:19 +03:00
|
|
|
AC_PATH_PROGS(LD, ld, :)
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_PATH_PROGS(DLLTOOL, dlltool, :)
|
|
|
|
AC_PATH_PROGS(WINDRES, windres, :)
|
|
|
|
if test -z "$HOST_CC"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
HOST_CC="$CC"
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
if test -z "$HOST_CFLAGS"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
HOST_CFLAGS="$CFLAGS"
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$GCC" = "yes"; then
|
|
|
|
GNU_CC=1
|
|
|
|
fi
|
2000-01-11 08:31:08 +03:00
|
|
|
if test "`echo | $AS -V 2>&1 | grep -c GNU`" != "0"; then
|
|
|
|
GNU_AS=1
|
|
|
|
fi
|
|
|
|
rm -f a.out
|
1999-10-14 19:09:11 +04:00
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Checks for programs.
|
|
|
|
dnl ========================================================
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PATH_PROGS(PERL, perl5 perl, :)
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Default platform specific options
|
|
|
|
dnl ========================================================
|
|
|
|
OBJ_SUFFIX=o
|
|
|
|
LIB_SUFFIX=a
|
|
|
|
DLL_SUFFIX=so
|
1999-11-29 08:27:26 +03:00
|
|
|
MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
|
1999-10-14 19:09:11 +04:00
|
|
|
PR_MD_ASFILES=
|
|
|
|
PR_MD_CSRCS=
|
1999-11-29 05:15:22 +03:00
|
|
|
PR_MD_ARCH_DIR=unix
|
1999-11-23 09:23:52 +03:00
|
|
|
AR_FLAGS='cr $@'
|
1999-10-14 19:09:11 +04:00
|
|
|
|
1999-12-03 13:32:18 +03:00
|
|
|
OS_TARGET=`uname -s`
|
|
|
|
OS_ARCH=`uname -s | sed -e 's|/|_|g'`
|
|
|
|
OS_RELEASE=`uname -r`
|
|
|
|
OS_TEST=`uname -m`
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
dnl ========================================================
|
|
|
|
dnl Override of system specific host options
|
|
|
|
dnl ========================================================
|
|
|
|
case "$host" in
|
|
|
|
*-mingw*)
|
|
|
|
;;
|
2000-02-24 02:38:19 +03:00
|
|
|
*-beos*)
|
|
|
|
HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
*)
|
|
|
|
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Override of system specific target options
|
|
|
|
dnl ========================================================
|
|
|
|
case "$target" in
|
1999-11-23 09:23:52 +03:00
|
|
|
|
1999-11-29 05:15:22 +03:00
|
|
|
*-aix*)
|
1999-11-23 09:23:52 +03:00
|
|
|
AC_DEFINE(XP_UNIX)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(AIX)
|
|
|
|
AC_DEFINE(SYSV)
|
|
|
|
DSO_LDOPTS='-brtl -bM:SRE -bnoentry -bexpall'
|
|
|
|
case "${target_os}" in
|
|
|
|
aix3.2*)
|
|
|
|
USE_NSPR_THREADS=1
|
|
|
|
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
|
|
|
AC_DEFINE(AIX_RENAME_SELECT)
|
|
|
|
AC_DEFINE(_PR_NO_LARGE_FILES)
|
|
|
|
AIX_LINK_OPTS='-bnso -berok'
|
1999-11-29 07:46:11 +03:00
|
|
|
PR_MD_ASFILES=os_AIX.s
|
1999-11-29 05:15:22 +03:00
|
|
|
;;
|
|
|
|
aix4.1*)
|
|
|
|
AC_DEFINE(AIX_RENAME_SELECT)
|
|
|
|
AC_DEFINE(AIX_HAVE_ATOMIC_OP_H)
|
|
|
|
AC_DEFINE(AIX_TIMERS)
|
|
|
|
AC_DEFINE(_PR_NO_LARGE_FILES)
|
|
|
|
AC_DEFINE(AIX4_1)
|
|
|
|
MKSHLIB=
|
|
|
|
DSO_LDOPTS=
|
|
|
|
AIX_LINK_OPTS='-bnso -berok'
|
|
|
|
;;
|
|
|
|
aix4.3*)
|
|
|
|
AC_DEFINE(AIX_HAVE_ATOMIC_OP_H)
|
|
|
|
AC_DEFINE(AIX_TIMERS)
|
|
|
|
AC_DEFINE(_PR_HAVE_OFF64_T)
|
|
|
|
AC_DEFINE(AIX4_3)
|
|
|
|
AC_DEFINE(HAVE_SOCKLEN_T)
|
|
|
|
USE_IPV6=1
|
|
|
|
AIX_LINK_OPTS='-brtl -bnso -berok'
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_DEFINE(AIX_HAVE_ATOMIC_OP_H)
|
|
|
|
AC_DEFINE(AIX_TIMERS)
|
|
|
|
AC_DEFINE(_PR_HAVE_OFF64_T)
|
|
|
|
AIX_LINK_OPTS='-brtl -bnso -berok'
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
CFLAGS="$CFLAGS -qro -qroconst"
|
|
|
|
if test `grep -c xlC_r $CC`; then
|
|
|
|
CFLAGS="$CFLAGS -qarch=com"
|
|
|
|
fi
|
|
|
|
AIX_WRAP='$(DIST)/lib/aixwrap.o'
|
|
|
|
AIX_TMP='./_aix_tmp.o'
|
1999-11-29 07:46:11 +03:00
|
|
|
if test -n "$USE_64"; then
|
|
|
|
MDCPUCFG_H=_aix64.cfg
|
|
|
|
else
|
|
|
|
if test -n "$USE_IPV6"; then
|
|
|
|
MDCPUCFG_H=_aix32in6.cfg
|
|
|
|
else
|
|
|
|
MDCPUCFG_H=_aix32.cfg
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
PR_MD_CSRCS=aix.c
|
1999-11-29 05:15:22 +03:00
|
|
|
;;
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
*-beos*)
|
|
|
|
AC_DEFINE(XP_BEOS)
|
|
|
|
AC_DEFINE(BeOS)
|
|
|
|
AC_DEFINE(BEOS)
|
1999-12-22 03:07:07 +03:00
|
|
|
AC_DEFINE(_POSIX_SOURCE)
|
|
|
|
DSO_LDOPTS=-nostart
|
|
|
|
MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
|
|
|
|
MDCPUCFG_H=_beos.cfg
|
|
|
|
USE_BTHREADS=1
|
|
|
|
PR_MD_ARCH_DIR=beos
|
|
|
|
RESOLVE_LINK_SYMBOLS=1
|
1999-10-14 19:09:11 +04:00
|
|
|
;;
|
|
|
|
|
1999-11-29 05:15:22 +03:00
|
|
|
*-dgux*)
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_DEFINE(XP_UNIX)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
|
|
|
AC_DEFINE(SVR4)
|
|
|
|
AC_DEFINE(SYSV)
|
|
|
|
AC_DEFINE(DGUX)
|
|
|
|
AC_DEFINE(_DGUX_SOURCE)
|
|
|
|
AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
|
|
|
|
MKSHLIB='$(LD) $(DSO_LDOPTS)'
|
|
|
|
DSO_LDOPTS=-G
|
|
|
|
NOSUCHFILE=/no-such-file
|
|
|
|
_OPTIMIZE_FLAGS=-O2
|
|
|
|
_DEBUG_FLAGS=
|
1999-11-29 07:46:11 +03:00
|
|
|
MDCPUCFG_H=_dgux.cfg
|
|
|
|
PR_MD_CSRCS=dgux.c
|
1999-11-29 05:15:22 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
*-freebsd*)
|
|
|
|
if test "${target_cpu}" != "alpha"; then
|
|
|
|
AC_DEFINE(i386)
|
|
|
|
fi
|
|
|
|
AC_DEFINE(FREEBSD)
|
|
|
|
AC_DEFINE(HAVE_BSD_FLOCK)
|
|
|
|
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall -pipe"
|
|
|
|
MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
|
|
|
|
if test "$MOZ_OBJFORMAT" = "elf"; then
|
|
|
|
DLL_SUFFIX=so
|
|
|
|
else
|
|
|
|
DLL_SUFFIX=so.1.0
|
|
|
|
fi
|
|
|
|
DSO_CFLAGS=-fPIC
|
|
|
|
DSO_LDOPTS=-Bshareable
|
1999-11-29 07:46:11 +03:00
|
|
|
MDCPUCFG_H=_freebsd.cfg
|
|
|
|
PR_MD_CSRCS=freebsd.c
|
1999-11-29 05:15:22 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
*-hpux*)
|
|
|
|
AC_DEFINE(HPUX)
|
|
|
|
AC_DEFINE(_HPUX_SOURCE)
|
|
|
|
DEFINES="$DEFINES -D${target_cpu}"
|
|
|
|
DLL_SUFFIX=sl
|
|
|
|
DSO_LDOPTS='-b +h $(notdir $@)'
|
1999-11-29 07:46:11 +03:00
|
|
|
PR_MD_CSRCS=hpux.c
|
|
|
|
if test -n "$USE_64"; then
|
|
|
|
MDCPUCFG_H=_hpux64.cfg
|
|
|
|
else
|
|
|
|
MDCPUCFG_H=_hpux32.cfg
|
|
|
|
fi
|
1999-11-29 05:15:22 +03:00
|
|
|
if test -z "$GNU_CC"; then
|
|
|
|
CC="$CC -Ae"
|
|
|
|
CXX="$CXX -ext"
|
|
|
|
CFLAGS="$CFLAGS +ESlit"
|
|
|
|
CXXFLAGS="$CXXFLAGS +ESlit"
|
|
|
|
DSO_CFLAGS=+Z
|
|
|
|
else
|
|
|
|
DSO_CFLAGS=-fPIC
|
|
|
|
fi
|
|
|
|
if test -n "$MOZILLA_CLIENT"; then
|
|
|
|
USE_NSPR_THREADS=1
|
|
|
|
fi
|
|
|
|
case "${target_os}" in
|
|
|
|
hpuxA.09*)
|
|
|
|
AC_DEFINE(HPUX9)
|
|
|
|
AC_DEFINE(_PR_NEED_H_ERRNO)
|
|
|
|
AC_DEFINE(_PR_NO_LARGE_FILES)
|
|
|
|
;;
|
|
|
|
hpuxB.10.01*)
|
|
|
|
AC_DEFINE(HPUX10)
|
|
|
|
;;
|
|
|
|
hpuxB.10.10*)
|
|
|
|
AC_DEFINE(HPUX10)
|
|
|
|
AC_DEFINE(HPUX10_10)
|
|
|
|
AC_DEFINE(HAVE_INT_LOCALTIME_R)
|
|
|
|
USE_PTHREADS=1
|
|
|
|
USE_NSPR_THREADS=
|
|
|
|
;;
|
|
|
|
hpuxB.10.20*)
|
|
|
|
AC_DEFINE(HPUX10)
|
|
|
|
AC_DEFINE(HPUX10_20)
|
|
|
|
AC_DEFINE(HAVE_INT_LOCALTIME_R)
|
|
|
|
if test -z "$GNU_CC"; then
|
|
|
|
CFLAGS="$CFLAGS +DAportable +DS1.1"
|
|
|
|
CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
|
|
|
|
fi
|
|
|
|
USE_PTHREADS=1
|
|
|
|
USE_NSPR_THREADS=
|
|
|
|
;;
|
|
|
|
hpuxB.10.30*)
|
|
|
|
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
|
|
|
if test -z "$GNU_CC"; then
|
|
|
|
CFLAGS="$CFLAGS +DAportable +DS1.1"
|
|
|
|
CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
|
|
|
|
fi
|
|
|
|
USE_PTHREADS=1
|
|
|
|
USE_NSPR_THREADS=
|
|
|
|
;;
|
|
|
|
hpuxB.11.00*)
|
|
|
|
AC_DEFINE(HPUX10)
|
|
|
|
AC_DEFINE(HPUX11)
|
|
|
|
AC_DEFINE(_LARGEFILE64_SOURCE)
|
|
|
|
AC_DEFINE(_PR_HAVE_OFF64_T)
|
|
|
|
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
|
|
|
if test -z "$GNU_CC"; then
|
|
|
|
if test -z "$USE_64"; then
|
|
|
|
CFLAGS="$CFLAGS +DAportable +DS2.0"
|
|
|
|
CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
|
|
|
|
else
|
|
|
|
CFLAGS="$CFLAGS +DA2.0W +DS2.0"
|
|
|
|
CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
USE_PTHREADS=1
|
|
|
|
USE_NSPR_THREADS=
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case "${target_os}" in
|
|
|
|
hpuxB.10*)
|
|
|
|
AC_DEFINE(_PR_NO_LARGE_FILES)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test -n "$USE_NSPR_THREADS"; then
|
|
|
|
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
|
|
|
fi
|
1999-10-14 19:09:11 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
*-irix*)
|
|
|
|
AC_DEFINE(XP_UNIX)
|
1999-11-22 18:24:12 +03:00
|
|
|
AC_DEFINE(IRIX)
|
|
|
|
AC_DEFINE(SVR4)
|
|
|
|
AC_DEFINE(_SGI_MP_SOURCE)
|
1999-10-14 19:09:11 +04:00
|
|
|
PR_MD_CSRCS=irix.c
|
|
|
|
PR_MD_ASFILES=os_Irix.s
|
1999-11-29 08:27:26 +03:00
|
|
|
MKSHLIB='$(LD) $(SHLIB_LD_OPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
|
1999-11-22 18:24:12 +03:00
|
|
|
DSO_LDOPTS='-elf -shared -all'
|
1999-11-29 07:46:11 +03:00
|
|
|
if test -n "$USE_64"; then
|
|
|
|
MDCPUCFG_H=_irix64.cfg
|
|
|
|
else
|
|
|
|
MDCPUCFG_H=_irix32.cfg
|
|
|
|
fi
|
1999-11-22 18:40:10 +03:00
|
|
|
case "${target_os}" in
|
1999-11-29 05:15:22 +03:00
|
|
|
irix5*)
|
1999-11-22 18:24:12 +03:00
|
|
|
USE_NSPR_THREADS=1
|
|
|
|
;;
|
1999-11-29 05:15:22 +03:00
|
|
|
*)
|
1999-11-22 18:24:12 +03:00
|
|
|
USE_N32=1
|
|
|
|
USE_PTHREADS=1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test "$GNU_CC"; then
|
1999-12-06 06:28:31 +03:00
|
|
|
AS='$(CC) -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
|
1999-11-29 05:15:22 +03:00
|
|
|
CFLAGS="$CFLAGS -Wall -Wno-format"
|
|
|
|
_OPTIMIZE_FLAGS="-O6"
|
1999-11-22 18:24:12 +03:00
|
|
|
else
|
1999-11-29 05:15:22 +03:00
|
|
|
AS="as -D_ASM $(INCLUDES) -n32"
|
|
|
|
CFLAGS="$CFLAGS -fullwarn -xansi"
|
|
|
|
if test "$USE_N32"; then
|
|
|
|
_OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
|
1999-11-22 18:24:12 +03:00
|
|
|
else
|
1999-11-29 05:15:22 +03:00
|
|
|
_OPTIMIZE_FLAGS="-O -Olimit 4000"
|
1999-11-22 18:24:12 +03:00
|
|
|
fi
|
1999-11-29 05:15:22 +03:00
|
|
|
if test "$USE_MDUPDATE"; then
|
|
|
|
$CFLAGS="$CFLAGS -MDupdate"
|
|
|
|
fi
|
|
|
|
case "$target}" in
|
|
|
|
*-irix6.*)
|
|
|
|
CFLAGS="$CFLAGS -multigot"
|
|
|
|
SHLIB_LD_OPTS="-no_unresolved"
|
|
|
|
if test "USE_N32"; then
|
|
|
|
CFLAGS="$CFLAGS -n32 -woff 1209"
|
|
|
|
LDFLAGS="$LDFLAGS -n32"
|
|
|
|
SHLIB_LD_OPTS="$SHLIB_LD_OPTS -n32"
|
|
|
|
if test "${target_os}" = "irix6.2"; then
|
|
|
|
LDFLAGS="$LDFLAGS -Wl,-woff,85"
|
|
|
|
SHLIB_LD_OPTS="$SHLIB_LD_OPTS -woff 85"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if test "$USE_64"; then
|
|
|
|
CFLAGS="$CFLAGS -64"
|
|
|
|
else
|
|
|
|
CFLAGS="$CFLAGS -32"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
CFLAGS="$CFLAGS -xgot"
|
|
|
|
;;
|
|
|
|
esac
|
1999-11-22 18:24:12 +03:00
|
|
|
fi
|
|
|
|
if test "${target_os}" = "irix5.3"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(IRIX5_3)
|
1999-11-22 18:24:12 +03:00
|
|
|
fi
|
|
|
|
case "${target_os}" in
|
|
|
|
irix6.5*)
|
|
|
|
if test -z "$GNU_CC"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
CFLAGS="$CFLAGS -mips3"
|
1999-11-22 18:24:12 +03:00
|
|
|
fi
|
|
|
|
AC_DEFINE(_PR_HAVE_GETPROTO_R)
|
|
|
|
AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
|
1999-12-06 06:28:31 +03:00
|
|
|
AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
|
|
|
|
;;
|
|
|
|
irix5*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
|
1999-11-22 18:24:12 +03:00
|
|
|
;;
|
|
|
|
esac
|
1999-10-14 19:09:11 +04:00
|
|
|
case "${target_cpu}" in
|
|
|
|
alpha*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_POSIX_SOURCE)
|
|
|
|
AC_DEFINE(_BSD_SOURCE)
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
1999-11-29 05:15:22 +03:00
|
|
|
*-linux*)
|
|
|
|
AC_DEFINE(XP_UNIX)
|
1999-12-05 02:49:35 +03:00
|
|
|
AC_DEFINE(_POSIX_SOURCE)
|
|
|
|
AC_DEFINE(_BSD_SOURCE)
|
|
|
|
AC_DEFINE(_SVID_SOURCE)
|
2000-02-24 02:38:19 +03:00
|
|
|
AC_DEFINE(LINUX)
|
1999-12-05 02:49:35 +03:00
|
|
|
CFLAGS="$CFLAGS -pipe -ansi"
|
|
|
|
CXXFLAGS="$CXXFLAGS -pipe -ansi"
|
1999-11-29 05:15:22 +03:00
|
|
|
MDCPUCFG_H=_linux.cfg
|
|
|
|
PR_MD_CSRCS=linux.c
|
1999-11-29 08:27:26 +03:00
|
|
|
MKSHLIB='$(LD) $(DSO_LDOPTS) -soname $(notdir $@) -o $@'
|
1999-11-29 07:46:11 +03:00
|
|
|
DSO_CFLAGS=-fPIC
|
|
|
|
DSO_LDOPTS=-shared
|
|
|
|
case "${target_cpu}" in
|
|
|
|
alpha)
|
|
|
|
AC_DEFINE(_ALPHA_)
|
|
|
|
AC_DEFINE(__alpha)
|
|
|
|
CFLAGS="$CFLAGS -mieee"
|
|
|
|
CXXFLAGS="$CXXFLAGS -mieee"
|
|
|
|
_OPTIMIZE_FLAGS=-O2
|
|
|
|
;;
|
|
|
|
m68k)
|
|
|
|
_OPTIMIZE_FLAGS=-O
|
|
|
|
CFLAGS="$CFLAGS -m68020-40"
|
|
|
|
CXXFLAGS="$CXXFLAGS -m68020-40"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
_OPTIMIZE_FLAGS=-O2
|
|
|
|
;;
|
|
|
|
esac
|
1999-11-29 05:15:22 +03:00
|
|
|
;;
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
*-mingw*)
|
|
|
|
AC_DEFINE(XP_PC)
|
2000-02-24 02:38:19 +03:00
|
|
|
AC_DEFINE(NONAMELESSUNION)
|
1999-10-14 19:09:11 +04:00
|
|
|
PR_MD_ARCH_DIR=windows
|
|
|
|
if test -z "$GNU_CC"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
OBJ_SUFFIX=obj
|
|
|
|
LIB_SUFFIX=lib
|
|
|
|
DLL_SUFFIX=dll
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@'
|
|
|
|
|
|
|
|
case "$MOZ_TARGET" in
|
|
|
|
WINNT)
|
1999-11-29 05:15:22 +03:00
|
|
|
DEFINES="$DEFINES -DWIN32 -DWINNT -DWin32_Winsock"
|
|
|
|
MDCPUCFG_H=_winnt.cfg
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
WIN95)
|
1999-11-29 05:15:22 +03:00
|
|
|
DEFINES="$DEFINES -UWINNT -DWIN32 -DWIN95 -DWin32_Winsock -D_PR_GLOBAL_THREADS_ONLY"
|
|
|
|
MDCPUCFG_H=_win95.cfg
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
WIN16)
|
1999-11-29 05:15:22 +03:00
|
|
|
DEFINES="$DEFINES -UWINNT"
|
|
|
|
MDCPUCFG_H=_win16.cfg
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_MSG_ERROR([Missing MOZ_TARGET for ${target}. Use --enable-target to set.])
|
1999-10-14 19:09:11 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$target" in
|
|
|
|
i?86-*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_X86_)
|
1999-10-14 19:09:11 +04:00
|
|
|
;;
|
|
|
|
alpha-*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_ALPHA_)
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
mips-*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_MIPS_)
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
esac
|
|
|
|
;;
|
1999-11-23 09:23:52 +03:00
|
|
|
|
1999-11-29 05:15:22 +03:00
|
|
|
*-nto*)
|
|
|
|
AC_DEFINE(XP_UNIX)
|
|
|
|
MDCPUCFG_H=_nto.cfg
|
|
|
|
PR_MD_CSRCS=nto.c
|
|
|
|
MKSHLIB='qcc -Vgcc_ntox86 -shared -Wl,-h$(@:$(OBJDIR)/%.so=%.so) -o $(@:$(OBJDIR)/%.so=%.so)'
|
|
|
|
CFLAGS="$CFLAGS -Wc,-Wall -Wc,-Wno-parentheses -DNTO -D_QNX_SOURCE -DHAVE_POINTER_LOCALTIME_R -shared"
|
|
|
|
OS_LIBS="-lsocket"
|
|
|
|
_OPTIMIZE_FLAGS="-O2"
|
|
|
|
_DEBUG_FLAGS="-O2 -gdwarf-2"
|
|
|
|
COMPILER_TAG="_qcc"
|
|
|
|
CC="qcc -Vgcc_ntox86 -w"
|
|
|
|
CXX="QCC -Vgcc_ntox86 -w"
|
|
|
|
CPP="qcc -Vgcc_ntox86 -w"
|
|
|
|
LD="qcc -Vgcc_ntox86 -nostdlib"
|
|
|
|
AR="qcc -Vgcc_ntox86 -M -a "
|
|
|
|
AR_FLAGS="$@"
|
|
|
|
;;
|
|
|
|
|
1999-11-29 07:46:11 +03:00
|
|
|
*-solaris*)
|
|
|
|
AC_DEFINE(XP_UNIX)
|
|
|
|
AC_DEFINE(SVR4)
|
|
|
|
AC_DEFINE(SYSV)
|
|
|
|
AC_DEFINE(__svr4)
|
|
|
|
AC_DEFINE(__svr4__)
|
|
|
|
AC_DEFINE(SOLARIS)
|
|
|
|
if test -n "$USE_64"; then
|
1999-12-01 14:25:52 +03:00
|
|
|
MDCPUCFG_H=_solaris64.cfg
|
1999-11-29 07:46:11 +03:00
|
|
|
else
|
1999-12-01 14:25:52 +03:00
|
|
|
MDCPUCFG_H=_solaris32.cfg
|
1999-11-29 07:46:11 +03:00
|
|
|
fi
|
|
|
|
PR_MD_CSRCS=solaris.c
|
|
|
|
DSO_LDOPTS='-G -h $(notdir $@)'
|
|
|
|
if test -n "$GNU_CC"; then
|
|
|
|
DSO_CFLAGS=-fPIC
|
|
|
|
else
|
|
|
|
DSO_CFLAGS=-KPIC
|
|
|
|
fi
|
2000-01-11 08:31:08 +03:00
|
|
|
AS='$(CC)'
|
|
|
|
if test -z "$GNU_AS"; then
|
|
|
|
ASFLAGS="$ASFLAGS -Wa,-P"
|
|
|
|
fi
|
1999-11-29 07:46:11 +03:00
|
|
|
NOSUCHFILE=/no-such-file
|
|
|
|
if test -n "$GNU_CC"; then
|
|
|
|
if test -n "$USE_MDUPDATE"; then
|
|
|
|
CFLAGS="$CFLAGS -MDupdate"
|
|
|
|
CXXFLAGS="$CXXFLAGS -MDupdate"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
CC="$CC -xstrconst"
|
|
|
|
CXX="$CXX -Qoption cg -xstrconst"
|
|
|
|
fi
|
|
|
|
if test -n "$BUILD_NUMBER" && test -z "$MOZ_OPTIMIZE"; then
|
|
|
|
CFLAGS="$CFLAGS -xs"
|
|
|
|
CXXFLAGS="$CXXFLAGS -xs"
|
|
|
|
fi
|
|
|
|
if test -n "$USE_64" && test -z "$GNU_CC"; then
|
|
|
|
CC="$CC -xarch=v9"
|
|
|
|
CXX="$CXX -xarch=v9"
|
|
|
|
fi
|
|
|
|
if test "${target_cpu}" = "i386"; then
|
|
|
|
AC_DEFINE(i386)
|
|
|
|
if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
|
2000-01-11 08:31:08 +03:00
|
|
|
_DEBUG_FLAGS="$_DEBUG_FLAGS -gstabs"
|
|
|
|
if test -z "$GNU_AS"; then
|
|
|
|
_DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
|
|
|
|
fi
|
1999-11-29 07:46:11 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
case "${target_os}" in
|
|
|
|
solaris2.3*)
|
|
|
|
AC_DEFINE(_PR_NO_LARGE_FILES)
|
|
|
|
;;
|
|
|
|
solaris2.4*)
|
|
|
|
AC_DEFINE(_PR_NO_LARGE_FILES)
|
|
|
|
;;
|
|
|
|
solaris2.5*)
|
|
|
|
AC_DEFINE(SOLARIS2_5)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_DEFINE(_PR_HAVE_OFF64_T)
|
|
|
|
if test -n "$GNU_CC"; then
|
|
|
|
AC_DEFINE(_LARGEFILE64_SOURCE)
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test "${target_cpu}" = "sun4u"; then
|
|
|
|
ULTRASPARC_LIBRARY=ultrasparc
|
|
|
|
ULTRASPARC_FILTER_LIBRARY=libatomic.so
|
|
|
|
DSO_LDOPTS="$DSO_LDOPTS -f "'$(ULTRASPARC_FILTER_LIBRARY)'
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
1999-11-29 05:15:22 +03:00
|
|
|
*)
|
|
|
|
AC_DEFINE(XP_UNIX)
|
|
|
|
;;
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
dnl Turn off shared libraries if asked to do so.
|
|
|
|
if test "$enable_shared" = no; then
|
|
|
|
MKSHLIB=
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Check for system libraries
|
|
|
|
dnl ========================================================
|
|
|
|
dnl AC_CHECK_LIB(C, main)
|
|
|
|
dnl AC_CHECK_LIB(C_r, main)
|
|
|
|
dnl AC_CHECK_LIB(c, main)
|
|
|
|
dnl AC_CHECK_LIB(c_r, main)
|
|
|
|
dnl AC_CHECK_LIB(dce, main)
|
|
|
|
dnl AC_CHECK_LIB(dl, main)
|
|
|
|
dnl AC_CHECK_LIB(dld, main)
|
|
|
|
dnl AC_CHECK_LIB(gen, main)
|
|
|
|
dnl AC_CHECK_LIB(ip6, main)
|
|
|
|
dnl AC_CHECK_LIB(l, main)
|
|
|
|
dnl AC_CHECK_LIB(m, main)
|
|
|
|
dnl AC_CHECK_LIB(nsl, main)
|
|
|
|
dnl AC_CHECK_LIB(posix4, main)
|
|
|
|
dnl AC_CHECK_LIB(prstrms, main)
|
|
|
|
dnl AC_CHECK_LIB(prstrms_shr, main)
|
|
|
|
dnl AC_CHECK_LIB(pthread, main)
|
|
|
|
dnl AC_CHECK_LIB(pthreads, main)
|
|
|
|
dnl AC_CHECK_LIB(resolv, main)
|
|
|
|
dnl AC_CHECK_LIB(rt, main)
|
|
|
|
dnl AC_CHECK_LIB(socket, main)
|
|
|
|
dnl AC_CHECK_LIB(svld, main)
|
|
|
|
dnl AC_CHECK_LIB(thread, main)
|
|
|
|
dnl AC_CHECK_LIB(vms_jackets, main)
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Check for system header files.
|
|
|
|
dnl ========================================================
|
|
|
|
dnl AC_HEADER_DIRENT
|
|
|
|
dnl AC_HEADER_STDC
|
|
|
|
dnl AC_HEADER_SYS_WAIT
|
|
|
|
dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Check for typedefs and structs
|
|
|
|
dnl ========================================================
|
|
|
|
dnl AC_C_CONST
|
|
|
|
dnl AC_TYPE_UID_T
|
|
|
|
dnl AC_TYPE_MODE_T
|
|
|
|
dnl AC_TYPE_OFF_T
|
|
|
|
dnl AC_TYPE_PID_T
|
|
|
|
dnl AC_TYPE_SIZE_T
|
|
|
|
dnl AC_STRUCT_ST_BLKSIZE
|
|
|
|
dnl AC_STRUCT_ST_BLOCKS
|
|
|
|
dnl AC_STRUCT_ST_RDEV
|
|
|
|
dnl AC_HEADER_TIME
|
|
|
|
dnl AC_STRUCT_TM
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Checks for library functions.
|
|
|
|
dnl ========================================================
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_CHECK_FUNCS(lchown strerror)
|
|
|
|
|
|
|
|
dnl AC_FUNC_MEMCMP
|
|
|
|
dnl AC_FUNC_MMAP
|
|
|
|
dnl AC_FUNC_SETVBUF_REVERSED
|
|
|
|
dnl AC_FUNC_STRCOLL
|
|
|
|
dnl AC_FUNC_STRFTIME
|
|
|
|
dnl AC_FUNC_UTIME_NULL
|
|
|
|
dnl AC_FUNC_VPRINTF
|
|
|
|
dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
|
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Check options
|
|
|
|
dnl ========================================================
|
|
|
|
|
|
|
|
AC_CHECK_LIB(pthread, pthread_attr_init,
|
1999-11-23 00:59:08 +03:00
|
|
|
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
|
|
|
|
AC_CHECK_LIB(c_r, pthread_attr_init,
|
|
|
|
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
|
|
|
|
AC_CHECK_LIB(c, pthread_attr_init,
|
|
|
|
_HAVE_PTHREADS=1 )
|
|
|
|
)
|
|
|
|
)
|
1999-10-14 19:09:11 +04:00
|
|
|
|
|
|
|
AC_ARG_WITH(pthreads,
|
|
|
|
[ --with-pthreads Use system pthreads library as thread subsystem],
|
1999-11-29 05:15:22 +03:00
|
|
|
[ if test "$withval" = "yes"; then
|
1999-10-14 19:09:11 +04:00
|
|
|
if test -n "$_HAVE_PTHREADS"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_PTHREADS=1
|
|
|
|
USE_USER_PTHREADS=
|
|
|
|
USE_NSPR_THREADS=
|
1999-10-14 19:09:11 +04:00
|
|
|
else
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
1999-11-29 05:15:22 +03:00
|
|
|
else
|
1999-10-14 19:09:11 +04:00
|
|
|
USE_PTHREADS=
|
|
|
|
_PTHREAD_LDFLAGS=
|
1999-11-29 05:15:22 +03:00
|
|
|
fi],
|
|
|
|
[ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USER_NSPR_THREADS"; then
|
1999-10-14 19:09:11 +04:00
|
|
|
USE_PTHREADS=1
|
|
|
|
USE_USER_PTHREADS=
|
|
|
|
USE_NSPR_THREADS=
|
|
|
|
fi])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(user-pthreads,
|
|
|
|
[ --enable-user-pthreads Build using userland pthreads],
|
1999-11-29 05:15:22 +03:00
|
|
|
[ if test "$enableval" = "yes"; then
|
|
|
|
if test -n "$_HAVE_PTHREADS"; then
|
|
|
|
USE_PTHREADS=
|
|
|
|
USE_USER_PTHREADS=1
|
|
|
|
USE_NSPR_THREADS=
|
1999-10-14 19:09:11 +04:00
|
|
|
else
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
1999-11-29 05:15:22 +03:00
|
|
|
fi])
|
1999-10-14 19:09:11 +04:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(nspr-threads,
|
|
|
|
[ --enable-nspr-threads Build using classic nspr threads],
|
1999-11-29 05:15:22 +03:00
|
|
|
[ if test "$enableval" = "yes"; then
|
1999-10-14 19:09:11 +04:00
|
|
|
USE_PTHREADS=
|
|
|
|
USE_USER_PTHREADS=
|
|
|
|
USE_NSPR_THREADS=1
|
1999-11-29 05:15:22 +03:00
|
|
|
fi])
|
1999-10-14 19:09:11 +04:00
|
|
|
|
|
|
|
case "$target" in
|
|
|
|
*-beos*)
|
|
|
|
AC_ARG_WITH(bthreads,
|
|
|
|
[ --with-bthreads Use system bthreads library as thread subsystem (BeOS only)],
|
|
|
|
[ if test "$withval" = "yes"; then
|
|
|
|
USE_BTHREADS=1
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_USER_PTHREADS=
|
|
|
|
USE_PTHREADS=
|
|
|
|
fi])
|
1999-10-14 19:09:11 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
*-solaris*)
|
|
|
|
AC_ARG_WITH(native-threads,
|
|
|
|
[ --with-native-threads Use native system threads as thread subsystem (Solaris only)],
|
1999-11-29 05:15:22 +03:00
|
|
|
[ if test "$withval" = "yes"; then
|
1999-10-14 19:09:11 +04:00
|
|
|
USE_NATIVE_THREADS=1
|
|
|
|
USE_USER_PTHREADS=
|
|
|
|
USE_PTHREADS=
|
1999-11-29 05:15:22 +03:00
|
|
|
fi])
|
1999-10-14 19:09:11 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(cplus,
|
|
|
|
[ --enable-cplus Use cplus for whatever reason],
|
|
|
|
[ if test "$enableval" = "yes"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_CPLUS=1
|
1999-10-14 19:09:11 +04:00
|
|
|
fi])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(ipv6,
|
|
|
|
[ --enable-ipv6 Compile ipv6 support],
|
|
|
|
[ if test "$enableval" = "yes"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_IPV6=1
|
1999-10-14 19:09:11 +04:00
|
|
|
fi])
|
|
|
|
|
|
|
|
if test -n "$USE_PTHREADS"; then
|
|
|
|
dnl See if -pthread is supported.
|
|
|
|
rm -f conftest*
|
|
|
|
ac_cv_have_dash_pthread=no
|
|
|
|
AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
|
|
|
|
echo 'int main() { return 0; }' | cat > conftest.c
|
|
|
|
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
|
|
|
|
if test $? -eq 0; then
|
|
|
|
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
|
|
|
|
ac_cv_have_dash_pthread=yes
|
|
|
|
CFLAGS="$CFLAGS -pthread"
|
|
|
|
CXXFLAGS="$CXXFLAGS -pthread"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
rm -f conftest*
|
|
|
|
AC_MSG_RESULT($ac_cv_have_dash_pthread)
|
|
|
|
|
|
|
|
case "$target" in
|
|
|
|
*-mingw*|*-cygwin*|*-uwin*)
|
1999-11-29 05:15:22 +03:00
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
*-solaris*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_REENTRANT)
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
*-freebsd*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_REENTRANT)
|
|
|
|
AC_DEFINE(_THREAD_SAFE)
|
|
|
|
dnl -pthread links in -lc_r, so don't specify it explicitly.
|
|
|
|
if test "$ac_cv_have_dash_pthread" = "yes"; then
|
|
|
|
PTHREAD_LDFLAGS=
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*-hpuxB.10.10*)
|
|
|
|
AC_DEFINE(_REENTRANT)
|
|
|
|
AC_DEFINE(_PR_DCETHREADS)
|
|
|
|
;;
|
|
|
|
*-hpuxB.10.20*)
|
|
|
|
AC_DEFINE(_REENTRANT)
|
|
|
|
AC_DEFINE(_PR_DCETHREADS)
|
|
|
|
;;
|
|
|
|
*-hpux*)
|
|
|
|
AC_DEFINE(_POSIX_C_SOURCE=199506L)
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
*)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_DEFINE(_REENTRANT)
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(pthread_create,,[
|
|
|
|
AC_CHECK_LIB(pthread, pthread_create, [OS_LIBS="-lpthread $OS_LIBS"])
|
|
|
|
])
|
|
|
|
|
|
|
|
else
|
|
|
|
if test -n "$USE_USER_PTHREADS"; then
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_PTHREADS=
|
|
|
|
USE_NSPR_THREADS=
|
1999-10-14 19:09:11 +04:00
|
|
|
else
|
1999-11-29 05:15:22 +03:00
|
|
|
USE_NSPR_THREADS=1
|
|
|
|
dnl AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
1999-10-14 19:09:11 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
dnl Special thread exceptions
|
|
|
|
|
|
|
|
case "$target" in
|
1999-11-29 05:15:22 +03:00
|
|
|
*-aix4.1*)
|
|
|
|
if test -z "$USE_PTHREADS"; then
|
|
|
|
AC_DEFINE(AIX_RENAME_SELECT)
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*-aix4.[23]*)
|
|
|
|
if test -z "$USE_NSPR_THREADS"; then
|
|
|
|
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
|
|
|
fi
|
|
|
|
;;
|
1999-11-29 07:46:11 +03:00
|
|
|
*-hpux*)
|
|
|
|
if test -n "$USE_USER_PTHREADS"; then
|
|
|
|
AC_DEFINE(_POSIX_C_SOURCE=199506L)
|
|
|
|
fi
|
|
|
|
;;
|
1999-11-29 05:15:22 +03:00
|
|
|
*-mingw*|*-cygwin*|*-uwin*)
|
|
|
|
dnl win32 does not use pthreads
|
|
|
|
USE_PTHREADS=
|
|
|
|
PTHREAD_LDFLAGS=
|
|
|
|
USE_USER_PTHREADS=
|
|
|
|
;;
|
|
|
|
*-solaris*)
|
|
|
|
if test -n "$USE_NATIVE_THREADS"; then
|
|
|
|
AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
|
|
|
|
else
|
1999-11-29 07:46:11 +03:00
|
|
|
if test -n "$USE_USER_PTHREADS"; then
|
|
|
|
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test -z "$USE_USER_PTHREADS"; then
|
|
|
|
AC_DEFINE(_REENTRANT)
|
|
|
|
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
|
|
|
|
if test "${target_cpu}" = "i386"; then
|
|
|
|
PR_MD_ASFILES=os_SunOS_x86.s
|
|
|
|
else
|
|
|
|
PR_MD_ASFILES=os_SunOS.s
|
|
|
|
if test -z "$USE_64"; then
|
|
|
|
PR_MD_ASFILES="$PR_MD_ASFILES os_SunOS_32.s"
|
|
|
|
fi
|
|
|
|
fi
|
1999-11-29 05:15:22 +03:00
|
|
|
fi
|
|
|
|
;;
|
1999-10-14 19:09:11 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(dlopen,,[
|
|
|
|
AC_CHECK_LIB(dl, dlopen, [OS_LIBS="-ldl $OS_LIBS"])
|
|
|
|
])
|
|
|
|
|
1999-11-23 00:59:08 +03:00
|
|
|
if test -n "$MOZ_OPTIMIZE"; then
|
1999-11-22 18:24:12 +03:00
|
|
|
CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
|
|
|
|
CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$MOZ_DEBUG"; then
|
|
|
|
CFLAGS="$CFLAGS $_DEBUG_FLAGS"
|
|
|
|
CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
|
|
|
|
fi
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
dnl ========================================================
|
|
|
|
dnl Substitution of found variables.
|
|
|
|
dnl ========================================================
|
|
|
|
AC_SUBST(MOZILLA_CLIENT)
|
|
|
|
AC_SUBST(CC)
|
|
|
|
AC_SUBST(CXX)
|
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
AC_SUBST(CXXFLAGS)
|
|
|
|
AC_SUBST(HOST_CC)
|
|
|
|
AC_SUBST(HOST_CFLAGS)
|
1999-12-03 13:32:18 +03:00
|
|
|
AC_SUBST(LDFLAGS)
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_SUBST(GNU_CC)
|
|
|
|
|
|
|
|
AC_SUBST(USE_CPLUS)
|
|
|
|
AC_SUBST(USE_IPV6)
|
1999-11-22 18:24:12 +03:00
|
|
|
AC_SUBST(USE_N32)
|
|
|
|
AC_SUBST(USE_64)
|
|
|
|
|
|
|
|
AC_SUBST(USE_PTHREADS)
|
|
|
|
AC_SUBST(USE_BTHREADS)
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_SUBST(USE_USER_PTHREADS)
|
|
|
|
AC_SUBST(USE_NATIVE_THREADS)
|
|
|
|
AC_SUBST(USE_NSPR_THREADS)
|
|
|
|
|
|
|
|
AC_SUBST(NSPR_VERSION)
|
|
|
|
AC_SUBST(NSPR_MODNAME)
|
|
|
|
AC_SUBST(MDCPUCFG_H)
|
|
|
|
AC_SUBST(MOZ_TARGET)
|
|
|
|
AC_SUBST(PR_MD_CSRCS)
|
|
|
|
AC_SUBST(PR_MD_ASFILES)
|
|
|
|
AC_SUBST(PR_MD_ARCH_DIR)
|
|
|
|
|
|
|
|
AC_SUBST(OBJ_SUFFIX)
|
|
|
|
AC_SUBST(LIB_SUFFIX)
|
|
|
|
AC_SUBST(DLL_SUFFIX)
|
|
|
|
AC_SUBST(MKSHLIB)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_SUBST(DSO_CFLAGS)
|
|
|
|
AC_SUBST(DSO_LDOPTS)
|
1999-10-14 19:09:11 +04:00
|
|
|
|
1999-12-03 13:32:18 +03:00
|
|
|
AC_SUBST(OS_TARGET)
|
|
|
|
AC_SUBST(OS_ARCH)
|
|
|
|
AC_SUBST(OS_RELEASE)
|
|
|
|
AC_SUBST(OS_TEST)
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_SUBST(DEFINES)
|
|
|
|
AC_SUBST(DEFS)
|
|
|
|
AC_SUBST(AR)
|
1999-11-23 09:23:52 +03:00
|
|
|
AC_SUBST(AR_FLAGS)
|
1999-11-29 07:46:11 +03:00
|
|
|
AC_SUBST(AS)
|
|
|
|
AC_SUBST(ASFLAGS)
|
2000-02-24 02:38:19 +03:00
|
|
|
AC_SUBST(LD)
|
1999-10-14 19:09:11 +04:00
|
|
|
AC_SUBST(DLLTOOL)
|
|
|
|
AC_SUBST(WINDRES)
|
|
|
|
AC_SUBST(RANLIB)
|
|
|
|
AC_SUBST(PERL)
|
|
|
|
|
|
|
|
AC_SUBST(OS_LIBS)
|
1999-12-22 03:07:07 +03:00
|
|
|
AC_SUBST(RESOLVE_LINK_SYMBOLS)
|
1999-11-29 05:15:22 +03:00
|
|
|
AC_SUBST(AIX_LINK_OPTS)
|
|
|
|
AC_SUBST(NOSUCHFILE)
|
|
|
|
AC_SUBST(MOZ_OBJFORMAT)
|
1999-11-29 07:46:11 +03:00
|
|
|
AC_SUBST(ULTRASPARC_LIBRARY)
|
|
|
|
AC_SUBST(ULTRASPARC_FILTER_LIBRARY)
|
1999-10-14 19:09:11 +04:00
|
|
|
|
|
|
|
dnl ========================================================
|
|
|
|
dnl Generate output files.
|
|
|
|
dnl ========================================================
|
2000-03-17 01:46:02 +03:00
|
|
|
MAKEFILES="
|
1999-10-14 19:09:11 +04:00
|
|
|
Makefile
|
|
|
|
config/Makefile
|
|
|
|
config/autoconf.mk
|
|
|
|
config/nsprincl.mk
|
|
|
|
config/nsprincl.sh
|
|
|
|
lib/Makefile
|
|
|
|
lib/ds/Makefile
|
|
|
|
lib/libc/Makefile
|
|
|
|
lib/libc/include/Makefile
|
|
|
|
lib/libc/src/Makefile
|
|
|
|
pr/Makefile
|
|
|
|
pr/include/Makefile
|
|
|
|
pr/include/md/Makefile
|
|
|
|
pr/include/obsolete/Makefile
|
|
|
|
pr/include/private/Makefile
|
|
|
|
pr/src/Makefile
|
|
|
|
pr/src/io/Makefile
|
|
|
|
pr/src/linking/Makefile
|
|
|
|
pr/src/malloc/Makefile
|
|
|
|
pr/src/md/Makefile
|
2000-03-17 01:46:02 +03:00
|
|
|
pr/src/md/${PR_MD_ARCH_DIR}/Makefile
|
1999-10-14 19:09:11 +04:00
|
|
|
pr/src/memory/Makefile
|
|
|
|
pr/src/misc/Makefile
|
|
|
|
pr/src/threads/Makefile
|
|
|
|
pr/tests/Makefile
|
|
|
|
pr/tests/dll/Makefile
|
2000-03-17 01:46:02 +03:00
|
|
|
"
|
|
|
|
dnl lib/tests/Makefile
|
|
|
|
dnl pr/tests/w16gui/Makefile
|
|
|
|
dnl tools/Makefile
|
|
|
|
|
|
|
|
if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
|
|
|
|
MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
|
|
|
|
elif test -n "$USE_PTHREADS"; then
|
|
|
|
MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
|
|
|
|
elif test -n "$USE_BTHREADS"; then
|
|
|
|
MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$USE_CPLUS"; then
|
|
|
|
MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
|
|
|
|
fi
|
1999-10-14 19:09:11 +04:00
|
|
|
|
2000-03-17 01:46:02 +03:00
|
|
|
AC_OUTPUT([$MAKEFILES])
|