Made the handling of the debug/optimize flags to match the Mozilla configure.in setup.
authorcls%seawood.org
Mon, 22 Nov 1999 15:24:12 +0000
changeset 962 976bb97e33c8c95d5bb0527a2d9648515d635847
parent 961 0adea7efa68617abf3ee088f1202281d5bedb645
child 963 f4bb42209c0fc0cec3c6d841f75e5c33dc5f1138
push idunknown
push userunknown
push dateunknown
bugs18966
Made the handling of the debug/optimize flags to match the Mozilla configure.in setup. Updated the irix target section to contain the exact logic contained in IRIX.mk in an effort to fix bug 18966. Added the following options: --enable-optimize --enable-mdupdate --enable-n32 (IRIX only) --enable-64bit
config/autoconf.mk.in
configure.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -5,20 +5,23 @@ DIST		= @prefix@
 OBJDIR_NAME	= .
 OBJDIR		= .
 OBJ_SUFFIX	= @OBJ_SUFFIX@
 LIB_SUFFIX	= @LIB_SUFFIX@
 DLL_SUFFIX	= @DLL_SUFFIX@
 MOD_VERSION	= @NSPR_VERSION@
 MOD_NAME	= @NSPR_MODNAME@
 
+USE_CPLUS	= @USE_CPLUS@
+USE_IPV6	= @USE_IPV6@
+USE_N32		= @USE_N32@
+USE_64		= @USE_64@
+
 USE_PTHREADS	= @USE_PTHREADS@
 USE_BTHREADS	= @USE_BTHREADS@
-USE_CPLUS	= @USE_CPLUS@
-USE_IPV6	= @USE_IPV6@
 PTHREADS_USER	= @USE_USER_PTHREADS@
 CLASSIC_NSPR	= @USE_NSPR_THREADS@
 
 AS		= @AS@
 CC		= @CC@
 CCC		= @CXX@
 AR		= @AR@ cr $@
 RANLIB		= @RANLIB@
--- a/configure.in
+++ b/configure.in
@@ -12,24 +12,31 @@ AC_CONFIG_AUX_DIR(${srcdir}/build/autoco
 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 ========================================================
-dnl = Version defaults
+dnl = Defaults
 dnl ========================================================
 NSPR_VERSION=3
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
+USE_N32=
+USE_64=
+USE_MDUPDATE=
+_OPTIMIZE_FLAGS=-O
+_DEBUG_FLAGS=-g
+MOZ_DEBUG=1
+MOZ_OPTIMIZE=
 
 dnl ========================================================
 dnl =
 dnl = Dont change the following lines.  Doing so breaks:
 dnl =
 dnl = CFLAGS="-foo" ./configure
 dnl =
 dnl ========================================================
@@ -39,38 +46,55 @@ LDFLAGS="${LDFLAGS=}"
 HOST_CFLAGS="${HOST_CFLAGS=}"
 HOST_LDFLAGS="${HOST_LDFLAGS=}"
 
 dnl ========================================================
 dnl =
 dnl = Check options that may affect the compiler
 dnl =
 dnl ========================================================
-MOZ_DEBUG=1
+AC_ARG_ENABLE(optimize,
+    [  --enable-optimize       Enable code optimizations],
+    MOZ_OPTIMIZE=1)
+
 AC_ARG_ENABLE(debug,
     [  --disable-debug         Do not compile in debugging symbols],
     [	if test "$enableval" = "no"; then
     	    MOZ_DEBUG=
 	fi])
 
 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=)
 
+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
+	USE_64=1
+    fi ])
+
+AC_ARG_ENABLE(mdupdate,
+    [  --enable-mdupdate       Enable use of certain compilers' mdupdate feature],
+    [ if test "$enableval" = "yes"; then
+	USE_MDUPDATE=1
+    fi ])
+
 if test -n "$MOZ_DEBUG"; then
-    CFLAGS="-g $CFLAGS"
-    CXXFLAGS="-g $CXXFLAGS"
     DEFINES="$DEFINES -DDEBUG -UNDEBUG -DDEBUG_$(shell whoami)"
 else
-    CFLAGS="-O $CFLAGS"
-    CXXFLAGS="-O $CFLAGS"
     DEFINES="$DEFINES -UDEBUG -DNDEBUG"    
 fi
 
 dnl ========================================================
 dnl Checks for compilers.
 dnl ========================================================
 if test "$target" != "$host"; then
     echo "cross compiling from $host to $target"
@@ -195,21 +219,95 @@ case "$target" in
     AC_DEFINE(XP_UNIX)
     MDCPUCFG_H=_linux.cfg
     PR_MD_CSRCS=linux.c
     PR_MD_ARCH_DIR=unix
     ;;
 
 *-irix*)
     AC_DEFINE(XP_UNIX)
+    AC_DEFINE(IRIX)
+    AC_DEFINE(SVR4)
+    AC_DEFINE(_SGI_MP_SOURCE)
     MDCPUCFG_H=_irix32.cfg
     PR_MD_CSRCS=irix.c
-    AS="as -D_ASM $(INCLUDES) -n32"
     PR_MD_ASFILES=os_Irix.s
     PR_MD_ARCH_DIR=unix
+    MKSHLIB='$(LD) $(SHLIB_LD_OPTS) -rdata_shared -shared -soname $(notdir $@)'
+    DSO_LDOPTS='-elf -shared -all'
+    case "${target_os}")
+	irix5*)
+	   USE_NSPR_THREADS=1
+	   ;;
+	*)
+	   USE_N32=1
+	   USE_PTHREADS=1
+	   ;;
+ 	esac
+    if test "$GNU_CC"; then
+	AS='$(CC) -x assembler-with-cpp -D_ASM -mips2'
+	CFLAGS="$CFLAGS -Wall -Wno-format"
+	_OPTIMIZE_FLAGS="-O6"
+    else
+	AS="as -D_ASM $(INCLUDES) -n32"
+	CFLAGS="$CFLAGS -fullwarn -xansi"
+	if test "$USE_N32"; then
+	    _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
+	else
+	    _OPTIMIZE_FLAGS="-O -Olimit 4000"
+	fi
+	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
+    fi
+    if test "${target_os}" = "irix5.3"; then
+	AC_DEFINE(IRIX5_3)
+    fi
+    case "${target_os}" in
+	irix5*)
+	    ;;
+	*)
+	    AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
+	    ;;
+	esac
+    case "${target_os}" in
+	irix6.5*)
+	    ;;
+	*)
+	    if test -z "$GNU_CC"; then
+		CFLAGS="$CFLAGS -mips3"
+	    fi
+	    AC_DEFINE(_PR_HAVE_GETPROTO_R)
+	    AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
+	    ;;
+	esac
     case "${target_cpu}" in
     alpha*)
 	AC_DEFINE(_POSIX_SOURCE)
 	AC_DEFINE(_BSD_SOURCE)
 	;;
     esac
     ;;
 
@@ -512,32 +610,45 @@ AC_CHECK_FUNC(dlopen,,[
     AC_CHECK_LIB(dl, dlopen, [OS_LIBS="-ldl $OS_LIBS"])
 ])
 
 EXTRA_LIBS=
 if test "$enable_shared" = no; then
   EXTRA_LIBS="$OS_LIBS"
 fi
 
+if test -n "$MOZ_OPTIMZE"; then
+    CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
+    CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
+fi
+
+if test -n "$MOZ_DEBUG"; then
+    CFLAGS="$CFLAGS $_DEBUG_FLAGS"
+    CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
+fi
+
 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)
 AC_SUBST(GNU_CC)
 
+AC_SUBST(USE_CPLUS)
+AC_SUBST(USE_IPV6)
+AC_SUBST(USE_N32)
+AC_SUBST(USE_64)
+
 AC_SUBST(USE_PTHREADS)
 AC_SUBST(USE_BTHREADS)
-AC_SUBST(USE_CPLUS)
-AC_SUBST(USE_IPV6)
 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)