-# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2006 by Red Hat, Inc. All rights reserved.
+# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2006, 2010, 2011 by Red Hat, Inc.
+# All rights reserved.
# Copyright 2004 Nathanael Nerode
#
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
dnl Process this file with autoconf to produce configure.
-AC_PREREQ(2.59)
+AC_PREREQ(2.64)
AC_INIT
AC_CONFIG_SRCDIR(gcj_mlc.c)
# This works around the fact that libtool configuration may change LD
m4_define([_AC_ARG_VAR_PRECIOUS],[])
AC_PROG_CC
AC_PROG_CXX
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
AM_PROG_CC_C_O
AM_CPPFLAGS="$AM_CPPFLAGS -pthread"
THREADLIBS=-pthread
;;
- *-*-solaris*)
+ *-*-solaris2.8*)
AC_DEFINE(GC_SOLARIS_PTHREADS,1,[support for Solaris pthreads])
# Need to use alternate thread library, otherwise gctest hangs
# on Solaris 8.
THREADLIBS="-L/usr/lib/lwp/$multi_os_directory \
-R/usr/lib/lwp/$multi_os_directory -lpthread -lthread -lrt"
;;
+ *-*-solaris2*)
+ AC_DEFINE(GC_SOLARIS_PTHREADS,1,[support for Solaris pthreads])
+ # The alternate thread library was only introduced in Solaris 8 and
+ # became the default in Solaris 9, so no need for the special code
+ # above otherwise.
+ # nanosleep, sched_yield, and sem_* only live in librt before
+ # Solaris 11.
+ THREADLIBS="-lpthread -lrt"
+ ;;
*-*-irix*)
AC_DEFINE(GC_IRIX_THREADS,1,[support for Irix pthreads])
;;
AC_DEFINE(GC_AIX_THREADS,1)
AC_DEFINE(_REENTRANT,1)
;;
- decosf1 | irix | mach | os2 | solaris | dce | vxworks)
+ decosf1 | irix | mach | os2 | dce | vxworks)
AC_MSG_ERROR(thread package $THREADS not yet supported)
;;
*)
*) ;;
esac
-# We never want libdl on darwin. It is a fake libdl that just ends up making
-# dyld calls anyway
case "$host" in
+ # While IRIX 6 has libdl for the O32 and N32 ABIs, it's missing for N64
+ # and unnecessary everywhere.
+ mips-sgi-irix6*) ;;
+ # We never want libdl on darwin. It is a fake libdl that just ends up making
+ # dyld calls anyway
*-*-darwin*) ;;
*)
AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
#
# Check for AViiON Machines running DGUX
#
-AC_MSG_CHECKING(if host is AViiON running DGUX)
ac_is_dgux=no
-AC_CHECK_HEADER(sys/dg_sys_info.h,
-[ac_is_dgux=yes;])
+AC_CHECK_HEADER(sys/dg_sys_info.h, [ac_is_dgux=yes])
+AC_MSG_CHECKING(if host is AViiON running DGUX)
AC_MSG_RESULT($ac_is_dgux)
## :GOTCHA: we do not check anything but sys/dg_sys_info.h
if test $ac_is_dgux = yes; then
if test "$enable_full_debug" = "yes"; then
- CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
- CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
- else
- CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
- CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
+ GC_CFLAGS="$GC_CFLAGS -mstandard"
fi
- AC_SUBST(CFLAGS)
- AC_SUBST(CXXFLAGS)
+ GC_CFLAGS="$GC_CFLAGS -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend"
fi
dnl As of 4.13a2, the collector will not properly work on Solaris when
dnl built with gcc and -O. So we remove -O in the appropriate case.
dnl Not needed anymore on Solaris.
-AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
+AC_MSG_CHECKING([whether GCC optimization should be disabled])
+O0_CFLAGS=
case "$host" in
- *aix*)
- if test "$GCC" = yes; then
- AC_MSG_RESULT(yes)
- new_CFLAGS=
- for i in $CFLAGS; do
- case "$i" in
- -O*)
- ;;
- *)
- new_CFLAGS="$new_CFLAGS $i"
- ;;
- esac
- done
- CFLAGS="$new_CFLAGS"
- else
- AC_MSG_RESULT(no)
- fi
- ;;
- *) AC_MSG_RESULT(no) ;;
+ *aix*) test "$GCC" = yes && O0_CFLAGS=-O0 ;;
+ *) ;;
esac
-
-dnl We need to override the top-level CFLAGS. This is how we do it.
-MY_CFLAGS="$CFLAGS"
-AC_SUBST(MY_CFLAGS)
+if test x"$O0_CFLAGS" != x; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST([O0_CFLAGS])
dnl Include defines that have become de facto standard.
dnl ALL_INTERIOR_POINTERS can be overridden in startup code.