aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2008-07-30 19:46:53 +0000
committerH.J. Lu <hongjiu.lu@intel.com>2008-07-30 19:46:53 +0000
commit15749f22dd44447408168aade723651e52233e3b (patch)
tree47597ed86cf0d3459a0e1165511bd6a323ad4a8f
parentc7aafc42747ab50670756656374bc9ae099b7c8f (diff)
Merged with trunk at revision 138336.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/stack@138337 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog8
-rw-r--r--Makefile.def1
-rw-r--r--Makefile.in2
-rw-r--r--Makefile.tpl1
-rw-r--r--config/ChangeLog11
-rw-r--r--config/acinclude.m41277
-rw-r--r--config/mh-pa (renamed from gcc/config/pa/x-ada)2
-rw-r--r--config/mh-pa-hpux10 (renamed from gcc/config/pa/x-ada-hpux10)2
-rw-r--r--config/tcl.m43240
-rwxr-xr-xconfigure12
-rw-r--r--configure.ac12
-rw-r--r--gcc/ChangeLog670
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in16
-rw-r--r--gcc/ada/ChangeLog196
-rw-r--r--gcc/ada/adaint.c18
-rw-r--r--gcc/ada/argv.c4
-rw-r--r--gcc/ada/cio.c23
-rw-r--r--gcc/ada/einfo.adb36
-rw-r--r--gcc/ada/einfo.ads22
-rw-r--r--gcc/ada/exp_ch9.adb1022
-rw-r--r--gcc/ada/exp_ch9.ads12
-rw-r--r--gcc/ada/exp_util.adb14
-rw-r--r--gcc/ada/exp_util.ads8
-rw-r--r--gcc/ada/g-pehage.adb228
-rw-r--r--gcc/ada/g-pehage.ads36
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in20
-rw-r--r--gcc/ada/gcc-interface/Makefile.in245
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h6
-rw-r--r--gcc/ada/gcc-interface/decl.c34
-rw-r--r--gcc/ada/gcc-interface/gigi.h12
-rw-r--r--gcc/ada/gcc-interface/trans.c3
-rw-r--r--gcc/ada/gcc-interface/utils.c317
-rw-r--r--gcc/ada/gcc-interface/utils2.c34
-rw-r--r--gcc/ada/gnat-style.texi46
-rw-r--r--gcc/ada/gnat_rm.texi26
-rw-r--r--gcc/ada/gnat_ugn.texi45
-rw-r--r--gcc/ada/gnatlink.adb278
-rw-r--r--gcc/ada/make.adb18
-rw-r--r--gcc/ada/mlib-utl.adb2
-rw-r--r--gcc/ada/osint.ads31
-rw-r--r--gcc/ada/rtsfind.adb71
-rw-r--r--gcc/ada/sem_ch3.adb129
-rw-r--r--gcc/ada/sem_ch6.adb215
-rw-r--r--gcc/ada/sem_ch6.ads8
-rw-r--r--gcc/ada/sem_ch8.adb58
-rw-r--r--gcc/ada/targparm.adb6
-rw-r--r--gcc/ada/targparm.ads3
-rw-r--r--gcc/ada/uintp.adb2
-rw-r--r--gcc/c-common.c161
-rw-r--r--gcc/c-common.h3
-rw-r--r--gcc/c-typeck.c88
-rw-r--r--gcc/config.host16
-rw-r--r--gcc/config.in14
-rw-r--r--gcc/config/arm/arm.c132
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/config/i386/i386.opt2
-rw-r--r--gcc/config/mips/iris6.h24
-rw-r--r--gcc/config/mips/irix-crti.asm7
-rw-r--r--gcc/config/rs6000/rs6000.c4
-rw-r--r--gcc/config/rs6000/rs6000.h5
-rw-r--r--gcc/cp/ChangeLog14
-rw-r--r--gcc/cp/decl2.c45
-rw-r--r--gcc/cp/typeck.c56
-rw-r--r--gcc/doc/cpp.texi2
-rw-r--r--gcc/doc/extend.texi12
-rw-r--r--gcc/doc/fragments.texi40
-rw-r--r--gcc/doc/gcc.texi10
-rw-r--r--gcc/doc/gccint.texi12
-rw-r--r--gcc/doc/install.texi5
-rw-r--r--gcc/doc/invoke.texi14
-rw-r--r--gcc/doc/tm.texi11
-rw-r--r--gcc/dse.c21
-rw-r--r--gcc/final.c39
-rw-r--r--gcc/fix-header.c5
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/gfc-internals.texi7
-rw-r--r--gcc/fortran/gfortran.texi7
-rw-r--r--gcc/fortran/intrinsic.texi7
-rw-r--r--gcc/fortran/invoke.texi9
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/gcj.texi13
-rw-r--r--gcc/scan.c2
-rw-r--r--gcc/testsuite/ChangeLog115
-rw-r--r--gcc/testsuite/g++.dg/parse/crash42.C9
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C53
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-pr34389.c53
-rw-r--r--gcc/testsuite/gfortran.dg/pr36967.f25
-rw-r--r--gcc/tree-predcom.c5
-rw-r--r--gnattools/ChangeLog17
-rw-r--r--gnattools/Makefile.in18
-rwxr-xr-xgnattools/configure14
-rw-r--r--gnattools/configure.ac10
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/libgomp.texi7
-rw-r--r--libiberty/functions.texi16
97 files changed, 6687 insertions, 2950 deletions
diff --git a/ChangeLog b/ChangeLog
index 63170e89c17..c4400d65acb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac: Add makefile fragments for hpux.
+ * Makefile.def (flags_to_pass): Add ADA_CFLAGS.
+ * Makefile.tpl (HOST_EXPORTS): Pass ADA_CFLAGS.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+
2008-07-28 Aldy Hernandez <aldyh@redhat.com>
* MAINTAINERS: Add Jakub and myself as gimple maintainers.
diff --git a/Makefile.def b/Makefile.def
index 3924617ebd3..832fc4236e9 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -226,6 +226,7 @@ flags_to_pass = { flag= YACC ; };
// Host tools
flags_to_pass = { flag= ADAFLAGS ; optional=true ; };
+flags_to_pass = { flag= ADA_CFLAGS ; };
flags_to_pass = { flag= AR_FLAGS ; };
flags_to_pass = { flag= BOOT_ADAFLAGS ; optional=true ; };
flags_to_pass = { flag= BOOT_CFLAGS ; };
diff --git a/Makefile.in b/Makefile.in
index 81bf0e9011c..d9ef0681497 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -164,6 +164,7 @@ HOST_SUBDIR = @host_subdir@
HOST_EXPORTS = \
$(BASE_EXPORTS) \
CC="$(CC)"; export CC; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
@@ -514,6 +515,7 @@ BASE_FLAGS_TO_PASS = \
"SHELL=$(SHELL)" \
"YACC=$(YACC)" \
"`echo 'ADAFLAGS=$(ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"AR_FLAGS=$(AR_FLAGS)" \
"`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
"BOOT_CFLAGS=$(BOOT_CFLAGS)" \
diff --git a/Makefile.tpl b/Makefile.tpl
index 4c744eba394..1f0c318012f 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -167,6 +167,7 @@ HOST_SUBDIR = @host_subdir@
HOST_EXPORTS = \
$(BASE_EXPORTS) \
CC="$(CC)"; export CC; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
diff --git a/config/ChangeLog b/config/ChangeLog
index e64c1cab72e..a35fe14673c 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,14 @@
+2008-07-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * mh-pa: New, from gcc/config/pa/x-ada.
+ * mh-pa-hpux10: New, from gcc/config/pa/x-ada-hpux10.
+
+2008-07-25 Keith Seitz <keiths@redhat.com>
+
+ * acinclude.m4: Remove libide, libgui, and all the other Tcl
+ functions.
+ * tcl.m4: New file.
+
2008-07-11 Joseph Myers <joseph@codesourcery.com>
* mh-mingw (LDFLAGS): Append to rather than replacing previous
diff --git a/config/acinclude.m4 b/config/acinclude.m4
index c7c0ab5dc11..8242b2c7a8a 100644
--- a/config/acinclude.m4
+++ b/config/acinclude.m4
@@ -497,99 +497,6 @@ AC_SUBST(DEVOHDIR)
])
dnl ====================================================================
-dnl find the IDE library and headers.
-AC_DEFUN([CYG_AC_PATH_IDE], [
-AC_MSG_CHECKING(for IDE headers in the source tree)
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-IDEHDIR=
-IDELIB=
-AC_CACHE_VAL(ac_cv_c_ideh,[
-for i in $dirlist; do
- if test -f "${srcdir}/$i/libide/src/event.h" ; then
- ac_cv_c_ideh=`(cd ${srcdir}/$i/libide/src; ${PWDCMD-pwd})`;
- fi
-done
-])
-if test x"${ac_cv_c_ideh}" != x; then
- IDEHDIR="-I${ac_cv_c_ideh}"
- AC_MSG_RESULT(${ac_cv_c_ideh})
-else
- AC_MSG_RESULT(none)
-fi
-
-AC_MSG_CHECKING(for LIBIDE TCL headers in the source tree)
-AC_CACHE_VAL(ac_cv_c_idetclh,[
-for i in $dirlist; do
- if test -f "${srcdir}/$i/libidetcl/src/idetcl.h" ; then
- ac_cv_c_idetclh=`(cd ${srcdir}/$i/libidetcl/src; ${PWDCMD-pwd})`;
- fi
-done
-])
-if test x"${ac_cv_c_idetclh}" != x; then
- IDEHDIR="${IDEHDIR} -I${ac_cv_c_idetclh}"
- AC_MSG_RESULT(${ac_cv_c_idetclh})
-else
- AC_MSG_RESULT(none)
-fi
-
-AC_MSG_CHECKING(for IDE headers in the build tree)
-AC_CACHE_VAL(ac_cv_c_ideh2,[
-for i in $dirlist; do
- if test -f "$i/libide/src/Makefile" ; then
- ac_cv_c_ideh2=`(cd $i/libide/src; ${PWDCMD-pwd})`;
- fi
-done
-])
-if test x"${ac_cv_c_ideh2}" != x; then
- IDEHDIR="${IDEHDIR} -I${ac_cv_c_ideh2}"
- AC_MSG_RESULT(${ac_cv_c_ideh2})
-else
- AC_MSG_RESULT(none)
-fi
-
-dnl look for the library
-AC_MSG_CHECKING(for IDE library)
-AC_CACHE_VAL(ac_cv_c_idelib,[
-if test x"${ac_cv_c_idelib}" = x ; then
- for i in $dirlist; do
- if test -f "$i/libide/src/Makefile" ; then
- ac_cv_c_idelib=`(cd $i/libide/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi])
-if test x"${ac_cv_c_idelib}" != x ; then
- IDELIB="-L${ac_cv_c_idelib}"
- AC_MSG_RESULT(${ac_cv_c_idelib})
-else
- AC_MSG_RESULT(none)
-fi
-
-dnl find libiddetcl.a if it exists
-AC_MSG_CHECKING(for IDE TCL library)
-AC_CACHE_VAL(ac_cv_c_idetcllib,[
-if test x"${ac_cv_c_idetcllib}" = x ; then
- for i in $dirlist; do
- if test -f "$i/libidetcl/src/Makefile" ; then
- ac_cv_c_idetcllib=`(cd $i/libidetcl/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-])
-if test x"${ac_cv_c_idetcllib}" != x ; then
- IDELIB="${IDELIB} -L${ac_cv_c_idetcllib}"
- IDETCLLIB="-lidetcl"
- AC_MSG_RESULT(${ac_cv_c_idetcllib})
-else
- AC_MSG_RESULT(none)
-fi
-AC_SUBST(IDEHDIR)
-AC_SUBST(IDELIB)
-AC_SUBST(IDETCLLIB)
-])
-
-dnl ====================================================================
dnl Find all the ILU headers and libraries
AC_DEFUN([CYG_AC_PATH_ILU], [
AC_MSG_CHECKING(for ILU kernel headers in the source tree)
@@ -837,1187 +744,3 @@ fi
AC_LANG_RESTORE
AC_SUBST(LIBGCC)
])
-
-dnl ====================================================================
-dnl Ok, lets find the tcl source trees so we can use the headers
-dnl Warning: transition of version 9 to 10 will break this algorithm
-dnl because 10 sorts before 9. We also look for just tcl. We have to
-dnl be careful that we don't match stuff like tclX by accident.
-dnl the alternative search directory is involked by --with-tclinclude
-AC_DEFUN([CYG_AC_PATH_TCL], [
- CYG_AC_PATH_TCLH
- CYG_AC_PATH_TCLCONFIG
- CYG_AC_LOAD_TCLCONFIG
-])
-AC_DEFUN([CYG_AC_PATH_TCLH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_tcl=true
-AC_MSG_CHECKING(for Tcl headers in the source tree)
-AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl headers are], with_tclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_tclh,[
-dnl first check to see if --with-tclinclude was specified
-if test x"${with_tclinclude}" != x ; then
- if test -f ${with_tclinclude}/tcl.h ; then
- ac_cv_c_tclh=`(cd ${with_tclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_tclinclude}/generic/tcl.h ; then
- ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tclinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Tcl configuration file
-if test x"${ac_cv_c_tclconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_tclconfig/$i/generic/tcl.h ; then
- ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/$i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tclh}" = x ; then
- dnl find the top level Tcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/tcl* 2>/dev/null`" ; then
- tclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Tcl source dir. We do it this way, cause there
- dnl might be multiple version of Tcl, and we want the most recent one.
- for i in `ls -dr $tclpath/tcl* 2>/dev/null ` ; do
- if test -f $i/generic/tcl.h ; then
- ac_cv_c_tclh=`(cd $i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl check if its installed with the compiler
-if test x"${ac_cv_c_tclh}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
- if test -f $ccpath/tcl.h; then
- ac_cv_c_tclh=$ccpath
- fi
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_tclh}" = x ; then
- AC_MSG_RESULT(none)
- AC_CHECK_HEADER(tcl.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
-else
- AC_MSG_RESULT(${ac_cv_c_tclh})
-fi
-])
- TCLHDIR=""
-if test x"${ac_cv_c_tclh}" = x ; then
- AC_MSG_ERROR([Can't find any Tcl headers])
-fi
-if test x"${ac_cv_c_tclh}" != x ; then
- no_tcl=""
- if test x"${ac_cv_c_tclh}" != x"installed" ; then
- if test x"${CC}" = xcl ; then
- tmp="`cygpath --windows ${ac_cv_c_tclh}`"
- ac_cv_c_tclh="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
- fi
- AC_MSG_RESULT(${ac_cv_c_tclh})
- TCLHDIR="-I${ac_cv_c_tclh}"
- fi
-fi
-
-AC_SUBST(TCLHDIR)
-])
-
-dnl ====================================================================
-dnl Ok, lets find the tcl configuration
-AC_DEFUN([CYG_AC_PATH_TCLCONFIG], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-dnl First, look for one uninstalled.
-dnl the alternative search directory is invoked by --with-tclconfig
-if test x"${no_tcl}" = x ; then
- dnl we reset no_tcl in case something fails here
- no_tcl=true
- AC_ARG_WITH(tclconfig, [ --with-tclconfig directory containing tcl configuration (tclConfig.sh)],
- with_tclconfig=${withval})
- AC_MSG_CHECKING([for Tcl configuration script])
- AC_CACHE_VAL(ac_cv_c_tclconfig,[
-
- dnl First check to see if --with-tclconfig was specified.
- if test x"${with_tclconfig}" != x ; then
- if test -f "${with_tclconfig}/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd ${with_tclconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
- fi
- fi
-
- dnl next check if it came with Tcl configuration file in the source tree
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in $dirlist; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tkConfig.sh could be in either directory depending
- dnl on the cygwin port of tcl.
- if test -f $srcdir/$i/unix/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $srcdir/$i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $srcdir/$i/win/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $srcdir/$i/win; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- dnl check in a few other locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- dnl find the top level Tcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $i/tcl* 2>/dev/null`" ; then
- tclconfpath=$i
- break
- fi
- done
-
- dnl find the exact Tcl dir. We do it this way, cause there
- dnl might be multiple version of Tcl, and we want the most recent one.
- for i in `ls -dr $tclconfpath/tcl* 2>/dev/null ` ; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tclConfig.sh could be in either directory depending
- dnl on the cygwin port of tcl.
- if test -f $i/unix/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $i/win/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $i/win; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
-
- dnl Check to see if it's installed. We have to look in the $CC path
- dnl to find it, cause our $prefix may not match the compilers.
- if test x"${ac_cv_c_tclconfig}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
- if test -f $ccpath/tclConfig.sh; then
- ac_cv_c_tclconfig=$ccpath
- fi
- fi
- ]) dnl end of cache_val
-
- if test x"${ac_cv_c_tclconfig}" = x ; then
- TCLCONFIG=""
- AC_MSG_WARN(Can't find Tcl configuration definitions)
- else
- no_tcl=""
- TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
- AC_MSG_RESULT(${TCLCONFIG})
- fi
-fi
-AC_SUBST(TCLCONFIG)
-])
-
-dnl Defined as a separate macro so we don't have to cache the values
-dnl from PATH_TCLCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_TCLCONFIG], [
- . $TCLCONFIG
-
-dnl AC_SUBST(TCL_VERSION)
-dnl AC_SUBST(TCL_MAJOR_VERSION)
-dnl AC_SUBST(TCL_MINOR_VERSION)
-dnl AC_SUBST(TCL_CC)
- AC_SUBST(TCL_DEFS)
-
-dnl not used, don't export to save symbols
- AC_SUBST(TCL_LIB_FILE)
- AC_SUBST(TCL_LIB_FULL_PATH)
- AC_SUBST(TCL_LIBS)
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_PREFIX)
-
- AC_SUBST(TCL_CFLAGS)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_EXEC_PREFIX)
-
- AC_SUBST(TCL_SHLIB_CFLAGS)
- AC_SUBST(TCL_SHLIB_LD)
-dnl don't export, not used outside of configure
-dnl AC_SUBST(TCL_SHLIB_LD_LIBS)
-dnl AC_SUBST(TCL_SHLIB_SUFFIX)
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_DL_LIBS)
- AC_SUBST(TCL_LD_FLAGS)
- AC_SUBST(TCL_LD_SEARCH_FLAGS)
-dnl don't export, not used outside of configure
-dnl AC_SUBST(TCL_COMPAT_OBJS)
- AC_SUBST(TCL_RANLIB)
- AC_SUBST(TCL_BUILD_LIB_SPEC)
- AC_SUBST(TCL_LIB_SPEC)
- AC_SUBST(TCL_BIN_DIR)
-dnl AC_SUBST(TCL_LIB_VERSIONS_OK)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
-])
-
-dnl ====================================================================
-AC_DEFUN([CYG_AC_PATH_TK], [
- CYG_AC_PATH_TKH
- CYG_AC_PATH_TKCONFIG
- CYG_AC_LOAD_TKCONFIG
-])
-AC_DEFUN([CYG_AC_PATH_TKH], [
-#
-# Ok, lets find the tk source trees so we can use the headers
-# If the directory (presumably symlink) named "tk" exists, use that one
-# in preference to any others. Same logic is used when choosing library
-# and again with Tcl. The search order is the best place to look first, then in
-# decreasing significance. The loop breaks if the trigger file is found.
-# Note the gross little conversion here of srcdir by cd'ing to the found
-# directory. This converts the path from a relative to an absolute, so
-# recursive cache variables for the path will work right. We check all
-# the possible paths in one loop rather than many separate loops to speed
-# things up.
-# the alternative search directory is involked by --with-tkinclude
-#
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_tk=true
-AC_MSG_CHECKING(for Tk headers in the source tree)
-AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where tk headers are], with_tkinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_tkh,[
-dnl first check to see if --with-tkinclude was specified
-if test x"${with_tkinclude}" != x ; then
- if test -f ${with_tkinclude}/tk.h ; then
- ac_cv_c_tkh=`(cd ${with_tkinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_tkinclude}/generic/tk.h ; then
- ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tkinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Tk configuration file
-if test x"${ac_cv_c_tkconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_tkconfig/$i/generic/tk.h ; then
- ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/$i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tkh}" = x ; then
- dnl find the top level Tk source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/tk* 2>/dev/null`" ; then
- tkpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Tk source dir. We do it this way, cause there
- dnl might be multiple version of Tk, and we want the most recent one.
- for i in `ls -dr $tkpath/tk* 2>/dev/null ` ; do
- if test -f $i/generic/tk.h ; then
- ac_cv_c_tkh=`(cd $i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_tkh}" = x ; then
- AC_MSG_RESULT(none)
- dnl Get the path to the compiler. We do it this way instead of using
- dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
- if test -f $ccpath/tk.h; then
- ac_cv_c_tkh=$ccpath
- fi
-else
- AC_MSG_RESULT(${ac_cv_c_tkh})
-fi
-])
- TKHDIR=""
-if test x"${ac_cv_c_tkh}" = x ; then
- AC_MSG_ERROR([Can't find any Tk headers])
-fi
-if test x"${ac_cv_c_tkh}" != x ; then
- no_tk=""
- if test x"${ac_cv_c_tkh}" != x"installed" ; then
- if test x"${CC}" = xcl ; then
- tmp="`cygpath --windows ${ac_cv_c_tkh}`"
- ac_cv_c_tkh="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
- fi
- AC_MSG_RESULT([found in ${ac_cv_c_tkh}])
- TKHDIR="-I${ac_cv_c_tkh}"
- fi
-fi
-
-AC_SUBST(TKHDIR)
-])
-
-AC_DEFUN([CYG_AC_PATH_TKCONFIG], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-dnl First, look for one uninstalled.
-dnl the alternative search directory is invoked by --with-tkconfig
-if test x"${no_tk}" = x ; then
- dnl we reset no_tk in case something fails here
- no_tk=true
- AC_ARG_WITH(tkconfig, [ --with-tkconfig directory containing tk configuration (tkConfig.sh)],
- with_tkconfig=${withval})
- AC_MSG_CHECKING([for Tk configuration script])
- AC_CACHE_VAL(ac_cv_c_tkconfig,[
-
- dnl First check to see if --with-tkconfig was specified.
- if test x"${with_tkconfig}" != x ; then
- if test -f "${with_tkconfig}/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd ${with_tkconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
- fi
- fi
-
- dnl next check if it came with Tk configuration file in the source tree
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in $dirlist; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tkConfig.sh could be in either directory depending
- dnl on the cygwin port of tk.
- if test -f $srcdir/$i/unix/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $srcdir/$i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $srcdir/$i/win/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $srcdir/$i/unix; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- dnl check in a few other locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- dnl find the top level Tk source directory
- for i in $dirlist; do
- if test -n "`ls -dr $i/tk* 2>/dev/null`" ; then
- tkconfpath=$i
- break
- fi
- done
-
- dnl find the exact Tk dir. We do it this way, cause there
- dnl might be multiple version of Tk, and we want the most recent one.
- for i in `ls -dr $tkconfpath/tk* 2>/dev/null ` ; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tkConfig.sh could be in either directory depending
- dnl on the cygwin port of tk.
- if test -f $i/unix/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $i/win/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $i/win; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
-
- dnl Check to see if it's installed. We have to look in the $CC path
- dnl to find it, cause our $prefix may not match the compilers.
- if test x"${ac_cv_c_tkconfig}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
- if test -f $ccpath/tkConfig.sh; then
- ac_cv_c_tkconfig=$ccpath
- fi
- fi
- ]) dnl end of cache_val
-
- if test x"${ac_cv_c_tkconfig}" = x ; then
- TKCONFIG=""
- AC_MSG_WARN(Can't find Tk configuration definitions)
- else
- no_tk=""
- TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
- AC_MSG_RESULT(${TKCONFIG})
- fi
-fi
-AC_SUBST(TKCONFIG)
-])
-
-dnl Defined as a separate macro so we don't have to cache the values
-dnl from PATH_TKCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_TKCONFIG], [
- if test -f "$TKCONFIG" ; then
- . $TKCONFIG
- fi
-
- AC_SUBST(TK_VERSION)
-dnl not actually used, don't export to save symbols
-dnl AC_SUBST(TK_MAJOR_VERSION)
-dnl AC_SUBST(TK_MINOR_VERSION)
- AC_SUBST(TK_DEFS)
-
-dnl not used, don't export to save symbols
- AC_SUBST(TK_LIB_FILE)
- AC_SUBST(TK_LIB_FULL_PATH)
- AC_SUBST(TK_LIBS)
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TK_PREFIX)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TK_EXEC_PREFIX)
- AC_SUBST(TK_BUILD_INCLUDES)
- AC_SUBST(TK_XINCLUDES)
- AC_SUBST(TK_XLIBSW)
- AC_SUBST(TK_BUILD_LIB_SPEC)
- AC_SUBST(TK_LIB_SPEC)
-])
-
-dnl ====================================================================
-dnl Ok, lets find the itcl source trees so we can use the headers
-dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN([CYG_AC_PATH_ITCL], [
- CYG_AC_PATH_ITCLH
- CYG_AC_PATH_ITCLLIB
- CYG_AC_PATH_ITCLSH
- CYG_AC_PATH_ITCLMKIDX
-])
-AC_DEFUN([CYG_AC_PATH_ITCLH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_itcl=true
-AC_MSG_CHECKING(for Itcl headers in the source tree)
-AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_itclh,[
-dnl first check to see if --with-itclinclude was specified
-if test x"${with_itclinclude}" != x ; then
- if test -f ${with_itclinclude}/itcl.h ; then
- ac_cv_c_itclh=`(cd ${with_itclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_itclinclude}/src/itcl.h ; then
- ac_cv_c_itclh=`(cd ${with_itclinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Itcl configuration file
-if test x"${ac_cv_c_itclconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_itclconfig/$i/src/itcl.h ; then
- ac_cv_c_itclh=`(cd $ac_cv_c_itclconfig/$i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_itclh}" = x ; then
- dnl find the top level Itcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
- itclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Itcl source dir. We do it this way, cause there
- dnl might be multiple version of Itcl, and we want the most recent one.
- for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
- if test -f $i/src/itcl.h ; then
- ac_cv_c_itclh=`(cd $i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_itclh}" = x ; then
- AC_MSG_RESULT(none)
- AC_CHECK_HEADER(itcl.h, ac_cv_c_itclh=installed, ac_cv_c_itclh="")
-else
- AC_MSG_RESULT(${ac_cv_c_itclh})
-fi
-])
- ITCLHDIR=""
-if test x"${ac_cv_c_itclh}" = x ; then
- AC_MSG_ERROR([Can't find any Itcl headers])
-fi
-if test x"${ac_cv_c_itclh}" != x ; then
- no_itcl=""
- if test x"${ac_cv_c_itclh}" != x"installed" ; then
- AC_MSG_RESULT(${ac_cv_c_itclh})
- ITCLHDIR="-I${ac_cv_c_itclh}"
- fi
-fi
-
-AC_SUBST(ITCLHDIR)
-])
-
-dnl Ok, lets find the itcl library
-dnl First, look for one uninstalled.
-dnl the alternative search directory is invoked by --with-itcllib
-AC_DEFUN([CYG_AC_PATH_ITCLLIB], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-if test x"${no_itcl}" = x ; then
- dnl we reset no_itcl incase something fails here
- no_itcl=true
- AC_ARG_WITH(itcllib,
- [ --with-itcllib directory where the itcl library is],
- with_itcllib=${withval})
- AC_MSG_CHECKING([for Itcl library])
- AC_CACHE_VAL(ac_cv_c_itcllib,[
- dnl First check to see if --with-itcllib was specified.
- if test x"${with_itcllib}" != x ; then
- if test -f "${with_itcllib}/libitcl$TCL_SHARED_LIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd ${with_itcllib}; ${PWDCMD-pwd})`/libitcl$TCL_SHARED_LIB_SUFFIX
- else
- if test -f "${with_itcllib}/libitcl$TCL_UNSHARED_LIB_SUFFIX"; then
- ac_cv_c_itcllib=`(cd ${with_itcllib}; ${PWDCMD-pwd})`/libitcl$TCL_UNSHARED_LIB_SUFFIX
- fi
- fi
- fi
- dnl then check for a Itcl library. Since these are uninstalled,
- dnl use the simple lib name root.
- if test x"${ac_cv_c_itcllib}" = x ; then
- dnl find the top level Itcl build directory
- for i in $dirlist; do
- if test -n "`ls -dr $i/itcl* 2>/dev/null`" ; then
- itclpath=$i/itcl
- break
- fi
- done
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "$itclpath/src/libitcl.$TCL_SHLIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd $itclpath/src; ${PWDCMD-pwd})`
- elif test -f "$itclpath/src/libitcl.a"; then
- ac_cv_c_itcllib=`(cd $itclpath/src; ${PWDCMD-pwd})`
- fi
- fi
- dnl check in a few other private locations
- if test x"${ac_cv_c_itcllib}" = x ; then
- for i in ${dirlist}; do
- if test -n "`ls -dr ${srcdir}/$i/itcl* 2>/dev/null`" ; then
- itclpath=${srcdir}/$i
- break
- fi
- done
- for i in `ls -dr ${itclpath}/itcl* 2>/dev/null` ; do
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "$i/src/libitcl$TCL_SHLIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd $i/src; ${PWDCMD-pwd})`
- break
- elif test -f "$i/src/libitcl.a"; then
- ac_cv_c_itcllib=`(cd $i/src; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
-
- dnl see if one is conveniently installed with the compiler
- if test x"${ac_cv_c_itcllib}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "${ccpath}/libitcl$TCL_SHLIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd ${ccpath}; ${PWDCMD-pwd})`
- elif test -f "${ccpath}/libitcl.a"; then
- ac_cv_c_itcllib=`(cd ${ccpath}; ${PWDCMD-pwd})`
- fi
- fi
- ])
- if test x"${ac_cv_c_itcllib}" = x ; then
- ITCLLIB=""
- AC_MSG_WARN(Can't find Itcl library)
- else
- ITCLLIB="-L${ac_cv_c_itcllib}"
- AC_MSG_RESULT(${ac_cv_c_itcllib})
- no_itcl=""
- fi
-fi
-
-AC_PROVIDE([$0])
-AC_SUBST(ITCLLIB)
-])
-
-
-dnl ====================================================================
-dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
-dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN([CYG_AC_PATH_ITCLSH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_itcl=true
-AC_MSG_CHECKING(for the itcl_sh script)
-AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_itclsh,[
-dnl first check to see if --with-itclinclude was specified
-if test x"${with_itclinclude}" != x ; then
- if test -f ${with_itclinclude}/itcl_sh ; then
- ac_cv_c_itclsh=`(cd ${with_itclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_itclinclude}/src/itcl_sh ; then
- ac_cv_c_itclsh=`(cd ${with_itclinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
- fi
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_itclsh}" = x ; then
- dnl find the top level Itcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
- itclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Itcl source dir. We do it this way, cause there
- dnl might be multiple version of Itcl, and we want the most recent one.
- for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
- if test -f $i/src/itcl_sh ; then
- ac_cv_c_itclsh=`(cd $i/src; ${PWDCMD-pwd})`/itcl_sh
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_itclsh}" = x ; then
- AC_MSG_RESULT(none)
- AC_PATH_PROG(ac_cv_c_itclsh, itcl_sh)
-else
- AC_MSG_RESULT(${ac_cv_c_itclsh})
-fi
-])
-
-if test x"${ac_cv_c_itclsh}" = x ; then
- AC_MSG_ERROR([Can't find the itcl_sh script])
-fi
-if test x"${ac_cv_c_itclsh}" != x ; then
- no_itcl=""
- AC_MSG_RESULT(${ac_cv_c_itclsh})
- ITCLSH="${ac_cv_c_itclsh}"
-fi
-AC_SUBST(ITCLSH)
-])
-
-
-dnl ====================================================================
-dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
-dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN([CYG_AC_PATH_ITCLMKIDX], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_itcl=true
-AC_MSG_CHECKING(for itcl_mkindex.tcl script)
-AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_itclmkidx,[
-dnl first check to see if --with-itclinclude was specified
-if test x"${with_itclinclude}" != x ; then
- if test -f ${with_itclinclude}/itcl_sh ; then
- ac_cv_c_itclmkidx=`(cd ${with_itclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_itclinclude}/src/itcl_sh ; then
- ac_cv_c_itclmkidx=`(cd ${with_itclinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
- fi
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_itclmkidx}" = x ; then
- dnl find the top level Itcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
- itclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Itcl source dir. We do it this way, cause there
- dnl might be multiple version of Itcl, and we want the most recent one.
- for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
- if test -f $i/library/itcl_mkindex.tcl ; then
- ac_cv_c_itclmkidx=`(cd $i/library; ${PWDCMD-pwd})`/itcl_mkindex.tcl
- break
- fi
- done
-fi
-if test x"${ac_cv_c_itclmkidx}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/share
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- for i in `ls -dr $ccpath/itcl* 2>/dev/null ` ; do
- if test -f $i/itcl_mkindex.tcl ; then
- ac_cv_c_itclmkidx=`(cd $i; ${PWDCMD-pwd})`/itcl_mkindex.tcl
- break
- fi
- done
-fi
-])
-
-if test x"${ac_cv_c_itclmkidx}" = x ; then
- AC_MSG_ERROR([Can't find the itcl_mkindex.tcl script])
-fi
-if test x"${ac_cv_c_itclmkidx}" != x ; then
- no_itcl=""
- AC_MSG_RESULT(${ac_cv_c_itclmkidx})
- ITCLMKIDX="${ac_cv_c_itclmkidx}"
-else
- AC_MSG_RESULT(none)
-fi
-AC_SUBST(ITCLMKIDX)
-])
-
-dnl ====================================================================
-dnl Ok, lets find the tix source trees so we can use the headers
-dnl the alternative search directory is involked by --with-tixinclude
-AC_DEFUN([CYG_AC_PATH_TIX], [
- CYG_AC_PATH_TIXH
- CYG_AC_PATH_TIXLIB
-])
-AC_DEFUN([CYG_AC_PATH_TIXH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_tix=true
-AC_MSG_CHECKING(for Tix headers in the source tree)
-AC_ARG_WITH(tixinclude, [ --with-tixinclude directory where tix headers are], with_tixinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_tixh,[
-dnl first check to see if --with-tixinclude was specified
-if test x"${with_tixinclude}" != x ; then
- if test -f ${with_tixinclude}/tix.h ; then
- ac_cv_c_tixh=`(cd ${with_tixinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_tixinclude}/generic/tix.h ; then
- ac_cv_c_tixh=`(cd ${with_tixinclude}/generic; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tixinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Tix configuration file
-if test x"${ac_cv_c_tixconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_tixconfig/$i/generic/tix.h ; then
- ac_cv_c_tixh=`(cd $ac_cv_c_tixconfig/$i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tixh}" = x ; then
- dnl find the top level Tix source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/tix* 2>/dev/null`" ; then
- tixpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Tix source dir. We do it this way, cause there
- dnl might be multiple version of Tix, and we want the most recent one.
- for i in `ls -dr $tixpath/tix* 2>/dev/null ` ; do
- if test -f $i/generic/tix.h ; then
- ac_cv_c_tixh=`(cd $i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_tixh}" = x ; then
- AC_MSG_RESULT(none)
- dnl Get the path to the compiler
-
- dnl Get the path to the compiler. We do it this way instead of using
- dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
- if test -f $ccpath/tix.h; then
- ac_cv_c_tixh=installed
- fi
-else
- AC_MSG_RESULT(${ac_cv_c_tixh})
-fi
-])
-if test x"${ac_cv_c_tixh}" = x ; then
- AC_MSG_ERROR([Can't find any Tix headers])
-fi
-if test x"${ac_cv_c_tixh}" != x ; then
- no_tix=""
- AC_MSG_RESULT(${ac_cv_c_tixh})
- if test x"${ac_cv_c_tixh}" != x"installed" ; then
- TIXHDIR="-I${ac_cv_c_tixh}"
- fi
-fi
-
-AC_SUBST(TIXHDIR)
-])
-
-AC_DEFUN([CYG_AC_PATH_TIXCONFIG], [
-#
-# Ok, lets find the tix configuration
-# First, look for one uninstalled.
-# the alternative search directory is invoked by --with-tixconfig
-#
-
-if test x"${no_tix}" = x ; then
- # we reset no_tix in case something fails here
- no_tix=true
- AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
- with_tixconfig=${withval})
- AC_MSG_CHECKING([for Tix configuration])
- AC_CACHE_VAL(ac_cv_c_tixconfig,[
-
- # First check to see if --with-tixconfig was specified.
- if test x"${with_tixconfig}" != x ; then
- if test -f "${with_tixconfig}/tixConfig.sh" ; then
- ac_cv_c_tixconfig=`(cd ${with_tixconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh])
- fi
- fi
-
- # then check for a private Tix library
- if test x"${ac_cv_c_tixconfig}" = x ; then
- for i in \
- ../tix \
- `ls -dr ../tix[[4]]* 2>/dev/null` \
- ../../tix \
- `ls -dr ../../tix[[4]]* 2>/dev/null` \
- ../../../tix \
- `ls -dr ../../../tix[[4]]* 2>/dev/null` ; do
- if test -f "$i/tixConfig.sh" ; then
- ac_cv_c_tixconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_tixconfig}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- if test -f "$i/tixConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_tixconfig}" = x ; then
- for i in \
- ${srcdir}/../tix \
- `ls -dr ${srcdir}/../tix[[4-9]]* 2>/dev/null` ; do
- if test -f "$i/tixConfig.sh" ; then
- ac_cv_c_tixconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- ])
- if test x"${ac_cv_c_tixconfig}" = x ; then
- TIXCONFIG="# no Tix configs found"
- AC_MSG_WARN(Can't find Tix configuration definitions)
- else
- no_tix=
- TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh
- AC_MSG_RESULT(found $TIXCONFIG)
- fi
-fi
-
-])
-
-# Defined as a separate macro so we don't have to cache the values
-# from PATH_TIXCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_TIXCONFIG], [
- if test -f "$TIXCONFIG" ; then
- . $TIXCONFIG
- fi
-
- AC_SUBST(TIX_BUILD_LIB_SPEC)
- AC_SUBST(TIX_LIB_FULL_PATH)
-])
-
-AC_DEFUN([CYG_AC_PATH_ITCLCONFIG], [
-#
-# Ok, lets find the itcl configuration
-# First, look for one uninstalled.
-# the alternative search directory is invoked by --with-itclconfig
-#
-
-if test x"${no_itcl}" = x ; then
- # we reset no_itcl in case something fails here
- no_itcl=true
- AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
- with_itclconfig=${withval})
- AC_MSG_CHECKING([for Itcl configuration])
- AC_CACHE_VAL(ac_cv_c_itclconfig,[
-
- # First check to see if --with-itclconfig was specified.
- if test x"${with_itclconfig}" != x ; then
- if test -f "${with_itclconfig}/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd ${with_itclconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh])
- fi
- fi
-
- # then check for a private itcl library
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in \
- ../itcl/itcl \
- `ls -dr ../itcl/itcl[[3]]* 2>/dev/null` \
- ../../itcl/itcl \
- `ls -dr ../../itcl/itcl[[3]]* 2>/dev/null` \
- ../../../itcl/itcl \
- `ls -dr ../../../itcl/itcl[[3]]* 2>/dev/null` ; do
- if test -f "$i/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- if test -f "$i/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in \
- ${srcdir}/../itcl/itcl \
- `ls -dr ${srcdir}/../itcl/itcl[[3]]* 2>/dev/null` ; do
- if test -f "$i/itcl/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- ])
- if test x"${ac_cv_c_itclconfig}" = x ; then
- ITCLCONFIG="# no itcl configs found"
- AC_MSG_WARN(Can't find itcl configuration definitions)
- else
- no_itcl=
- ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh
- AC_MSG_RESULT(found $ITCLCONFIG)
- fi
-fi
-
-])
-
-# Defined as a separate macro so we don't have to cache the values
-# from PATH_ITCLCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_ITCLCONFIG], [
- if test -f "$ITCLCONFIG" ; then
- . $ITCLCONFIG
- fi
-
- AC_SUBST(ITCL_BUILD_LIB_SPEC)
- AC_SUBST(ITCL_SH)
- AC_SUBST(ITCL_LIB_FILE)
- AC_SUBST(ITCL_LIB_FULL_PATH)
-
-])
-
-
-AC_DEFUN([CYG_AC_PATH_ITKCONFIG], [
-#
-# Ok, lets find the itk configuration
-# First, look for one uninstalled.
-# the alternative search directory is invoked by --with-itkconfig
-#
-
-if test x"${no_itk}" = x ; then
- # we reset no_itk in case something fails here
- no_itk=true
- AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
- with_itkconfig=${withval})
- AC_MSG_CHECKING([for Itk configuration])
- AC_CACHE_VAL(ac_cv_c_itkconfig,[
-
- # First check to see if --with-itkconfig was specified.
- if test x"${with_itkconfig}" != x ; then
- if test -f "${with_itkconfig}/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd ${with_itkconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh])
- fi
- fi
-
- # then check for a private itk library
- if test x"${ac_cv_c_itkconfig}" = x ; then
- for i in \
- ../itcl/itk \
- `ls -dr ../itcl/itk[[3]]* 2>/dev/null` \
- ../../itcl/itk \
- `ls -dr ../../itcl/itk[[3]]* 2>/dev/null` \
- ../../../itcl/itk \
- `ls -dr ../../../itcl/itk[[3]]* 2>/dev/null` ; do
- if test -f "$i/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_itkconfig}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- if test -f "$i/itcl/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_itkconfig}" = x ; then
- for i in \
- ${srcdir}/../itcl/itk \
- `ls -dr ${srcdir}/../itcl/itk[[3]]* 2>/dev/null` ; do
- if test -f "$i/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- ])
- if test x"${ac_cv_c_itkconfig}" = x ; then
- ITCLCONFIG="# no itk configs found"
- AC_MSG_WARN(Can't find itk configuration definitions)
- else
- no_itk=
- ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh
- AC_MSG_RESULT(found $ITKCONFIG)
- fi
-fi
-
-])
-
-# Defined as a separate macro so we don't have to cache the values
-# from PATH_ITKCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_ITKCONFIG], [
- if test -f "$ITKCONFIG" ; then
- . $ITKCONFIG
- fi
-
- AC_SUBST(ITK_BUILD_LIB_SPEC)
- AC_SUBST(ITK_LIB_FILE)
- AC_SUBST(ITK_LIB_FULL_PATH)
-])
-
-
-dnl ====================================================================
-dnl Ok, lets find the libgui source trees so we can use the headers
-dnl the alternative search directory is involked by --with-libguiinclude
-AC_DEFUN([CYG_AC_PATH_LIBGUI], [
- CYG_AC_PATH_LIBGUIH
- CYG_AC_PATH_LIBGUILIB
-])
-AC_DEFUN([CYG_AC_PATH_LIBGUIH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../..../../../../../../../../../../.."
-no_libgui=true
-AC_MSG_CHECKING(for Libgui headers in the source tree)
-AC_ARG_WITH(libguiinclude, [ --with-libguiinclude directory where libgui headers are], with_libguiinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_libguih,[
-dnl first check to see if --with-libguiinclude was specified
-if test x"${with_libguiinclude}" != x ; then
- if test -f ${with_libguiinclude}/guitcl.h ; then
- ac_cv_c_libguih=`(cd ${with_libguiinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_libguiinclude}/src/guitcl.h ; then
- ac_cv_c_libguih=`(cd ${with_libguiinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_libguiinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Libgui configuration file
-if test x"${ac_cv_c_libguiconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_libguiconfig/$i/src/guitcl.h ; then
- ac_cv_c_libguih=`(cd $ac_cv_c_libguiconfig/$i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_libguih}" = x ; then
- dnl find the top level Libgui source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/libgui* 2>/dev/null`" ; then
- libguipath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Libgui source dir. We do it this way, cause there
- dnl might be multiple version of Libgui, and we want the most recent one.
- for i in `ls -dr $libguipath/libgui* 2>/dev/null ` ; do
- if test -f $i/src/guitcl.h ; then
- ac_cv_c_libguih=`(cd $i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_libguih}" = x ; then
- AC_MSG_RESULT(none)
- AC_CHECK_HEADER(guitcl.h, ac_cv_c_libguih=installed, ac_cv_c_libguih="")
-fi
-])
-LIBGUIHDIR=""
-if test x"${ac_cv_c_libguih}" = x ; then
- AC_MSG_WARN([Can't find any Libgui headers])
-fi
-if test x"${ac_cv_c_libguih}" != x ; then
- no_libgui=""
- if test x"${ac_cv_c_libguih}" != x"installed" ; then
- LIBGUIHDIR="-I${ac_cv_c_libguih}"
- fi
-fi
-AC_MSG_RESULT(${ac_cv_c_libguih})
-AC_SUBST(LIBGUIHDIR)
-])
-
-dnl ====================================================================
-dnl find the GUI library
-AC_DEFUN([CYG_AC_PATH_LIBGUILIB], [
-AC_MSG_CHECKING(for GUI library in the build tree)
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-dnl look for the library
-AC_MSG_CHECKING(for GUI library)
-AC_CACHE_VAL(ac_cv_c_libguilib,[
-if test x"${ac_cv_c_libguilib}" = x ; then
- for i in $dirlist; do
- if test -f "$i/libgui/src/Makefile" ; then
- ac_cv_c_libguilib=`(cd $i/libgui/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-])
-if test x"${ac_cv_c_libguilib}" != x ; then
- GUILIB="${GUILIB} -L${ac_cv_c_libguilib}"
- LIBGUILIB="-lgui"
- AC_MSG_RESULT(${ac_cv_c_libguilib})
-else
- AC_MSG_RESULT(none)
-fi
-
-AC_SUBST(GUILIB)
-AC_SUBST(LIBGUILIB)
-])
diff --git a/gcc/config/pa/x-ada b/config/mh-pa
index b60b3d7925b..b0005a25d4d 100644
--- a/gcc/config/pa/x-ada
+++ b/config/mh-pa
@@ -1,4 +1,4 @@
# The ada virtual array implementation requires that indexing be disabled on
# hosts such as hpux that use a segmented memory architecture. Both the c
# and ada files need to be compiled with this option for correct operation.
-X_ADA_CFLAGS=-mdisable-indexing
+ADA_CFLAGS = -mdisable-indexing
diff --git a/gcc/config/pa/x-ada-hpux10 b/config/mh-pa-hpux10
index d2b70753088..99a2278f281 100644
--- a/gcc/config/pa/x-ada-hpux10
+++ b/config/mh-pa-hpux10
@@ -1,4 +1,4 @@
# The ada virtual array implementation requires that indexing be disabled on
# hosts such as hpux that use a segmented memory architecture. Both the c
# and ada files need to be compiled with this option for correct operation.
-X_ADA_CFLAGS = -mdisable-indexing -D_X_HPUX10
+ADA_CFLAGS = -mdisable-indexing -D_X_HPUX10
diff --git a/config/tcl.m4 b/config/tcl.m4
new file mode 100644
index 00000000000..51809fdc0bd
--- /dev/null
+++ b/config/tcl.m4
@@ -0,0 +1,3240 @@
+#------------------------------------------------------------------------
+# SC_PATH_TCLCONFIG --
+#
+# Locate the tclConfig.sh file and perform a sanity check on
+# the Tcl compile flags
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tcl=...
+#
+# Defines the following vars:
+# TCL_BIN_DIR Full path to the directory containing
+# the tclConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_PATH_TCLCONFIG], [
+ #
+ # Ok, lets find the tcl configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tcl
+ #
+
+ if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+ AC_ARG_WITH(tcl, [ --with-tcl directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval})
+ AC_MSG_CHECKING([for Tcl configuration])
+ AC_CACHE_VAL(ac_cv_c_tclconfig,[
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
+ else
+ AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCL_BIN_DIR="# no Tcl configs found"
+ AC_MSG_WARN([Can't find Tcl configuration definitions])
+ exit 0
+ else
+ no_tcl=
+ TCL_BIN_DIR=${ac_cv_c_tclconfig}
+ AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_PATH_TKCONFIG --
+#
+# Locate the tkConfig.sh file
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tk=...
+#
+# Defines the following vars:
+# TK_BIN_DIR Full path to the directory containing
+# the tkConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_PATH_TKCONFIG], [
+ #
+ # Ok, lets find the tk configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tk
+ #
+
+ if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+ AC_ARG_WITH(tk, [ --with-tk directory containing tk configuration (tkConfig.sh)], with_tkconfig=${withval})
+ AC_MSG_CHECKING([for Tk configuration])
+ AC_CACHE_VAL(ac_cv_c_tkconfig,[
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
+ else
+ AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TK_BIN_DIR="# no Tk configs found"
+ AC_MSG_WARN([Can't find Tk configuration definitions])
+ exit 0
+ else
+ no_tk=
+ TK_BIN_DIR=${ac_cv_c_tkconfig}
+ AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_LOAD_TCLCONFIG --
+#
+# Load the tclConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TCL_BIN_DIR
+#
+# Results:
+#
+# Subst the following vars:
+# TCL_BIN_DIR
+# TCL_SRC_DIR
+# TCL_LIB_FILE
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_LOAD_TCLCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
+
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . ${TCL_BIN_DIR}/tclConfig.sh
+ else
+ AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f ${TCL_BIN_DIR}/Makefile ; then
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tcl.framework installed in an arbitary location.
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
+ for i in "`cd ${TCL_BIN_DIR}; pwd`" \
+ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
+ TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
+ TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TCL_VERSION)
+ AC_SUBST(TCL_PATCH_LEVEL)
+ AC_SUBST(TCL_BIN_DIR)
+ AC_SUBST(TCL_SRC_DIR)
+
+ AC_SUBST(TCL_LIB_FILE)
+ AC_SUBST(TCL_LIB_FLAG)
+ AC_SUBST(TCL_LIB_SPEC)
+
+ AC_SUBST(TCL_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
+])
+
+#------------------------------------------------------------------------
+# SC_LOAD_TKCONFIG --
+#
+# Load the tkConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TK_BIN_DIR
+#
+# Results:
+#
+# Sets the following vars that should be in tkConfig.sh:
+# TK_BIN_DIR
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_LOAD_TKCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
+
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . ${TK_BIN_DIR}/tkConfig.sh
+ else
+ AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
+ # If the TK_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TK_LIB_SPEC will be set to the value
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f ${TK_BIN_DIR}/Makefile ; then
+ TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
+ TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
+ TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tk.framework installed in an arbitary location.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then
+ for i in "`cd ${TK_BIN_DIR}; pwd`" \
+ "`cd ${TK_BIN_DIR}/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
+ TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then
+ TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TK_VERSION)
+ AC_SUBST(TK_BIN_DIR)
+ AC_SUBST(TK_SRC_DIR)
+
+ AC_SUBST(TK_LIB_FILE)
+ AC_SUBST(TK_LIB_FLAG)
+ AC_SUBST(TK_LIB_SPEC)
+
+ AC_SUBST(TK_STUB_LIB_FILE)
+ AC_SUBST(TK_STUB_LIB_FLAG)
+ AC_SUBST(TK_STUB_LIB_SPEC)
+])
+
+#------------------------------------------------------------------------
+# SC_PROG_TCLSH
+# Locate a tclsh shell installed on the system path. This macro
+# will only find a Tcl shell that already exists on the system.
+# It will not find a Tcl shell in the Tcl build directory or
+# a Tcl shell that has been installed from the Tcl build directory.
+# If a Tcl shell can't be located on the PATH, then TCLSH_PROG will
+# be set to "". Extensions should take care not to create Makefile
+# rules that are run by default and depend on TCLSH_PROG. An
+# extension can't assume that an executable Tcl shell exists at
+# build time.
+#
+# Arguments
+# none
+#
+# Results
+# Subst's the following values:
+# TCLSH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_PROG_TCLSH], [
+ AC_MSG_CHECKING([for tclsh])
+ AC_CACHE_VAL(ac_cv_path_tclsh, [
+ search_path=`echo ${PATH} | sed -e 's/:/ /g'`
+ for dir in $search_path ; do
+ for j in `ls -r $dir/tclsh[[8-9]]* 2> /dev/null` \
+ `ls -r $dir/tclsh* 2> /dev/null` ; do
+ if test x"$ac_cv_path_tclsh" = x ; then
+ if test -f "$j" ; then
+ ac_cv_path_tclsh=$j
+ break
+ fi
+ fi
+ done
+ done
+ ])
+
+ if test -f "$ac_cv_path_tclsh" ; then
+ TCLSH_PROG="$ac_cv_path_tclsh"
+ AC_MSG_RESULT([$TCLSH_PROG])
+ else
+ # It is not an error if an installed version of Tcl can't be located.
+ TCLSH_PROG=""
+ AC_MSG_RESULT([No tclsh found on PATH])
+ fi
+ AC_SUBST(TCLSH_PROG)
+])
+
+#------------------------------------------------------------------------
+# SC_BUILD_TCLSH
+# Determine the fully qualified path name of the tclsh executable
+# in the Tcl build directory. This macro will correctly determine
+# the name of the tclsh executable even if tclsh has not yet
+# been built in the build directory. The build tclsh must be used
+# when running tests from an extension build directory. It is not
+# correct to use the TCLSH_PROG in cases like this.
+#
+# Arguments
+# none
+#
+# Results
+# Subst's the following values:
+# BUILD_TCLSH
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_BUILD_TCLSH], [
+ AC_MSG_CHECKING([for tclsh in Tcl build directory])
+ BUILD_TCLSH=${TCL_BIN_DIR}/tclsh
+ AC_MSG_RESULT([$BUILD_TCLSH])
+ AC_SUBST(BUILD_TCLSH)
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_SHARED --
+#
+# Allows the building of shared libraries
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-shared=yes|no
+#
+# Defines the following vars:
+# STATIC_BUILD Used for building import/export libraries
+# on Windows.
+#
+# Sets the following vars:
+# SHARED_BUILD Value of 1 or 0
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_ENABLE_SHARED], [
+ AC_MSG_CHECKING([how to build libraries])
+ AC_ARG_ENABLE(shared,
+ [ --enable-shared build and link with shared libraries [--enable-shared]],
+ [tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ AC_MSG_RESULT([shared])
+ SHARED_BUILD=1
+ else
+ AC_MSG_RESULT([static])
+ SHARED_BUILD=0
+ AC_DEFINE(STATIC_BUILD)
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_FRAMEWORK --
+#
+# Allows the building of shared libraries into frameworks
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-framework=yes|no
+#
+# Sets the following vars:
+# FRAMEWORK_BUILD Value of 1 or 0
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_ENABLE_FRAMEWORK], [
+ if test "`uname -s`" = "Darwin" ; then
+ AC_MSG_CHECKING([how to package libraries])
+ AC_ARG_ENABLE(framework,
+ [ --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]],
+ [enable_framework=$enableval], [enable_framework=no])
+ if test $enable_framework = yes; then
+ if test $SHARED_BUILD = 0; then
+ AC_MSG_WARN([Frameworks can only be built if --enable-shared is yes])
+ enable_framework=no
+ fi
+ if test $tcl_corefoundation = no; then
+ AC_MSG_WARN([Frameworks can only be used when CoreFoundation is available])
+ enable_framework=no
+ fi
+ fi
+ if test $enable_framework = yes; then
+ AC_MSG_RESULT([framework])
+ FRAMEWORK_BUILD=1
+ else
+ if test $SHARED_BUILD = 1; then
+ AC_MSG_RESULT([shared library])
+ else
+ AC_MSG_RESULT([static library])
+ fi
+ FRAMEWORK_BUILD=0
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_THREADS --
+#
+# Specify if thread support should be enabled. TCL_THREADS is
+# checked so that if you are compiling an extension against a
+# threaded core, your extension must be compiled threaded as well.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-threads
+#
+# Sets the following vars:
+# THREADS_LIBS Thread library(s)
+#
+# Defines the following vars:
+# TCL_THREADS
+# _REENTRANT
+# _THREAD_SAFE
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_ENABLE_THREADS], [
+ AC_ARG_ENABLE(threads, [ --enable-threads build with threads],
+ [tcl_ok=$enableval], [tcl_ok=no])
+
+ if test "${TCL_THREADS}" = 1; then
+ tcl_threaded_core=1;
+ fi
+
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+ AC_DEFINE(USE_THREAD_ALLOC)
+ AC_DEFINE(_REENTRANT)
+ if test "`uname -s`" = "SunOS" ; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
+ fi
+ AC_DEFINE(_THREAD_SAFE)
+ AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ AC_CHECK_LIB(pthread, __pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ AC_CHECK_LIB(c, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ AC_CHECK_LIB(c_r, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ AC_MSG_WARN([Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...])
+ fi
+ fi
+ fi
+ fi
+
+ # Does the pthread-implementation provide
+ # 'pthread_attr_setstacksize' ?
+
+ ac_saved_libs=$LIBS
+ LIBS="$LIBS $THREADS_LIBS"
+ AC_CHECK_FUNCS(pthread_attr_setstacksize)
+ AC_CHECK_FUNCS(pthread_atfork)
+ LIBS=$ac_saved_libs
+ else
+ TCL_THREADS=0
+ fi
+ # Do checking message here to not mess up interleaved configure output
+ AC_MSG_CHECKING([for building with threads])
+ if test "${TCL_THREADS}" = 1; then
+ AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
+ if test "${tcl_threaded_core}" = 1; then
+ AC_MSG_RESULT([yes (threaded core)])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ else
+ AC_MSG_RESULT([no (default)])
+ fi
+
+ AC_SUBST(TCL_THREADS)
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_SYMBOLS --
+#
+# Specify if debugging symbols should be used.
+# Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging
+# can also be enabled.
+#
+# Arguments:
+# none
+#
+# Requires the following vars to be set in the Makefile:
+# CFLAGS_DEBUG
+# CFLAGS_OPTIMIZE
+# LDFLAGS_DEBUG
+# LDFLAGS_OPTIMIZE
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-symbols
+#
+# Defines the following vars:
+# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
+# Sets to $(CFLAGS_OPTIMIZE) if false
+# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
+# Sets to $(LDFLAGS_OPTIMIZE) if false
+# DBGX Debug library extension
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_ENABLE_SYMBOLS], [
+ AC_MSG_CHECKING([for build with symbols])
+ AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])
+# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
+ if test "$tcl_ok" = "no"; then
+ CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
+ LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
+ DBGX=""
+ AC_MSG_RESULT([no])
+ else
+ CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
+ LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
+ DBGX=g
+ if test "$tcl_ok" = "yes"; then
+ AC_MSG_RESULT([yes (standard debugging)])
+ fi
+ fi
+ AC_SUBST(CFLAGS_DEFAULT)
+ AC_SUBST(LDFLAGS_DEFAULT)
+
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
+ AC_DEFINE(TCL_MEM_DEBUG)
+ fi
+
+ if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
+ AC_DEFINE(TCL_COMPILE_DEBUG)
+ AC_DEFINE(TCL_COMPILE_STATS)
+ fi
+
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
+ if test "$tcl_ok" = "all"; then
+ AC_MSG_RESULT([enabled symbols mem compile debugging])
+ else
+ AC_MSG_RESULT([enabled $tcl_ok debugging])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_LANGINFO --
+#
+# Allows use of modern nl_langinfo check for better l10n.
+# This is only relevant for Unix.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-langinfo=yes|no (default is yes)
+#
+# Defines the following vars:
+# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_ENABLE_LANGINFO], [
+ AC_ARG_ENABLE(langinfo,
+ [ --enable-langinfo use nl_langinfo if possible to determine
+ encoding at startup, otherwise use old heuristic],
+ [langinfo_ok=$enableval], [langinfo_ok=yes])
+
+ HAVE_LANGINFO=0
+ if test "$langinfo_ok" = "yes"; then
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
+ fi
+ AC_MSG_CHECKING([whether to use nl_langinfo])
+ if test "$langinfo_ok" = "yes"; then
+ AC_CACHE_VAL(tcl_cv_langinfo_h, [
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
+ AC_MSG_RESULT([$tcl_cv_langinfo_h])
+ if test $tcl_cv_langinfo_h = yes; then
+ AC_DEFINE(HAVE_LANGINFO)
+ fi
+ else
+ AC_MSG_RESULT([$langinfo_ok])
+ fi
+])
+
+#--------------------------------------------------------------------
+# SC_CONFIG_MANPAGES
+#
+# Decide whether to use symlinks for linking the manpages,
+# whether to compress the manpages after installation, and
+# whether to add a package name suffix to the installed
+# manpages to avoidfile name clashes.
+# If compression is enabled also find out what file name suffix
+# the given compression program is using.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-man-symlinks
+# --enable-man-compression=PROG
+# --enable-man-suffix[=STRING]
+#
+# Defines the following variable:
+#
+# MAN_FLAGS - The apropriate flags for installManPage
+# according to the user's selection.
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_CONFIG_MANPAGES], [
+ AC_MSG_CHECKING([whether to use symlinks for manpages])
+ AC_ARG_ENABLE(man-symlinks,
+ [ --enable-man-symlinks use symlinks for the manpages],
+ test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks",
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+
+ AC_MSG_CHECKING([whether to compress the manpages])
+ AC_ARG_ENABLE(man-compression,
+ [ --enable-man-compression=PROG
+ compress the manpages with PROG],
+ [case $enableval in
+ yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);;
+ no) ;;
+ *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";;
+ esac],
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+ if test "$enableval" != "no"; then
+ AC_MSG_CHECKING([for compressed file suffix])
+ touch TeST
+ $enableval TeST
+ Z=`ls TeST* | sed 's/^....//'`
+ rm -f TeST*
+ MAN_FLAGS="$MAN_FLAGS --extension $Z"
+ AC_MSG_RESULT([$Z])
+ fi
+
+ AC_MSG_CHECKING([whether to add a package name suffix for the manpages])
+ AC_ARG_ENABLE(man-suffix,
+ [ --enable-man-suffix=STRING
+ use STRING as a suffix to manpage file names
+ (default: $1)],
+ [case $enableval in
+ yes) enableval="$1" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
+ no) ;;
+ *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
+ esac],
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+
+ AC_SUBST(MAN_FLAGS)
+])
+
+#--------------------------------------------------------------------
+# SC_CONFIG_SYSTEM
+#
+# Determine what the system is (some things cannot be easily checked
+# on a feature-driven basis, alas). This can usually be done via the
+# "uname" command, but there are a few systems, like Next, where
+# this doesn't work.
+#
+# Arguments:
+# none
+#
+# Results:
+# Defines the following var:
+#
+# system - System/platform/version identification code.
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_CONFIG_SYSTEM], [
+ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
+ if test -f /usr/lib/NextStep/software_version; then
+ tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ AC_MSG_WARN([can't find uname command])
+ tcl_cv_sys_version=unknown
+ else
+ # Special check for weird MP-RAS system (uname returns weird
+ # results, and the version is kept in special file).
+
+ if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+ tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid`
+ fi
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+ ])
+ system=$tcl_cv_sys_version
+])
+
+#--------------------------------------------------------------------
+# SC_CONFIG_CFLAGS
+#
+# Try to determine the proper flags to pass to the compiler
+# for building shared libraries and other such nonsense.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines and substitutes the following vars:
+#
+# DL_OBJS - Name of the object file that implements dynamic
+# loading for Tcl on this system.
+# DL_LIBS - Library file(s) to include in tclsh and other base
+# applications in order for the "load" command to work.
+# LDFLAGS - Flags to pass to the compiler when linking object
+# files into an executable application binary such
+# as tclsh.
+# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile. Could
+# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
+# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile.
+# MAKE_LIB - Command to execute to build the a library;
+# differs when building shared or static.
+# MAKE_STUB_LIB -
+# Command to execute to build a stub library.
+# INSTALL_LIB - Command to execute to install a library;
+# differs when building shared or static.
+# INSTALL_STUB_LIB -
+# Command to execute to install a stub library.
+# STLIB_LD - Base command to use for combining object files
+# into a static library.
+# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
+# of a shared library (may request position-independent
+# code, among other things).
+# SHLIB_LD - Base command to use for combining object files
+# into a shared library.
+# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
+# creating shared libraries. This symbol typically
+# goes at the end of the "ld" commands that build
+# shared libraries. The value of the symbol is
+# "${LIBS}" if all of the dependent libraries should
+# be specified when creating a shared library. If
+# dependent libraries should not be specified (as on
+# SunOS 4.x, where they cause the link to fail, or in
+# general if Tcl and Tk aren't themselves shared
+# libraries), then this symbol has an empty string
+# as its value.
+# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
+# extensions. An empty string means we don't know how
+# to use shared libraries on this platform.
+# TCL_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS
+# TK_SHLIB_LD_EXTRAS for the build of Tcl and Tk, but not recorded in the
+# tclConfig.sh, since they are only used for the build
+# of Tcl and Tk.
+# Examples: MacOS X records the library version and
+# compatibility version in the shared library. But
+# of course the Tcl version of this is only used for Tcl.
+# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
+# in a static or shared library name, using the $VERSION variable
+# to put the version in the right place. This is used
+# by platforms that need non-standard library names.
+# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
+# to have a version after the .so, and ${VERSION}.a
+# on AIX, since a shared library needs to have
+# a .a extension whereas shared objects for loadable
+# extensions have a .so extension. Defaults to
+# ${VERSION}${SHLIB_SUFFIX}.
+# TCL_NEEDS_EXP_FILE -
+# 1 means that an export file is needed to link to a
+# shared library.
+# TCL_EXP_FILE - The name of the installed export / import file which
+# should be used to link to the Tcl shared library.
+# Empty if Tcl is unshared.
+# TCL_BUILD_EXP_FILE -
+# The name of the built export / import file which
+# should be used to link to the Tcl shared library.
+# Empty if Tcl is unshared.
+# CFLAGS_DEBUG -
+# Flags used when running the compiler in debug mode
+# CFLAGS_OPTIMIZE -
+# Flags used when running the compiler in optimize mode
+# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_CONFIG_CFLAGS], [
+
+ # Step 0.a: Enable 64 bit support?
+
+ AC_MSG_CHECKING([if 64bit support is requested])
+ AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],
+ [do64bit=$enableval], [do64bit=no])
+ AC_MSG_RESULT([$do64bit])
+
+ # Step 0.b: Enable Solaris 64 bit VIS support?
+
+ AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
+ AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],
+ [do64bitVIS=$enableval], [do64bitVIS=no])
+ AC_MSG_RESULT([$do64bitVIS])
+
+ if test "$do64bitVIS" = "yes"; then
+ # Force 64bit on with VIS
+ do64bit=yes
+ fi
+
+ # Step 1: set the variable "system" to hold the name and version number
+ # for the system.
+
+ SC_CONFIG_SYSTEM
+
+ # Step 2: check for existence of -ldl library. This is needed because
+ # Linux can use either -ldl or -ldld for dynamic loading.
+
+ AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
+
+ # Require ranlib early so we can override it in special cases below.
+
+ AC_REQUIRE([AC_PROG_RANLIB])
+
+ # Step 3: set configuration options based on system name and version.
+
+ do64bit_ok=no
+ LDFLAGS_ORIG="$LDFLAGS"
+ TCL_EXPORT_FILE_SUFFIX=""
+ UNSHARED_LIB_SUFFIX=""
+ TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
+ ECHO_VERSION='`echo ${VERSION}`'
+ TCL_LIB_VERSIONS_OK=ok
+ CFLAGS_DEBUG=-g
+ CFLAGS_OPTIMIZE=-O
+ if test "$GCC" = "yes" ; then
+ CFLAGS_WARNING="-Wall -Wno-implicit-int -fno-strict-aliasing"
+ else
+ CFLAGS_WARNING=""
+ fi
+ TCL_NEEDS_EXP_FILE=0
+ TCL_BUILD_EXP_FILE=""
+ TCL_EXP_FILE=""
+dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
+dnl AC_CHECK_TOOL(AR, ar)
+ AC_CHECK_PROG(AR, ar, ar)
+ if test "${AR}" = "" ; then
+ AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
+ fi
+ STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ PLAT_OBJS=""
+ PLAT_SRCS=""
+ case $system in
+ AIX-*)
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
+ # AIX requires the _r compiler when gcc isn't being used
+ case "${CC}" in
+ *_r)
+ # ok ...
+ ;;
+ *)
+ CC=${CC}_r
+ ;;
+ esac
+ AC_MSG_RESULT([Using $CC for compiling with threads])
+ fi
+ LIBS="$LIBS -lc"
+ SHLIB_CFLAGS=""
+ # Note: need the LIBS below, otherwise Tk won't find Tcl's
+ # symbols when dynamically loaded into tclsh.
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+
+ DL_OBJS="tclLoadDl.o"
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker on AIX 4+
+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
+ if test "$GCC" = "yes" ; then
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ else
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -q64"
+ LDFLAGS="$LDFLAGS -q64"
+ RANLIB="${RANLIB} -X64"
+ AR="${AR} -X64"
+ SHLIB_LD_FLAGS="-b64"
+ fi
+ fi
+
+ if test "`uname -m`" = "ia64" ; then
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ # AIX-5 has dl* in libc.so
+ DL_LIBS=""
+ if test "$GCC" = "yes" ; then
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ else
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
+ fi
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ else
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="gcc -shared"
+ else
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
+ fi
+ SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ TCL_NEEDS_EXP_FILE=1
+ TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
+ fi
+
+ # AIX v<=4.1 has some different flags than 4.2+
+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
+ LIBOBJS="$LIBOBJS tclLoadAix.o"
+ DL_LIBS="-lld"
+ fi
+
+ # On AIX <=v4 systems, libbsd.a has to be linked in to support
+ # non-blocking file IO. This library has to be linked in after
+ # the MATH_LIBS or it breaks the pow() function. The way to
+ # insure proper sequencing, is to add it to the tail of MATH_LIBS.
+ # This library also supplies gettimeofday.
+ #
+ # AIX does not have a timezone field in struct tm. When the AIX
+ # bsd library is used, the timezone global and the gettimeofday
+ # methods are to be avoided for timezone deduction instead, we
+ # deduce the timezone by comparing the localtime result on a
+ # known GMT value.
+
+ AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
+ if test $libbsd = yes; then
+ MATH_LIBS="$MATH_LIBS -lbsd"
+ AC_DEFINE(USE_DELTA_FOR_TZ)
+ fi
+ ;;
+ BeOS*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -nostart"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+
+ #-----------------------------------------------------------
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
+ # -lsocket, even if the network functions are in -lnet which
+ # is always linked to, for compatibility.
+ #-----------------------------------------------------------
+ AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
+ ;;
+ BSD/OS-2.1*|BSD/OS-3*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="shlicc -r"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ BSD/OS-4.*)
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
+ SHLIB_LD="cc -shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ dgux*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD="cc -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+ AC_DEFINE(_XOPEN_SOURCE) # Use the XOPEN network library
+ AC_DEFINE(_XOPEN_SOURCE_EXTENDED) # Use the XOPEN network library
+ LIBS="$LIBS -lxnet" # Use the XOPEN network library
+
+ if test "`uname -m`" = "ia64" ; then
+ SHLIB_SUFFIX=".so"
+ else
+ SHLIB_SUFFIX=".sl"
+ fi
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = yes; then
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+ SHLIB_LD_LIBS='${LIBS}'
+ DL_OBJS="tclLoadShl.o"
+ DL_LIBS="-ldld"
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+ fi
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="gcc -shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ fi
+
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #CFLAGS="$CFLAGS +DAportable"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ hpux_arch=`${CC} -dumpmachine`
+ case $hpux_arch in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD="${CC} -shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ ;;
+ esac
+ else
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS +DD64"
+ LDFLAGS="$LDFLAGS +DD64"
+ fi
+ fi
+ ;;
+ HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
+ SHLIB_SUFFIX=".sl"
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = yes; then
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+ SHLIB_LD_LIBS=""
+ DL_OBJS="tclLoadShl.o"
+ DL_LIBS="-ldld"
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+ fi
+ ;;
+ IRIX-4.*)
+ SHLIB_CFLAGS="-G 0"
+ SHLIB_SUFFIX=".a"
+ SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
+ SHLIB_LD_LIBS='${LIBS}'
+ DL_OBJS="tclLoadAout.o"
+ DL_LIBS=""
+ LDFLAGS="$LDFLAGS -Wl,-D,08000000"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
+ ;;
+ IRIX-5.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -shared -rdata_shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ ;;
+ IRIX-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
+ CFLAGS="$CFLAGS -mabi=n32"
+ LDFLAGS="$LDFLAGS -mabi=n32"
+ else
+ case $system in
+ IRIX-6.3)
+ # Use to build 6.2 compatible binaries on 6.3.
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -n32"
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS -n32"
+ fi
+ ;;
+ IRIX64-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ AC_MSG_WARN([64bit mode not supported by gcc])
+ else
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ CFLAGS="$CFLAGS -64"
+ LDFLAGS="$LDFLAGS -64"
+ fi
+ fi
+ ;;
+ Linux*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+
+ CFLAGS_OPTIMIZE=-O2
+ # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
+ # when you inline the string and math operations. Turn this off to
+ # get rid of the warnings.
+ #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
+
+ if test "$have_dl" = yes; then
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ else
+ AC_CHECK_HEADER(dld.h, [
+ SHLIB_LD="ld -shared"
+ DL_OBJS="tclLoadDld.o"
+ DL_LIBS="-ldld"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""])
+ fi
+ if test "`uname -m`" = "alpha" ; then
+ CFLAGS="$CFLAGS -mieee"
+ fi
+ if test $do64bit = yes; then
+ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_m64 = yes; then
+ CFLAGS="$CFLAGS -m64"
+ do64bit_ok=yes
+ fi
+ fi
+
+ # The combo of gcc + glibc has a bug related
+ # to inlining of functions like strtod(). The
+ # -fno-builtin flag should address this problem
+ # but it does not work. The -fno-inline flag
+ # is kind of overkill but it works.
+ # Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+ if test x"${LIBOBJS}" != x ; then
+ CFLAGS="$CFLAGS -fno-inline"
+ fi
+
+ # XIM peeking works under XFree86.
+ AC_DEFINE(PEEK_XCLOSEIM)
+
+ ;;
+ GNU*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+
+ if test "$have_dl" = yes; then
+ SHLIB_LD="${CC} -shared"
+ DL_OBJS=""
+ DL_LIBS="-ldl"
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ else
+ AC_CHECK_HEADER(dld.h, [
+ SHLIB_LD="ld -shared"
+ DL_OBJS=""
+ DL_LIBS="-ldld"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""])
+ fi
+ if test "`uname -m`" = "alpha" ; then
+ CFLAGS="$CFLAGS -mieee"
+ fi
+ ;;
+ Lynx*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ CFLAGS_OPTIMIZE=-02
+ SHLIB_LD="${CC} -shared "
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-mshared -ldl"
+ LD_FLAGS="-Wl,--export-dynamic"
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ ;;
+ MP-RAS-02*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD="cc -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ MP-RAS-*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD="cc -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ NetBSD-*|FreeBSD-[[1-2]].*)
+ # Not available on all versions: check for include file.
+ AC_CHECK_HEADER(dlfcn.h, [
+ # NetBSD/SPARC needs -fPIC, -fpic will not do.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
+ AC_EGREP_CPP(yes, [
+#ifdef __ELF__
+ yes
+#endif
+ ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
+ if test $tcl_cv_ld_elf = yes; then
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+ else
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
+ fi
+ ], [
+ SHLIB_CFLAGS=""
+ SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".a"
+ DL_OBJS="tclLoadAout.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ ])
+
+ # FreeBSD doesn't handle version numbers with dots.
+
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ OpenBSD-*)
+ case `arch -s` in
+ m88k|vax)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".a"
+ DL_OBJS="tclLoadAout.o"
+ DL_LIBS=""
+ LDFLAGS=""
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ ;;
+ *)
+ # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
+ case `machine` in
+ sparc|sparc64)
+ SHLIB_CFLAGS="-fPIC";;
+ *)
+ SHLIB_CFLAGS="-fpic";;
+ esac
+ SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
+ AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
+ AC_EGREP_CPP(yes, [
+#ifdef __ELF__
+ yes
+#endif
+ ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
+ if test $tcl_cv_ld_elf = yes; then
+ LDFLAGS=-Wl,-export-dynamic
+ else
+ LDFLAGS=""
+ fi
+ ;;
+ esac
+
+ # OpenBSD doesn't do version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ FreeBSD-*)
+ # FreeBSD 3.* and greater have ELF.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "${TCL_THREADS}" = "1" ; then
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ fi
+ case $system in
+ FreeBSD-3.*)
+ # FreeBSD-3 doesn't handle version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ esac
+ ;;
+ Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
+ SHLIB_CFLAGS="-fno-common"
+ # To avoid discrepancies between what headers configure sees during
+ # preprocessing tests and compiling tests, move any -isysroot and
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
+ CFLAGS="`echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
+ if test $do64bit = yes; then
+ case `arch` in
+ ppc)
+ AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
+ tcl_cv_cc_arch_ppc64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
+ tcl_cv_cc_arch_ppc64=no)
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_arch_ppc64 = yes; then
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ do64bit_ok=yes
+ fi;;
+ i386)
+ AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
+ tcl_cv_cc_arch_x86_64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch x86_64"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
+ tcl_cv_cc_arch_x86_64=no)
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_arch_x86_64 = yes; then
+ CFLAGS="$CFLAGS -arch x86_64"
+ do64bit_ok=yes
+ fi;;
+ *)
+ AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
+ esac
+ else
+ # Check for combined 32-bit and 64-bit fat build
+ echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \
+ echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \
+ fat_32_64=yes
+ fi
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
+ AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
+ LDFLAGS=$hold_ldflags])
+ if test $tcl_cv_ld_single_module = yes; then
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+ fi
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".dylib"
+ DL_OBJS="tclLoadDyld.o"
+ DL_LIBS=""
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \
+ LDFLAGS="$LDFLAGS -prebind"
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
+ AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no)
+ LDFLAGS=$hold_ldflags])
+ if test $tcl_cv_ld_search_paths_first = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ PLAT_OBJS=\$\(MAC\_OSX_OBJS\)
+ PLAT_SRCS=\$\(MAC\_OSX_SRCS\)
+ AC_MSG_CHECKING([whether to use CoreFoundation])
+ AC_ARG_ENABLE(corefoundation, [ --enable-corefoundation use CoreFoundation API [--enable-corefoundation]],
+ [tcl_corefoundation=$enableval], [tcl_corefoundation=yes])
+ AC_MSG_RESULT([$tcl_corefoundation])
+ if test $tcl_corefoundation = yes; then
+ AC_CACHE_CHECK([for CoreFoundation.framework], tcl_cv_lib_corefoundation, [
+ hold_libs=$LIBS
+ if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do
+ # On Tiger there is no 64-bit CF, so remove 64-bit archs
+ # from CFLAGS et al. while testing for presence of CF.
+ # 64-bit CF is disabled in tclUnixPort.h if necessary.
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done; fi
+ LIBS="$LIBS -framework CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
+ [CFBundleRef b = CFBundleGetMainBundle();],
+ tcl_cv_lib_corefoundation=yes, tcl_cv_lib_corefoundation=no)
+ if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done; fi; LIBS=$hold_libs])
+ if test $tcl_cv_lib_corefoundation = yes; then
+ LIBS="$LIBS -framework CoreFoundation"
+ AC_DEFINE(HAVE_COREFOUNDATION)
+ else
+ tcl_corefoundation=no
+ fi
+ if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then
+ AC_CACHE_CHECK([for 64-bit CoreFoundation], tcl_cv_lib_corefoundation_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
+ [CFBundleRef b = CFBundleGetMainBundle();],
+ tcl_cv_lib_corefoundation_64=yes, tcl_cv_lib_corefoundation_64=no)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ if test $tcl_cv_lib_corefoundation_64 = no; then
+ AC_DEFINE(NO_COREFOUNDATION_64)
+ fi
+ fi
+ fi
+ AC_DEFINE(MAC_OSX_TCL)
+ ;;
+ NEXTSTEP-*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="cc -nostdlib -r"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadNext.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ OS/390-*)
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
+ AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h
+ ;;
+ OSF1-1.0|OSF1-1.1|OSF1-1.2)
+ # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
+ SHLIB_CFLAGS=""
+ # Hack: make package name same as library name
+ SHLIB_LD='ld -R -export $@:'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadOSF.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ OSF1-1.*)
+ # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
+ SHLIB_CFLAGS="-fPIC"
+ if test "$SHARED_BUILD" = "1" ; then
+ SHLIB_LD="ld -shared"
+ else
+ SHLIB_LD="ld -non_shared"
+ fi
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ OSF1-V*)
+ # Digital OSF/1
+ SHLIB_CFLAGS=""
+ if test "$SHARED_BUILD" = "1" ; then
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+ else
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+ fi
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
+ CFLAGS="$CFLAGS -mieee"
+ else
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
+ fi
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
+ if test "${TCL_THREADS}" = "1" ; then
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ if test "$GCC" = "yes" ; then
+ LIBS="$LIBS -lpthread -lmach -lexc"
+ else
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ fi
+ fi
+
+ ;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ # dlopen is in -lc on QNX
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ RISCos-*)
+ SHLIB_CFLAGS="-G 0"
+ SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".a"
+ DL_OBJS="tclLoadAout.o"
+ DL_LIBS=""
+ LDFLAGS="$LDFLAGS -Wl,-D,08000000"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ SCO_SV-3.2*)
+ # Note, dlopen is available only on SCO 3.2.5 and greater. However,
+ # this test works, since "uname -s" was non-standard in 3.2.4 and
+ # below.
+ if test "$GCC" = "yes" ; then
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ else
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+ fi
+ SHLIB_LD="ld -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SINIX*5.4*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD="cc -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-4*)
+ SHLIB_CFLAGS="-PIC"
+ SHLIB_LD="ld"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+ # SunOS can't handle version numbers with dots in them in library
+ # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
+ # requires an extra version number at the end of .so file names.
+ # So, the library has to have a name like libtcl75.so.1.0
+
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ SunOS-5.[[0-6]])
+ # Careful to not let 5.10+ fall into this case
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Note: need the LIBS below, otherwise Tk won't find Tcl's
+ # symbols when dynamically loaded into tclsh.
+
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="$CC -shared"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ else
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ fi
+ ;;
+ SunOS-5*)
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ arch=`isainfo`
+ if test "$arch" = "sparcv9 sparc" ; then
+ if test "$GCC" = "yes" ; then
+ if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then
+ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
+ else
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+ fi
+ else
+ do64bit_ok=yes
+ if test "$do64bitVIS" = "yes" ; then
+ CFLAGS="$CFLAGS -xarch=v9a"
+ LDFLAGS="$LDFLAGS -xarch=v9a"
+ else
+ CFLAGS="$CFLAGS -xarch=v9"
+ LDFLAGS="$LDFLAGS -xarch=v9"
+ fi
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
+ fi
+ elif test "$arch" = "amd64 i386" ; then
+ if test "$GCC" = "yes" ; then
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ else
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64"
+ fi
+ else
+ AC_MSG_WARN([64bit mode not supported for $arch])
+ fi
+ fi
+
+ # Note: need the LIBS below, otherwise Tk won't find Tcl's
+ # symbols when dynamically loaded into tclsh.
+
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="$CC -shared"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$do64bit_ok" = "yes" ; then
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ fi
+ else
+ case $system in
+ SunOS-5.[[1-9]][[0-9]]*)
+ SHLIB_LD='${CC} -G -z text';;
+ *)
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text";;
+ esac
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ fi
+ ;;
+ ULTRIX-4.*)
+ SHLIB_CFLAGS="-G 0"
+ SHLIB_SUFFIX=".a"
+ SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
+ SHLIB_LD_LIBS='${LIBS}'
+ DL_OBJS="tclLoadAout.o"
+ DL_LIBS=""
+ LDFLAGS="$LDFLAGS -Wl,-D,08000000"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$GCC" != "yes" ; then
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1"
+ fi
+ ;;
+ UNIX_SV* | UnixWare-5*)
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_LD="cc -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
+ # that don't grok the -Bexport option. Test that it does.
+ AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
+ LDFLAGS=$hold_ldflags])
+ if test $tcl_cv_ld_Bexport = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ esac
+
+ if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
+ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
+ fi
+
+dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
+dnl # until the end of configure, as configure's compile and link tests use
+dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
+dnl # preprocessing tests use only CPPFLAGS.
+ SC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
+
+ # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
+ # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop,
+ # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
+ # to determine which of several header files defines the a.out file
+ # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we
+ # support only a file format that is more or less version-7-compatible.
+ # In particular,
+ # - a.out files must begin with `struct exec'.
+ # - the N_TXTOFF on the `struct exec' must compute the seek address
+ # of the text segment
+ # - The `struct exec' must contain a_magic, a_text, a_data, a_bss
+ # and a_entry fields.
+ # The following compilation should succeed if and only if either sys/exec.h
+ # or a.out.h is usable for the purpose.
+ #
+ # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
+ # `struct exec' includes a second header that contains information that
+ # duplicates the v7 fields that are needed.
+
+ if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
+ AC_CACHE_CHECK([sys/exec.h], tcl_cv_sysexec_h, [
+ AC_TRY_COMPILE([#include <sys/exec.h>],[
+ struct exec foo;
+ unsigned long seek;
+ int flag;
+#if defined(__mips) || defined(mips)
+ seek = N_TXTOFF (foo.ex_f, foo.ex_o);
+#else
+ seek = N_TXTOFF (foo);
+#endif
+ flag = (foo.a_magic == OMAGIC);
+ return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
+ ], tcl_cv_sysexec_h=usable, tcl_cv_sysexec_h=unusable)])
+ if test $tcl_cv_sysexec_h = usable; then
+ AC_DEFINE(USE_SYS_EXEC_H)
+ else
+ AC_CACHE_CHECK([a.out.h], tcl_cv_aout_h, [
+ AC_TRY_COMPILE([#include <a.out.h>],[
+ struct exec foo;
+ unsigned long seek;
+ int flag;
+#if defined(__mips) || defined(mips)
+ seek = N_TXTOFF (foo.ex_f, foo.ex_o);
+#else
+ seek = N_TXTOFF (foo);
+#endif
+ flag = (foo.a_magic == OMAGIC);
+ return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
+ ], tcl_cv_aout_h=usable, tcl_cv_aout_h=unusable)])
+ if test $tcl_cv_aout_h = usable; then
+ AC_DEFINE(USE_A_OUT_H)
+ else
+ AC_CACHE_CHECK([sys/exec_aout.h], tcl_cv_sysexecaout_h, [
+ AC_TRY_COMPILE([#include <sys/exec_aout.h>],[
+ struct exec foo;
+ unsigned long seek;
+ int flag;
+#if defined(__mips) || defined(mips)
+ seek = N_TXTOFF (foo.ex_f, foo.ex_o);
+#else
+ seek = N_TXTOFF (foo);
+#endif
+ flag = (foo.a_midmag == OMAGIC);
+ return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
+ ], tcl_cv_sysexecaout_h=usable, tcl_cv_sysexecaout_h=unusable)])
+ if test $tcl_cv_sysexecaout_h = usable; then
+ AC_DEFINE(USE_SYS_EXEC_AOUT_H)
+ else
+ DL_OBJS=""
+ fi
+ fi
+ fi
+ fi
+
+ # Step 5: disable dynamic loading if requested via a command-line switch.
+
+ AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command],
+ [tcl_ok=$enableval], [tcl_ok=yes])
+ if test "$tcl_ok" = "no"; then
+ DL_OBJS=""
+ fi
+
+ if test "x$DL_OBJS" != "x" ; then
+ BUILD_DLTEST="\$(DLTEST_TARGETS)"
+ else
+ echo "Can't figure out how to do dynamic loading or shared libraries"
+ echo "on this system."
+ SHLIB_CFLAGS=""
+ SHLIB_LD=""
+ SHLIB_SUFFIX=""
+ DL_OBJS="tclLoadNone.o"
+ DL_LIBS=""
+ LDFLAGS="$LDFLAGS_ORIG"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ BUILD_DLTEST=""
+ fi
+
+ # If we're running gcc, then change the C flags for compiling shared
+ # libraries to the right flags for gcc, instead of those for the
+ # standard manufacturer compiler.
+
+ if test "$DL_OBJS" != "tclLoadNone.o" ; then
+ if test "$GCC" = "yes" ; then
+ case $system in
+ AIX-*)
+ ;;
+ BSD/OS*)
+ ;;
+ IRIX*)
+ ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*)
+ ;;
+ Darwin-*)
+ ;;
+ RISCos-*)
+ ;;
+ SCO_SV-3.2*)
+ ;;
+ ULTRIX-4.*)
+ ;;
+ *)
+ SHLIB_CFLAGS="-fPIC"
+ ;;
+ esac
+ fi
+ fi
+
+ if test "$SHARED_LIB_SUFFIX" = "" ; then
+ SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}'
+ fi
+ if test "$UNSHARED_LIB_SUFFIX" = "" ; then
+ UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
+ fi
+
+ if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
+ LIB_SUFFIX=${SHARED_LIB_SUFFIX}
+ MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ else
+ LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
+
+ if test "$RANLIB" = "" ; then
+ MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ else
+ MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
+ fi
+
+dnl Not at all clear what this was doing in Tcl's configure.in
+dnl or why it was needed was needed. In any event, this sort of
+dnl things needs to be done in the big loop above.
+dnl REMOVE THIS BLOCK LATER! (mdejong)
+dnl case $system in
+dnl BSD/OS*)
+dnl ;;
+dnl AIX-[[1-4]].*)
+dnl ;;
+dnl *)
+dnl SHLIB_LD_LIBS=""
+dnl ;;
+dnl esac
+ fi
+
+
+ # Stub lib does not depend on shared/static configuration
+ if test "$RANLIB" = "" ; then
+ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)'
+ else
+ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))'
+ fi
+
+
+ AC_SUBST(DL_LIBS)
+
+ AC_SUBST(DL_OBJS)
+ AC_SUBST(PLAT_OBJS)
+ AC_SUBST(PLAT_SRCS)
+ AC_SUBST(CFLAGS)
+ AC_SUBST(CFLAGS_DEBUG)
+ AC_SUBST(CFLAGS_OPTIMIZE)
+ AC_SUBST(CFLAGS_WARNING)
+
+ AC_SUBST(LDFLAGS)
+ AC_SUBST(LDFLAGS_DEBUG)
+ AC_SUBST(LDFLAGS_OPTIMIZE)
+ AC_SUBST(CC_SEARCH_FLAGS)
+ AC_SUBST(LD_SEARCH_FLAGS)
+
+ AC_SUBST(STLIB_LD)
+ AC_SUBST(SHLIB_LD)
+ AC_SUBST(TCL_SHLIB_LD_EXTRAS)
+ AC_SUBST(TK_SHLIB_LD_EXTRAS)
+ AC_SUBST(SHLIB_LD_LIBS)
+ AC_SUBST(SHLIB_CFLAGS)
+ AC_SUBST(SHLIB_SUFFIX)
+
+ AC_SUBST(MAKE_LIB)
+ AC_SUBST(MAKE_STUB_LIB)
+ AC_SUBST(INSTALL_LIB)
+ AC_SUBST(INSTALL_STUB_LIB)
+ AC_SUBST(RANLIB)
+])
+
+#--------------------------------------------------------------------
+# SC_SERIAL_PORT
+#
+# Determine which interface to use to talk to the serial port.
+# Note that #include lines must begin in leftmost column for
+# some compilers to recognize them as preprocessor directives,
+# and some build environments have stdin not pointing at a
+# pseudo-terminal (usually /dev/null instead.)
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines only one of the following vars:
+# HAVE_SYS_MODEM_H
+# USE_TERMIOS
+# USE_TERMIO
+# USE_SGTTY
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_SERIAL_PORT], [
+ AC_CHECK_HEADERS(sys/modem.h)
+ AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
+ AC_TRY_RUN([
+#include <termios.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termio.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termios.h>
+#include <errno.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <termio.h>
+#include <errno.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+#include <errno.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
+ fi])
+ case $tcl_cv_api_serial in
+ termios) AC_DEFINE(USE_TERMIOS);;
+ termio) AC_DEFINE(USE_TERMIO);;
+ sgtty) AC_DEFINE(USE_SGTTY);;
+ esac
+])
+
+#--------------------------------------------------------------------
+# SC_MISSING_POSIX_HEADERS
+#
+# Supply substitutes for missing POSIX header files. Special
+# notes:
+# - stdlib.h doesn't define strtol, strtoul, or
+# strtod insome versions of SunOS
+# - some versions of string.h don't declare procedures such
+# as strstr
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# NO_DIRENT_H
+# NO_ERRNO_H
+# NO_VALUES_H
+# HAVE_LIMITS_H or NO_LIMITS_H
+# NO_STDLIB_H
+# NO_STRING_H
+# NO_SYS_WAIT_H
+# NO_DLFCN_H
+# HAVE_UNISTD_H
+# HAVE_SYS_PARAM_H
+#
+# HAVE_STRING_H ?
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_MISSING_POSIX_HEADERS], [
+ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
+ AC_TRY_LINK([#include <sys/types.h>
+#include <dirent.h>], [
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
+
+ if test $tcl_cv_dirent_h = no; then
+ AC_DEFINE(NO_DIRENT_H)
+ fi
+
+ AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)])
+ AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)])
+ AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)])
+ AC_CHECK_HEADER(limits.h,
+ [AC_DEFINE(HAVE_LIMITS_H)], [AC_DEFINE(NO_LIMITS_H)])
+ AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STDLIB_H)
+ fi
+ AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
+
+ # See also memmove check below for a place where NO_STRING_H can be
+ # set and why.
+
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STRING_H)
+ fi
+
+ AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)])
+ AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)])
+
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
+ AC_HAVE_HEADERS(unistd.h sys/param.h)
+])
+
+#--------------------------------------------------------------------
+# SC_PATH_X
+#
+# Locate the X11 header files and the X11 library archive. Try
+# the ac_path_x macro first, but if it doesn't find the X stuff
+# (e.g. because there's no xmkmf program) then check through
+# a list of possible directories. Under some conditions the
+# autoconf macro will return an include directory that contains
+# no include files, so double-check its result just to be safe.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets the the following vars:
+# XINCLUDES
+# XLIBSW
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_PATH_X], [
+ AC_PATH_X
+ not_really_there=""
+ if test "$no_x" = ""; then
+ if test "$x_includes" = ""; then
+ AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
+ else
+ if test ! -r $x_includes/X11/Intrinsic.h; then
+ not_really_there="yes"
+ fi
+ fi
+ fi
+ if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
+ AC_MSG_CHECKING([for X11 header files])
+ found_xincludes="no"
+ AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no")
+ if test "$found_xincludes" = "no"; then
+ dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
+ for i in $dirs ; do
+ if test -r $i/X11/Intrinsic.h; then
+ AC_MSG_RESULT([$i])
+ XINCLUDES=" -I$i"
+ found_xincludes="yes"
+ break
+ fi
+ done
+ fi
+ else
+ if test "$x_includes" != ""; then
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
+ fi
+ fi
+ if test found_xincludes = "no"; then
+ AC_MSG_RESULT([couldn't find any!])
+ fi
+
+ if test "$no_x" = yes; then
+ AC_MSG_CHECKING([for X11 libraries])
+ XLIBSW=nope
+ dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
+ for i in $dirs ; do
+ if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
+ AC_MSG_RESULT([$i])
+ XLIBSW="-L$i -lX11"
+ x_libraries="$i"
+ break
+ fi
+ done
+ else
+ if test "$x_libraries" = ""; then
+ XLIBSW=-lX11
+ else
+ XLIBSW="-L$x_libraries -lX11"
+ fi
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_MSG_RESULT([could not find any! Using -lX11.])
+ XLIBSW=-lX11
+ fi
+])
+
+#--------------------------------------------------------------------
+# SC_BLOCKING_STYLE
+#
+# The statements below check for systems where POSIX-style
+# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
+# On these systems (mostly older ones), use the old BSD-style
+# FIONBIO approach instead.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# HAVE_SYS_IOCTL_H
+# HAVE_SYS_FILIO_H
+# USE_FIONBIO
+# O_NONBLOCK
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_BLOCKING_STYLE], [
+ AC_CHECK_HEADERS(sys/ioctl.h)
+ AC_CHECK_HEADERS(sys/filio.h)
+ SC_CONFIG_SYSTEM
+ AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
+ case $system in
+ # There used to be code here to use FIONBIO under AIX. However, it
+ # was reported that FIONBIO doesn't work under AIX 3.2.5. Since
+ # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
+ # code (JO, 5/31/97).
+
+ OSF*)
+ AC_DEFINE(USE_FIONBIO)
+ AC_MSG_RESULT([FIONBIO])
+ ;;
+ SunOS-4*)
+ AC_DEFINE(USE_FIONBIO)
+ AC_MSG_RESULT([FIONBIO])
+ ;;
+ ULTRIX-4.*)
+ AC_DEFINE(USE_FIONBIO)
+ AC_MSG_RESULT([FIONBIO])
+ ;;
+ *)
+ AC_MSG_RESULT([O_NONBLOCK])
+ ;;
+ esac
+])
+
+#--------------------------------------------------------------------
+# SC_TIME_HANLDER
+#
+# Checks how the system deals with time.h, what time structures
+# are used on the system, and what fields the structures have.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# USE_DELTA_FOR_TZ
+# HAVE_TM_GMTOFF
+# HAVE_TM_TZADJ
+# HAVE_TIMEZONE_VAR
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TIME_HANDLER], [
+ AC_CHECK_HEADERS(sys/time.h)
+ AC_HEADER_TIME
+ AC_STRUCT_TIMEZONE
+
+ AC_CHECK_FUNCS(gmtime_r localtime_r)
+
+ AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
+ tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
+ if test $tcl_cv_member_tm_tzadj = yes ; then
+ AC_DEFINE(HAVE_TM_TZADJ)
+ fi
+
+ AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
+ tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
+ if test $tcl_cv_member_tm_gmtoff = yes ; then
+ AC_DEFINE(HAVE_TM_GMTOFF)
+ fi
+
+ #
+ # Its important to include time.h in this check, as some systems
+ # (like convex) have timezone functions, etc.
+ #
+ AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern long timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
+ if test $tcl_cv_timezone_long = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR)
+ else
+ #
+ # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
+ #
+ AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern time_t timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
+ if test $tcl_cv_timezone_time = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR)
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# SC_BUGGY_STRTOD
+#
+# Under Solaris 2.4, strtod returns the wrong value for the
+# terminating character under some conditions. Check for this
+# and if the problem exists use a substitute procedure
+# "fixstrtod" (provided by Tcl) that corrects the error.
+# Also, on Compaq's Tru64 Unix 5.0,
+# strtod(" ") returns 0.0 instead of a failure to convert.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Might defines some of the following vars:
+# strtod (=fixstrtod)
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_BUGGY_STRTOD], [
+ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
+ if test "$tcl_strtod" = 1; then
+ AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
+ AC_TRY_RUN([
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
+ }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
+ tcl_cv_strtod_buggy=buggy)])
+ if test "$tcl_cv_strtod_buggy" = buggy; then
+ LIBOBJS="$LIBOBJS fixstrtod.o"
+ AC_DEFINE(strtod, fixstrtod)
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# SC_TCL_LINK_LIBS
+#
+# Search for the libraries needed to link the Tcl shell.
+# Things like the math library (-lm) and socket stuff (-lsocket vs.
+# -lnsl) are dealt with here.
+#
+# Arguments:
+# Requires the following vars to be set in the Makefile:
+# DL_LIBS
+# LIBS
+# MATH_LIBS
+#
+# Results:
+#
+# Subst's the following var:
+# TCL_LIBS
+# MATH_LIBS
+#
+# Might append to the following vars:
+# LIBS
+#
+# Might define the following vars:
+# HAVE_NET_ERRNO_H
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_LINK_LIBS], [
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
+ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
+ AC_CHECK_HEADER(net/errno.h, [AC_DEFINE(HAVE_NET_ERRNO_H)])
+
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
+
+ tcl_checkBoth=0
+ AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
+ if test "$tcl_checkSocket" = 1; then
+ AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
+ LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
+ fi
+ AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
+ [LIBS="$LIBS -lnsl"])])
+
+ # Don't perform the eval of the libraries here because DL_LIBS
+ # won't be set until we call SC_CONFIG_CFLAGS
+
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(MATH_LIBS)
+])
+
+#--------------------------------------------------------------------
+# SC_TCL_EARLY_FLAGS
+#
+# Check for what flags are needed to be passed so the correct OS
+# features are available.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# _ISOC99_SOURCE
+# _LARGEFILE64_SOURCE
+# _LARGEFILE_SOURCE64
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_EARLY_FLAG],[
+ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
+ AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
+ AC_TRY_COMPILE([[#define ]$1[ 1
+]$2], $3,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
+ if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
+ AC_DEFINE($1)
+ tcl_flags="$tcl_flags $1"
+ fi
+])
+
+AC_DEFUN([SC_TCL_EARLY_FLAGS],[
+ AC_MSG_CHECKING([for required early compiler flags])
+ tcl_flags=""
+ SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
+ [char *p = (char *)strtoll; char *q = (char *)strtoull;])
+ SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
+ [struct stat64 buf; int i = stat64("/", &buf);])
+ SC_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
+ [char *p = (char *)open64;])
+ if test "x${tcl_flags}" = "x" ; then
+ AC_MSG_RESULT([none])
+ else
+ AC_MSG_RESULT([${tcl_flags}])
+ fi
+])
+
+#--------------------------------------------------------------------
+# SC_TCL_64BIT_FLAGS
+#
+# Check for what is defined in the way of 64-bit features.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# TCL_WIDE_INT_IS_LONG
+# TCL_WIDE_INT_TYPE
+# HAVE_STRUCT_DIRENT64
+# HAVE_STRUCT_STAT64
+# HAVE_TYPE_OFF64_T
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_64BIT_FLAGS], [
+ AC_MSG_CHECKING([for 64-bit integer type])
+ AC_CACHE_VAL(tcl_cv_type_64bit,[
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
+ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
+ tcl_type_64bit=__int64, tcl_type_64bit="long long")
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ AC_TRY_COMPILE(,[switch (0) {
+ case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
+ }],tcl_cv_type_64bit=${tcl_type_64bit})])
+ if test "${tcl_cv_type_64bit}" = none ; then
+ AC_DEFINE(TCL_WIDE_INT_IS_LONG)
+ AC_MSG_RESULT([using long])
+ else
+ AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit})
+ AC_MSG_RESULT([${tcl_cv_type_64bit}])
+
+ # Now check for auxiliary declarations
+ AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/dirent.h>],[struct dirent64 p;],
+ tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_DIRENT64)
+ fi
+
+ AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
+ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
+],
+ tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_STAT64)
+ fi
+
+ AC_CHECK_FUNCS(open64 lseek64)
+ AC_MSG_CHECKING([for off64_t])
+ AC_CACHE_VAL(tcl_cv_type_off64_t,[
+ AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
+],
+ tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
+ dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
+ dnl functions lseek64 and open64 are defined.
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+ AC_DEFINE(HAVE_TYPE_OFF64_T)
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# SC_TCL_GETHOSTBYADDR_R
+#
+# Check if we have MT-safe variant of gethostbyaddr().
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# HAVE_GETHOSTBYADDR_R
+# HAVE_GETHOSTBYADDR_R_7
+# HAVE_GETHOSTBYADDR_R_8
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
+ AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *addr;
+ int length;
+ int type;
+ struct hostent *result;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
+ &h_errnop);
+ ], tcl_cv_api_gethostbyaddr_r_7=yes, tcl_cv_api_gethostbyaddr_r_7=no)])
+ tcl_ok=$tcl_cv_api_gethostbyaddr_r_7
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_7)
+ else
+ AC_CACHE_CHECK([for gethostbyaddr_r with 8 args], tcl_cv_api_gethostbyaddr_r_8, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *addr;
+ int length;
+ int type;
+ struct hostent *result, *resultp;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
+ &resultp, &h_errnop);
+ ], tcl_cv_api_gethostbyaddr_r_8=yes, tcl_cv_api_gethostbyaddr_r_8=no)])
+ tcl_ok=$tcl_cv_api_gethostbyaddr_r_8
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_8)
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R)
+ fi
+])])
+
+#--------------------------------------------------------------------
+# SC_TCL_GETHOSTBYNAME_R
+#
+# Check to see what variant of gethostbyname_r() we have.
+# Based on David Arnold's example from the comp.programming.threads
+# FAQ Q213
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# HAVE_GETHOSTBYADDR_R
+# HAVE_GETHOSTBYADDR_R_3
+# HAVE_GETHOSTBYADDR_R_5
+# HAVE_GETHOSTBYADDR_R_6
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
+ AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *name;
+ struct hostent *he, *res;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
+ ], tcl_cv_api_gethostbyname_r_6=yes, tcl_cv_api_gethostbyname_r_6=no)])
+ tcl_ok=$tcl_cv_api_gethostbyname_r_6
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_6)
+ else
+ AC_CACHE_CHECK([for gethostbyname_r with 5 args], tcl_cv_api_gethostbyname_r_5, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *name;
+ struct hostent *he;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
+ ], tcl_cv_api_gethostbyname_r_5=yes, tcl_cv_api_gethostbyname_r_5=no)])
+ tcl_ok=$tcl_cv_api_gethostbyname_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
+ else
+ AC_CACHE_CHECK([for gethostbyname_r with 3 args], tcl_cv_api_gethostbyname_r_3, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *name;
+ struct hostent *he;
+ struct hostent_data data;
+
+ (void) gethostbyname_r(name, he, &data);
+ ], tcl_cv_api_gethostbyname_r_3=yes, tcl_cv_api_gethostbyname_r_3=no)])
+ tcl_ok=$tcl_cv_api_gethostbyname_r_3
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
+ fi
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ fi
+])])
+
+#--------------------------------------------------------------------
+# SC_TCL_GETPWUID_R
+#
+# Check if we have MT-safe variant of getpwuid() and if yes,
+# which one exactly.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# HAVE_GETPWUID_R
+# HAVE_GETPWUID_R_4
+# HAVE_GETPWUID_R_5
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [
+ AC_CACHE_CHECK([for getpwuid_r with 5 args], tcl_cv_api_getpwuid_r_5, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <pwd.h>
+ ], [
+ uid_t uid;
+ struct passwd pw, *pwp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
+ ], tcl_cv_api_getpwuid_r_5=yes, tcl_cv_api_getpwuid_r_5=no)])
+ tcl_ok=$tcl_cv_api_getpwuid_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWUID_R_5)
+ else
+ AC_CACHE_CHECK([for getpwuid_r with 4 args], tcl_cv_api_getpwuid_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <pwd.h>
+ ], [
+ uid_t uid;
+ struct passwd pw;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getpwnam_r(uid, &pw, buf, buflen);
+ ], tcl_cv_api_getpwuid_r_4=yes, tcl_cv_api_getpwuid_r_4=no)])
+ tcl_ok=$tcl_cv_api_getpwuid_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWUID_R_4)
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWUID_R)
+ fi
+])])
+
+#--------------------------------------------------------------------
+# SC_TCL_GETPWNAM_R
+#
+# Check if we have MT-safe variant of getpwnam() and if yes,
+# which one exactly.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# HAVE_GETPWNAM_R
+# HAVE_GETPWNAM_R_4
+# HAVE_GETPWNAM_R_5
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [
+ AC_CACHE_CHECK([for getpwnam_r with 5 args], tcl_cv_api_getpwnam_r_5, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <pwd.h>
+ ], [
+ char *name;
+ struct passwd pw, *pwp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
+ ], tcl_cv_api_getpwnam_r_5=yes, tcl_cv_api_getpwnam_r_5=no)])
+ tcl_ok=$tcl_cv_api_getpwnam_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWNAM_R_5)
+ else
+ AC_CACHE_CHECK([for getpwnam_r with 4 args], tcl_cv_api_getpwnam_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <pwd.h>
+ ], [
+ char *name;
+ struct passwd pw;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getpwnam_r(name, &pw, buf, buflen);
+ ], tcl_cv_api_getpwnam_r_4=yes, tcl_cv_api_getpwnam_r_4=no)])
+ tcl_ok=$tcl_cv_api_getpwnam_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWNAM_R_4)
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWNAM_R)
+ fi
+])])
+
+#--------------------------------------------------------------------
+# SC_TCL_GETGRGID_R
+#
+# Check if we have MT-safe variant of getgrgid() and if yes,
+# which one exactly.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# HAVE_GETGRGID_R
+# HAVE_GETGRGID_R_4
+# HAVE_GETGRGID_R_5
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [
+ AC_CACHE_CHECK([for getgrgid_r with 5 args], tcl_cv_api_getgrgid_r_5, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <grp.h>
+ ], [
+ gid_t gid;
+ struct group gr, *grp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
+ ], tcl_cv_api_getgrgid_r_5=yes, tcl_cv_api_getgrgid_r_5=no)])
+ tcl_ok=$tcl_cv_api_getgrgid_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRGID_R_5)
+ else
+ AC_CACHE_CHECK([for getgrgid_r with 4 args], tcl_cv_api_getgrgid_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <grp.h>
+ ], [
+ gid_t gid;
+ struct group gr;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getgrgid_r(gid, &gr, buf, buflen);
+ ], tcl_cv_api_getgrgid_r_4=yes, tcl_cv_api_getgrgid_r_4=no)])
+ tcl_ok=$tcl_cv_api_getgrgid_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRGID_R_4)
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRGID_R)
+ fi
+])])
+
+#--------------------------------------------------------------------
+# SC_TCL_GETGRNAM_R
+#
+# Check if we have MT-safe variant of getgrnam() and if yes,
+# which one exactly.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# HAVE_GETGRNAM_R
+# HAVE_GETGRNAM_R_4
+# HAVE_GETGRNAM_R_5
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [
+ AC_CACHE_CHECK([for getgrnam_r with 5 args], tcl_cv_api_getgrnam_r_5, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <grp.h>
+ ], [
+ char *name;
+ struct group gr, *grp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getgrnam_r(name, &gr, buf, buflen, &grp);
+ ], tcl_cv_api_getgrnam_r_5=yes, tcl_cv_api_getgrnam_r_5=no)])
+ tcl_ok=$tcl_cv_api_getgrnam_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRNAM_R_5)
+ else
+ AC_CACHE_CHECK([for getgrnam_r with 4 args], tcl_cv_api_getgrnam_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <grp.h>
+ ], [
+ char *name;
+ struct group gr;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getgrnam_r(name, &gr, buf, buflen);
+ ], tcl_cv_api_getgrnam_r_4=yes, tcl_cv_api_getgrnam_r_4=no)])
+ tcl_ok=$tcl_cv_api_getgrnam_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRNAM_R_4)
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRNAM_R)
+ fi
+])])
+
+#--------------------------------------------------------------------
+# SC_CONFIG_COMMANDS_PRE(CMDS)
+#
+# Replacement for autoconf 2.5x AC_COMMANDS_PRE:
+# Commands to run right before config.status is
+# created. Accumulates.
+#
+# Requires presence of SC_OUTPUT_COMMANDS_PRE at the end
+# of configure.in (right before AC_OUTPUT).
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_CONFIG_COMMANDS_PRE], [
+ define([SC_OUTPUT_COMMANDS_PRE], defn([SC_OUTPUT_COMMANDS_PRE])[$1
+])])
+AC_DEFUN([SC_OUTPUT_COMMANDS_PRE])
+
diff --git a/configure b/configure
index 1c190078943..797cfcf5562 100755
--- a/configure
+++ b/configure
@@ -2844,10 +2844,18 @@ fi
# without overflowing the jump tables (-J says to use a 32 bit table)
tentative_cc="cc -J"
;;
- *-hp-hpux*)
+ hppa*-hp-hpux10*)
tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa-hpux10"
;;
- *-*-hiux*)
+ hppa*-hp-hpux* | hppa*-*-hiux*)
+ tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa"
+ ;;
+ hppa*-*)
+ host_makefile_frag="config/mh-pa"
+ ;;
+ *-hp-hpux* | *-*-hiux*)
tentative_cc="cc -Wp,-H256000"
;;
rs6000-*-lynxos*)
diff --git a/configure.ac b/configure.ac
index b7fb222298d..dc9ffacf7c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1067,10 +1067,18 @@ case "${host}" in
# without overflowing the jump tables (-J says to use a 32 bit table)
tentative_cc="cc -J"
;;
- *-hp-hpux*)
+ hppa*-hp-hpux10*)
tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa-hpux10"
;;
- *-*-hiux*)
+ hppa*-hp-hpux* | hppa*-*-hiux*)
+ tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa"
+ ;;
+ hppa*-*)
+ host_makefile_frag="config/mh-pa"
+ ;;
+ *-hp-hpux* | *-*-hiux*)
tentative_cc="cc -Wp,-H256000"
;;
rs6000-*-lynxos*)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 406234289ea..bc455ab423f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,257 @@
+2008-07-30 Joey Ye <joey.ye@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * builtins.c (expand_builtin_setjmp_receiver): Replace
+ virtual_incoming_args_rtx with crtl->args.internal_arg_pointer.
+ (expand_builtin_apply_args_1): Likewise.
+ (expand_builtin_longjmp): Need DRAP for stack alignment.
+ (expand_builtin_apply): Likewise.
+
+ * caller-save.c (setup_save_areas): Call assign_stack_local_1
+ instead of assign_stack_local to allow alignment reduction.
+
+ * calls.c (emit_call_1): Need DRAP for stack alignment if
+ return pops.
+ (expand_call): Replace virtual_incoming_args_rtx with
+ crtl->args.internal_arg_pointer.
+ * stmt.c (expand_nl_goto_receiver): Likewise.
+
+ * cfgexpand.c (get_decl_align_unit): Estimate stack variable
+ alignment and store to stack_alignment_estimated and
+ max_used_stack_slot_alignment.
+ (expand_one_var): Likewise.
+ (expand_stack_alignment): New function.
+ (tree_expand_cfg): Initialize max_used_stack_slot_alignment
+ and stack_alignment_estimated fields in rtl_data. Call
+ expand_stack_alignment at end.
+
+ * defaults.h (INCOMING_STACK_BOUNDARY): New.
+ (MAX_STACK_ALIGNMENT): Likewise.
+ (MAX_SUPPORTED_STACK_ALIGNMENT): Likewise.
+ (SUPPORTS_STACK_ALIGNMENT): Likewise.
+
+ * emit-rtl.c (gen_reg_rtx): Estimate stack alignment for
+ stack alignment when generating virtual registers.
+
+ * function.c (assign_stack_local): Renamed to ...
+ (assign_stack_local_1): This. Add a parameter to indicate
+ if it is OK to reduce alignment.
+ (assign_stack_local): Use it.
+ (instantiate_new_reg): Instantiate virtual incoming args rtx
+ to vDRAP if stack realignment and DRAP is needed.
+ (assign_parms): Collect parameter/return type alignment and
+ contribute to stack_alignment_estimated.
+ (locate_and_pad_parm): Likewise.
+ (get_arg_pointer_save_area): Replace virtual_incoming_args_rtx
+ with crtl->args.internal_arg_pointer.
+
+ * function.h (rtl_data): Add new field drap_reg,
+ max_used_stack_slot_alignment, stack_alignment_estimated,
+ stack_realign_needed, need_drap, stack_realign_processed and
+ stack_realign_finalized.
+ (stack_realign_fp): New macro.
+ (stack_realign_drap): Likewise.
+
+ * global.c (compute_regsets): Frame pointer is needed when
+ stack is realigned. Can eliminate frame pointer when stack is
+ realigned and dynamic realigned argument pointer isn't used.
+
+ * reload1.c (update_eliminables): Frame pointer is needed
+ when stack is realigned.
+ (init_elim_table): Can eliminate frame pointer when stack is
+ realigned and dynamic realigned argument pointer isn't used.
+
+ * rtl.h (assign_stack_local_1): Declare new funtion.
+
+ * target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New.
+ (TARGET_GET_DRAP_RTX): Likewise.
+ (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and
+ TARGET_GET_DRAP_RTX.
+
+ * target.h (gcc_target): Add update_stack_boundary and
+ get_drap_rtx.
+
+ * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace
+ STACK_BOUNDARY with MAX_STACK_ALIGNMENT.
+
+2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg,
+ vdrap_reg, stack_realign and drap_reg_saved.
+ (add_cfi): Don't allow redefining CFA when DRAP is used.
+ (reg_save): Handle stack alignment.
+ (dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack
+ alignment. Don't generate DWARF information for (set fp sp)
+ when DRAP is used.
+ (dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg
+ to INVALID_REGNUM.
+ (int_loc_descriptor): Move prototype forward. Also define if
+ DWARF2_UNWIND_INFO is true.
+ (output_cfa_loc): Handle DW_CFA_expression.
+ (build_cfa_aligned_loc): New.
+ (based_loc_descr): Update assert for stack realign. For local
+ variables, use sp+offset when stack is aligned without drap and
+ fp+offset when stack is aligned with drap. For arguments, use
+ cfa+offset when drap is used to align stack.
+
+2008-07-30 Joey Ye <joey.ye@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_force_align_arg_pointer_string):
+ Break long line.
+ (ix86_gen_andsp): New.
+ (ix86_user_incoming_stack_boundary): Likewise.
+ (ix86_default_incoming_stack_boundary): Likewise.
+ (ix86_incoming_stack_boundary): Likewise.
+ (ix86_can_eliminate): Likewise.
+ (find_drap_reg): Likewise.
+ (ix86_update_stack_boundary): Likewise.
+ (ix86_get_drap_rtx): Likewise.
+ (ix86_finalize_stack_realign_flags): Likewise.
+ (TARGET_UPDATE_STACK_BOUNDARY): Likewise.
+ (TARGET_GET_DRAP_RTX): Likewise.
+ (override_options): Overide option value for new options.
+ (ix86_function_ok_for_sibcall): Remove check for
+ force_align_arg_pointer.
+ (ix86_handle_cconv_attribute): Likewise.
+ (ix86_function_regparm): Likewise.
+ (setup_incoming_varargs_64): Don't set stack_alignment_needed
+ here.
+ (ix86_va_start): Replace virtual_incoming_args_rtx with
+ crtl->args.internal_arg_pointer.
+ (ix86_select_alt_pic_regnum): Check DRAP register.
+ (ix86_save_reg): Replace force_align_arg_pointer with drap_reg.
+ (ix86_compute_frame_layout): Compute frame layout wrt stack
+ realignment.
+ (ix86_internal_arg_pointer): Just return
+ virtual_incoming_args_rtx.
+ (ix86_expand_prologue): Decide if stack realignment is needed
+ and generate prologue code accordingly.
+ (ix86_expand_epilogue): Generate epilogue code wrt stack
+ realignment is really needed or not.
+
+ * config/i386/i386.h (MAIN_STACK_BOUNDARY): New.
+ (ABI_STACK_BOUNDARY): Likewise.
+ (PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise.
+ (STACK_REALIGN_DEFAULT): Likewise.
+ (INCOMING_STACK_BOUNDARY): Likewise.
+ (MAX_STACK_ALIGNMENT): Likewise.
+ (ix86_incoming_stack_boundary): Likewise.
+ (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed.
+ (REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG.
+ (CAN_ELIMINATE): Defined with ix86_can_eliminate.
+ (machine_function): Remove force_align_arg_pointer.
+
+ * config/i386/i386.md (BX_REG): New.
+ (R13_REG): Likewise.
+
+ * config/i386/i386.opt (mforce_drap): New.
+ (mincoming-stack-boundary): Likewise.
+ (mstackrealign): Add Init(-1).
+
+ * config/i386/i386-protos.h (ix86_can_eliminate): New
+
+2008-07-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * doc/extend.texi: Update force_align_arg_pointer.
+
+ * doc/invoke.texi: Document -mincoming-stack-boundary. Update
+ -mstackrealign.
+
+ * doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro.
+ (INCOMING_STACK_BOUNDARY): Likewise.
+ (TARGET_UPDATE_STACK_BOUNDARY): New target hook.
+ (TARGET_GET_DRAP_RTX): Likewise.
+
+2008-07-30 Andreas Schwab <schwab@suse.de>
+
+ PR rtl-optimization/36929
+ * dse.c (replace_inc_dec): Use emit_insn_before instead of
+ add_insn_before and fix argument order.
+ (replace_inc_dec_mem): Handle NULL rtx.
+
+2008-07-30 Andrew Jenner <andrew@codesourcery.com>
+
+ * config/arm/arm.c (arm_compute_static_chain_stack_bytes): New
+ function.
+ (arm_compute_initial_elimination_offset): Use it.
+ (arm_compute_save_reg_mask): Include static chain save slot when
+ calculating alignment.
+ (arm_get_frame_offsets): Ditto.
+ (thumb1_compute_save_reg_mask): Ensure we have a low register saved
+ that we can use to decrement the stack when the stack decrement
+ could be too big for an immediate value in a single insn.
+ (thumb1_expand_prologue): Avoid using r12 for stack decrement.
+
+2008-07-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36967
+ * tree-predcom.c (remove_stmt): Use gimple_assign_ssa_name_copy_p.
+ Release defs of statements we remove.
+
+2008-07-30 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/arm/arm.c (arm_expand_prologue): Use 0-length rtvec
+ instead of NULL_RTVEC.
+
+2008-07-30 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR target/35866
+
+ * config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Add clause for
+ vector modes.
+
+2008-07-30 Rafael Avila de Espindola <espindola@google.com>
+
+ * final.c (call_from_call_insn): New.
+ (final_scan_insn): Call assemble_external on FUNCTION_DECLs.
+
+2008-07-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac: Substitute ADA_CFLAGS.
+ * configure: Regenerate.
+ * config.host: Remove mention of pa/x-ada and pa/x-ada-hpux10 files.
+ * Makefile.in: Remove mention of X_* variables.
+ * config/pa/x-ada-hpux10: Remove.
+ * config/pa/x-ada: Remove.
+
+ * doc/fragments.texi: Update.
+
+2008-07-30 Olivier Hainque <hainque@adacore.com>
+
+ * config/mips/irix-crti.asm: .hide __gcc_init and __gcc_fini.
+ * config/mips/iris6.h (IRIX_SUBTARGET_LINK_SPEC, irix ld): Hide
+ __dso_handle explicitly here.
+
+2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34389
+ * c-typeck.c (build_binary_op): Encapsulate code into...
+ * c-common.c (shorten_binary_op): ...this new function.
+ (conversion_warning): Use the new function. Handle non-negative
+ constant in bitwise-and.
+ * c-common.h (shorten_binary_op): Declare.
+
+2008-07-30 Olivier Hainque <hainque@adacore.com>
+
+ * scan.c (make_sstring_space): Add explicit conversions of
+ allocator's return value.
+ * fix-header.c (recognized_function): Likewise.
+
+2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/cpp.texi: Update to GFDL 1.2.
+ * doc/gcc.texi: Do not list GPL as Invariant Section.
+ * doc/gccint.texi: Likewise. Update copyright years.
+ * doc/install.texi: Update copyright years.
+
+2008-07-30 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/36955
+ * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Add
+ a use of pic_offset_table_rtx for -msecure-plt __tls_get_addr calls.
+
2008-07-29 Jan Hubicka <jh@suse.cz>
* c-decl.c (merge_decls): Do not handle DECL_INLINE.
@@ -69,7 +323,7 @@
PR 34985
* c-decl.c (merge_decls): Merge USED flags.
-
+
2008-07-29 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_gimplify_va_arg_expr): Unshare the addr,
@@ -337,7 +591,7 @@
(is_ctor_dtor): Return symkind instead of int. Adjust prototype,
code and head comment accordingly.
(scan_prog_file): Use symkind names instead of bare integers.
-
+
2008-07-25 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on DECL_INLINE.
@@ -346,7 +600,7 @@
* dojump.c (clear_pending_stack_adjust): Likewise.
* print-tree.c (print_node): Ignore DECL_INLINE.
* tree-inline.c (inlinable_function_p): Likewise.
-
+
2008-07-25 Michael Meissner <gnu@the-meissners.org>
* doc/extend.texi (hot attribute): Document that the hot attribute
@@ -440,7 +694,7 @@
(cgraph_gate_early_inlining): Likewise.
(gate_inline_passes): Remove.
(pass_inline_parameters, pass_ipa_inline): Remove gates.
- (cgraph_gate_O0_always_inline, cgraph_O0_always_inline,
+ (cgraph_gate_O0_always_inline, cgraph_O0_always_inline,
pass_O0_always_inline): Remove.
* c-pch.c (c_pch_matching): Remove -funit-at-a-time.
* dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check.
@@ -495,7 +749,7 @@
* config/i386/i386.c (get_dllimport_decl): Treat user_label_prefix for
imp symbol extension.
- 2008-07-23 Ian Lance Taylor <iant@google.com>
+ 2008-07-23 Ian Lance Taylor <iant@google.com>
* tree-vrp.c (infer_value_range): Ignore asm statements when
looking for memory accesses for -fdelete-null-pointer-checks.
@@ -522,10 +776,10 @@
2008-07-23 Martin Jambor <mjambor@suse.cz>
- * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed
+ * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed
rather than for DECL_SAVED_TREE.
* ipa-prop.c: Include diagnostic.h.
- (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs
+ (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs
thoroughly.
(ipa_detect_param_modifications): Function rewritten from scratch.
(ipa_compute_jump_functions): Changed accesses to modification flags.
@@ -533,9 +787,9 @@
(ipa_node_duplication_hook): Update flags duplication.
(ipa_print_all_params_modified): Updated flag access.
* ipa-prop.h (struct ipa_param_flags): New structure.
- (struct ipa_node_params): New field modification_analysis_done,
- modified_flags changed into param_flags.
- (ipa_is_ith_param_modified): Changed to use new flags.
+ (struct ipa_node_params): New field modification_analysis_done,
+ modified_flags changed into param_flags.
+ (ipa_is_ith_param_modified): Changed to use new flags.
* Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies.
* ipa-prop.c (ipa_print_all_jump_functions): Moved here from
@@ -564,18 +818,18 @@
* doc/invoke.texi (Optimize options): Add description of
-findirect-inlining.
* common.opt (flag_indirect_inlining): New flag.
- * opts.c (decode_options): Set flag_indirect_inlining when
+ * opts.c (decode_options): Set flag_indirect_inlining when
optimize >= 3.
* ipa-inline.c: Include ipa-prop.h.
(inline_indirect_intraprocedural_analysis): New function.
(inline_generate_summary): Allocate parameter and argument info
structures, call inline_indirect_intraprocedural_analysis on each
- node when doing indirect inlining and deallocate indirect inlining
+ node when doing indirect inlining and deallocate indirect inlining
data structures in the end.
* ipa-prop.c (ipa_create_param_decls_array): Return if already done.
(free_all_ipa_structures_after_iinln): New function.
- (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be
+ (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be
done.
* Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies.
@@ -584,7 +838,7 @@
of computing the frequency separately.
(rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead
of computing the frequency separately.
- * ipa-cp.c (ipcp_print_all_structures): Replace a call to
+ * ipa-cp.c (ipcp_print_all_structures): Replace a call to
ipa_print_all_param_modified with a call to ipa_print_all_param_flags.
* ipa-prop.c (ipa_get_member_ptr_load_param): New function.
(ipa_get_stmt_member_ptr_load_param): New function.
@@ -646,7 +900,7 @@
* testsuite/g++.dg/ipa/iinline-1.C: New testcase.
* testsuite/gcc.dg/ipa/iinline-1.c: New testcase.
* testsuite/gcc.dg/ipa/modif-1.c: New testcase.
-
+
2008-07-23 Michael Meissner <gnu@the-meissners.org>
PR 36907
@@ -673,7 +927,7 @@
* c-typeck.c: All calls to pedwarn changed.
* c-common.c: All calls to pedwarn changed.
* c-parser.c: All calls to pedwarn changed.
-
+
2008-07-23 Michael Meissner <gnu@the-meissners.org>
Karthik Kumar <karthikkumar@gmail.com>
@@ -1140,7 +1394,7 @@
PR tree-opt/36879
* tree-switch-conversion.c (build_one_array): Call
- varpool_mark_needed_node and varpool_finalize_decl
+ varpool_mark_needed_node and varpool_finalize_decl
instead of assemble_variable.
2008-07-19 Jan Hubicka <jh@suse.cz>
@@ -1231,7 +1485,7 @@
(gen_array_type_die): Factorize comments about the MIPS_DEBUG_INFO
issues, centralize the nested array types collapsing control and
disable the transformation for Ada.
-
+
2008-07-18 Uros Bizjak <ubizjak@gmail.com>
PR target/36786
@@ -1423,10 +1677,10 @@
* config/sh/sh.md (symGOT_load): Don't add REG_EQUAL note.
2008-07-15 Bob Wilson <bob.wilson@acm.org>
-
+
* config/xtensa/libgcc-xtensa.ver: New file.
* config/xtensa/t-linux (SHLIB_MAPFILES): Append libgcc-xtensa.ver.
-
+
2008-07-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* df-problems.c (df_set_note): Avoid C++ keywords.
@@ -1678,7 +1932,7 @@
* config/h8300/h8300.md (length): Fix branch offset limit.
-2008-07-11 Anatoly Sokolov <aesok@post.ru>
+2008-07-11 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr-protos.h (avr_peep2_scratch_safe): Remove prototype.
* config/avr/avr.c (avr_peep2_scratch_safe): Remove.
@@ -1817,7 +2071,7 @@
callers.
* omp-low.c (lower_omp_sections, lower_omp_single, lower_omp_master,
lower_omp_ordered, lower_omp_critical, lower_omp_for,
- create_task_copyfn, lower_omp_taskreg, execute_lower_omp):
+ create_task_copyfn, lower_omp_taskreg, execute_lower_omp):
* tree-ssa-ccp.c (convert_to_gimple_builtin): Likewise.
* tree-sra.c (generate_element_init): Likewise.
* tree-mudflap.c (execute_mudflap_function_ops,
@@ -1926,7 +2180,7 @@
* tree-sra.c (sra_build_assignment): Handle CONVERT_EXPR_P dst.
2008-07-05 Daniel Berlin <dberlin@dberlin.org>
-
+
Fix PR tree-optimization/23455
Fix PR tree-optimization/35286
Fix PR tree-optimization/35287
@@ -1979,7 +2233,7 @@
(vn_nary_op_compute_hash): De-staticify.
(vn_nary_op_eq): Ditto.
(vn_nary_op_lookup_pieces): New function.
- (vn_nary_op_lookup): Add new argument.
+ (vn_nary_op_lookup): Add new argument.
(vn_nary_op_insert_pieces): New function.
(vn_nary_op_insert): Add return type. Modify to deal with value ids.
(vn_phi_insert): Ditto.
@@ -1988,7 +2242,7 @@
(visit_reference_op_load): Ditto.
(visit_reference_op_store): Ditto.
(init_scc_vn): Init next_value_id, constant_to_value_id and
- constant_value_ids.
+ constant_value_ids.
(free_scc_vn): Free them.
(set_hashtable_value_ids): New function.
(run_scc_vn): Use it.
@@ -2001,7 +2255,7 @@
above).
* tree.c (iterative_hash_hashval_t): Made non-static
* tree.h (iterative_hash_hashval_t): Declare it.
-
+
2008-07-08 Martin Jambor <mjambor@suse.cz>
* ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params
@@ -2033,7 +2287,7 @@
(ipa_register_cgraph_hooks): New function.
(ipa_unregister_cgraph_hooks): New function.
(free_all_ipa_structures_after_ipa_cp): New function.
-
+
* ipa-prop.h: Include vec.h.
(ipa_node_params_t): New typedef with vector types for it.
(ipa_edge_args_t): New typedef with vector types for it.
@@ -2041,10 +2295,10 @@
(IPA_EDGE_REF): Changed to access an on-the-side vector.
(ipa_check_create_node_params): New function.
(ipa_check_create_edge_args): New function.
-
+
* Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted
all users.
-
+
2008-07-07 Tom Tromey <tromey@redhat.com>
* configure, config.in: Rebuilt.
@@ -2127,7 +2381,7 @@
-print-sysroot option.
(main): Print the sysroot if requested.
* doc/invoke.texi (Debugging Options): Document -print-sysroot.
-
+
2008-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR target/34780
@@ -2180,7 +2434,7 @@
2008-07-07 Maxim Kuvyrkov <maxim@codesourcery.com>
* config/m68k/m68k.c (m68k_return_in_memory): Fix arguments types.
-
+
2008-07-07 Mark Shinwell <shinwell@codesourcery.com>
* config/m68k/lb1sf68.asm: Add PIC macros for Linux targets.
@@ -2578,7 +2832,7 @@
2008-07-02 Martin Jambor <mjambor@suse.cz>
* tree-switch-conversion.c: Included timevar.h which I forgot before.
-
+
2008-07-02 Martin Jambor <mjambor@suse.cz>
* tree-switch-conversion.c: Included timevar.h
@@ -2706,7 +2960,7 @@
2008-06-30 Kenneth Zadeck <zadeck@naturalbridge.com>
* ifcvt.c (cond_move_process_if_block): Free vectors on false return.
-
+
2008-06-30 Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/34744
@@ -2735,7 +2989,7 @@
(ix86_init_builtins): Here.
(ix86_scalar_mode_supported_p): Always return true for TFmode.
(ix86_c_mode_for_suffix): Always return TFmode and XFmode for
- 'q' and 'w', respectively.
+ 'q' and 'w', respectively.
* config/i386/i386.md (movtf): Check TARGET_SSE2 instead of
TARGET_64BIT.
@@ -3619,7 +3873,7 @@
2008-06-22 Andy Hutchinson <hutchinsonandy@aim.com>
* config/avr/avr.h (SUPPORTS_INIT_PRIORITY): Define.
-
+
2008-06-22 Laurynas Biveinis <laurynas.biveinis@gmail.com>
PR middle-end/34906
@@ -3767,7 +4021,7 @@
* tree-ssa-loop-im.c (mem_ref_in_stmt, memref_hash, memref_eq,
memref_free, gather_mem_refs_stmt, vtoe_hash, vtoe_eq, vtoe_free,
record_vop_access, get_vop_accesses, get_vop_stores): Likewise.
- * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise.
+ * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise.
* tree-ssa-sccvn.c (VN_INFO_GET, free_phi, free_reference,
vn_nary_op_insert): Likewise.
* tree-ssa.c (redirect_edge_var_map_add,
@@ -4093,20 +4347,20 @@
2008-06-17 Eric B. Weddington <eric.weddington@atmel.com>
* config/avr/avr.c (avr_mcu_t): Remove atmega32hvb.
- * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
+ * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-17 Eric B. Weddington <eric.weddington@atmel.com>
* config/avr/avr.c (avr_mcu_t): Add attiny167.
- * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * gcc/config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
+ * gcc/config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-17 Eric B. Weddington <eric.weddington@atmel.com>
* config/avr/avr.c (avr_mcu_t): Add atmega32u4.
- * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
+ * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-17 Bernhard Fischer <aldot@gcc.gnu.org>
@@ -4167,7 +4421,7 @@
(delete_unmarked_insns): Don't handle libcall blocks.
(preserve_libcall_for_dce): Remove.
(prescan_insns_for_dce): Don't special-case libcall block insns.
- * reload1 (reload): Don't handle libcall notes.
+ * reload1 (reload): Don't handle libcall notes.
* doc/rtl.texi (REG_LIBCALL, REG_RETVAL, REG_LIBCALL_ID): Remove
documentation.
@@ -4181,7 +4435,7 @@
* config/avr/avr.c (avr_mcu_t): Add atmega32m1.
* config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
@@ -4202,7 +4456,7 @@
2008-06-015 Andy Hutchinson <hutchinsonandy@aim.com>
PR target/36336
- * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for
+ * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for
reg_equiv_constant.
2008-06-15 Maxim Kuvyrkov <maxim@codesourcery.com>
@@ -4278,7 +4532,7 @@
Nathan Sidwell <nathan@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
-
+
* config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes.
* config/mips/mips-protos.h (mips_expand_vector_init): New.
* config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F
@@ -4581,7 +4835,7 @@
2008-06-09 Andy Hutchinson <hutchinsonandy@aim.com>
PR middle-end/36447
- * simplify-rtx.c (simplify_subreg): Add check for shift count
+ * simplify-rtx.c (simplify_subreg): Add check for shift count
greater than size.
2008-06-09 Richard Sandiford <rdsandiford@googlemail.com>
@@ -4696,7 +4950,7 @@
* doc/invoke.texi (Wenum-compare): Mention that it is enabled by
default.
-
+
2008-06-08 Joseph Myers <joseph@codesourcery.com>
PR tree-optimization/36218
@@ -4710,8 +4964,8 @@
PR target/36424
* config/avr/avr.h (HARD_REGNO_RENAME_OK): Define.
- * config/avr/avr.c (avr_hard_regno_rename_ok): New function.
- * config/avr/avr-protos.h (avr_hard_regno_rename_ok): New prototype.
+ * config/avr/avr.c (avr_hard_regno_rename_ok): New function.
+ * config/avr/avr-protos.h (avr_hard_regno_rename_ok): New prototype.
2008-06-07 Danny Smith <dannysmith@users.sourceforge.net>
@@ -5039,7 +5293,7 @@
Rename parallel_nesting_level to taskreg_nesting_level.
(scan_omp_task): New function.
(lower_rec_input_clauses): Don't run constructors for firstprivate
- explicit task vars which are initialized by *_omp_cpyfn*.
+ explicit task vars which are initialized by *_omp_cpyfn*.
Pass outer var ref to omp_clause_default_ctor hook if
OMP_CLAUSE_PRIVATE_OUTER_REF or OMP_CLAUSE_LASTPRIVATE.
Replace OMP_CLAUSE_REDUCTION_PLACEHOLDER decls in
@@ -5313,11 +5567,11 @@
PR target/30243
* builtins.c (expand_builtin_signbit): Don't take lowpart when
- register is already smaller or equal to required mode.
+ register is already smaller or equal to required mode.
2008-06-04 Xinliang David Li <davidxl@google.com>
- * tree-call-cdce.c: New file.
+ * tree-call-cdce.c: New file.
(cond_dead_built_in_calls): New static variable.
(input_domain): New struct.
(check_pow): New function.
@@ -5492,7 +5746,7 @@
* config/i386/mingw32.h (EXTRA_OS_CPP_BUILTINS): Replace
TARGET_64BIT_MS_ABI by DEFAULT_ABI compare to MS_ABI.
-2008-06-02 Andy Hutchinson <hutchinsonandy@aim.com>
+2008-06-02 Andy Hutchinson <hutchinsonandy@aim.com>
PR target/34879
* config/avr/avr.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Redefine.
@@ -5628,10 +5882,10 @@
* config/avr/avr.md (UNSPECV_WRITE_SP_IRQ_ON): New constants.
(UNSPECV_WRITE_SP_IRQ_OFF): (Ditto.).
(movhi_sp_r_irq_off, movhi_sp_r_irq_on): New insn.
- * config/avr/avr.c (expand_prologue, expand_epilogue): Use
- movhi_sp_r_irq_off and movhi_sp_r_irq_on insns for writing to the
+ * config/avr/avr.c (expand_prologue, expand_epilogue): Use
+ movhi_sp_r_irq_off and movhi_sp_r_irq_on insns for writing to the
stack pointer register.
- (output_movhi): Remove code for interrupt specific writing to the
+ (output_movhi): Remove code for interrupt specific writing to the
stack pointer register.
2008-05-31 Richard Guenther <rguenther@suse.de>
@@ -5760,7 +6014,7 @@
call clobber check for NMTs.
2008-05-28 Seongbae Park <seongbae.park@gmail.com>
-
+
* value-prof.c (tree_ic_transform): Use HOST_WIDEST_INT_PRINT_DEC
for printing gcov_type.
@@ -5998,9 +6252,9 @@
that the bitfield is of integral type before testing its precision.
2008-05-27 Trevor Smigiel <trevor_smigiel@playstation.sony.com>
- Sa Liu <saliu@de.ibm.com>
+ Sa Liu <saliu@de.ibm.com>
- * config/spu/spu.c (spu_init_libfuncs): Add __multi3, __divti3,
+ * config/spu/spu.c (spu_init_libfuncs): Add __multi3, __divti3,
__modti3, __udivti3, __umodti3 and __udivmodti4.
* config/spu/t-spu-elf (LIB2FUNCS_STATIC_EXTRA): Add files
that implement TImode mul and div functions.
@@ -6039,7 +6293,7 @@
* config/avr/avr.md ("call_prologue_saves"): Use hi8(gs())/lo8(gs())
instead of pm_lo8/pm_hi8 to makes this call working on avr6.
- * config/avr/avr.c (expand_prologue): Tune "call_prologue"
+ * config/avr/avr.c (expand_prologue): Tune "call_prologue"
optimization for 'avr6' architecture.
2008-05-26 Andy Hutchinson <hutchinsonandy@aim.com>
@@ -6577,7 +6831,7 @@
* tree-data-ref.c (dr_analyze_indices): Replace resolve_mixers with
instantiate_scev.
(analyze_siv_subscript): Pass in the loop nest number.
- Call evolution_function_is_affine_in_loop instead of
+ Call evolution_function_is_affine_in_loop instead of
evolution_function_is_affine_p.
(analyze_overlapping_iterations): Pass in the loop nest number.
@@ -6643,7 +6897,7 @@
2008-05-19 Xinliang David Li <davidxl@google.com>
- * tree-ssa-dce.c: Revert patches of 2008-05-17 and 2008-05-18.
+ * tree-ssa-dce.c: Revert patches of 2008-05-17 and 2008-05-18.
* opts.c: Ditto.
* common.opt: Ditto.
* doc/invoke.texi: Ditto.
@@ -6702,7 +6956,7 @@
2008-05-18 Xinliang David Li <davidxl@google.com>
* gcc/tree-ssa-dce.c: Coding style fix.
- (check_pow): Documentation comment.
+ (check_pow): Documentation comment.
(check_log): Documenation comment. Coding style fix.
(is_unnecessary_except_errno_call): Ditto.
(gen_conditions_for_pow): Ditto.
@@ -6710,7 +6964,7 @@
(gen_shrink_wrap_conditions): Ditto.
(shrink_wrap_one_built_in_calls): Ditto.
* gcc/doc/invoke.texi: Better documentation string.
- * ChangeLog: Fix wrong change log entries from
+ * ChangeLog: Fix wrong change log entries from
May 17 checkin on function call DCE.
2008-05-17 Kaz Kojima <kkojima@gcc.gnu.org>
@@ -6722,7 +6976,7 @@
* doc/rtl.texi (RTL_CONST_CALL_P, RTL_PURE_CALL_P): Fixed typos.
* df-problems.c (simulation routines): Fixed block comment to
properly say how to add forwards scanning functions.
-
+
2008-05-17 Eric Botcazou <ebotcazou@adacore.com>
* tree-inline.c (setup_one_parameter): Remove dead code.
@@ -6735,8 +6989,8 @@
2008-05-17 Xinliang David Li <davidxl@google.com>
* gcc/tree-ssa-dce.c (cond_dead_built_in_calls): New static variable.
- (check_pow, check_log, is_unnecessary_except_errno_call): New
- functions to check for eliminating math functions that are pure
+ (check_pow, check_log, is_unnecessary_except_errno_call): New
+ functions to check for eliminating math functions that are pure
except for setting errno.
(gen_conditions_for_pow, gen_conditionas_for_log): New functions to
general condition expressions for shrink-wrapping pow/log calls.
@@ -6799,7 +7053,7 @@
2008-05-16 Kenneth Zadeck <zadeck@naturalbridge.com>
* tree-ssa-dse (max_stmt_uid): Removed.
- (get_stmt_uid, dse_possible_dead_store_p, dse_optimize_stmt,
+ (get_stmt_uid, dse_possible_dead_store_p, dse_optimize_stmt,
tree_ssa_dse): Encapsulate all uses of stmt_ann->uid.
* tree-ssa-sccvn.c (compare_ops, init_scc_vn): Ditto.
* function.h (cfun.last_stmt_uid): New field.
@@ -6878,7 +7132,7 @@
write_summary, read_summary.
* cgraphunit.c (cgraph_process_new_functions): Changed call from
pass_ipa_inline.function_generate_summary, to
- compute_inline_parameters.
+ compute_inline_parameters.
* ipa-inline.c (compute_inline_parameters): Made public and added
node parameter.
(compute_inline_parameters_for_current): New function.
@@ -6888,19 +7142,19 @@
(pass_ipa_inline): Updated for new IPA_PASS structure.
* passes.c (execute_ipa_summary_passes): Now is called once per
pass rather than once per node*pass.
-
+
2008-05-15 Anatoly Sokolov <aesok@post.ru>
- * config/avr/avr.c (avr_base_arch_macro, avr_have_movw_lpmx_p,
+ * config/avr/avr.c (avr_base_arch_macro, avr_have_movw_lpmx_p,
avr_have_mul_p, avr_asm_only_p): Remove variables.
(avr_override_options): Remove initialization of removed variables.
- (avr_file_start): Convert removed variables to fields of
- 'struct base_arch_s *avr_current_arch'.
+ (avr_file_start): Convert removed variables to fields of
+ 'struct base_arch_s *avr_current_arch'.
* config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): (Ditto.).
(AVR_HAVE_MUL): (Ditto.).
(AVR_HAVE_MOVW): (Ditto.).
- (AVR_HAVE_LPMX): (Ditto.).
- (avr_base_arch_macro, avr_have_movw_lpmx_p, avr_have_mul_p,
+ (AVR_HAVE_LPMX): (Ditto.).
+ (avr_base_arch_macro, avr_have_movw_lpmx_p, avr_have_mul_p,
avr_asm_only_p): Remove declaration.
2008-05-15 Diego Novillo <dnovillo@google.com>
@@ -6916,7 +7170,7 @@
(record_truncated_value): Turn it into a for_each_rtx callback.
(record_truncated_values): New function.
(combine_instructions): Call note_uses with record_truncated_values.
- Change name of check_conversion to check_promoted_subreg.
+ Change name of check_conversion to check_promoted_subreg.
2008-05-15 Janis Johnson <janis187@us.ibm.com>
@@ -7200,14 +7454,14 @@
* optabs.c (prepare_cmp_insn): Changed LCT_PURE_MAKE_BLOCK to
LCT_PURE and LCT_CONST_MAKE_BLOCK to LCT_CONST in calls to
- emit_library_call_value.
+ emit_library_call_value.
* builtins.c (expand_builtin_powi, expand_builtin_memcmp): Ditto.
* tree.h (ECF_LIBCALL_BLOCK): Removed.
- * calls.c (initialize_argument_information, precompute_arguments,
+ * calls.c (initialize_argument_information, precompute_arguments,
expand_call, emit_library_call_value_1): Remove ECF_LIBCALL_BLOCK.
(precompute_arguments): Removed flags parameter.
* rtl.h (LCT_CONST_MAKE_BLOCK, LCT_PURE_MAKE_BLOCK): Removed.
-
+
2008-05-14 Richard Guenther <rguenther@suse.de>
* tree-ssa-dse.c (dse_possible_dead_store_p): Remove dead code.
@@ -7395,7 +7649,7 @@
2008-05-10 Kenneth Zadeck <zadeck@naturalbridge.com>
* gcse.c (store_killed_in_insn): Negated call to RTL_CONST_CALL_P.
-
+
2008-05-10 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (bdesc_ptest): Removed.
@@ -7538,7 +7792,7 @@
CONVERT_EXPR_P.
(CONVERT_EXPR_P): Define.
(CASE_CONVERT): Define.
-
+
2008-05-08 Kenneth Zadeck <zadeck@naturalbridge.com>
PR middle-end/36117
@@ -7622,7 +7876,7 @@
2008-05-08 David Daney <ddaney@avtrex.com>
Richard Sandiford <rsandifo@nildram.co.uk>
-
+
* config/mips/mips.md (mips_expand_compare_and_swap_12): Handle
special case of constant zero operands.
* config/mips/mips.c (mips_expand_compare_and_swap_12): Zero extend
@@ -7847,9 +8101,9 @@
(analyze_function): Rename DECL_IS_PURE to DECL_PURE_P.
(static_execute): Set looping true for recursive functions.
Undo setting state to IPA_NEITHER for recursive functions.
- * cse.c (cse_insn):
+ * cse.c (cse_insn):
* ifcvt.c (noce_can_store_speculate_p): Changed
- CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or
+ CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or
RTL_CONST_OR_PURE_CALL_P.
* dse.c (scan_insn): Ditto.
* local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto.
@@ -7891,7 +8145,7 @@
DECL_PURE_P.
* tree-cfg.c (update_call_expr_flags): Do not clear tree side
effects for looping pure or const calls.
- (verify_gimple_expr): Added verification code.
+ (verify_gimple_expr): Added verification code.
* config/alpha/alpha.c (alpha_legitimize_address,
alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to
RTL_CONST_CALL_P.
@@ -8185,14 +8439,14 @@
(ipcp_redirect): Removed newly unused local variable callee.
(ipcp_redirect): Removed (a bit confusing) local variable type.
(ipcp_insert_stage): Added local variable info.
- (ipcp_cval_changed): Renamed to ipcp_lattice_changed, parameters
+ (ipcp_cval_changed): Renamed to ipcp_lattice_changed, parameters
renamed too
(ipcp_formal_create): Removed.
(ipcp_method_cval_set): Removed.
(ipcp_propagate_stage): Renamed lattice variables.
(ipcp_method_cval_set_cvalue_type): Removed.
(ipcp_method_cval_print): Renamed to ipcp_print_all_lattices
- (ipcp_print_all_lattices): Changed printed strings to refer to
+ (ipcp_print_all_lattices): Changed printed strings to refer to
lattices rather than cvals.
(ipcp_method_cval_init): Renamed to ipcp_initialize_node_lattices
(ipcp_propagate_const): Changed formal parameters.
@@ -8203,7 +8457,7 @@
(ipcp_after_propagate): Renamed to ipcp_change_tops_to_bottom
(ipcp_callsite_param_print): Renamed to ipcp_print_all_jump_functions
(ipcp_profile_mt_count_print): Renamed to ipcp_print_func_profile_counts
- (ipcp_print_func_profile_counts): Changed string from "method" to
+ (ipcp_print_func_profile_counts): Changed string from "method" to
"function"
(ipcp_profile_cs_count_print): Renamed to ipcp_print_call_profile_counts
(ipcp_profile_edge_print): Renamed to ipcp_print_edge_profiles
@@ -8213,7 +8467,7 @@
(ipcp_lat_is_const): Changed parameters and made inline.
(ipcp_replace_map_create): Renamed to ipcp_create_replace_map
(ipcp_redirect): Renamed to ipcp_need_redirect_p
- (ipcp_need_redirect_p): Calls ipcp_lat_is_const instead of using
+ (ipcp_need_redirect_p): Calls ipcp_lat_is_const instead of using
the predicate condition directly
(ipcp_propagate_stage): Added local variable args. Removed local
variable callee. (Both are mere code simplifications.)
@@ -8340,13 +8594,13 @@
* gthr-single.h: Add in required interface elements as per gthr.h.
Add stub types for __gthread_key_t, __gthread_once_t. Add defines
for __GTHREAD_ONCE_INIT, __GTHREAD_RECURSIVE_MUTEX_INIT.
- Generalize UNUSED macro.
+ Generalize UNUSED macro.
(__gthread_once): Add.
(__gthread_key_create): Add.
(__gthread_key_delete): Add.
(__gthread_getspecific): Add.
(__gthread_setspecific): Add.
-
+
2008-05-05 Andrew Pinski <Andrew.Pinski@playstation.sony.com>
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): If we have
@@ -8428,7 +8682,7 @@
* doc/invoke.texi (max-flow-memory-locations): Removed.
* params.def (PARAM_MAX_FLOW_MEMORY_LOCATIONS): Removed.
-
+
2008-05-03 Richard Guenther <rguenther@suse.de>
PR middle-end/34973
@@ -8710,13 +8964,13 @@
* ipa-cp.c (ipcp_init_stage): Calls ipa_set_called_with_variable_arg
instead of setting number of formal parameters to zero.
- (ipcp_init_stage): Do not set the number of actual parameters to zero
+ (ipcp_init_stage): Do not set the number of actual parameters to zero
either.
(ipcp_propagate_stage): Explicitly skipping all calls to nodes
which are called with variable number of arguments.
(ipcp_insert_stage): Explicitely skipping all nodes which are
called with variable number of arguments.
- (ipcp_callsite_param_print): Skipps callsites to nodes with varaible
+ (ipcp_callsite_param_print): Skipps callsites to nodes with varaible
number of parameters.
* ipa-prop.h (struct ipa_node_params): Added flag
@@ -8728,13 +8982,13 @@
(ipa_is_called_with_var_arguments): Added.
(ipa_get_ith_param): Added. All readers of param_decls converted
to use it instead.
- (ipa_set_cs_argument_count): Added, sole writer to argument_count
- changed to use it.
+ (ipa_set_cs_argument_count): Added, sole writer to argument_count
+ changed to use it.
(ipa_get_cs_argument_count): Added, all readers of argument_count
changed to cal it.
- (ipa_get_ith_jump_func): Added. Accessors of jump values changed
+ (ipa_get_ith_jump_func): Added. Accessors of jump values changed
to use it.
-
+
* ipa-prop.h (struct ipcp_formal): Renamed to ipcp_lattice
(struct ipcp_lattice): Renamed cval_type to type
(struct ipa_node_params): ipcp_cval renamed to ipcp_lattices
@@ -8746,9 +9000,9 @@
(build_const_val): Changed the type of parameter cvalue to tree
(ipcp_propagate_const): Changed the type of parameter cvalue to tree
(ipcp_method_cval_set_cvalue_type): Renamed parameter cval_type1 to type
-
- * ipa-prop.h (struct ipcp_formal): Replaced cvalue with tree called
- constant
+
+ * ipa-prop.h (struct ipcp_formal): Replaced cvalue with tree called
+ constant
* ipa-prop.c (ipa_methodlist_init): Renamed to ipa_init_func_list
(ipa_methodlist_not_empty): Removed, the sole user now checks directly
@@ -8766,7 +9020,7 @@
(ipa_method_tree_map_create): Removed.
(ipa_method_compute_tree_map): Renamed to ipa_create_param_decls_array
(ipa_create_param_decls_array): Creates the array itself
- (ipa_create_param_decls_array): Temporary variable info instead of
+ (ipa_create_param_decls_array): Temporary variable info instead of
a few dereferences.
(ipa_method_formal_compute_count): Renamed to ipa_count_formal_params
(ipa_method_compute_modify): Renamed to ipa_detect_param_modifications
@@ -8778,7 +9032,7 @@
(ipa_edges_create): Renamed to ipa_create_all_edge_args
(ipa_edges_free): Renamed to ipa_free_all_edge_args
(ipa_nodes_free): Integrated into ipa_free_all_node_params and removed
- (ipa_free_all_node_params): Deallocation to jump_functions moved to
+ (ipa_free_all_node_params): Deallocation to jump_functions moved to
ipa_free_all_edge_args
(ipa_method_tree_print): Renamed to ipa_print_all_tree_maps
(ipa_method_modify_print): Renamed to ipa_print_all_params_modified
@@ -8789,22 +9043,22 @@
(ipa_methodlist_next_method_set): Removed.
(ipa_method_is_modified): Removed.
(ipa_method_modify_create): Removed.
- (ipa_method_modify_init): Temporary variable info instead of a few
+ (ipa_method_modify_init): Temporary variable info instead of a few
dereferences.
- (ipa_detect_param_modifications): Temporary variable info instead of
+ (ipa_detect_param_modifications): Temporary variable info instead of
a few dereferences.
- (ipa_compute_jump_functions): Temporary variable info instead of
+ (ipa_compute_jump_functions): Temporary variable info instead of
a few dereferences.
(ipa_method_modify_set): Removed.
(ipa_method_tree_map): Renamed to ipa_get_param_decl_index
- (ipa_get_param_decl_index): Now accepts struct ipa_node_params rather
+ (ipa_get_param_decl_index): Now accepts struct ipa_node_params rather
than craph_node as the first parameter.
(ipa_method_modify_stmt): Renamed to ipa_check_stmt_modifications
(ipa_method_modify_init): Removed.
- (ipa_compute_jump_functions): Added a temp variable instead of
+ (ipa_compute_jump_functions): Added a temp variable instead of
repeatadly dereferencing the cgraph_edge.aux pointer
(ipa_callsite_param_set_type): Removed.
- (ipa_compute_jump_functions): i renamed to index and moved to
+ (ipa_compute_jump_functions): i renamed to index and moved to
an inner block
(ipa_callsite_param_set_info_type_formal): Removed.
(ipa_callsite_param_set_info_type): Removed.
@@ -8815,9 +9069,9 @@
* ipa-prop.h (enum cvalue_type): Renamed to ipa_lattice_type,
prefixed all values with IPA_. Changed all users.
- (enum jump_func_type): Rnamed UNKNOWN_IPATYPE to IPA_UNKNOWN,
- CONST_IPATYPE to IPA_CONST, CONST_IPATYPE_REF to IPA_CONST_REF
- and FORMAL_IPATYPE IPA_PASS_THROUGH.
+ (enum jump_func_type): Rnamed UNKNOWN_IPATYPE to IPA_UNKNOWN,
+ CONST_IPATYPE to IPA_CONST, CONST_IPATYPE_REF to IPA_CONST_REF
+ and FORMAL_IPATYPE IPA_PASS_THROUGH.
(union parameter_info): Renamed to jump_func_value.
(union jump_func_value): Renamed value to constant
(struct ipa_jump_func): Renamed info_type to value
@@ -8974,7 +9228,7 @@
* tree-ssa-loop-manip.c (find_uses_to_rename_use): Only record
uses outside of the loop.
(tree_duplicate_loop_to_header_edge): Only verify loop-closed SSA
- form if it is available.
+ form if it is available.
* tree-flow.h (tree_unroll_loops_completely): Add extra parameter.
* passes.c (init_optimization_passes): Schedule complete inner
loop unrolling pass before the first CCP pass after final inlining.
@@ -9316,9 +9570,9 @@
(init_elim_table): Update.
2008-04-25 Bob Wilson <bob.wilson@acm.org>
-
+
* optabs.c (expand_float): Fix REG_EQUAL for UNSIGNED_FLOAT libcall.
-
+
2008-04-25 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/sse.md (mov<mode>): Replace SSEMODEI with SSEMODE.
@@ -9389,7 +9643,7 @@
of code delimited by two edges in the CFG.
(separate_decls_in_loop_name): Renamed separate_decls_in_region_name.
(separate_decls_in_loop_stmt): Renamed separate_decls_in_region_stmt.
- (separate_decls_in_loop): Renamed separate_decls_in_region. Isolate
+ (separate_decls_in_loop): Renamed separate_decls_in_region. Isolate
the case of parallelisation of reductions.
(expr_invariant_in_region_p): New.
@@ -9556,7 +9810,7 @@
PR middle-end/36003
* passes.c (init_optimization_passes): Remove
pass_fast_rtl_byte_dce.
-
+
2008-04-22 Uros Bizjak <ubizjak@gmail.com>
PR target/29096
@@ -9647,14 +9901,14 @@
* dbgcnt.def (ra_byte_scan): Added.
* dbgcnt.c (dbg_cnt): Added code to print message to dump_file
- when the last hit happens for a counter.
+ when the last hit happens for a counter.
* timevar.def (TV_DF_BYTE_LR): New variable.
* tree-pass.h (pass_fast_rtl_byte_dce): New pass.
* passes.c (pass_fast_rtl_byte_dce): New pass.
* fwprop.c (update_df): Added mode to call df_ref_create.
Renamed DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and
DF_REF_EXTRACT_OFFSET.
- * df.h (DF_BYTE_LR, DF_BYTE_LR_BB_INFO, DF_BYTE_LR_IN,
+ * df.h (DF_BYTE_LR, DF_BYTE_LR_BB_INFO, DF_BYTE_LR_IN,
DF_BYTE_LR_OUT, df_byte_lr): New macro.
(df_mm): New enum.
(df_ref_extract): Added mode field.
@@ -9662,7 +9916,7 @@
DF_REF_EXTRACT_OFFSET.
(DF_REF_EXTRACT_MODE): New macro.
(df_byte_lr_bb_info): New structure.
- (df_print_byte_regset, df_compute_accessed_bytes,
+ (df_print_byte_regset, df_compute_accessed_bytes,
df_byte_lr_add_problem, df_byte_lr_get_regno_start,
df_byte_lr_get_regno_len, df_byte_lr_simulate_defs,
df_byte_lr_simulate_uses,
@@ -9673,9 +9927,9 @@
(df_byte_lr_get_bb_info): New inline function.
* df-scan.c (df_ref_record, df_uses_record,
df_ref_create_structure): Added mode parameter.
- (df_ref_create, df_notes_rescan, df_ref_record, df_def_record_1,
+ (df_ref_create, df_notes_rescan, df_ref_record, df_def_record_1,
df_defs_record, df_uses_record, df_get_conditional_uses,
- df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect,
+ df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect,
df_entry_block_defs_collect, df_exit_block_uses_collect):
Added mode parameter to calls to df_ref_record, df_uses_record,
df_ref_create_structure.
@@ -9686,25 +9940,25 @@
* df-core.c (df_print_byte_regset): New function.
* df-byte-scan.c: New file.
* df-problems.c (df_rd_transfer_function): Removed unnecessary
- calls to BITMAP_FREE.
+ calls to BITMAP_FREE.
(df_byte_lr_problem_data, df_problem problem_BYTE_LR): New structure.
(df_byte_lr_get_regno_start, df_byte_lr_get_regno_len,
- df_byte_lr_set_bb_info, df_byte_lr_free_bb_info,
- df_byte_lr_check_regs, df_byte_lr_expand_bitmap,
+ df_byte_lr_set_bb_info, df_byte_lr_free_bb_info,
+ df_byte_lr_check_regs, df_byte_lr_expand_bitmap,
df_byte_lr_alloc, df_byte_lr_reset, df_byte_lr_bb_local_compute,
df_byte_lr_local_compute, df_byte_lr_init,
- df_byte_lr_confluence_0, df_byte_lr_confluence_n,
- df_byte_lr_transfer_function, df_byte_lr_free,
+ df_byte_lr_confluence_0, df_byte_lr_confluence_n,
+ df_byte_lr_transfer_function, df_byte_lr_free,
df_byte_lr_top_dump, df_byte_lr_bottom_dump,
- df_byte_lr_add_problem, df_byte_lr_simulate_defs,
+ df_byte_lr_add_problem, df_byte_lr_simulate_defs,
df_byte_lr_simulate_uses,
df_byte_lr_simulate_artificial_refs_at_top,
df_byte_lr_simulate_artificial_refs_at_end): New function.
* dce.c (byte_dce_process_block): New function.
(dce_process_block): au is now passed in rather than computed
locally. Changed loops that look at artificial defs to not look
- for conditional or partial ones, because there never are any.
- (fast_dce): Now is able to drive byte_dce_process_block or
+ for conditional or partial ones, because there never are any.
+ (fast_dce): Now is able to drive byte_dce_process_block or
dce_process_block depending on the kind of dce being done.
(rest_of_handle_fast_dce): Add parameter to fast_dce.
(rest_of_handle_fast_byte_dce): New function.
@@ -9752,14 +10006,14 @@
pointer_may_wrap_p to disable some false positives.
2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
-
+
* c-common.c (CHAR16_TYPE, CHAR32_TYPE): New macros.
(fname_as_string): Match updated cpp_interpret_string prototype.
(fix_string_type): Support char16_t* and char32_t*.
(c_common_nodes_and_builtins): Add char16_t and char32_t (and
derivative) nodes. Register as builtin if C++0x.
(c_parse_error): Support CPP_CHAR{16,32}.
- * c-common.h (RID_CHAR16, RID_CHAR32): New elements.
+ * c-common.h (RID_CHAR16, RID_CHAR32): New elements.
(enum c_tree_index) <CTI_CHAR16_TYPE, CTI_SIGNED_CHAR16_TYPE,
CTI_UNSIGNED_CHAR16_TYPE, CTI_CHAR32_TYPE, CTI_SIGNED_CHAR32_TYPE,
CTI_UNSIGNED_CHAR32_TYPE, CTI_CHAR16_ARRAY_TYPE,
@@ -9925,7 +10179,7 @@
* config/sh/sh.c (expand_cbranchdi4): Use original operands for
msw_skip comparison.
-
+
2008-04-16 Jakub Jelinek <jakub@redhat.com>
PR c/35739
@@ -9981,7 +10235,7 @@
unused.
Move filter, exc_ptr, ttype_data, ehspec_data, action_record_data and
exception_handler_label_map, ehr_stackadj, ehr_handler, ehr_label,
- sjlj_fc, sjlj_exit_after to rth_eh in function.h.
+ sjlj_fc, sjlj_exit_after to rth_eh in function.h.
Remove call_site_data_used, call_site_data_size.
Turn call_site_record into vector in function.h.
(note_current_region_may_contain_throw): Remove.
@@ -9991,7 +10245,7 @@
add_ttypes_entry, add_ehspec_entry, assign_filter_values,
build_post_landing_pads, dw2_build_landing_pads,
sjlj_assign_call_site_values, sjlj_mark_call_sites,
- sjlj_emit_function_enter, sjlj_emit_function_enter,
+ sjlj_emit_function_enter, sjlj_emit_function_enter,
sjlj_emit_function_exit, sjlj_emit_dispatch_table,
sjlj_build_landing_pads, finish_eh_generation,
remove_exception_handler_label, remove_eh_handler,
@@ -10217,7 +10471,7 @@
(*<code>extendsfdf2): Macroize insn pattern from *absextendsfdf2 and
*negextendsfdf2 patterns using absneg code iterator.
* config/i386/sse.md (<code><mode>2): Macroize expander from
- abs<mode>2 and neg<mode>2 patterns using absneg code iterator.
+ abs<mode>2 and neg<mode>2 patterns using absneg code iterator.
2008-04-10 Andreas Krebbel <krebbel1@de.ibm.com>
@@ -10457,10 +10711,10 @@
2008-04-08 Anatoly Sokolov <aesok@post.ru>
- * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Define
- __AVR_HAVE_EIJMP_EICALL__ macro if device have EIJMP and EICALL
+ * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Define
+ __AVR_HAVE_EIJMP_EICALL__ macro if device have EIJMP and EICALL
instructions.
- * config/avr/avr.c (avr_mcu_types): Set AVR31 architecture for
+ * config/avr/avr.c (avr_mcu_types): Set AVR31 architecture for
atmega103 device.
2008-04-07 Jan Hubicka <jh@suse.cz>
@@ -10481,7 +10735,7 @@
(assign_stack_local): Update
(expand_function_end): Update.
(get_art_pointer_save_area): Update
- * function.h
+ * function.h
* emit-rtl.c (rtl): Declare.
(regno_reg_rtx): Declare.
(first_insn, last_insn, cur_insn_uid, last_location, first_label_num):
@@ -10576,7 +10830,7 @@
(avr_asm_init_sections): (Ditto.).
(avr_rtx_costs): (Ditto.).
* config/avr/avr.md: (Ditto.).
- * config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of
+ * config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of
'__AVR_MEGA__'.
2008-04-06 Richard Guenther <rguenther@suse.de>
@@ -10744,7 +10998,7 @@
* c-objc-common.h (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P):
Rename to LANG_HOOKS_MISSING_NORETURN_OK_P.
-
+
2008-04-04 Jakub Jelinek <jakub@redhat.com>
PR c/35440
@@ -10940,10 +11194,10 @@
2008-04-02 Anatoly Sokolov <aesok@post.ru>
- * config/avr/predicates.md (io_address_operand): New predicate.
+ * config/avr/predicates.md (io_address_operand): New predicate.
* config/avr/avr-protos.h (avr_io_address_p): Remove declaration.
* config/avr/avr.c (avr_io_address_p): Remove function.
- (out_movqi_r_mr): Use 'io_address_operand' predicate instead of
+ (out_movqi_r_mr): Use 'io_address_operand' predicate instead of
'avr_io_address_p' function.
(out_movhi_r_mr): (Ditto.).
(out_movqi_mr_r): (Ditto.).
@@ -11640,7 +11894,7 @@
* config/alpha/x-vms (EXTRA_PROGRAMS): Remove.
* config/t-openbsd-thread: Remove commented out lines.
-
+
* config/x-interix: Remove.
* config/m68hc11/t-m68hc11-gas: Rename to...
@@ -11764,7 +12018,7 @@
(reload_reg_rtx_for_input): New variable.
(reload_reg_rtx_for_output): Likewise.
(emit_input_reload_insns): Use reloadreg rather than rl->reg_rtx
- when reassigning a pseudo register. Load reloadreg from
+ when reassigning a pseudo register. Load reloadreg from
reload_reg_rtx_for_input, moving the mode and register
calculation to...
(do_input_reload): ...here. Use the mode-adjusted reg_rtx
@@ -11806,12 +12060,12 @@
(build/genflags.o): Likewise.
2008-03-25 Bob Wilson <bob.wilson@acm.org>
-
+
* config/xtensa/xtensa.c (xtensa_va_start): Use build_int_cst
instead of size_int for integer types.
(xtensa_gimplify_va_arg_expr): Likewise. Convert index to sizetype
to match type of MINUS_EXPR.
-
+
2008-03-25 Tom Tromey <tromey@redhat.com>
* configure: Rebuilt.
@@ -11929,7 +12183,7 @@
2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com>
* config/sh/sh.md (prefetch): Add condition for SH2A target.
- (prefetch_sh2a): New.
+ (prefetch_sh2a): New.
2008-03-25 Jayant Sonar <Jayant.sonar@kpitcummins.com>
Naveen.H.S <naveen.hs@kpitcummins.com>
@@ -11982,7 +12236,7 @@
* diagnostic.c (diagnostic_count_diagnostic): Delete.
(diagnostic_report_diagnostic): Update. Handle ICEs here.
-
+
2008-03-24 Nathan Sidwell <nathan@codesourcery.com>
* gthr-vxworks.h (UNUSED): Define.
@@ -11995,7 +12249,7 @@
* doc/extend.texi (Function Attributes): Add missing comma in the
example of the "alloc_size" attribute.
-
+
2008-03-23 Uros Bizjak <ubizjak@gmail.com>
Revert:
@@ -12473,22 +12727,22 @@
* config/avr/avr.c (avr_arch_types): Add avr6 entry.
(avr_arch): Add ARCH_AVR6.
(avr_mcu_types): Add 'atmega2560' and 'atmega2561' entry.
- (initial_elimination_offset): Initialize and use 'avr_pc_size'
+ (initial_elimination_offset): Initialize and use 'avr_pc_size'
instead of fixed value 2.
(print_operand_address): Use gs() asm specifier instead of pm().
(avr_assemble_integer): (Ditto.).
(avr_output_addr_vec_elt): (Ditto.).
(print_operand): Handle "!" code.
- * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Add
+ * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Add
__AVR_3_BYTE_PC__, __AVR_2_BYTE_PC__ and __AVR_HAVE_JMP_CALL__.
(AVR_HAVE_EIJMP_EICALL): Define.
(AVR_3_BYTE_PC): Redefine.
(AVR_2_BYTE_PC): (Ditto.).
(PRINT_OPERAND_PUNCT_VALID_P): Add '!' code.
(LINK_SPEC): Add atmega2560 and atmega2561.
- (CRT_BINUTILS_SPEC): Add atmega2560 (crtm2560.o) and atmega2561
+ (CRT_BINUTILS_SPEC): Add atmega2560 (crtm2560.o) and atmega2561
(crtm2561.o).
- * config/avr/avr.md (call_insn): Use eicall instead of icall
+ * config/avr/avr.md (call_insn): Use eicall instead of icall
for 3 byte PC devices.
(call_value_insn): (Ditto.).
(*tablejump_enh): Use eijmp instead of ijmp for 3 byte PC devices.
@@ -12496,11 +12750,11 @@
(*tablejump): (Ditto.).
(*indirect_jump_avr6): Add insn.
(*tablejump_rjmp): Don't use for 3 byte PC devices.
- * config/avr/libgcc.S (__prologue_saves__): Use eijmp
+ * config/avr/libgcc.S (__prologue_saves__): Use eijmp
instead of ijmp for 3 byte PC devices.
(__tablejump2__): (Ditto.).
* config/avr/t-avr (MULITLIB_OPTIONS): Add avr6 architecture.
- (MULITLIB_DIRNAMES): (Ditto.).
+ (MULITLIB_DIRNAMES): (Ditto.).
(MULTILIB_MATCHES): Add atmega2560 and atmega2561 to list.
2008-03-15 Uros Bizjak <ubizjak@gmail.com>
@@ -12527,7 +12781,7 @@
being a PHI_NODE.
2008-03-14 Bob Wilson <bob.wilson@acm.org>
-
+
* doc/invoke.texi (Option Summary, Xtensa Options): Document
-mserialize-volatile and -mno-serialize-volatile Xtensa options.
* config/xtensa/xtensa.c (print_operand): Do not emit MEMW instructions
@@ -13145,7 +13399,7 @@
(df_ref_create_structure): Allocate df_ref_extract if offset and
width fields are used.
(df_def_record_1): Get offset and width from ZERO_EXTRACT.
- (df_uses_record): Get offset and width from ZERO_EXTRACT
+ (df_uses_record): Get offset and width from ZERO_EXTRACT
and SIGN_EXTRACT.
* global.c (build_insn_chain): Change DF_REF_EXTRACT to either
DF_REF_ZERO_EXTRACT or DF_REF_SIGN_EXTRACT. Change
@@ -13156,7 +13410,7 @@
(df_ref_extract): New structure.
(DF_REF_WIDTH, DF_REF_OFFSET): New macros.
(df_ref_create): Add width and offset parameters.
-
+
2008-03-05 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (get_constraint_for_component_ref):
@@ -13387,7 +13641,7 @@
* Makefile.in (OBJS-common): Remove struct-equiv.o.
(struct-equiv.o): Remove rule.
* basic-block.h (struct_equiv_checkpoint, STRUCT_EQUIV_*,
- insns_match_p, struct_equiv_block_eq, struct_equiv_init,
+ insns_match_p, struct_equiv_block_eq, struct_equiv_init,
rtx_equiv_p, condjump_equiv_p): Remove prototypes.
2008-03-01 Alexandre Oliva <aoliva@redhat.com>
@@ -13574,7 +13828,7 @@
* tree-vect-analyze.c: Remove unused static decls.
* lambda.h (dependence_level): New.
* common.opt (ftree-loop-distribution): New.
- * tree-flow.h (mark_virtual_ops_in_bb,
+ * tree-flow.h (mark_virtual_ops_in_bb,
slpeel_tree_duplicate_loop_to_edge_cfg,
rename_variables_in_loop): Declared.
* Makefile.in (TREE_DATA_REF_H): Depend on tree-chrec.h.
@@ -13784,7 +14038,7 @@
2008-02-26 Jason Merrill <jason@redhat.com>
PR c++/35315
- * attribs.c (decl_attributes): Leave ATTR_FLAG_TYPE_IN_PLACE
+ * attribs.c (decl_attributes): Leave ATTR_FLAG_TYPE_IN_PLACE
alone if it's the naming decl for the type's main variant.
2008-02-26 Tom Tromey <tromey@redhat.com>
@@ -13878,7 +14132,7 @@
* builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START.
* tree-stdarg.c (execute_optimize_stdarg): Likewise.
* tree-inline.c (inline_forbidden_p_1): Likewise.
-
+
2008-02-26 Richard Guenther <rguenther@suse.de>
* tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ...
@@ -13947,7 +14201,7 @@
Wvolatile-register-var.
* common.opt: Move Wvolatile-register-var to...
* c.opt: ...here.
-
+
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* common.opt (Wlarger-than=): New.
@@ -13958,7 +14212,7 @@
* opth-gen.awk: Likewise.
* stor-layout.c (layout_decl): Use -Wlarger-than= for warning.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
-
+
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* c-common.c (match_case_to_enum_1): Add appropriate
@@ -13981,7 +14235,7 @@
(print_ignored_options): New.
(handle_option): Postpone errors for unknown -Wno-* options.
* opts.h (print_ignored_options): Declare.
-
+
2008-02-25 Richard Sandiford <rsandifo@nildram.co.uk>
* config/mips/mips.md (loadgp_blockage, blockage): Change type
@@ -14060,7 +14314,7 @@
PR c/35162
* doc/invoke.texi (-fcx-limited-range): Correct to be in line with
actual behaviour and C99.
-
+
2008-02-26 Ben Elliston <bje@au.ibm.com>
* config/rs6000/rs6000.h (ASM_CPU_POWER5_SPEC): Define.
@@ -14163,7 +14417,7 @@
unused local variable `has_hot_blocks'.
(fix_crossing_conditional_branches): Remove unused local variable
`prev_bb'.
-
+
2008-02-25 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/19984
@@ -14255,7 +14509,7 @@
2008-02-23 Uros Bizjak <ubizjak@gmail.com>
PR target/22076
- PR target/34256
+ PR target/34256
* config/i386/mmx.md (*mov<mode>_internal_rex64): Use "!y" to
prevent reload from using MMX registers.
(*mov<mode>_internal): Ditto.
@@ -14390,7 +14644,7 @@
* config/h8300/h8300.c (h8300_expand_epilogue): Emit return insn
as a jump, not as a plain insn.
-
+
2008-02-20 Seongbae Park <seongbae.park@gmail.com>
* doc/invoke.texi (Warning Options): Add new option
@@ -14443,7 +14697,7 @@
* doc/install.texi: Correct references to CFLAGS, replacing them
with BOOT_CFLAGS. Document flags used during bootstrap for
target libraries.
-
+
2008-02-20 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.h (SSE_VEC_FLOAT_MODE_P): New define.
@@ -14576,7 +14830,7 @@
cannot be disambiguated.
* c.opt (v): Pass on to the common option handler.
-2008-02-19 Revital Eres <eres@il.ibm.com>
+2008-02-19 Revital Eres <eres@il.ibm.com>
* modulo-sched.c (sms_schedule): Change dump message when
create_ddg function fails.
@@ -14698,7 +14952,7 @@
2008-02-17 Uros Bizjak <ubizjak@gmail.com>
Revert:
- 2008-02-15 Uros Bizjak <ubizjak@gmail.com>
+ 2008-02-15 Uros Bizjak <ubizjak@gmail.com>
* config/i386/sfp-machine.h (CMPtype): Define as typedef using
libgcc_cmp_return mode.
@@ -14874,7 +15128,7 @@
Add -fdump-ipa-inline.
* tree-dump.c (dump_files): Remove tree-inlined dump.
* tree-pass.h (tree_dump_index): Remove TDI_inlined.
-
+
2008-02-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/35171
@@ -14964,7 +15218,7 @@
2008-02-08 Sa Liu <saliu@de.ibm.com>
- * config/spu/spu-builtins.def: Fixed wrong parameter type in spu
+ * config/spu/spu-builtins.def: Fixed wrong parameter type in spu
intrinsics spu_convts, spu_convtu, spu_convtf.
2008-02-08 Hans-Peter Nilsson <hp@axis.com>
@@ -14979,7 +15233,7 @@
optc-gen.awk.
* opts-common.c: Likewise.
* optc-gen.awk: Likewise.
-
+
2008-02-07 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.h (FUNCTION_ARG_REGNO_P): Fix fprs for 64 bit.
@@ -14988,7 +15242,7 @@
PR rtl-opt/33410
* config/alpha/alpha.c (alpha_emit_xfloating_compare): Use an
- EXPR_LIST for the REG_EQUAL instead of a comparison with a
+ EXPR_LIST for the REG_EQUAL instead of a comparison with a
funny mode.
2008-02-07 Uros Bizjak <ubizjak@gmail.com>
@@ -15025,7 +15279,7 @@
2008-02-06 Ralf Corsepius <ralf.corsepius@rtems.org>
- * config/arm/rtems-elf.h (TARGET_OS_CPP_BUILTINS): Add
+ * config/arm/rtems-elf.h (TARGET_OS_CPP_BUILTINS): Add
builtin_define ("__USE_INIT_FINI__").
* config/h8300/t-rtems (MULTILIB_OPTION,MULTILIB_DIRNAMES): Add
-msx multilibs.
@@ -15158,16 +15412,16 @@
* doc/c-tree.texi (Types): Fix grammar.
(Expression trees): Ditto.
* doc/passes.texi (Tree-SSA passes): Ditto.
-
+
* doc/configterms.texi (Configure Terms): Fix typo.
* doc/cpp.texi (Common Predefined Macros): Ditto.
* doc/md.texi (Machine Constraints): Ditto.
-
+
* doc/makefile.texi (Makefile): Add comma.
2008-01-31 Tom Browder <tom.browder@gmail.com>
Gerald Pfeifer <gerald@pfeifer.com>
-
+
* doc/sourcebuild.texi (Front End): Remove references to CVS
and CVSROOT/modules.
(Texinfo Manuals): Replace reference to CVS by one to SVN.
@@ -15188,7 +15442,7 @@
options. Minor fixes.
(-std): Move reference to standards closer to where language
standards are first mentioned.
-
+
2008-01-31 Richard Sandiford <rsandifo@nildram.co.uk>
PR rtl-optimization/34995
@@ -15284,7 +15538,7 @@
2008-01-28 Andy Hutchinson <hutchinsonandy@netscape.net>
PR target/34412
- * config/avr/avr.c (expand_prologue): Use correct QI mode frame
+ * config/avr/avr.c (expand_prologue): Use correct QI mode frame
pointer for tiny stack.
2008-01-28 Bernhard Fischer <aldot@gcc.gnu.org>
@@ -15369,7 +15623,7 @@
Change type of cost to comp_cost.
(determine_iv_cost): Increase cost of non-original ivs, instead
of decreasing the cost of original ones.
- (get_address_cost): Indicate the complexity of the addressing mode
+ (get_address_cost): Indicate the complexity of the addressing mode
in comp_cost.
(try_add_cand_for): Prefer using ivs not specific to some object.
* tree-flow.h (force_expr_to_var_cost): Declaration removed.
@@ -15612,10 +15866,10 @@
* ipa-struct-reorg.c (remove_str_allocs_in_func, remove_str_allocs):
New functions.
(remove_structure): Update allocations list before removing structure.
-
+
2008-01-25 Golovanevsky Olga <olga@il.ibm.com>
- * ipa-struct-reorg.c (is_safe_cond_expr,
+ * ipa-struct-reorg.c (is_safe_cond_expr,
create_new_stmts_for_cond_expr): Use integer_zerop function,
that recognize not only zero-pointer, but zero-integer too.
@@ -15671,7 +15925,7 @@
PR c++/25701
* doc/gcc.texi (Software development): Add a direntry for g++.
-
+
2008-01-23 Hans-Peter Nilsson <hp@axis.com>
* config/cris/cris.h (CC1PLUS_SPEC, OPTIMIZATION_OPTIONS): Drop
@@ -15699,17 +15953,17 @@
(avr_arch_types): Add 'avr31' and 'avr51' entries.
(avr_arch): Add 'ARCH_AVR31' and 'ARCH_AVR51'.
(avr_mcu_types): Add 'avr31' and 'avr51' architectures.
- (avr_override_options): Init 'avr_current_arch'.
+ (avr_override_options): Init 'avr_current_arch'.
(base_arch_s): Move from here...
- * config/avr/avr.h (base_arch_s): ... here. Add new members
- 'have_elpm', 'have_elpmx', 'have_eijmp_eicall', 'reserved'. Rename
+ * config/avr/avr.h (base_arch_s): ... here. Add new members
+ 'have_elpm', 'have_elpmx', 'have_eijmp_eicall', 'reserved'. Rename
'mega' to 'have_jmp_call'.
- (TARGET_CPU_CPP_BUILTINS): Define "__AVR_HAVE_JMP_CALL__",
+ (TARGET_CPU_CPP_BUILTINS): Define "__AVR_HAVE_JMP_CALL__",
"__AVR_HAVE_RAMPZ__", "__AVR_HAVE_ELPM__" and "__AVR_HAVE_ELPMX__"
macros.
- (LINK_SPEC, CRT_BINUTILS_SPECS, ASM_SPEC): Add 'avr31' and 'avr51'
+ (LINK_SPEC, CRT_BINUTILS_SPECS, ASM_SPEC): Add 'avr31' and 'avr51'
architectures.
- * config/avr/t-avr (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
+ * config/avr/t-avr (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
MULTILIB_MATCHES): (Ditto.).
2008-01-23 Richard Guenther <rguenther@suse.de>
@@ -15879,7 +16133,7 @@
2008-01-21 Alon Dayan <alond@il.ibm.com>
Olga Golovanevsky <olga@il.ibm.com>
-
+
PR tree-optimization/34701
* ipa-struct-reorg.c (gen_size): Fix the malloc parameter calculation
when the structure size is not a power of 2.
@@ -15887,7 +16141,7 @@
2008-01-20 Kenneth Zadeck <zadeck@naturalbridge.com>
* doc/install.texi: Add doc for --enable-checking=df.
-
+
2008-01-20 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/34808
@@ -15961,7 +16215,7 @@
(df_live_init): Init the df_live sets only with the variables
found live by df_lr.
(df_live_transfer_function): Use the df_lr sets to prune the
- df_live sets as they are being computed.
+ df_live sets as they are being computed.
(df_live_free): Free df_live_scratch.
2008-01-18 Ian Lance Taylor <iant@google.com>
@@ -16143,7 +16397,7 @@
2008-01-16 Sebastian Pop <sebastian.pop@amd.com>
- * tree-data-ref.c (subscript_dependence_tester_1): Call
+ * tree-data-ref.c (subscript_dependence_tester_1): Call
free_conflict_function.
(compute_self_dependence): Same.
@@ -16182,7 +16436,7 @@
PR c++/24924
* c-opts (c_common_post_options): Do not enable CPP
flag_pedantic_errors by default.
-
+
2008-01-14 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/31944
@@ -16244,9 +16498,9 @@
correct type.
2008-01-11 Bob Wilson <bob.wilson@acm.org>
-
+
* config/xtensa/xtensa.c (override_options): Set flag_shlib.
-
+
2008-01-11 James E. Wilson <wilson@specifix.com>
PR target/26015
@@ -16254,8 +16508,8 @@
2008-01-11 Anatoly Sokolov <aesok@post.ru>
- * config/avr/avr.c (expand_prologue, expand_epilogue): Don't
- save/restore frame pointer register and don't use 'call-prologues'
+ * config/avr/avr.c (expand_prologue, expand_epilogue): Don't
+ save/restore frame pointer register and don't use 'call-prologues'
optimization in function with "OS_task" attribute.
2008-01-11 Eric Botcazou <ebotcazou@adacore.com>
@@ -16381,13 +16635,13 @@
2008-01-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_builtin_reciprocal): Remove check
- for TARGET_RECIP.
-
+ for TARGET_RECIP.
+
2008-01-08 Jan Sjodin <jan.sjodin@amd.com>
-
+
* config/i386/i386.c (k8_cost, amdfam10_cost): Branch costs
for vectorization tuned.
-
+
2008-01-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34683
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 5adbc009454..bbceca5500f 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080729
+20080730
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 3dbaa733fe4..10193a150c9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -113,15 +113,6 @@ VPATH = @srcdir@
vpath %.texi $(gcc_docdir)
vpath %.texi $(gcc_docdir)/include
-# ----
-# Default values for variables overridden in Makefile fragments.
-# These need to be quite early in the Makefile so as to avoid
-# trouble induced by changes in fragment ordering.
-# ----
-
-# For ada/Make-lang.in; overridden in, for example, config/pa/x-ada.
-X_ADA_CFLAGS =
-
# --------
# UNSORTED
# --------
@@ -136,9 +127,11 @@ SUBDIRS =@subdirs@ build
CONFIG_LANGUAGES = @all_selected_languages@
LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
-# Various ways of specifying flags for compilations:
+# Default values for variables overridden in Makefile fragments.
# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
# TCFLAGS is used for compilations with the GCC just built.
+# T_CFLAGS is used for all compilations and is overridden by t-* files.
+T_CFLAGS =
TCFLAGS =
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
@@ -198,9 +191,6 @@ WARN_CFLAGS = @warn_cflags@
CPPFLAGS = @CPPFLAGS@
-# These exists to be overridden by the x-* and t-* files, respectively.
-T_CFLAGS =
-
AWK = @AWK@
CC = @CC@
BISON = @BISON@
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 2dcf15cd375..b000c134db6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,199 @@
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch9.adb: Minor reformatting
+
+ * exp_util.ads (Find_Prim_Op): Document that Program_Error is raised
+ if no primitive operation is found.
+
+ * exp_util.adb: (Find_Prim_Op): Add comments for previous change
+
+ * sem_ch8.adb: Minor reformatting
+
+2008-07-30 Laurent Pautet <pautet@adacore.com>
+
+ * g-pehage.adb:
+ Remove a limitation on the length of the words handled by the minimal
+ perfect hash function generator.
+
+ * g-pehage.ads:
+ Detail the use of subprograms Insert, Initialize, Compute and Finalize.
+ Fix some typos.
+
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * gnatlink.adb: Minor reformatting
+
+2008-07-30 Thomas Quinot <quinot@adacore.com>
+
+ * rtsfind.adb (Check_RPC): Check version consistency even when not
+ generating RCI stubs. Provide more detailed error message in case of
+ mismatch.
+
+2008-07-30 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Analyze_Subprogram_Renaming): When renaming an attribute
+ as a actual in an instance, check for a missing attribute to prevent
+ program_error on an illegal program.
+
+ * exp_util.adb (Find_Prim_Op): Rather than Assert (False), raise program
+ error if primitive is not found, so that exception can be handled
+ elsewhere on illegal programs.
+
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * uintp.adb (UI_GCD): Fix potential overflow
+
+2008-07-30 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * einfo.adb: Flag245 is now used.
+ (Is_Primitive_Wrapper, Set_Is_Primitive_Wrapper): Relax the assertion
+ check to include functions.
+ (Is_Private_Primitive, Set_Is_Private_Primitive): New subprograms.
+ (Wrapped_Entity, Set_Wrapped_Entity): Relax the assertion check to
+ include functions.
+ (Write_Entity_Flags): Move flag Is_Primitive, add Is_Private_Primitive
+ to the list of displayed flags.
+
+ * einfo.ads: Update comment on the usage of Is_Primitive_Wrapper and
+ Wrapped_Entity. These two flags are now present in functions.
+ New flag Is_Private_Primitive.
+ (Is_Private_Primitive, Set_Is_Private_Primitive): New subprograms.
+
+ * exp_ch9.adb:
+ (Build_Wrapper_Bodies): New subprogram.
+ (Build_Wrapper_Body): The spec and body have been moved to in
+ Build_Wrapper_ Bodies. Code cleanup.
+ (Build_Wrapper_Spec): Moved to the spec of Exp_Ch9. Code cleanup.
+ Wrappers are now generated for primitives declared between the private
+ and full view of a concurrent type that implements an interface.
+ (Build_Wrapper_Specs): New subprogram.
+ (Expand_N_Protected_Body): Code reformatting. Replace the wrapper body
+ creation mechanism with a call to Build_Wrapper_Bodies.
+ (Expand_N_Protected_Type_Declaration): Code reformatting. Replace the
+ wrapper spec creation mechanism with a call to Build_Wrapper_Specs.
+ (Expand_N_Task_Body): Replace the wrapper body creation
+ mechanism with a call to Build_Wrapper_Bodies.
+ (Expand_N_Task_Type_Declaration): Replace the wrapper spec
+ creation mechanism with a call to Build_Wrapper_Specs.
+ (Is_Private_Primitive_Subprogram): New subprogram.
+ (Overriding_Possible): Code cleanup.
+ (Replicate_Entry_Formals): Renamed to Replicate_Formals, code cleanup.
+
+ * exp_ch9.ads (Build_Wrapper_Spec): Moved from the body of Exp_Ch9.
+
+ * sem_ch3.adb: Add with and use clause for Exp_Ch9.
+ (Process_Full_View): Build wrapper specs for all primitives
+ that belong to a private view completed by a concurrent type
+ implementing an interface.
+
+ * sem_ch6.adb (Analyze_Subprogram_Body): When the current subprogram
+ is a primitive of a
+ concurrent type with a private view that implements an interface, try to
+ find the proper spec.
+ (Analyze_Subprogram_Declaration): Mark a subprogram as a private
+ primitive if the type of its first parameter is a non-generic tagged
+ private type.
+ (Analyze_Subprogram_Specification): Code reformatting.
+ (Disambiguate_Spec): New routine.
+ (Find_Corresponding_Spec): Add a flag to controll the output of errors.
+ (Is_Private_Concurrent_Primitive): New routine.
+
+ * sem_ch6.ads:
+ (Find_Corresponding_Spec): Add a formal to control the output of errors.
+
+2008-07-30 Doug Rupp <rupp@adacore.com>
+
+ * gigi.h (build_vms_descriptor64): New function prototype.
+ (fill_vms_descriptor): Modified function prototype.
+
+ * utils.c (build_vms_descriptor64): New function.
+
+ * utils2.c (fill_vms_descriptor): Fix handling on 32bit systems.
+
+ * trans.c (call_to_gnu): Call fill_vms_descriptor with new third
+ argument.
+
+ * decl.c (gnat_to_gnu_tree): For By_Descriptor mech, build both a
+ 64bit and 32bit descriptor and save the 64bit version as an alternate
+ TREE_TYPE in the parameter.
+ (make_type_from_size) <RECORD_TYPE>: Use the appropriate mode for the
+ thin pointer.
+
+ * ada-tree.h (DECL_PARM_ALT, SET_DECL_PARM_ALT): New macros.
+
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * make.adb: Minor reformatting
+
+ * mlib-utl.adb: Minor reformatting
+
+ * osint.ads: Minor reformatting
+
+2008-07-30 Jose Ruiz <ruiz@adacore.com>
+
+ * adaint.c
+ (__gnat_file_exists): Do not use __gnat_stat for RTX.
+ (__main for RTX in RTSS mode): Create this dummy procedure symbol to
+ avoid the use of this symbol from libgcc.a in RTX kernel mode.
+
+ * cio.c
+ (put_int, put_int_stderr, put_char, put_char_stderr): For RTX we call
+ the function RtPrintf for console output.
+
+ * argv.c Do not use the environ variable for RTX.
+
+ * gnatlink.adb (gnatlink): The part that handles the --RTS option has
+ been moved before the call to Osint.Add_Default_Search_Dirs in order
+ to take into account the flags in system.ads (RTX_RTSS_Kernel_Module)
+ from the appropriate run time.
+
+ * targparm.ads
+ (RTX_RTSS_Kernel_Module_On_Target): Add this flag that is set to True if
+ target is a RTSS module for RTX.
+
+ * targparm.adb (Targparm_Tags, RTX_Str, Targparm_Str): Add tag RTX for
+ RTX_RTSS_Kernel_Module
+ (Get_Target_Parameters): Add processing of RTX_RTSS_Kernel_Module flag.
+
+ * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS for RTX): Use gcc
+ exception handling mechanism for Windows and RTX in Win32 mode, but
+ not for RTX in kernel mode (RTSS).
+ (LIBGNAT_SRCS): Remove ada.h
+
+2008-07-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * gcc-interface/Make-lang.in (ALL_ADAFLAGS): Remove X_ADAFLAGS and
+ T_ADAFLAGS, replace ALL_ADA_CFLAGS with ADA_CFLAGS.
+ (ALL_ADA_CFLAGS): Remove, replace throughout with ADA_CFLAGS.
+ * gcc-interface/Makefile.in (XCFLAGS, X_CFLAGS, X_CPPFLAGS, T_CPPFLAGS,
+ X_ADA_CFLAGS, T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS, ADA_CFLAGS,
+ ALL_ADA_CFLAGS): Remove.
+ (ALL_ADAFLAGS, MOST_ADAFLAGS): Remove X_ADAFLAGS and T_ADAFLAGS,
+ replace ALL_ADA_CFLAGS with ADA_CFLAGS.
+ (GCC_CFLAGS): Remove X_CFLAGS.
+ (LOOSE_CFLAGS): Remove X_CFLAGS and XCFLAGS.
+ (ALL_CPPFLAGS): Remove X_CPPFLAGS and T_CPPFLAGS.
+ (ADA_CFLAGS): Substitute.
+
+2008-07-30 Laurent Guerby <laurent@guerby.net>
+
+ PR ada/5911
+ * gcc-interface/Makefile.in (MULTISUBDIR, RTSDIR): New variables.
+ Pass MULTISUBDIR to recursive make. Use $(RTSDIR) instead of rts.
+ Replace stamp-gnatlib* by stamp-gnatlib*-rts.
+ * gcc-interface/Make-lang.in: Replace stamp-gnatlib2
+ by stamp-gnatlib2-rts.
+
+2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR documentation/15479
+ * gnat-style.texi: Remove AdaCore copyright statement and GPL
+ statement for GNAT. Add @copying stanza, use it. Update to
+ GFDL 1.2. Do not list GFDL as Invariant Section, do not list
+ title as Front-Cover Text.
+ * gnat_rm.texi: Likewise.
+ * gnat_ugn.texi: Likewise.
+
2008-07-29 Jan Hubicka <jh@suse.cz>
* trans.c (process_inlined_subprograms): Remove tree_really_inline
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 8f7bcab516f..29f649aa096 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -1061,6 +1061,7 @@ __gnat_readdir (DIR *dirp, char *buffer, int *len)
/* Not supported in RTX */
return NULL;
+
#elif defined (__MINGW32__)
struct _tdirent *dirent = _treaddir ((_TDIR*)dirp);
@@ -1606,7 +1607,7 @@ __gnat_stat (char *name, struct stat *statbuf)
int
__gnat_file_exists (char *name)
{
-#if defined (__MINGW32__) && !defined (RTX)
+#ifdef __MINGW32__
/* On Windows do not use __gnat_stat() because a bug in Microsoft
_stat() routine. When the system time-zone is set with a negative
offset the _stat() routine fails on specific files like CON: */
@@ -3048,11 +3049,14 @@ __gnat_sals_init_using_constructors ()
#endif
}
+#ifdef RTX
+
/* In RTX mode, the procedure to get the time (as file time) is different
in RTSS mode and Win32 mode. In order to avoid duplicating an Ada file,
we introduce an intermediate procedure to link against the corresponding
one in each situation. */
-#ifdef RTX
+
+extern void GetTimeAsFileTime(LPFILETIME pTime);
void GetTimeAsFileTime(LPFILETIME pTime)
{
@@ -3062,6 +3066,16 @@ void GetTimeAsFileTime(LPFILETIME pTime)
GetSystemTimeAsFileTime (pTime); /* w32 interface */
#endif
}
+
+#ifdef RTSS
+/* Add symbol that is required to link. It would otherwise be taken from
+ libgcc.a and it would try to use the gcc constructors that are not
+ supported by Microsoft linker. */
+
+extern void __main (void);
+
+void __main (void) {}
+#endif
#endif
#if defined (linux) || defined(__GLIBC__)
diff --git a/gcc/ada/argv.c b/gcc/ada/argv.c
index 276edf7e0f2..0adfa4ea948 100644
--- a/gcc/ada/argv.c
+++ b/gcc/ada/argv.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -61,7 +61,7 @@ int gnat_argc = 0;
const char **gnat_argv = (const char **) 0;
const char **gnat_envp = (const char **) 0;
-#ifdef _WIN32
+#if defined (_WIN32) && !defined (RTX)
/* Note that on Windows environment the environ point to a buffer that could
be reallocated if needed. It means that gnat_envp needs to be updated
before using gnat_envp to point to the right environment space */
diff --git a/gcc/ada/cio.c b/gcc/ada/cio.c
index 6fba5a0b0cb..67dcfc3dd36 100644
--- a/gcc/ada/cio.c
+++ b/gcc/ada/cio.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2005, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -56,6 +56,11 @@
#undef getchar
#endif
+#ifdef RTX
+#include <windows.h>
+#include <Rtapi.h>
+#endif
+
int
get_char (void)
{
@@ -78,27 +83,43 @@ get_int (void)
void
put_int (int x)
{
+#ifdef RTX
+ RtPrintf ("%d", x);
+#else
/* Use fprintf rather than printf, since the latter is unbuffered
on vxworks */
fprintf (stdout, "%d", x);
+#endif
}
void
put_int_stderr (int x)
{
+#ifdef RTX
+ RtPrintf ("%d", x);
+#else
fprintf (stderr, "%d", x);
+#endif
}
void
put_char (int c)
{
+#ifdef RTX
+ RtPrintf ("%c", c);
+#else
putchar (c);
+#endif
}
void
put_char_stderr (int c)
{
+#ifdef RTX
+ RtPrintf ("%c", c);
+#else
fputc (c, stderr);
+#endif
}
#ifdef __vxworks
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 49dffae047b..01d384ec4f6 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -504,9 +504,8 @@ package body Einfo is
-- Optimize_Alignment_Time Flag242
-- Overlays_Constant Flag243
-- Is_RACW_Stub_Type Flag244
+ -- Is_Private_Primitive Flag245
- -- (unused) Flag169
- -- (unused) Flag245
-- (unused) Flag246
-- (unused) Flag247
@@ -1929,7 +1928,8 @@ package body Einfo is
function Is_Primitive_Wrapper (Id : E) return B is
begin
- pragma Assert (Ekind (Id) = E_Procedure);
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
return Flag195 (Id);
end Is_Primitive_Wrapper;
@@ -1944,6 +1944,13 @@ package body Einfo is
return Flag53 (Id);
end Is_Private_Descendant;
+ function Is_Private_Primitive (Id : E) return B is
+ begin
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
+ return Flag245 (Id);
+ end Is_Private_Primitive;
+
function Is_Protected_Interface (Id : E) return B is
begin
pragma Assert (Is_Interface (Id));
@@ -2702,8 +2709,9 @@ package body Einfo is
function Wrapped_Entity (Id : E) return E is
begin
- pragma Assert (Ekind (Id) = E_Procedure
- and then Is_Primitive_Wrapper (Id));
+ pragma Assert ((Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure)
+ and then Is_Primitive_Wrapper (Id));
return Node27 (Id);
end Wrapped_Entity;
@@ -4372,7 +4380,8 @@ package body Einfo is
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True) is
begin
- pragma Assert (Ekind (Id) = E_Procedure);
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
Set_Flag195 (Id, V);
end Set_Is_Primitive_Wrapper;
@@ -4387,6 +4396,13 @@ package body Einfo is
Set_Flag53 (Id, V);
end Set_Is_Private_Descendant;
+ procedure Set_Is_Private_Primitive (Id : E; V : B := True) is
+ begin
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
+ Set_Flag245 (Id, V);
+ end Set_Is_Private_Primitive;
+
procedure Set_Is_Protected_Interface (Id : E; V : B := True) is
begin
pragma Assert (Is_Interface (Id));
@@ -5168,8 +5184,9 @@ package body Einfo is
procedure Set_Wrapped_Entity (Id : E; V : E) is
begin
- pragma Assert (Ekind (Id) = E_Procedure
- and then Is_Primitive_Wrapper (Id));
+ pragma Assert ((Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure)
+ and then Is_Primitive_Wrapper (Id));
Set_Node27 (Id, V);
end Set_Wrapped_Entity;
@@ -7597,9 +7614,11 @@ package body Einfo is
W ("Is_Packed_Array_Type", Flag138 (Id));
W ("Is_Potentially_Use_Visible", Flag9 (Id));
W ("Is_Preelaborated", Flag59 (Id));
+ W ("Is_Primitive", Flag218 (Id));
W ("Is_Primitive_Wrapper", Flag195 (Id));
W ("Is_Private_Composite", Flag107 (Id));
W ("Is_Private_Descendant", Flag53 (Id));
+ W ("Is_Private_Primitive", Flag245 (Id));
W ("Is_Protected_Interface", Flag198 (Id));
W ("Is_Public", Flag10 (Id));
W ("Is_Pure", Flag44 (Id));
@@ -7666,7 +7685,6 @@ package body Einfo is
W ("Suppress_Init_Proc", Flag105 (Id));
W ("Suppress_Style_Checks", Flag165 (Id));
W ("Suppress_Value_Tracking_On_Call", Flag217 (Id));
- W ("Is_Primitive", Flag218 (Id));
W ("Treat_As_Volatile", Flag41 (Id));
W ("Universal_Aliasing", Flag216 (Id));
W ("Used_As_Generic_Actual", Flag222 (Id));
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 43e0e17ab1d..8316a68018a 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -2513,9 +2513,9 @@ package Einfo is
-- indicators in bodies.
-- Is_Primitive_Wrapper (Flag195)
--- Present in all entities. Set for procedure entries that are used as
--- primitive wrappers. which are generated by the expander to wrap
--- entries of protected or task types implementing a limited interface.
+-- Present in functions and procedures created by the expander to serve
+-- as an indirection mechanism to overriding primitives of concurrent
+-- types, entries and protected procedures.
-- Is_Prival (synthesized)
-- Applies to all entities, true for renamings of private protected
@@ -2533,6 +2533,10 @@ package Einfo is
-- functions, procedures). Set if the library unit is itself a private
-- child unit, or if it is the descendent of a private child unit.
+-- Is_Private_Primitive (Flag245)
+-- Present in subprograms. Set if the first parameter of the subprogram
+-- is of concurrent tagged type with a private view.
+
-- Is_Private_Type (synthesized)
-- Applies to all entities, true for private types and subtypes,
-- as well as for record with private types as subtypes
@@ -3723,8 +3727,8 @@ package Einfo is
-- attribute when the limited-view is installed (Ada 2005: AI-217).
-- Wrapped_Entity (Node27)
--- Present in an E_Procedure classified as an Is_Primitive_Wrapper. Set
--- to the entity that is being wrapped.
+-- Present in functions and procedures which have been classified as
+-- Is_Primitive_Wrapper. Set to the entity being wrapper.
------------------
-- Access Kinds --
@@ -5013,6 +5017,7 @@ package Einfo is
-- Protection_Object (Node23) (for concurrent kind)
-- Interface_Alias (Node25)
-- Overridden_Operation (Node26)
+ -- Wrapped_Entity (Node27) (non-generic case only)
-- Extra_Formals (Node28)
-- Body_Needed_For_SAL (Flag40)
-- Elaboration_Entity_Required (Flag174)
@@ -5039,7 +5044,9 @@ package Einfo is
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Primitive (Flag218)
+ -- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
+ -- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
-- Is_Thunk (Flag225)
-- Is_Visible_Child_Unit (Flag116)
@@ -5305,6 +5312,7 @@ package Einfo is
-- Is_Primitive (Flag218)
-- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
+ -- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
-- Is_Thunk (Flag225)
-- Is_Valued_Procedure (Flag127)
@@ -5974,6 +5982,7 @@ package Einfo is
function Is_Primitive_Wrapper (Id : E) return B;
function Is_Private_Composite (Id : E) return B;
function Is_Private_Descendant (Id : E) return B;
+ function Is_Private_Primitive (Id : E) return B;
function Is_Protected_Interface (Id : E) return B;
function Is_Public (Id : E) return B;
function Is_Pure (Id : E) return B;
@@ -6538,6 +6547,7 @@ package Einfo is
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True);
procedure Set_Is_Private_Composite (Id : E; V : B := True);
procedure Set_Is_Private_Descendant (Id : E; V : B := True);
+ procedure Set_Is_Private_Primitive (Id : E; V : B := True);
procedure Set_Is_Protected_Interface (Id : E; V : B := True);
procedure Set_Is_Public (Id : E; V : B := True);
procedure Set_Is_Pure (Id : E; V : B := True);
@@ -7216,6 +7226,7 @@ package Einfo is
pragma Inline (Is_Primitive_Wrapper);
pragma Inline (Is_Private_Composite);
pragma Inline (Is_Private_Descendant);
+ pragma Inline (Is_Private_Primitive);
pragma Inline (Is_Private_Type);
pragma Inline (Is_Protected_Interface);
pragma Inline (Is_Protected_Type);
@@ -7609,6 +7620,7 @@ package Einfo is
pragma Inline (Set_Is_Primitive_Wrapper);
pragma Inline (Set_Is_Private_Composite);
pragma Inline (Set_Is_Private_Descendant);
+ pragma Inline (Set_Is_Private_Primitive);
pragma Inline (Set_Is_Protected_Interface);
pragma Inline (Set_Is_Public);
pragma Inline (Set_Is_Pure);
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 572dae04ea0..574d01f0ac8 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -152,29 +152,25 @@ package body Exp_Ch9 is
-- <formalN> : AnnN;
-- end record;
- function Build_Wrapper_Body
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id;
- -- Ada 2005 (AI-345): Build the body that wraps a primitive operation
- -- associated with a protected or task type. This is required to implement
- -- dispatching calls through interfaces. Proc_Nam is the entry name to be
- -- wrapped, Obj_Typ is the type of the newly added formal parameter to
- -- handle object notation, Formals are the original entry formals that will
- -- be explicitly replicated.
-
- function Build_Wrapper_Spec
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id;
- -- Ada 2005 (AI-345): Build the specification of a primitive operation
- -- associated with a protected or task type. This is required implement
- -- dispatching calls through interfaces. Proc_Nam is the entry name to be
- -- wrapped, Obj_Typ is the type of the newly added formal parameter to
- -- handle object notation, Formals are the original entry formals that will
- -- be explicitly replicated.
+ procedure Build_Wrapper_Bodies
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : Node_Id);
+ -- Ada 2005 (AI-345): Typ is either a concurrent type or the corresponding
+ -- record of a concurrent type. N is the insertion node where all bodies
+ -- will be placed. This routine builds the bodies of the subprograms which
+ -- serve as an indirection mechanism to overriding primitives of concurrent
+ -- types, entries and protected procedures. Any new body is analyzed.
+
+ procedure Build_Wrapper_Specs
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : in out Node_Id);
+ -- Ada 2005 (AI-345): Typ is either a concurrent type or the corresponding
+ -- record of a concurrent type. N is the insertion node where all specs
+ -- will be placed. This routine builds the specs of the subprograms which
+ -- serve as an indirection mechanism to overriding primitives of concurrent
+ -- types, entries and protected procedures. Any new spec is analyzed.
function Build_Find_Body_Index (Typ : Entity_Id) return Node_Id;
-- Build the function that translates the entry index in the call
@@ -359,6 +355,10 @@ package body Exp_Ch9 is
Lo : Node_Id;
Hi : Node_Id) return Boolean;
+ function Is_Private_Primitive_Subprogram (Id : Entity_Id) return Boolean;
+ -- Determine whether Id is a function or a procedure and is marked as a
+ -- private primitive.
+
function Null_Statements (Stats : List_Id) return Boolean;
-- Used to check DO-END sequence. Checks for equivalent of DO NULL; END.
-- Allows labels, and pragma Warnings/Unreferenced in the sequence as
@@ -1541,144 +1541,241 @@ package body Exp_Ch9 is
return Rec_Nam;
end Build_Parameter_Block;
- ------------------------
- -- Build_Wrapper_Body --
- ------------------------
+ --------------------------
+ -- Build_Wrapper_Bodies --
+ --------------------------
- function Build_Wrapper_Body
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id
+ procedure Build_Wrapper_Bodies
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : Node_Id)
is
- Actuals : List_Id := No_List;
- Body_Spec : Node_Id;
- Conv_Id : Node_Id;
- First_Formal : Node_Id;
- Formal : Node_Id;
-
- begin
- Body_Spec := Build_Wrapper_Spec (Loc, Proc_Nam, Obj_Typ, Formals);
+ Rec_Typ : Entity_Id;
- -- If we did not generate the specification do have nothing else to do
+ function Build_Wrapper_Body
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id;
+ -- Ada 2005 (AI-345): Build the body that wraps a primitive operation
+ -- associated with a protected or task type. Subp_Id is the subprogram
+ -- name which will be wrapped. Obj_Typ is the type of the new formal
+ -- parameter which handles dispatching and object notation. Formals are
+ -- the original formals of Subp_Id which will be explicitly replicated.
+
+ ------------------------
+ -- Build_Wrapper_Body --
+ ------------------------
+
+ function Build_Wrapper_Body
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id
+ is
+ Body_Spec : Node_Id;
- if Body_Spec = Empty then
- return Empty;
- end if;
+ begin
+ Body_Spec := Build_Wrapper_Spec (Loc, Subp_Id, Obj_Typ, Formals);
- -- Map formals to actuals. Use the list built for the wrapper spec,
- -- skipping the object notation parameter.
+ -- The subprogram is not overriding or is not a primitive declared
+ -- between two views.
- First_Formal := First (Parameter_Specifications (Body_Spec));
+ if No (Body_Spec) then
+ return Empty;
+ end if;
- Formal := First_Formal;
- Next (Formal);
+ declare
+ Actuals : List_Id := No_List;
+ Conv_Id : Node_Id;
+ First_Formal : Node_Id;
+ Formal : Node_Id;
+ Nam : Node_Id;
- if Present (Formal) then
- Actuals := New_List;
+ begin
+ -- Map formals to actuals. Use the list built for the wrapper
+ -- spec, skipping the object notation parameter.
- while Present (Formal) loop
- Append_To (Actuals,
- Make_Identifier (Loc, Chars =>
- Chars (Defining_Identifier (Formal))));
+ First_Formal := First (Parameter_Specifications (Body_Spec));
+ Formal := First_Formal;
Next (Formal);
- end loop;
- end if;
- -- An access-to-variable first parameter will require an explicit
- -- dereference in the unchecked conversion. This case occurs when
- -- a protected entry wrapper must override an interface-level
- -- procedure with interface access as first parameter.
+ if Present (Formal) then
+ Actuals := New_List;
- -- SubprgName (O.all).Proc_Nam (Formal_1 .. Formal_N)
+ while Present (Formal) loop
+ Append_To (Actuals,
+ Make_Identifier (Loc, Chars =>
+ Chars (Defining_Identifier (Formal))));
- if Nkind (Parameter_Type (First_Formal)) = N_Access_Definition then
- Conv_Id :=
- Make_Explicit_Dereference (Loc,
- Prefix =>
- Make_Identifier (Loc, Chars => Name_uO));
+ Next (Formal);
+ end loop;
+ end if;
+
+ -- Special processing for primitives declared between a private
+ -- type and its completion.
+
+ if Is_Private_Primitive_Subprogram (Subp_Id) then
+ if No (Actuals) then
+ Actuals := New_List;
+ end if;
+
+ Prepend_To (Actuals,
+ Unchecked_Convert_To (
+ Corresponding_Concurrent_Type (Obj_Typ),
+ Make_Identifier (Loc, Name_uO)));
+
+ Nam := New_Reference_To (Subp_Id, Loc);
+
+ else
+ -- An access-to-variable object parameter requires an explicit
+ -- dereference in the unchecked conversion. This case occurs
+ -- when a protected entry wrapper must override an interface
+ -- level procedure with interface access as first parameter.
+
+ -- O.all.Subp_Id (Formal_1 .. Formal_N)
+
+ if Nkind (Parameter_Type (First_Formal)) =
+ N_Access_Definition
+ then
+ Conv_Id :=
+ Make_Explicit_Dereference (Loc,
+ Prefix => Make_Identifier (Loc, Name_uO));
+ else
+ Conv_Id := Make_Identifier (Loc, Name_uO);
+ end if;
+
+ Nam :=
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Unchecked_Convert_To (
+ Corresponding_Concurrent_Type (Obj_Typ),
+ Conv_Id),
+ Selector_Name =>
+ New_Reference_To (Subp_Id, Loc));
+ end if;
+
+ -- Create the subprogram body
+
+ if Ekind (Subp_Id) = E_Function then
+ return
+ Make_Subprogram_Body (Loc,
+ Specification => Body_Spec,
+ Declarations => Empty_List,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Simple_Return_Statement (Loc,
+ Make_Function_Call (Loc,
+ Name => Nam,
+ Parameter_Associations => Actuals)))));
+
+ else
+ return
+ Make_Subprogram_Body (Loc,
+ Specification => Body_Spec,
+ Declarations => Empty_List,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Procedure_Call_Statement (Loc,
+ Name => Nam,
+ Parameter_Associations => Actuals))));
+ end if;
+ end;
+ end Build_Wrapper_Body;
+
+ -- Start of processing for Build_Wrapper_Bodies
+
+ begin
+ if Is_Concurrent_Type (Typ) then
+ Rec_Typ := Corresponding_Record_Type (Typ);
else
- Conv_Id :=
- Make_Identifier (Loc, Chars => Name_uO);
+ Rec_Typ := Typ;
end if;
- if Ekind (Proc_Nam) = E_Function then
- return
- Make_Subprogram_Body (Loc,
- Specification => Body_Spec,
- Declarations => Empty_List,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements =>
- New_List (
- Make_Simple_Return_Statement (Loc,
- Make_Function_Call (Loc,
- Name =>
- Make_Selected_Component (Loc,
- Prefix =>
- Unchecked_Convert_To (
- Corresponding_Concurrent_Type (Obj_Typ),
- Conv_Id),
- Selector_Name =>
- New_Reference_To (Proc_Nam, Loc)),
- Parameter_Associations => Actuals)))));
- else
- return
- Make_Subprogram_Body (Loc,
- Specification => Body_Spec,
- Declarations => Empty_List,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements =>
- New_List (
- Make_Procedure_Call_Statement (Loc,
- Name =>
- Make_Selected_Component (Loc,
- Prefix =>
- Unchecked_Convert_To (
- Corresponding_Concurrent_Type (Obj_Typ),
- Conv_Id),
- Selector_Name =>
- New_Reference_To (Proc_Nam, Loc)),
- Parameter_Associations => Actuals))));
+ -- Generate wrapper bodies for a concurrent type which implements an
+ -- interface.
+
+ if Present (Interfaces (Rec_Typ)) then
+ declare
+ Insert_Nod : Node_Id;
+ Prim : Entity_Id;
+ Prim_Elmt : Elmt_Id;
+ Prim_Decl : Node_Id;
+ Subp : Entity_Id;
+ Wrap_Body : Node_Id;
+ Wrap_Id : Entity_Id;
+
+ begin
+ Insert_Nod := N;
+
+ -- Examine all primitive operations of the corresponding record
+ -- type, looking for wrapper specs. Generate bodies in order to
+ -- complete them.
+
+ Prim_Elmt := First_Elmt (Primitive_Operations (Rec_Typ));
+ while Present (Prim_Elmt) loop
+ Prim := Node (Prim_Elmt);
+
+ if (Ekind (Prim) = E_Function
+ or else Ekind (Prim) = E_Procedure)
+ and then Is_Primitive_Wrapper (Prim)
+ then
+ Subp := Wrapped_Entity (Prim);
+ Prim_Decl := Parent (Parent (Prim));
+
+ Wrap_Body :=
+ Build_Wrapper_Body (Loc,
+ Subp_Id => Subp,
+ Obj_Typ => Rec_Typ,
+ Formals => Parameter_Specifications (Parent (Subp)));
+ Wrap_Id := Defining_Unit_Name (Specification (Wrap_Body));
+
+ Set_Corresponding_Spec (Wrap_Body, Prim);
+ Set_Corresponding_Body (Prim_Decl, Wrap_Id);
+
+ Insert_After (Insert_Nod, Wrap_Body);
+ Insert_Nod := Wrap_Body;
+
+ Analyze (Wrap_Body);
+ end if;
+
+ Next_Elmt (Prim_Elmt);
+ end loop;
+ end;
end if;
- end Build_Wrapper_Body;
+ end Build_Wrapper_Bodies;
------------------------
-- Build_Wrapper_Spec --
------------------------
function Build_Wrapper_Spec
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id
is
- New_Name_Id : constant Entity_Id :=
- Make_Defining_Identifier (Loc, Chars (Proc_Nam));
-
- First_Param : Node_Id := Empty;
- Iface : Entity_Id;
- Iface_Elmt : Elmt_Id := No_Elmt;
- New_Formals : List_Id;
- Obj_Param : Node_Id;
- Obj_Param_Typ : Node_Id;
- Iface_Prim_Op : Entity_Id;
- Iface_Prim_Op_Elmt : Elmt_Id;
+ First_Param : Node_Id;
+ Iface : Entity_Id;
+ Iface_Elmt : Elmt_Id;
+ Iface_Op : Entity_Id;
+ Iface_Op_Elmt : Elmt_Id;
function Overriding_Possible
- (Iface_Prim_Op : Entity_Id;
- Proc_Nam : Entity_Id) return Boolean;
- -- Determine whether a primitive operation can be overridden by the
- -- wrapper. Iface_Prim_Op is the candidate primitive operation of an
- -- abstract interface type, Proc_Nam is the generated entry wrapper.
+ (Iface_Op : Entity_Id;
+ Wrapper : Entity_Id) return Boolean;
+ -- Determine whether a primitive operation can be overridden by Wrapper.
+ -- Iface_Op is the candidate primitive operation of an interface type,
+ -- Wrapper is the generated entry wrapper.
- function Replicate_Entry_Formals
+ function Replicate_Formals
(Loc : Source_Ptr;
Formals : List_Id) return List_Id;
- -- An explicit parameter replication is required due to the
- -- Is_Entry_Formal flag being set for all the formals. The explicit
+ -- An explicit parameter replication is required due to the Is_Entry_
+ -- Formal flag being set for all the formals of an entry. The explicit
-- replication removes the flag that would otherwise cause a different
-- path of analysis.
@@ -1687,18 +1784,15 @@ package body Exp_Ch9 is
-------------------------
function Overriding_Possible
- (Iface_Prim_Op : Entity_Id;
- Proc_Nam : Entity_Id) return Boolean
+ (Iface_Op : Entity_Id;
+ Wrapper : Entity_Id) return Boolean
is
- Prim_Op_Spec : constant Node_Id := Parent (Iface_Prim_Op);
- Proc_Spec : constant Node_Id := Parent (Proc_Nam);
-
- Is_Access_To_Variable : Boolean;
- Is_Out_Present : Boolean;
+ Iface_Op_Spec : constant Node_Id := Parent (Iface_Op);
+ Wrapper_Spec : constant Node_Id := Parent (Wrapper);
function Type_Conformant_Parameters
- (Prim_Op_Param_Specs : List_Id;
- Proc_Param_Specs : List_Id) return Boolean;
+ (Iface_Op_Params : List_Id;
+ Wrapper_Params : List_Id) return Boolean;
-- Determine whether the parameters of the generated entry wrapper
-- and those of a primitive operation are type conformant. During
-- this check, the first parameter of the primitive operation is
@@ -1709,40 +1803,40 @@ package body Exp_Ch9 is
--------------------------------
function Type_Conformant_Parameters
- (Prim_Op_Param_Specs : List_Id;
- Proc_Param_Specs : List_Id) return Boolean
+ (Iface_Op_Params : List_Id;
+ Wrapper_Params : List_Id) return Boolean
is
- Prim_Op_Param : Node_Id;
- Prim_Op_Typ : Entity_Id;
- Proc_Param : Node_Id;
- Proc_Typ : Entity_Id;
+ Iface_Op_Param : Node_Id;
+ Iface_Op_Typ : Entity_Id;
+ Wrapper_Param : Node_Id;
+ Wrapper_Typ : Entity_Id;
begin
-- Skip the first parameter of the primitive operation
- Prim_Op_Param := Next (First (Prim_Op_Param_Specs));
- Proc_Param := First (Proc_Param_Specs);
- while Present (Prim_Op_Param)
- and then Present (Proc_Param)
+ Iface_Op_Param := Next (First (Iface_Op_Params));
+ Wrapper_Param := First (Wrapper_Params);
+ while Present (Iface_Op_Param)
+ and then Present (Wrapper_Param)
loop
- Prim_Op_Typ := Find_Parameter_Type (Prim_Op_Param);
- Proc_Typ := Find_Parameter_Type (Proc_Param);
+ Iface_Op_Typ := Find_Parameter_Type (Iface_Op_Param);
+ Wrapper_Typ := Find_Parameter_Type (Wrapper_Param);
-- The two parameters must be mode conformant
if not Conforming_Types
- (Prim_Op_Typ, Proc_Typ, Mode_Conformant)
+ (Iface_Op_Typ, Wrapper_Typ, Mode_Conformant)
then
return False;
end if;
- Next (Prim_Op_Param);
- Next (Proc_Param);
+ Next (Iface_Op_Param);
+ Next (Wrapper_Param);
end loop;
-- One of the lists is longer than the other
- if Present (Prim_Op_Param) or else Present (Proc_Param) then
+ if Present (Iface_Op_Param) or else Present (Wrapper_Param) then
return False;
end if;
@@ -1752,47 +1846,41 @@ package body Exp_Ch9 is
-- Start of processing for Overriding_Possible
begin
- if Chars (Iface_Prim_Op) /= Chars (Proc_Nam) then
+ if Chars (Iface_Op) /= Chars (Wrapper) then
return False;
end if;
- -- Special check for protected procedures: If an inherited subprogram
- -- is implemented by a protected procedure or an entry, then the
- -- first parameter of the inherited subprogram shall be of mode OUT
- -- or IN OUT, or an access-to-variable parameter.
-
- if Ekind (Iface_Prim_Op) = E_Procedure then
-
- Is_Out_Present :=
- Present (Parameter_Specifications (Prim_Op_Spec))
- and then
- Out_Present (First (Parameter_Specifications (Prim_Op_Spec)));
+ -- If an inherited subprogram is implemented by a protected procedure
+ -- or an entry, then the first parameter of the inherited subprogram
+ -- shall be of mode OUT or IN OUT, or access-to-variable parameter.
- Is_Access_To_Variable :=
- Present (Parameter_Specifications (Prim_Op_Spec))
- and then
- Nkind (Parameter_Type
- (First
- (Parameter_Specifications (Prim_Op_Spec)))) =
- N_Access_Definition;
-
- if not Is_Out_Present
- and then not Is_Access_To_Variable
- then
- return False;
- end if;
+ if Ekind (Iface_Op) = E_Procedure
+ and then Present (Parameter_Specifications (Iface_Op_Spec))
+ then
+ declare
+ Obj_Param : constant Node_Id :=
+ First (Parameter_Specifications (Iface_Op_Spec));
+ begin
+ if not Out_Present (Obj_Param)
+ and then Nkind (Parameter_Type (Obj_Param)) /=
+ N_Access_Definition
+ then
+ return False;
+ end if;
+ end;
end if;
- return Type_Conformant_Parameters (
- Parameter_Specifications (Prim_Op_Spec),
- Parameter_Specifications (Proc_Spec));
+ return
+ Type_Conformant_Parameters (
+ Parameter_Specifications (Iface_Op_Spec),
+ Parameter_Specifications (Wrapper_Spec));
end Overriding_Possible;
- -----------------------------
- -- Replicate_Entry_Formals --
- -----------------------------
+ -----------------------
+ -- Replicate_Formals --
+ -----------------------
- function Replicate_Entry_Formals
+ function Replicate_Formals
(Loc : Source_Ptr;
Formals : List_Id) return List_Id
is
@@ -1802,6 +1890,14 @@ package body Exp_Ch9 is
begin
Formal := First (Formals);
+
+ -- Skip the object parameter when dealing with primitives declared
+ -- between two views.
+
+ if Is_Private_Primitive_Subprogram (Subp_Id) then
+ Formal := Next (Formal);
+ end if;
+
while Present (Formal) loop
-- Create an explicit copy of the entry parameter
@@ -1835,166 +1931,229 @@ package body Exp_Ch9 is
end loop;
return New_Formals;
- end Replicate_Entry_Formals;
+ end Replicate_Formals;
-- Start of processing for Build_Wrapper_Spec
begin
- -- The mode is determined by the first parameter of the interface-level
- -- procedure that the current entry is trying to override.
-
- pragma Assert (Is_Non_Empty_List (Abstract_Interface_List (Obj_Typ)));
-
- -- We must examine all the protected operations of the implemented
- -- interfaces in order to discover a possible overriding candidate.
-
- Iface := Etype (First (Abstract_Interface_List (Obj_Typ)));
-
- Examine_Parents : loop
- if Present (Primitive_Operations (Iface)) then
- Iface_Prim_Op_Elmt := First_Elmt (Primitive_Operations (Iface));
- while Present (Iface_Prim_Op_Elmt) loop
- Iface_Prim_Op := Node (Iface_Prim_Op_Elmt);
+ -- There is no point in building wrappers for non-tagged concurrent
+ -- types.
- if not Is_Predefined_Dispatching_Operation (Iface_Prim_Op) then
- while Present (Alias (Iface_Prim_Op)) loop
- Iface_Prim_Op := Alias (Iface_Prim_Op);
- end loop;
+ pragma Assert (Is_Tagged_Type (Obj_Typ));
- -- The current primitive operation can be overridden by the
- -- generated entry wrapper.
+ -- An entry or a protected procedure can override a routine where the
+ -- controlling formal is either IN OUT, OUT or is of access-to-variable
+ -- type. Since the wrapper must have the exact same signature as that of
+ -- the overridden subprogram, we try to find the overriding candidate
+ -- and use its controlling formal.
- if Overriding_Possible (Iface_Prim_Op, Proc_Nam) then
- First_Param := First (Parameter_Specifications
- (Parent (Iface_Prim_Op)));
+ First_Param := Empty;
- goto Found;
- end if;
- end if;
+ -- Check every implemented interface
- Next_Elmt (Iface_Prim_Op_Elmt);
- end loop;
- end if;
-
- exit Examine_Parents when Etype (Iface) = Iface;
-
- Iface := Etype (Iface);
- end loop Examine_Parents;
-
- if Present (Interfaces
- (Corresponding_Record_Type (Scope (Proc_Nam))))
- then
- Iface_Elmt := First_Elmt
- (Interfaces
- (Corresponding_Record_Type (Scope (Proc_Nam))));
- Examine_Interfaces : while Present (Iface_Elmt) loop
+ if Present (Interfaces (Obj_Typ)) then
+ Iface_Elmt := First_Elmt (Interfaces (Obj_Typ));
+ Search : while Present (Iface_Elmt) loop
Iface := Node (Iface_Elmt);
+ -- Check every interface primitive
+
if Present (Primitive_Operations (Iface)) then
- Iface_Prim_Op_Elmt := First_Elmt (Primitive_Operations (Iface));
- while Present (Iface_Prim_Op_Elmt) loop
- Iface_Prim_Op := Node (Iface_Prim_Op_Elmt);
+ Iface_Op_Elmt := First_Elmt (Primitive_Operations (Iface));
+ while Present (Iface_Op_Elmt) loop
+ Iface_Op := Node (Iface_Op_Elmt);
- if not Is_Predefined_Dispatching_Operation
- (Iface_Prim_Op)
- then
- while Present (Alias (Iface_Prim_Op)) loop
- Iface_Prim_Op := Alias (Iface_Prim_Op);
- end loop;
+ -- Ignore predefined primitives
+
+ if not Is_Predefined_Dispatching_Operation (Iface_Op) then
+ Iface_Op := Ultimate_Alias (Iface_Op);
-- The current primitive operation can be overridden by
-- the generated entry wrapper.
- if Overriding_Possible (Iface_Prim_Op, Proc_Nam) then
- First_Param := First (Parameter_Specifications
- (Parent (Iface_Prim_Op)));
+ if Overriding_Possible (Iface_Op, Subp_Id) then
+ First_Param :=
+ First (Parameter_Specifications (Parent (Iface_Op)));
- goto Found;
+ exit Search;
end if;
end if;
- Next_Elmt (Iface_Prim_Op_Elmt);
+ Next_Elmt (Iface_Op_Elmt);
end loop;
end if;
Next_Elmt (Iface_Elmt);
- end loop Examine_Interfaces;
+ end loop Search;
+ end if;
+
+ -- If the subprogram to be wrapped is not overriding anything or is not
+ -- a primitive declared between two views, do not produce anything. This
+ -- avoids spurious errors involving overriding.
+
+ if No (First_Param)
+ and then not Is_Private_Primitive_Subprogram (Subp_Id)
+ then
+ return Empty;
end if;
- -- Return if no interface primitive can be overridden
+ declare
+ Wrapper_Id : constant Entity_Id :=
+ Make_Defining_Identifier (Loc, Chars (Subp_Id));
+ New_Formals : List_Id;
+ Obj_Param : Node_Id;
+ Obj_Param_Typ : Entity_Id;
+
+ begin
+ -- Minimum decoration is needed to catch the entity in
+ -- Sem_Ch6.Override_Dispatching_Operation.
- return Empty;
+ if Ekind (Subp_Id) = E_Function then
+ Set_Ekind (Wrapper_Id, E_Function);
+ else
+ Set_Ekind (Wrapper_Id, E_Procedure);
+ end if;
- <<Found>>
+ Set_Is_Primitive_Wrapper (Wrapper_Id);
+ Set_Wrapped_Entity (Wrapper_Id, Subp_Id);
+ Set_Is_Private_Primitive (Wrapper_Id,
+ Is_Private_Primitive_Subprogram (Subp_Id));
- New_Formals := Replicate_Entry_Formals (Loc, Formals);
+ -- Process the formals
- -- ??? Certain source packages contain protected or task types that do
- -- not implement any interfaces and are compiled with the -gnat05
- -- switch. In this case, a default first parameter is created.
+ New_Formals := Replicate_Formals (Loc, Formals);
- -- If the interface operation has an access parameter, create a copy
- -- of it, with the same null exclusion indicator if present.
+ -- Routine Subp_Id has been found to override an interface primitive.
+ -- If the interface operation has an access parameter, create a copy
+ -- of it, with the same null exclusion indicator if present.
- if Present (First_Param) then
- if Nkind (Parameter_Type (First_Param)) = N_Access_Definition then
- Obj_Param_Typ :=
- Make_Access_Definition (Loc,
- Subtype_Mark =>
- New_Reference_To (Obj_Typ, Loc));
- Set_Null_Exclusion_Present (Obj_Param_Typ,
- Null_Exclusion_Present (Parameter_Type (First_Param)));
+ if Present (First_Param) then
+ if Nkind (Parameter_Type (First_Param)) = N_Access_Definition then
+ Obj_Param_Typ :=
+ Make_Access_Definition (Loc,
+ Subtype_Mark =>
+ New_Reference_To (Obj_Typ, Loc));
+ Set_Null_Exclusion_Present (Obj_Param_Typ,
+ Null_Exclusion_Present (Parameter_Type (First_Param)));
+ else
+ Obj_Param_Typ := New_Reference_To (Obj_Typ, Loc);
+ end if;
+
+ Obj_Param :=
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc,
+ Chars => Name_uO),
+ In_Present => In_Present (First_Param),
+ Out_Present => Out_Present (First_Param),
+ Parameter_Type => Obj_Param_Typ);
+
+ -- If we are dealing with a primitive declared between two views,
+ -- create a default parameter.
+
+ else pragma Assert (Is_Private_Primitive_Subprogram (Subp_Id));
+ Obj_Param :=
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc, Name_uO),
+ In_Present => True,
+ Out_Present => Ekind (Subp_Id) /= E_Function,
+ Parameter_Type => New_Reference_To (Obj_Typ, Loc));
+ end if;
+
+ Prepend_To (New_Formals, Obj_Param);
+
+ -- Build the final spec
+
+ if Ekind (Subp_Id) = E_Function then
+ return
+ Make_Function_Specification (Loc,
+ Defining_Unit_Name => Wrapper_Id,
+ Parameter_Specifications => New_Formals,
+ Result_Definition =>
+ New_Copy (Result_Definition (Parent (Subp_Id))));
else
- Obj_Param_Typ := New_Reference_To (Obj_Typ, Loc);
+ return
+ Make_Procedure_Specification (Loc,
+ Defining_Unit_Name => Wrapper_Id,
+ Parameter_Specifications => New_Formals);
end if;
+ end;
+ end Build_Wrapper_Spec;
- Obj_Param :=
- Make_Parameter_Specification (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Loc, Name_uO),
- In_Present => In_Present (First_Param),
- Out_Present => Out_Present (First_Param),
- Parameter_Type => Obj_Param_Typ);
+ -------------------------
+ -- Build_Wrapper_Specs --
+ -------------------------
- else
- Obj_Param :=
- Make_Parameter_Specification (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Loc, Name_uO),
- In_Present => True,
- Out_Present => True,
- Parameter_Type => New_Reference_To (Obj_Typ, Loc));
+ procedure Build_Wrapper_Specs
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : in out Node_Id)
+ is
+ Def : Node_Id;
+ Rec_Typ : Entity_Id;
+
+ begin
+ if Is_Protected_Type (Typ) then
+ Def := Protected_Definition (Parent (Typ));
+ else pragma Assert (Is_Task_Type (Typ));
+ Def := Task_Definition (Parent (Typ));
end if;
- Prepend_To (New_Formals, Obj_Param);
+ Rec_Typ := Corresponding_Record_Type (Typ);
- -- Minimum decoration needed to catch the entity in
- -- Sem_Ch6.Override_Dispatching_Operation
+ -- Generate wrapper specs for a concurrent type which implements an
+ -- interface and has visible entries and/or protected procedures.
- if Ekind (Proc_Nam) = E_Procedure
- or else Ekind (Proc_Nam) = E_Entry
+ if Present (Interfaces (Rec_Typ))
+ and then Present (Def)
+ and then Present (Visible_Declarations (Def))
then
- Set_Ekind (New_Name_Id, E_Procedure);
- Set_Is_Primitive_Wrapper (New_Name_Id);
- Set_Wrapped_Entity (New_Name_Id, Proc_Nam);
+ declare
+ Decl : Node_Id;
+ Wrap_Decl : Node_Id;
+ Wrap_Spec : Node_Id;
- return
- Make_Procedure_Specification (Loc,
- Defining_Unit_Name => New_Name_Id,
- Parameter_Specifications => New_Formals);
+ begin
+ Decl := First (Visible_Declarations (Def));
+ while Present (Decl) loop
+ Wrap_Spec := Empty;
- else pragma Assert (Ekind (Proc_Nam) = E_Function);
- Set_Ekind (New_Name_Id, E_Function);
+ if Nkind (Decl) = N_Entry_Declaration
+ and then Ekind (Defining_Identifier (Decl)) = E_Entry
+ then
+ Wrap_Spec :=
+ Build_Wrapper_Spec (Loc,
+ Subp_Id => Defining_Identifier (Decl),
+ Obj_Typ => Rec_Typ,
+ Formals => Parameter_Specifications (Decl));
- return
- Make_Function_Specification (Loc,
- Defining_Unit_Name => New_Name_Id,
- Parameter_Specifications => New_Formals,
- Result_Definition =>
- New_Copy (Result_Definition (Parent (Proc_Nam))));
+ elsif Nkind (Decl) = N_Subprogram_Declaration then
+ Wrap_Spec :=
+ Build_Wrapper_Spec (Loc,
+ Subp_Id => Defining_Unit_Name (Specification (Decl)),
+ Obj_Typ => Rec_Typ,
+ Formals =>
+ Parameter_Specifications (Specification (Decl)));
+ end if;
+
+ if Present (Wrap_Spec) then
+ Wrap_Decl :=
+ Make_Subprogram_Declaration (Loc,
+ Specification => Wrap_Spec);
+
+ Insert_After (N, Wrap_Decl);
+ N := Wrap_Decl;
+
+ Analyze (Wrap_Decl);
+ end if;
+
+ Next (Decl);
+ end loop;
+ end;
end if;
- end Build_Wrapper_Spec;
+ end Build_Wrapper_Specs;
---------------------------
-- Build_Find_Body_Index --
@@ -6903,13 +7062,13 @@ package body Exp_Ch9 is
procedure Expand_N_Protected_Body (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Pid : constant Entity_Id := Corresponding_Spec (N);
- Op_Body : Node_Id;
- Op_Decl : Node_Id;
- Op_Id : Entity_Id;
+ Current_Node : Node_Id;
Disp_Op_Body : Node_Id;
New_Op_Body : Node_Id;
- Current_Node : Node_Id;
Num_Entries : Natural := 0;
+ Op_Body : Node_Id;
+ Op_Decl : Node_Id;
+ Op_Id : Entity_Id;
function Build_Dispatching_Subprogram_Body
(N : Node_Id;
@@ -7002,14 +7161,12 @@ package body Exp_Ch9 is
return;
end if;
- if Nkind (Parent (N)) = N_Subunit then
-
- -- This is the proper body corresponding to a stub. The declarations
- -- must be inserted at the point of the stub, which is in the decla-
- -- rative part of the parent unit.
+ -- This is the proper body corresponding to a stub. The declarations
+ -- must be inserted at the point of the stub, which in turn is in the
+ -- declarative part of the parent unit.
+ if Nkind (Parent (N)) = N_Subunit then
Current_Node := Corresponding_Stub (Parent (N));
-
else
Current_Node := N;
end if;
@@ -7171,63 +7328,12 @@ package body Exp_Ch9 is
Analyze (New_Op_Body);
end if;
- -- Ada 2005 (AI-345): Construct the primitive entry wrapper bodies after
- -- the protected body. At this point the entry specs have been created,
+ -- Ada 2005 (AI-345): Construct the primitive wrapper bodies after the
+ -- protected body. At this point all wrapper specs have been created,
-- frozen and included in the dispatch table for the protected type.
- pragma Assert (Present (Corresponding_Record_Type (Pid)));
-
- if Ada_Version >= Ada_05
- and then Present (Protected_Definition (Parent (Pid)))
- and then Present (Interfaces (Corresponding_Record_Type (Pid)))
- then
- declare
- Vis_Decl : Node_Id :=
- First (Visible_Declarations
- (Protected_Definition (Parent (Pid))));
- Wrap_Body : Node_Id;
-
- begin
- -- Examine the visible declarations of the protected type, looking
- -- for an entry declaration. We do not consider entry families
- -- since they cannot have dispatching operations, thus they do not
- -- need entry wrappers.
-
- while Present (Vis_Decl) loop
- if Nkind (Vis_Decl) = N_Entry_Declaration then
- Wrap_Body :=
- Build_Wrapper_Body (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Corresponding_Record_Type (Pid),
- Formals => Parameter_Specifications (Vis_Decl));
-
- if Wrap_Body /= Empty then
- Insert_After (Current_Node, Wrap_Body);
- Current_Node := Wrap_Body;
-
- Analyze (Wrap_Body);
- end if;
-
- elsif Nkind (Vis_Decl) = N_Subprogram_Declaration then
- Wrap_Body :=
- Build_Wrapper_Body (Loc,
- Proc_Nam => Defining_Unit_Name
- (Specification (Vis_Decl)),
- Obj_Typ => Corresponding_Record_Type (Pid),
- Formals => Parameter_Specifications
- (Specification (Vis_Decl)));
-
- if Wrap_Body /= Empty then
- Insert_After (Current_Node, Wrap_Body);
- Current_Node := Wrap_Body;
-
- Analyze (Wrap_Body);
- end if;
- end if;
-
- Next (Vis_Decl);
- end loop;
- end;
+ if Ada_Version >= Ada_05 then
+ Build_Wrapper_Bodies (Loc, Pid, Current_Node);
end if;
end Expand_N_Protected_Body;
@@ -7625,67 +7731,11 @@ package body Exp_Ch9 is
Analyze (Rec_Decl, Suppress => All_Checks);
-- Ada 2005 (AI-345): Construct the primitive entry wrappers before
- -- the corresponding record is frozen
-
- if Ada_Version >= Ada_05
- and then Present (Visible_Declarations (Pdef))
- and then Present (Corresponding_Record_Type
- (Defining_Identifier (Parent (Pdef))))
- and then Present (Interfaces
- (Corresponding_Record_Type
- (Defining_Identifier (Parent (Pdef)))))
- then
- declare
- Current_Node : Node_Id := Rec_Decl;
- Vis_Decl : Node_Id;
- Wrap_Spec : Node_Id;
- New_N : Node_Id;
-
- begin
- -- Examine the visible declarations of the protected type, looking
- -- for declarations of entries, and subprograms. We do not
- -- consider entry families since they cannot have dispatching
- -- operations, thus they do not need entry wrappers.
-
- Vis_Decl := First (Visible_Declarations (Pdef));
-
- while Present (Vis_Decl) loop
+ -- the corresponding record is frozen. If any wrappers are generated,
+ -- Current_Node is updated accordingly.
- Wrap_Spec := Empty;
-
- if Nkind (Vis_Decl) = N_Entry_Declaration
- and then No (Discrete_Subtype_Definition (Vis_Decl))
- then
- Wrap_Spec :=
- Build_Wrapper_Spec (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Defining_Identifier (Rec_Decl),
- Formals => Parameter_Specifications (Vis_Decl));
-
- elsif Nkind (Vis_Decl) = N_Subprogram_Declaration then
- Wrap_Spec :=
- Build_Wrapper_Spec (Loc,
- Proc_Nam => Defining_Unit_Name
- (Specification (Vis_Decl)),
- Obj_Typ => Defining_Identifier (Rec_Decl),
- Formals => Parameter_Specifications
- (Specification (Vis_Decl)));
-
- end if;
-
- if Wrap_Spec /= Empty then
- New_N := Make_Subprogram_Declaration (Loc,
- Specification => Wrap_Spec);
-
- Insert_After (Current_Node, New_N);
- Current_Node := New_N;
-
- Analyze (New_N);
- end if;
-
- Next (Vis_Decl);
- end loop;
- end;
+ if Ada_Version >= Ada_05 then
+ Build_Wrapper_Specs (Loc, Prot_Typ, Current_Node);
end if;
-- Collect pointers to entry bodies and their barriers, to be placed
@@ -7694,9 +7744,7 @@ package body Exp_Ch9 is
-- this array. The array is declared after all protected subprograms.
if Has_Entries (Prot_Typ) then
- Entries_Aggr :=
- Make_Aggregate (Loc, Expressions => New_List);
-
+ Entries_Aggr := Make_Aggregate (Loc, Expressions => New_List);
else
Entries_Aggr := Empty;
end if;
@@ -9461,6 +9509,9 @@ package body Exp_Ch9 is
Call : Node_Id;
New_N : Node_Id;
+ Insert_Nod : Node_Id;
+ -- Used to determine the proper location of wrapper body insertions
+
begin
-- Add renaming declarations for discriminals and a declaration for the
-- entry family index (if applicable).
@@ -9527,56 +9578,17 @@ package body Exp_Ch9 is
end if;
-- Ada 2005 (AI-345): Construct the primitive entry wrapper bodies after
- -- the task body. At this point the entry specs have been created,
+ -- the task body. At this point all wrapper specs have been created,
-- frozen and included in the dispatch table for the task type.
- pragma Assert (Present (Corresponding_Record_Type (Ttyp)));
-
- if Ada_Version >= Ada_05
- and then Present (Task_Definition (Parent (Ttyp)))
- and then Present (Interfaces (Corresponding_Record_Type (Ttyp)))
- then
- declare
- Current_Node : Node_Id;
- Vis_Decl : Node_Id :=
- First (Visible_Declarations (Task_Definition (Parent (Ttyp))));
- Wrap_Body : Node_Id;
-
- begin
- if Nkind (Parent (N)) = N_Subunit then
- Current_Node := Corresponding_Stub (Parent (N));
- else
- Current_Node := N;
- end if;
-
- -- Examine the visible declarations of the task type, looking for
- -- an entry declaration. We do not consider entry families since
- -- they cannot have dispatching operations, thus they do not need
- -- entry wrappers.
-
- while Present (Vis_Decl) loop
- if Nkind (Vis_Decl) = N_Entry_Declaration
- and then Ekind (Defining_Identifier (Vis_Decl)) = E_Entry
- then
- -- Create the specification of the wrapper
-
- Wrap_Body :=
- Build_Wrapper_Body (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Corresponding_Record_Type (Ttyp),
- Formals => Parameter_Specifications (Vis_Decl));
-
- if Wrap_Body /= Empty then
- Insert_After (Current_Node, Wrap_Body);
- Current_Node := Wrap_Body;
-
- Analyze (Wrap_Body);
- end if;
- end if;
+ if Ada_Version >= Ada_05 then
+ if Nkind (Parent (N)) = N_Subunit then
+ Insert_Nod := Corresponding_Stub (Parent (N));
+ else
+ Insert_Nod := N;
+ end if;
- Next (Vis_Decl);
- end loop;
- end;
+ Build_Wrapper_Bodies (Loc, Ttyp, Insert_Nod);
end if;
end Expand_N_Task_Body;
@@ -10025,51 +10037,8 @@ package body Exp_Ch9 is
-- Ada 2005 (AI-345): Construct the primitive entry wrapper specs before
-- the corresponding record has been frozen.
- if Ada_Version >= Ada_05
- and then Present (Taskdef)
- and then Present (Corresponding_Record_Type
- (Defining_Identifier (Parent (Taskdef))))
- and then Present (Interfaces
- (Corresponding_Record_Type
- (Defining_Identifier (Parent (Taskdef)))))
- then
- declare
- Current_Node : Node_Id := Rec_Decl;
- Vis_Decl : Node_Id := First (Visible_Declarations (Taskdef));
- Wrap_Spec : Node_Id;
- New_N : Node_Id;
-
- begin
- -- Examine the visible declarations of the task type, looking for
- -- an entry declaration. We do not consider entry families since
- -- they cannot have dispatching operations, thus they do not need
- -- entry wrappers.
-
- while Present (Vis_Decl) loop
- if Nkind (Vis_Decl) = N_Entry_Declaration
- and then Ekind (Defining_Identifier (Vis_Decl)) = E_Entry
- then
- Wrap_Spec :=
- Build_Wrapper_Spec (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Etype (Rec_Ent),
- Formals => Parameter_Specifications (Vis_Decl));
-
- if Wrap_Spec /= Empty then
- New_N :=
- Make_Subprogram_Declaration (Loc,
- Specification => Wrap_Spec);
-
- Insert_After (Current_Node, New_N);
- Current_Node := New_N;
-
- Analyze (New_N);
- end if;
- end if;
-
- Next (Vis_Decl);
- end loop;
- end;
+ if Ada_Version >= Ada_05 then
+ Build_Wrapper_Specs (Loc, Tasktyp, Rec_Decl);
end if;
-- Ada 2005 (AI-345): We must defer freezing to allow further
@@ -11408,6 +11377,17 @@ package body Exp_Ch9 is
or else Denotes_Discriminant (Hi, True));
end Is_Potentially_Large_Family;
+ -------------------------------------
+ -- Is_Private_Primitive_Subprogram --
+ -------------------------------------
+
+ function Is_Private_Primitive_Subprogram (Id : Entity_Id) return Boolean is
+ begin
+ return
+ (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure)
+ and then Is_Private_Primitive (Id);
+ end Is_Private_Primitive_Subprogram;
+
------------------
-- Index_Object --
------------------
diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads
index a4c618a61cb..1cfa74d3635 100644
--- a/gcc/ada/exp_ch9.ads
+++ b/gcc/ada/exp_ch9.ads
@@ -153,6 +153,18 @@ package Exp_Ch9 is
-- aggregate. It replaces the call to Init (Args) done by
-- Build_Task_Allocate_Block.
+ function Build_Wrapper_Spec
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id;
+ -- Ada 2005 (AI-345): Build the specification of a primitive operation
+ -- associated with a protected or task type. This is required to implement
+ -- dispatching calls through interfaces. Subp_Id is the primitive to be
+ -- wrapped, Obj_Typ is the type of the newly added formal parameter to
+ -- handle object notation, Formals are the original entry formals that
+ -- will be explicitly replicated.
+
function Concurrent_Ref (N : Node_Id) return Node_Id;
-- Given the name of a concurrent object (task or protected object), or
-- the name of an access to a concurrent object, this function returns an
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index d41a6bc383c..09850f644d4 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -1581,7 +1581,12 @@ package body Exp_Util is
or else Etype (First_Entity (Op)) = Etype (Last_Entity (Op)));
Next_Elmt (Prim);
- pragma Assert (Present (Prim));
+
+ -- Raise Program_Error if no primitive found
+
+ if No (Prim) then
+ raise Program_Error;
+ end if;
end loop;
return Node (Prim);
@@ -1608,7 +1613,12 @@ package body Exp_Util is
Prim := First_Elmt (Primitive_Operations (Typ));
while not Is_TSS (Node (Prim), Name) loop
Next_Elmt (Prim);
- pragma Assert (Present (Prim));
+
+ -- Raise program error if no primitive found
+
+ if No (Prim) then
+ raise Program_Error;
+ end if;
end loop;
return Node (Prim);
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads
index 5e57147b720..5848d5d7171 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -360,7 +360,10 @@ package Exp_Util is
-- Find the first primitive operation of type T whose name is 'Name'.
-- This function allows the use of a primitive operation which is not
-- directly visible. If T is a class wide type, then the reference is
- -- to an operation of the corresponding root type.
+ -- to an operation of the corresponding root type. Raises Program_Error
+ -- exception if no primitive operation is found. This is normally an
+ -- internal error, but in some cases is an expected consequence of
+ -- illegalities elsewhere.
function Find_Prim_Op
(T : Entity_Id;
@@ -370,6 +373,9 @@ package Exp_Util is
-- with the indicated suffix). This function allows use of a primitive
-- operation which is not directly visible. If T is a class wide type,
-- then the reference is to an operation of the corresponding root type.
+ -- Raises Program_Error exception if no primitive operation is found.
+ -- This is normally an internal error, but in some cases is an expected
+ -- consequence of illegalities elsewhere.
function Find_Protection_Object (Scop : Entity_Id) return Entity_Id;
-- Traverse the scope stack starting from Scop and look for an entry,
diff --git a/gcc/ada/g-pehage.adb b/gcc/ada/g-pehage.adb
index 8d4733334d6..c779fac7ca7 100644
--- a/gcc/ada/g-pehage.adb
+++ b/gcc/ada/g-pehage.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2007, AdaCore --
+-- Copyright (C) 2002-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -51,8 +51,8 @@ package body GNAT.Perfect_Hash_Generators is
-- where f1 and f2 are functions that map strings into integers, and g is a
-- function that maps integers into [0, m-1]. h can be order preserving.
- -- For instance, let W = {w_0, ..., w_i, ...,
- -- w_m-1}, h can be defined such that h (w_i) = i.
+ -- For instance, let W = {w_0, ..., w_i, ..., w_m-1}, h can be defined
+ -- such that h (w_i) = i.
-- This algorithm defines two possible constructions of f1 and f2. Method
-- b) stores the hash function in less memory space at the expense of
@@ -82,10 +82,10 @@ package body GNAT.Perfect_Hash_Generators is
-- probability of generating an acyclic graph, n >= 2m. If it is not
-- acyclic, Tk have to be regenerated.
- -- In the assignment step, the algorithm builds function g. As is acyclic,
- -- there is a vertex v1 with only one neighbor v2. Let w_i be the word such
- -- that v1 = f1 (w_i) and v2 = f2 (w_i). Let g (v1) = 0 by construction and
- -- g (v2) = (i - g (v1)) mod n (or to be general, (h (i) - g (v1) mod n).
+ -- In the assignment step, the algorithm builds function g. As G is
+ -- acyclic, there is a vertex v1 with only one neighbor v2. Let w_i be
+ -- the word such that v1 = f1 (w_i) and v2 = f2 (w_i). Let g (v1) = 0 by
+ -- construction and g (v2) = (i - g (v1)) mod n (or h (i) - g (v1) mod n).
-- If word w_j is such that v2 = f1 (w_j) and v3 = f2 (w_j), g (v3) = (j -
-- g (v2)) mod (or to be general, (h (j) - g (v2)) mod n). If w_i has no
-- neighbor, then another vertex is selected. The algorithm traverses G to
@@ -102,11 +102,12 @@ package body GNAT.Perfect_Hash_Generators is
No_Edge : constant Edge_Id := -1;
No_Table : constant Table_Id := -1;
- Max_Word_Length : constant := 32;
- subtype Word_Type is String (1 .. Max_Word_Length);
- Null_Word : constant Word_Type := (others => ASCII.NUL);
- -- Store keyword in a word. Note that the length of word is limited to 32
- -- characters.
+ type Word_Type is new String_Access;
+ procedure Free_Word (W : in out Word_Type);
+ function New_Word (S : String) return Word_Type;
+
+ procedure Resize_Word (W : in out Word_Type; Len : Natural);
+ -- Resize string W to have a length Len
type Key_Type is record
Edge : Edge_Id;
@@ -130,8 +131,12 @@ package body GNAT.Perfect_Hash_Generators is
package WT is new GNAT.Table (Word_Type, Word_Id, 0, 32, 32);
package IT is new GNAT.Table (Integer, Integer, 0, 32, 32);
- -- The two main tables. IT is used to store several tables of components
- -- containing only integers.
+ -- The two main tables. WT is used to store the words in their initial
+ -- version and in their reduced version (that is words reduced to
+ -- their significant characters). As an instance of GNAT.Table, WT does
+ -- not initialize string pointers to null. This initialization has to be
+ -- done manually when the table is allocated. IT is used to store several
+ -- tables of components containing only integers.
function Image (Int : Integer; W : Natural := 0) return String;
function Image (Str : String; W : Natural := 0) return String;
@@ -298,9 +303,6 @@ package body GNAT.Perfect_Hash_Generators is
function Allocate (N : Natural; S : Natural := 1) return Table_Id;
-- Allocate N * S ints from IT table
- procedure Free_Tmp_Tables;
- -- Deallocate the tables used by the algorithm (but not the keys table)
-
----------
-- Keys --
----------
@@ -408,7 +410,7 @@ package body GNAT.Perfect_Hash_Generators is
-- Optimization mode (memory vs CPU)
Max_Key_Len : Natural := 0;
- Min_Key_Len : Natural := Max_Word_Length;
+ Min_Key_Len : Natural := 0;
-- Maximum and minimum of all the word length
S : Natural;
@@ -530,26 +532,27 @@ package body GNAT.Perfect_Hash_Generators is
procedure Apply_Position_Selection is
begin
- WT.Set_Last (2 * NK);
for J in 0 .. NK - 1 loop
declare
- I_Word : constant Word_Type := WT.Table (Initial (J));
- R_Word : Word_Type := Null_Word;
- Index : Natural := I_Word'First - 1;
+ IW : constant String := WT.Table (Initial (J)).all;
+ RW : String (1 .. IW'Length) := (others => ASCII.NUL);
+ N : Natural := IW'First - 1;
begin
-- Select the characters of Word included in the position
-- selection.
for C in 0 .. Char_Pos_Set_Len - 1 loop
- exit when I_Word (Get_Char_Pos (C)) = ASCII.NUL;
- Index := Index + 1;
- R_Word (Index) := I_Word (Get_Char_Pos (C));
+ exit when IW (Get_Char_Pos (C)) = ASCII.NUL;
+ N := N + 1;
+ RW (N) := IW (Get_Char_Pos (C));
end loop;
- -- Build the new table with the reduced word
+ -- Build the new table with the reduced word. Be careful
+ -- to deallocate the old version to avoid memory leaks.
- WT.Table (Reduced (J)) := R_Word;
+ Free_Word (WT.Table (Reduced (J)));
+ WT.Table (Reduced (J)) := New_Word (RW);
Set_Key (J, (Edge => No_Edge));
end;
end loop;
@@ -588,7 +591,7 @@ package body GNAT.Perfect_Hash_Generators is
-- Start of processing for Assign_Values_To_Vertices
begin
- -- Value -1 denotes an uninitialized value as it is supposed to
+ -- Value -1 denotes an unitialized value as it is supposed to
-- be in the range 0 .. NK.
if G = No_Table then
@@ -628,9 +631,9 @@ package body GNAT.Perfect_Hash_Generators is
Success : Boolean := False;
begin
- NV := Natural (K2V * Float (NK));
-
- Keys := Allocate (NK);
+ if NK = 0 then
+ raise Program_Error with "keywords set cannot be empty";
+ end if;
if Verbose then
Put_Initial_Keys (Output, "Initial Key Table");
@@ -861,23 +864,16 @@ package body GNAT.Perfect_Hash_Generators is
procedure Finalize is
begin
- Free_Tmp_Tables;
+ -- Deallocate all the WT components (both initial and reduced
+ -- ones) to avoid memory leaks.
+ for W in 0 .. WT.Last loop
+ Free_Word (WT.Table (W));
+ end loop;
WT.Release;
IT.Release;
- NK := 0;
- Max_Key_Len := 0;
- Min_Key_Len := Max_Word_Length;
- end Finalize;
-
- ---------------------
- -- Free_Tmp_Tables --
- ---------------------
-
- procedure Free_Tmp_Tables is
- begin
- IT.Init;
+ -- Reset all variables for next usage
Keys := No_Table;
@@ -901,7 +897,22 @@ package body GNAT.Perfect_Hash_Generators is
Vertices := No_Table;
NV := 0;
- end Free_Tmp_Tables;
+
+ NK := 0;
+ Max_Key_Len := 0;
+ Min_Key_Len := 0;
+ end Finalize;
+
+ ---------------
+ -- Free_Word --
+ ---------------
+
+ procedure Free_Word (W : in out Word_Type) is
+ begin
+ if W /= null then
+ Free (W);
+ end if;
+ end Free_Word;
----------------------------
-- Generate_Mapping_Table --
@@ -1130,20 +1141,76 @@ package body GNAT.Perfect_Hash_Generators is
Tries : Positive := Default_Tries)
is
begin
- -- Free previous tables (the settings may have changed between two runs)
+ -- Deallocated the part of the table concerning the reduced
+ -- words. Initial words are already present in the table. We
+ -- may have reduced words already there because a previous
+ -- computation failed. We are currently retrying and the
+ -- reduced words have to be deallocated.
+
+ for W in NK .. WT.Last loop
+ Free_Word (WT.Table (W));
+ end loop;
+ IT.Init;
- Free_Tmp_Tables;
+ -- Initialize of computation variables
- if K_To_V <= 2.0 then
- Put (Output, "K to V ratio cannot be lower than 2.0");
- New_Line (Output);
- raise Program_Error;
- end if;
+ Keys := No_Table;
+
+ Char_Pos_Set := No_Table;
+ Char_Pos_Set_Len := 0;
+
+ Used_Char_Set := No_Table;
+ Used_Char_Set_Len := 0;
+
+ T1 := No_Table;
+ T2 := No_Table;
+
+ T1_Len := 0;
+ T2_Len := 0;
+
+ G := No_Table;
+ G_Len := 0;
+
+ Edges := No_Table;
+ Edges_Len := 0;
+
+ Vertices := No_Table;
+ NV := 0;
S := Seed;
K2V := K_To_V;
Opt := Optim;
NT := Tries;
+
+ if K2V <= 2.0 then
+ raise Program_Error with "K to V ratio cannot be lower than 2.0";
+ end if;
+
+ -- Do not accept a value of K2V too close to 2.0 such that once
+ -- rounded up, NV = 2 * NK because the algorithm would not converge.
+
+ NV := Natural (Float (NK) * K2V);
+ if NV <= 2 * NK then
+ NV := 2 * NK + 1;
+ end if;
+
+ Keys := Allocate (NK);
+
+ -- Resize initial words to have all of them at the same size
+ -- (so the size of the largest one).
+
+ for K in 0 .. NK - 1 loop
+ Resize_Word (WT.Table (Initial (K)), Max_Key_Len);
+ end loop;
+
+ -- Allocated the table to store the reduced words. As WT is a
+ -- GNAT.Table (using C memory management), pointers have to be
+ -- explicitly initialized to null.
+
+ WT.Set_Last (Reduced (NK - 1));
+ for W in 0 .. NK - 1 loop
+ WT.Table (Reduced (W)) := null;
+ end loop;
end Initialize;
------------
@@ -1151,28 +1218,18 @@ package body GNAT.Perfect_Hash_Generators is
------------
procedure Insert (Value : String) is
- Word : Word_Type := Null_Word;
Len : constant Natural := Value'Length;
begin
- Word (1 .. Len) := Value (Value'First .. Value'First + Len - 1);
WT.Set_Last (NK);
- WT.Table (NK) := Word;
+ WT.Table (NK) := New_Word (Value);
NK := NK + 1;
- NV := Natural (Float (NK) * K2V);
-
- -- Do not accept a value of K2V too close to 2.0 such that once rounded
- -- up, NV = 2 * NK because the algorithm would not converge.
-
- if NV <= 2 * NK then
- NV := 2 * NK + 1;
- end if;
if Max_Key_Len < Len then
Max_Key_Len := Len;
end if;
- if Len < Min_Key_Len then
+ if Min_Key_Len = 0 or else Len < Min_Key_Len then
Min_Key_Len := Len;
end if;
end Insert;
@@ -1188,6 +1245,15 @@ package body GNAT.Perfect_Hash_Generators is
end if;
end New_Line;
+ --------------
+ -- New_Word --
+ --------------
+
+ function New_Word (S : String) return Word_Type is
+ begin
+ return new String'(S);
+ end New_Word;
+
------------------------------
-- Parse_Position_Selection --
------------------------------
@@ -1761,7 +1827,7 @@ package body GNAT.Perfect_Hash_Generators is
K := Get_Key (J);
Put (File, Image (J, M), F1, L1, J, 1, 3, 1);
Put (File, Image (K.Edge, M), F1, L1, J, 1, 3, 2);
- Put (File, WT.Table (Initial (J)), F1, L1, J, 1, 3, 3);
+ Put (File, WT.Table (Initial (J)).all, F1, L1, J, 1, 3, 3);
end loop;
end Put_Initial_Keys;
@@ -1842,7 +1908,7 @@ package body GNAT.Perfect_Hash_Generators is
K := Get_Key (J);
Put (File, Image (J, M), F1, L1, J, 1, 3, 1);
Put (File, Image (K.Edge, M), F1, L1, J, 1, 3, 2);
- Put (File, WT.Table (Reduced (J)), F1, L1, J, 1, 3, 3);
+ Put (File, WT.Table (Reduced (J)).all, F1, L1, J, 1, 3, 3);
end loop;
end Put_Reduced_Keys;
@@ -1920,6 +1986,22 @@ package body GNAT.Perfect_Hash_Generators is
return K + NK + 1;
end Reduced;
+ -----------------
+ -- Resize_Word --
+ -----------------
+
+ procedure Resize_Word (W : in out Word_Type; Len : Natural) is
+ S1 : constant String := W.all;
+ S2 : String (1 .. Len) := (others => ASCII.NUL);
+ L : constant Natural := S1'Length;
+ begin
+ if L /= Len then
+ Free_Word (W);
+ S2 (1 .. L) := S1;
+ W := New_Word (S2);
+ end if;
+ end Resize_Word;
+
--------------------------
-- Select_Char_Position --
--------------------------
@@ -1985,11 +2067,11 @@ package body GNAT.Perfect_Hash_Generators is
begin
if L = 0 then
- Left := Reduced (0) - 1;
+ Left := NK;
Right := Offset + R;
elsif R = 0 then
Left := Offset + L;
- Right := Reduced (0) - 1;
+ Right := NK;
else
Left := Offset + L;
Right := Offset + R;
@@ -2007,17 +2089,18 @@ package body GNAT.Perfect_Hash_Generators is
begin
if From = 0 then
- Source := Reduced (0) - 1;
+ Source := NK;
Target := Offset + To;
elsif To = 0 then
Source := Offset + From;
- Target := Reduced (0) - 1;
+ Target := NK;
else
Source := Offset + From;
Target := Offset + To;
end if;
WT.Table (Target) := WT.Table (Source);
+ WT.Table (Source) := null;
end Move;
package Sorting is new GNAT.Heap_Sort_G (Move, Lt);
@@ -2120,9 +2203,8 @@ package body GNAT.Perfect_Hash_Generators is
begin
-- Initialize the reduced words set
- WT.Set_Last (2 * NK);
for K in 0 .. NK - 1 loop
- WT.Table (Reduced (K)) := WT.Table (Initial (K));
+ WT.Table (Reduced (K)) := New_Word (WT.Table (Initial (K)).all);
end loop;
declare
@@ -2220,7 +2302,7 @@ package body GNAT.Perfect_Hash_Generators is
Same_Keys_Sets_Table (J).First ..
Same_Keys_Sets_Table (J).Last
loop
- Put (Output, WT.Table (Reduced (K)));
+ Put (Output, WT.Table (Reduced (K)).all);
New_Line (Output);
end loop;
Put (Output, "--");
diff --git a/gcc/ada/g-pehage.ads b/gcc/ada/g-pehage.ads
index b2aea490eed..277a2a4580b 100644
--- a/gcc/ada/g-pehage.ads
+++ b/gcc/ada/g-pehage.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2005, AdaCore --
+-- Copyright (C) 2002-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -60,7 +60,7 @@
-- The hash table size corresponds to the exact size of W and *no larger*.
-- This represents the "minimal" property.
--- The functions generated by this package require the key set to be known in
+-- The functions generated by this package require the words to be known in
-- advance (they are "static" hash functions). The hash functions are also
-- order preserving. If w2 is inserted after w1 in the generator, then (w1)
-- < f (w2). These hashing functions are convenient for use with realtime
@@ -99,27 +99,33 @@ package GNAT.Perfect_Hash_Generators is
K_To_V : Float := Default_K_To_V;
Optim : Optimization := CPU_Time;
Tries : Positive := Default_Tries);
- -- Initialize the generator and its internal structures. Set the ratio of
- -- vertices over keys in the random graphs. This value has to be greater
- -- than 2.0 in order for the algorithm to succeed. The key set is not
- -- modified (in particular when it is already set). For instance, it is
- -- possible to run several times the generator with different settings on
- -- the same key set.
+ -- Initialize the generator and its internal structures. Set the
+ -- ratio of vertices over keys in the random graphs. This value
+ -- has to be greater than 2.0 in order for the algorithm to
+ -- succeed. The word set is not modified (in particular when it is
+ -- already set). For instance, it is possible to run several times
+ -- the generator with different settings on the same words.
+
+ -- A classical way of doing is to Insert all the words and then to
+ -- invoke Initialize and Compute. If Compute fails to find a
+ -- perfect hash function, invoke Initialize another time with
+ -- other configuration parameters (probably with a greater K_To_V
+ -- ratio). Once successful, invoke Produce and Finalize.
procedure Finalize;
- -- Deallocate the internal structures and the key table
+ -- Deallocate the internal structures and the words table
procedure Insert (Value : String);
- -- Insert a new key in the table
+ -- Insert a new word in the table
Too_Many_Tries : exception;
-- Raised after Tries unsuccessful runs
procedure Compute (Position : String := Default_Position);
-- Compute the hash function. Position allows to define selection of
- -- character positions used in the keywords hash function. Positions can be
+ -- character positions used in the word hash function. Positions can be
-- separated by commas and range like x-y may be used. Character '$'
- -- represents the final character of a key. With an empty position, the
+ -- represents the final character of a word. With an empty position, the
-- generator automatically produces positions to reduce the memory usage.
-- Raise Too_Many_Tries in case that the algorithm does not succeed in less
-- than Tries attempts (see Initialize).
@@ -144,7 +150,7 @@ package GNAT.Perfect_Hash_Generators is
-- F1 and F2 are two functions based on two function tables T1 and T2.
-- Their definition depends on the chosen optimization mode.
- -- Only some character positions are used in the keys because they are
+ -- Only some character positions are used in the words because they are
-- significant. They are listed in a character position table (P in the
-- pseudo-code below). For instance, in {"jan", "feb", "mar", "apr", "jun",
-- "jul", "aug", "sep", "oct", "nov", "dec"}, only positions 2 and 3 are
@@ -152,7 +158,7 @@ package GNAT.Perfect_Hash_Generators is
-- {2, 3}
-- When Optimization is CPU_Time, the first dimension of T1 and T2
- -- corresponds to the character position in the key and the second to the
+ -- corresponds to the character position in the word and the second to the
-- character set. As all the character set is not used, we define a used
-- character table which associates a distinct index to each used character
-- (unused characters are mapped to zero). In this case, the second
@@ -177,7 +183,7 @@ package GNAT.Perfect_Hash_Generators is
-- end Hash;
-- When Optimization is Memory_Space, the first dimension of T1 and T2
- -- corresponds to the character position in the key and the second
+ -- corresponds to the character position in the word and the second
-- dimension is ignored. T1 and T2 are no longer matrices but vectors.
-- Therefore, the used character table is not available. The hash function
-- has the following form:
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 2d21d45c23f..1254793dc2d 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -55,11 +55,9 @@ else
ADAFLAGS= $(COMMON_ADAFLAGS)
endif
-ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
- $(ADAFLAGS)
+ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
FORCE_DEBUG_ADAFLAGS = -g
ADA_CFLAGS =
-ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
ADA_INCLUDES = -nostdinc -I- -I. -Iada -I$(srcdir)/ada -I$(srcdir)/ada/gcc-interface
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
@@ -76,9 +74,9 @@ ADA_FLAGS_TO_PASS = \
# Say how to compile Ada programs.
.SUFFIXES: .ada .adb .ads
-# FIXME: need to add $(ALL_ADA_CFLAGS) to .c.o suffix rule
+# FIXME: need to add $(ADA_CFLAGS) to .c.o suffix rule
# Use loose warnings for this front end, but add some special flags
-ada-warn = $(ALL_ADA_CFLAGS) $(WERROR)
+ada-warn = $(ADA_CFLAGS) $(WERROR)
# unresolved warnings in a couple of files
ada/tracebak.o-warn = -Wno-error
ada/b_gnat1.o-warn = -Wno-error
@@ -302,7 +300,7 @@ TARGET_ADA_SRCS =
# stamp target in the parent directory whenever gnat1 is rebuilt
gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBDEPS)
$(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBS) $(SYSLIBS) $(GMPLIBS)
- $(RM) stamp-gnatlib2 stamp-tools
+ $(RM) stamp-gnatlib2-rts stamp-tools
gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS)
$(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) $(ALL_CFLAGS) $(LIBS) $(SYSLIBS)
@@ -1058,25 +1056,25 @@ ada/targext.o : ada/targext.c $(SYSTEM_H) coretypes.h $(TM_H)
$< $(OUTPUT_OPTION)
ada/cio.o : ada/cio.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
ada/init.o : ada/init.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h ada/raise.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
ada/initialize.o : ada/initialize.c
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
ada/raise.o : ada/raise.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h ada/raise.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
# Need to keep the frame pointer in this file to pop the stack properly on
# some targets.
ada/tracebak.o : ada/tracebak.c $(CONFIG_H) $(SYSTEM_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-fno-omit-frame-pointer $< $(OUTPUT_OPTION)
ada/cuintp.o : ada/gcc-interface/cuintp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index fc96dcb1857..a8c0c1bbb25 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -66,23 +66,11 @@
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass
# to the stage2 and stage3 compilations
-# XCFLAGS is used for most compilations but not when using the GCC just built.
-XCFLAGS =
CFLAGS = -g
BOOT_CFLAGS = -O $(CFLAGS)
-# These exists to be overridden by the x-* and t-* files, respectively.
-X_CFLAGS =
+# These exists to be overridden by the t-* files, respectively.
T_CFLAGS =
-X_CPPFLAGS =
-T_CPPFLAGS =
-
-X_ADA_CFLAGS =
-T_ADA_CFLAGS =
-
-X_ADAFLAGS =
-T_ADAFLAGS =
-
CC = cc
BISON = bison
BISONFLAGS =
@@ -119,11 +107,8 @@ GNATLIBFLAGS = -gnatpg -nostdinc
GNATLIBCFLAGS = -g -O2
GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
-DIN_RTS
-ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
-ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
- $(ADAFLAGS)
-MOST_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
- $(SOME_ADAFLAGS)
+ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
+MOST_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(SOME_ADAFLAGS)
THREAD_KIND = native
THREADSLIB =
GMEM_LIB =
@@ -144,9 +129,9 @@ hyphen = -
P =
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
-# It omits XCFLAGS, and specifies -B./.
+# It specifies -B./.
# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
-GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
+GCC_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS)
# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
@@ -193,6 +178,10 @@ TARGET_ADA_SRCS =
# Type of tools build we are doing; default is not compiling tools.
TOOLSCASE =
+# Multilib handling
+MULTISUBDIR =
+RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
+
# End of variables for you to override.
all: all.indirect
@@ -227,11 +216,10 @@ INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
# This is the variable actually used when we compile.
LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS) \
- $(XCFLAGS)
+ALL_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS)
# Likewise.
-ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
+ALL_CPPFLAGS = $(CPPFLAGS)
# This is where we get libiberty.a from.
LIBIBERTY = ../../libiberty/libiberty.a
@@ -1338,13 +1326,20 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
s-intman.adb<s-intman-dummy.adb \
s-osinte.ads<s-osinte-rtx.ads \
s-osprim.adb<s-osprim-rtx.adb \
- s-taprop.adb<s-taprop-rtx.adb \
- system.ads<system-rtx.ads
+ s-taprop.adb<s-taprop-rtx.adb
EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
- MISCLIB = -lwsock32 -lrtapi_w32
- THREADSLIB=-lrtapi_w32
+ ifeq ($(strip $(filter-out rtx_w32,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += system.ads<system-rtx.ads
+
+ EH_MECHANISM=-gcc
+ else
+ LIBGNAT_TARGET_PAIRS += system.ads<system-rtx-rtss.ads
+
+ EH_MECHANISM=
+ endif
+
else
LIBGNAT_TARGET_PAIRS += \
a-exetim.adb<a-exetim-mingw.adb \
@@ -1366,13 +1361,14 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
# ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
# auto-import support for array/record will be done.
GNATLIB_SHARED = gnatlib-shared-win32
+
+ EH_MECHANISM=-gcc
endif
TOOLS_TARGET_PAIRS= \
mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
indepsw.adb<indepsw-mingw.adb
- EH_MECHANISM=-gcc
GMEM_LIB = gmemlib
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
@@ -1718,7 +1714,7 @@ endif
# while GNATRTL_OBJS lists the object files compiled from Ada sources that
# go into the directory. The pthreads emulation is built in the threads
# subdirectory and copied.
-LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
+LIBGNAT_SRCS = adaint.c adaint.h argv.c cio.c cstreams.c \
errno.c exit.c cal.c ctrl_c.c env.c env.h \
raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
@@ -1753,17 +1749,17 @@ ADA_INCLUDE_SRCS =\
a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
-LIBGNAT=../rts/libgnat.a
+LIBGNAT=../$(RTSDIR)/libgnat.a
GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
# when compiling the tools, the runtime has to be first on the path so that
# it hides the runtime files lying with the rest of the sources
ifeq ($(TOOLSCASE),native)
- vpath %.ads ../rts ../
- vpath %.adb ../rts ../
- vpath %.c ../rts ../
- vpath %.h ../rts ../
+ vpath %.ads ../$(RTSDIR) ../
+ vpath %.adb ../$(RTSDIR) ../
+ vpath %.c ../$(RTSDIR) ../
+ vpath %.h ../$(RTSDIR) ../
endif
# in the cross tools case, everything is compiled with the native
@@ -1843,8 +1839,8 @@ gnatlink-re: link.o targext.o
$(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
$(TOOLS_LIBS)
-../stamp-gnatlib:
- @if [ ! -f stamp-gnatlib ] ; \
+../stamp-gnatlib-$(RTSDIR):
+ @if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
then \
$(ECHO) You must first build the GNAT library: make gnatlib; \
false; \
@@ -1852,7 +1848,7 @@ gnatlink-re: link.o targext.o
true; \
fi
-install-gnatlib: ../stamp-gnatlib
+install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
# Create the directory before deleting it, in case the directory is
# a list of directories (as it may be on VMS). This ensures we are
# deleting the right one.
@@ -1862,49 +1858,49 @@ install-gnatlib: ../stamp-gnatlib
$(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
-$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
-$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- for file in rts/*.ali; do \
+ for file in $(RTSDIR)/*.ali; do \
$(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
done
- -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- -cd rts; for file in *$(arext);do \
+ -$(INSTALL_DATA) $(RTSDIR)/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
+ -cd $(RTSDIR); for file in *$(arext);do \
$(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
$(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
done
-$(foreach file, $(EXTRA_ADALIB_FILES), \
- $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
+ $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
) true
# Install the shared libraries, if any, using $(INSTALL) instead
# of $(INSTALL_DATA). The latter may force a mode inappropriate
# for shared libraries on some targets, e.g. on HP-UX where the x
# permission is required.
for file in gnat gnarl; do \
- if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
- $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
+ $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(DESTDIR)$(ADA_RTL_OBJ_DIR); \
fi; \
- if [ -f rts/lib$${file}$(soext) ]; then \
+ if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
$(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
fi; \
done
# This copy must be done preserving the date on the original file.
- for file in rts/*.ad?; do \
+ for file in $(RTSDIR)/*.ad?; do \
$(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
done
cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
-../stamp-gnatlib2:
- $(RM) rts/s-*.ali
- $(RM) rts/s-*$(objext)
- $(RM) rts/a-*.ali
- $(RM) rts/a-*$(objext)
- $(RM) rts/*.ali
- $(RM) rts/*$(objext)
- $(RM) rts/*$(arext)
- $(RM) rts/*$(soext)
- touch ../stamp-gnatlib2
- $(RM) ../stamp-gnatlib
+../stamp-gnatlib2-$(RTSDIR):
+ $(RM) $(RTSDIR)/s-*.ali
+ $(RM) $(RTSDIR)/s-*$(objext)
+ $(RM) $(RTSDIR)/a-*.ali
+ $(RM) $(RTSDIR)/a-*$(objext)
+ $(RM) $(RTSDIR)/*.ali
+ $(RM) $(RTSDIR)/*$(objext)
+ $(RM) $(RTSDIR)/*$(arext)
+ $(RM) $(RTSDIR)/*$(soext)
+ touch ../stamp-gnatlib2-$(RTSDIR)
+ $(RM) ../stamp-gnatlib-$(RTSDIR)
# NOTE: The $(foreach ...) commands assume ";" is the valid separator between
# successive target commands. Although the Gnu make documentation
@@ -1915,34 +1911,34 @@ install-gnatlib: ../stamp-gnatlib
# GNULLI Begin ###########################################################
-../stamp-gnatlib1: Makefile ../stamp-gnatlib2
- $(RMDIR) rts
- $(MKDIR) rts
- $(CHMOD) u+w rts
+../stamp-gnatlib1-$(RTSDIR): Makefile ../stamp-gnatlib2-$(RTSDIR)
+ $(RMDIR) $(RTSDIR)
+ $(MKDIR) $(RTSDIR)
+ $(CHMOD) u+w $(RTSDIR)
# Copy target independent sources
$(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
- $(LN_S) $(fsrcpfx)$(f) rts ;) true
+ $(LN_S) $(fsrcpfx)$(f) $(RTSDIR) ;) true
# Remove files to be replaced by target dependent sources
$(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
- rts/$(word 1,$(subst <, ,$(PAIR))))
- $(RM) rts/*-*-*.ads rts/*-*-*.adb
+ $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
+ $(RM) $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb
# Copy new target dependent sources
$(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
$(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
- rts/$(word 1,$(subst <, ,$(PAIR)));)
- $(RM) ../stamp-gnatlib
- touch ../stamp-gnatlib1
+ $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
+ $(RM) ../stamp-gnatlib-$(RTSDIR)
+ touch ../stamp-gnatlib1-$(RTSDIR)
# GNULLI End #############################################################
# Don't use semicolon separated shell commands that involve list expansions.
# The semicolon triggers a call to DCL on VMS and DCL can't handle command
# line lengths in excess of 256 characters.
-# Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
+# Example: cd $(RTSDIR); ar rc libfoo.a $(LONG_LIST_OF_OBJS)
# is guaranteed to overflow the buffer.
-gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
- $(MAKE) -C rts \
+gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
+ $(MAKE) -C $(RTSDIR) \
CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
@@ -1950,7 +1946,7 @@ gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
srcdir=$(fsrcdir) \
-f ../Makefile $(LIBGNAT_OBJS)
- $(MAKE) -C rts \
+ $(MAKE) -C $(RTSDIR) \
CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
ADA_INCLUDES="" \
@@ -1960,83 +1956,88 @@ gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
srcdir=$(fsrcdir) \
-f ../Makefile \
$(GNATRTL_OBJS)
- $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
- $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
+ $(RM) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnarl$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat$(arext) \
+ $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
ifneq ($(PREFIX_OBJS),)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgccprefix$(arext) \
$(PREFIX_OBJS);
- $(RANLIB_FOR_TARGET) rts/libgccprefix$(arext)
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgccprefix$(arext)
endif
- $(RANLIB_FOR_TARGET) rts/libgnat$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnarl$(arext) \
- $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
- $(RANLIB_FOR_TARGET) rts/libgnarl$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnala$(arext) \
- $(addprefix rts/,$(GNATRTL_LINEARALGEBRA_OBJS))
- $(RANLIB_FOR_TARGET) rts/libgnala$(arext)
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
+ $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnala$(arext) \
+ $(addprefix $(RTSDIR)/,$(GNATRTL_LINEARALGEBRA_OBJS))
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnala$(arext)
ifeq ($(GMEM_LIB),gmemlib)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgmem$(arext) \
- rts/memtrack.o
- $(RANLIB_FOR_TARGET) rts/libgmem$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
+ $(RTSDIR)/memtrack.o
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
endif
- $(CHMOD) a-wx rts/*.ali
- touch ../stamp-gnatlib
+ $(CHMOD) a-wx $(RTSDIR)/*.ali
+ touch ../stamp-gnatlib-$(RTSDIR)
# Warning: this target assumes that LIBRARY_VERSION has been set correctly.
gnatlib-shared-default:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+ $(RM) $(RTSDIR)/libgna*$(soext)
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
$(TARGET_LIBGCC2_CFLAGS) \
-o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
$(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(MISCLIB) -lm
- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
$(TARGET_LIBGCC2_CFLAGS) \
-o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(THREADSLIB)
- cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnat$(soext)
- cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnarl$(soext)
gnatlib-shared-dual:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib-shared-default
- $(MV) rts/libgna*$(soext) .
- $(RM) ../stamp-gnatlib2
+ $(MV) $(RTSDIR)/libgna*$(soext) .
+ $(RM) ../stamp-gnatlib2-$(RTSDIR)
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
- $(MV) libgna*$(soext) rts
+ $(MV) libgna*$(soext) $(RTSDIR)
gnatlib-shared-dual-win32:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib-shared-win32
- $(MV) rts/libgna*$(soext) .
- $(RM) ../stamp-gnatlib2
+ $(MV) $(RTSDIR)/libgna*$(soext) .
+ $(RM) ../stamp-gnatlib2-$(RTSDIR)
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
- $(MV) libgna*$(soext) rts
+ $(MV) libgna*$(soext) $(RTSDIR)
# ??? we need to add the option to support auto-import of arrays/records to
# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
@@ -2046,14 +2047,15 @@ gnatlib-shared-win32:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
+ $(RM) $(RTSDIR)/libgna*$(soext)
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
-o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
$(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
-o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
@@ -2064,32 +2066,34 @@ gnatlib-shared-darwin:
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
-fno-common" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
- $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
+ $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
+ cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
-o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
$(SO_OPTS) \
$(MISCLIB) -lm
- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
+ cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
-o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS) \
$(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
- cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnat$(soext)
- cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnarl$(soext)
gnatlib-shared-vms:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts && \
+ $(RM) $(RTSDIR)/libgna*$(soext)
+ cd $(RTSDIR) && \
../../gnatsym -s SYMVEC_$$$$.opt \
$(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
../../xgcc -g -B../../ -shared -shared-libgcc \
@@ -2098,7 +2102,7 @@ gnatlib-shared-vms:
--for-linker=/noinform \
--for-linker=SYMVEC_$$$$.opt \
--for-linker=gsmatch=equal,$(GSMATCH_VERSION)
- cd rts && \
+ cd $(RTSDIR) && \
../../gnatsym -s SYMVEC_$$$$.opt \
$(GNATRTL_TASKING_OBJS) && \
../../xgcc -g -B../../ -shared -shared-libgcc \
@@ -2113,29 +2117,32 @@ gnatlib-shared:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
$(GNATLIB_SHARED)
gnatlib-sjlj:
- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1
- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' rts/system.ads > rts/s.ads
- $(MV) rts/s.ads rts/system.ads
+ $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1-$(RTSDIR)
+ sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
+ $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
$(MAKE) $(FLAGS_TO_PASS) \
EH_MECHANISM="" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
gnatlib-zcx:
- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1
- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' rts/system.ads > rts/s.ads
- $(MV) rts/s.ads rts/system.ads
+ $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1-$(RTSDIR)
+ sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
+ $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
$(MAKE) $(FLAGS_TO_PASS) \
EH_MECHANISM="-gcc" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
@@ -2245,15 +2252,15 @@ gen-soccon: gen-soccon.c gsocket.h
cio.o : cio.c
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
init.o : init.c adaint.h raise.h
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
initialize.o : initialize.c raise.h
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
targext.o : targext.c
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
@@ -2264,7 +2271,7 @@ targext.o : targext.c
# the SEH handling on Windows. The reasons are not clear.
seh_init.o : seh_init.c raise.h
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) -O0 \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
# Need to keep the frame pointer in this file to pop the stack properly on
# some targets.
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 9c31e46f267..9472995effc 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -294,6 +294,12 @@ struct lang_type GTY(()) {tree t; };
#define SET_DECL_FUNCTION_STUB(NODE, X) \
SET_DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE), X)
+/* In a PARM_DECL, points to the alternate TREE_TYPE */
+#define DECL_PARM_ALT(NODE) \
+ GET_DECL_LANG_SPECIFIC (PARM_DECL_CHECK (NODE))
+#define SET_DECL_PARM_ALT(NODE, X) \
+ SET_DECL_LANG_SPECIFIC (PARM_DECL_CHECK (NODE), X)
+
/* In a FIELD_DECL corresponding to a discriminant, contains the
discriminant number. */
#define DECL_DISCRIMINANT_NUMBER(NODE) DECL_INITIAL (FIELD_DECL_CHECK (NODE))
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index ebc2e5edd14..61ae653de2a 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -4774,6 +4774,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
{
tree gnu_param_name = get_entity_name (gnat_param);
tree gnu_param_type = gnat_to_gnu_type (Etype (gnat_param));
+ tree gnu_param_type_alt = NULL_TREE;
bool in_param = (Ekind (gnat_param) == E_In_Parameter);
/* The parameter can be indirectly modified if its address is taken. */
bool ro_param = in_param && !Address_Taken (gnat_param);
@@ -4820,12 +4821,20 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
gnu_param_type
= TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_param_type))));
- /* VMS descriptors are themselves passed by reference. */
+ /* VMS descriptors are themselves passed by reference.
+ Build both a 32bit and 64bit descriptor, one of which will be chosen
+ in fill_vms_descriptor based on the allocator size */
if (mech == By_Descriptor)
- gnu_param_type
- = build_pointer_type (build_vms_descriptor (gnu_param_type,
- Mechanism (gnat_param),
- gnat_subprog));
+ {
+ gnu_param_type_alt
+ = build_pointer_type (build_vms_descriptor64 (gnu_param_type,
+ Mechanism (gnat_param),
+ gnat_subprog));
+ gnu_param_type
+ = build_pointer_type (build_vms_descriptor (gnu_param_type,
+ Mechanism (gnat_param),
+ gnat_subprog));
+ }
/* Arrays are passed as pointers to element type for foreign conventions. */
else if (foreign
@@ -4921,6 +4930,9 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
DECL_POINTS_TO_READONLY_P (gnu_param)
= (ro_param && (by_ref || by_component_ptr));
+ /* Save the 64bit descriptor for later. */
+ SET_DECL_PARM_ALT (gnu_param, gnu_param_type_alt);
+
/* If no Mechanism was specified, indicate what we're using, then
back-annotate it. */
if (mech == Default)
@@ -7155,9 +7167,15 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
/* Do something if this is a fat pointer, in which case we
may need to return the thin pointer. */
if (TYPE_IS_FAT_POINTER_P (type) && size < POINTER_SIZE * 2)
- return
- build_pointer_type
- (TYPE_OBJECT_RECORD_TYPE (TYPE_UNCONSTRAINED_ARRAY (type)));
+ {
+ enum machine_mode p_mode = mode_for_size (size, MODE_INT, 0);
+ if (!targetm.valid_pointer_mode (p_mode))
+ p_mode = ptr_mode;
+ return
+ build_pointer_type_for_mode
+ (TYPE_OBJECT_RECORD_TYPE (TYPE_UNCONSTRAINED_ARRAY (type)),
+ p_mode, 0);
+ }
break;
case POINTER_TYPE:
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index aaf5e7f8d8f..685bb383bbd 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -678,7 +678,7 @@ extern void end_subprog_body (tree body, bool elab_p);
Return a constructor for the template. */
extern tree build_template (tree template_type, tree array_type, tree expr);
-/* Build a VMS descriptor from a Mechanism_Type, which must specify
+/* Build a 32bit VMS descriptor from a Mechanism_Type, which must specify
a descriptor type, and the GCC type of an object. Each FIELD_DECL
in the type contains in its DECL_INITIAL the expression to use when
a constructor is made for the type. GNAT_ENTITY is a gnat node used
@@ -687,6 +687,10 @@ extern tree build_template (tree template_type, tree array_type, tree expr);
extern tree build_vms_descriptor (tree type, Mechanism_Type mech,
Entity_Id gnat_entity);
+/* Build a 64bit VMS descriptor from a Mechanism_Type. See above. */
+extern tree build_vms_descriptor64 (tree type, Mechanism_Type mech,
+ Entity_Id gnat_entity);
+
/* Build a stub for the subprogram specified by the GCC tree GNU_SUBPROG
and the GNAT node GNAT_SUBPROG. */
extern void build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog);
@@ -844,9 +848,9 @@ extern tree build_allocator (tree type, tree init, tree result_type,
Node_Id gnat_node, bool);
/* Fill in a VMS descriptor for EXPR and return a constructor for it.
- GNAT_FORMAL is how we find the descriptor record. */
-
-extern tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal);
+ GNAT_FORMAL is how we find the descriptor record. GNAT_ACTUAL is how we
+ find the size of the allocator. */
+extern tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual);
/* Indicate that we need to make the address of EXPR_NODE and it therefore
should not be allocated in a register. Return true if successful. */
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 88f9a20a3e6..3b15e30a222 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -2368,7 +2368,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
else
gnu_actual = build_unary_op (ADDR_EXPR, NULL_TREE,
fill_vms_descriptor (gnu_actual,
- gnat_formal));
+ gnat_formal,
+ gnat_actual));
}
else
{
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 4188d38831e..01cc9b8948e 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -2635,7 +2635,7 @@ build_template (tree template_type, tree array_type, tree expr)
return gnat_build_constructor (template_type, nreverse (template_elts));
}
-/* Build a VMS descriptor from a Mechanism_Type, which must specify
+/* Build a 32bit VMS descriptor from a Mechanism_Type, which must specify
a descriptor type, and the GCC type of an object. Each FIELD_DECL
in the type contains in its DECL_INITIAL the expression to use when
a constructor is made for the type. GNAT_ENTITY is an entity used
@@ -2937,6 +2937,321 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
return record_type;
}
+/* Build a 64bit VMS descriptor from a Mechanism_Type, which must specify
+ a descriptor type, and the GCC type of an object. Each FIELD_DECL
+ in the type contains in its DECL_INITIAL the expression to use when
+ a constructor is made for the type. GNAT_ENTITY is an entity used
+ to print out an error message if the mechanism cannot be applied to
+ an object of that type and also for the name. */
+
+tree
+build_vms_descriptor64 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
+{
+ tree record64_type = make_node (RECORD_TYPE);
+ tree pointer64_type;
+ tree field_list64 = 0;
+ int class;
+ int dtype = 0;
+ tree inner_type;
+ int ndim;
+ int i;
+ tree *idx_arr;
+ tree tem;
+
+ /* If TYPE is an unconstrained array, use the underlying array type. */
+ if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
+ type = TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (type))));
+
+ /* If this is an array, compute the number of dimensions in the array,
+ get the index types, and point to the inner type. */
+ if (TREE_CODE (type) != ARRAY_TYPE)
+ ndim = 0;
+ else
+ for (ndim = 1, inner_type = type;
+ TREE_CODE (TREE_TYPE (inner_type)) == ARRAY_TYPE
+ && TYPE_MULTI_ARRAY_P (TREE_TYPE (inner_type));
+ ndim++, inner_type = TREE_TYPE (inner_type))
+ ;
+
+ idx_arr = (tree *) alloca (ndim * sizeof (tree));
+
+ if (mech != By_Descriptor_NCA
+ && TREE_CODE (type) == ARRAY_TYPE && TYPE_CONVENTION_FORTRAN_P (type))
+ for (i = ndim - 1, inner_type = type;
+ i >= 0;
+ i--, inner_type = TREE_TYPE (inner_type))
+ idx_arr[i] = TYPE_DOMAIN (inner_type);
+ else
+ for (i = 0, inner_type = type;
+ i < ndim;
+ i++, inner_type = TREE_TYPE (inner_type))
+ idx_arr[i] = TYPE_DOMAIN (inner_type);
+
+ /* Now get the DTYPE value. */
+ switch (TREE_CODE (type))
+ {
+ case INTEGER_TYPE:
+ case ENUMERAL_TYPE:
+ if (TYPE_VAX_FLOATING_POINT_P (type))
+ switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1))
+ {
+ case 6:
+ dtype = 10;
+ break;
+ case 9:
+ dtype = 11;
+ break;
+ case 15:
+ dtype = 27;
+ break;
+ }
+ else
+ switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
+ {
+ case 8:
+ dtype = TYPE_UNSIGNED (type) ? 2 : 6;
+ break;
+ case 16:
+ dtype = TYPE_UNSIGNED (type) ? 3 : 7;
+ break;
+ case 32:
+ dtype = TYPE_UNSIGNED (type) ? 4 : 8;
+ break;
+ case 64:
+ dtype = TYPE_UNSIGNED (type) ? 5 : 9;
+ break;
+ case 128:
+ dtype = TYPE_UNSIGNED (type) ? 25 : 26;
+ break;
+ }
+ break;
+
+ case REAL_TYPE:
+ dtype = GET_MODE_BITSIZE (TYPE_MODE (type)) == 32 ? 52 : 53;
+ break;
+
+ case COMPLEX_TYPE:
+ if (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE
+ && TYPE_VAX_FLOATING_POINT_P (type))
+ switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1))
+ {
+ case 6:
+ dtype = 12;
+ break;
+ case 9:
+ dtype = 13;
+ break;
+ case 15:
+ dtype = 29;
+ }
+ else
+ dtype = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) == 32 ? 54: 55;
+ break;
+
+ case ARRAY_TYPE:
+ dtype = 14;
+ break;
+
+ default:
+ break;
+ }
+
+ /* Get the CLASS value. */
+ switch (mech)
+ {
+ case By_Descriptor_A:
+ class = 4;
+ break;
+ case By_Descriptor_NCA:
+ class = 10;
+ break;
+ case By_Descriptor_SB:
+ class = 15;
+ break;
+ case By_Descriptor:
+ case By_Descriptor_S:
+ default:
+ class = 1;
+ break;
+ }
+
+ /* Make the type for a 64bit descriptor for VMS. The first six fields
+ are the same for all types. */
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("MBO",
+ gnat_type_for_size (16, 1),
+ record64_type, size_int (1)));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("DTYPE",
+ gnat_type_for_size (8, 1),
+ record64_type, size_int (dtype)));
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("CLASS",
+ gnat_type_for_size (8, 1),
+ record64_type, size_int (class)));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("MBMO",
+ gnat_type_for_size (32, 1),
+ record64_type, ssize_int (-1)));
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("LENGTH", gnat_type_for_size (64, 1), record64_type,
+ size_in_bytes (mech == By_Descriptor_A ? inner_type : type)));
+
+ pointer64_type = build_pointer_type_for_mode (type, DImode, false);
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("POINTER", pointer64_type, record64_type,
+ build_unary_op (ADDR_EXPR,
+ pointer64_type,
+ build0 (PLACEHOLDER_EXPR, type))));
+
+ switch (mech)
+ {
+ case By_Descriptor:
+ case By_Descriptor_S:
+ break;
+
+ case By_Descriptor_SB:
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("SB_L1", gnat_type_for_size (64, 1), record64_type,
+ TREE_CODE (type) == ARRAY_TYPE
+ ? TYPE_MIN_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("SB_U1", gnat_type_for_size (64, 1), record64_type,
+ TREE_CODE (type) == ARRAY_TYPE
+ ? TYPE_MAX_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
+ break;
+
+ case By_Descriptor_A:
+ case By_Descriptor_NCA:
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("SCALE",
+ gnat_type_for_size (8, 1),
+ record64_type,
+ size_zero_node));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("DIGITS",
+ gnat_type_for_size (8, 1),
+ record64_type,
+ size_zero_node));
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("AFLAGS", gnat_type_for_size (8, 1), record64_type,
+ size_int (mech == By_Descriptor_NCA
+ ? 0
+ /* Set FL_COLUMN, FL_COEFF, and FL_BOUNDS. */
+ : (TREE_CODE (type) == ARRAY_TYPE
+ && TYPE_CONVENTION_FORTRAN_P (type)
+ ? 224 : 192))));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("DIMCT",
+ gnat_type_for_size (8, 1),
+ record64_type,
+ size_int (ndim)));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("MBZ",
+ gnat_type_for_size (32, 1),
+ record64_type,
+ size_int (0)));
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("ARSIZE",
+ gnat_type_for_size (64, 1),
+ record64_type,
+ size_in_bytes (type)));
+
+ /* Now build a pointer to the 0,0,0... element. */
+ tem = build0 (PLACEHOLDER_EXPR, type);
+ for (i = 0, inner_type = type; i < ndim;
+ i++, inner_type = TREE_TYPE (inner_type))
+ tem = build4 (ARRAY_REF, TREE_TYPE (inner_type), tem,
+ convert (TYPE_DOMAIN (inner_type), size_zero_node),
+ NULL_TREE, NULL_TREE);
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("A0",
+ build_pointer_type_for_mode (inner_type, DImode, false),
+ record64_type,
+ build1 (ADDR_EXPR,
+ build_pointer_type_for_mode (inner_type, DImode,
+ false),
+ tem)));
+
+ /* Next come the addressing coefficients. */
+ tem = size_one_node;
+ for (i = 0; i < ndim; i++)
+ {
+ char fname[3];
+ tree idx_length
+ = size_binop (MULT_EXPR, tem,
+ size_binop (PLUS_EXPR,
+ size_binop (MINUS_EXPR,
+ TYPE_MAX_VALUE (idx_arr[i]),
+ TYPE_MIN_VALUE (idx_arr[i])),
+ size_int (1)));
+
+ fname[0] = (mech == By_Descriptor_NCA ? 'S' : 'M');
+ fname[1] = '0' + i, fname[2] = 0;
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field (fname,
+ gnat_type_for_size (64, 1),
+ record64_type, idx_length));
+
+ if (mech == By_Descriptor_NCA)
+ tem = idx_length;
+ }
+
+ /* Finally here are the bounds. */
+ for (i = 0; i < ndim; i++)
+ {
+ char fname[3];
+
+ fname[0] = 'L', fname[1] = '0' + i, fname[2] = 0;
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ (fname, gnat_type_for_size (64, 1), record64_type,
+ TYPE_MIN_VALUE (idx_arr[i])));
+
+ fname[0] = 'U';
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ (fname, gnat_type_for_size (64, 1), record64_type,
+ TYPE_MAX_VALUE (idx_arr[i])));
+ }
+ break;
+
+ default:
+ post_error ("unsupported descriptor type for &", gnat_entity);
+ }
+
+ finish_record_type (record64_type, field_list64, 0, true);
+ create_type_decl (create_concat_name (gnat_entity, "DESC64"), record64_type,
+ NULL, true, false, gnat_entity);
+
+ return record64_type;
+}
+
/* Utility routine for above code to make a field. */
static tree
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 300fbd37d01..1ed1b9f9cdb 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -2151,15 +2151,43 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
}
/* Fill in a VMS descriptor for EXPR and return a constructor for it.
- GNAT_FORMAL is how we find the descriptor record. */
+ GNAT_FORMAL is how we find the descriptor record. GNAT_ACTUAL is
+ how we find the allocator size which determines whether to use the
+ alternate 64bit descriptor. */
tree
-fill_vms_descriptor (tree expr, Entity_Id gnat_formal)
+fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
{
- tree record_type = TREE_TYPE (TREE_TYPE (get_gnu_tree (gnat_formal)));
tree field;
+ tree parm_decl = get_gnu_tree (gnat_formal);
tree const_list = NULL_TREE;
+ int size;
+ tree record_type;
+
+ /* A string literal will always be in 32bit space on VMS. Where
+ will it be on other 64bit systems???
+ An identifier's allocation may be unknown at compile time.
+ An explicit dereference could be either in 32bit or 64bit space.
+ Don't know about other possibilities, so assume unknown which
+ will result in fetching the 64bit descriptor. ??? */
+ if (Nkind (gnat_actual) == N_String_Literal)
+ size = 32;
+ else if (Nkind (gnat_actual) == N_Identifier)
+ size = UI_To_Int (Esize (Etype (gnat_actual)));
+ else if (Nkind (gnat_actual) == N_Explicit_Dereference)
+ size = UI_To_Int (Esize (Etype (Prefix (gnat_actual))));
+ else
+ size = 0;
+
+ /* If size is unknown, make it POINTER_SIZE */
+ if (size == 0)
+ size = POINTER_SIZE;
+
+ /* If size is 64bits grab the alternate 64bit descriptor. */
+ if (size == 64)
+ TREE_TYPE (parm_decl) = DECL_PARM_ALT (parm_decl);
+ record_type = TREE_TYPE (TREE_TYPE (parm_decl));
expr = maybe_unconstrained_array (expr);
gnat_mark_addressable (expr);
diff --git a/gcc/ada/gnat-style.texi b/gcc/ada/gnat-style.texi
index 4600d1fd849..8af9fc9bb02 100644
--- a/gcc/ada/gnat-style.texi
+++ b/gcc/ada/gnat-style.texi
@@ -7,23 +7,23 @@
@c o
@c G N A T C O D I N G S T Y L E o
@c o
-@c Copyright (C) 1992-2007, AdaCore o
-@c o
-@c GNAT is free software; you can redistribute it and/or modify it under o
-@c terms of the GNU General Public License as published by the Free Soft- o
-@c ware Foundation; either version 2, or (at your option) any later ver- o
-@c sion. GNAT is distributed in the hope that it will be useful, but WITH- o
-@c OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY o
-@c or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License o
-@c for more details. You should have received a copy of the GNU General o
-@c Public License distributed with GNAT; see file COPYING. If not, write o
-@c to the Free Software Foundation, 51 Franklin Street, Fifth Floor, o
-@c Boston, MA 02110-1301, USA. o
+@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
@c o
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@setfilename gnat-style.info
+@copying
+Copyright @copyright{} 1992-2007, Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts and with no Back-Cover
+Texts. A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+@end copying
+
@settitle GNAT Coding Style
@setchapternewpage odd
@@ -49,17 +49,7 @@
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1995-2007, Free Software Foundation
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'', with the
-Front-Cover Texts being
-``GNAT Coding Style'' and ``A Guide for GNAT Developers'',
-and with no Back-Cover Texts.
-A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
+@insertcopying
@end titlepage
@raisesections
@@ -76,15 +66,7 @@ A Guide for GNAT Developers
GNAT, The GNU Ada Compiler@*
@noindent
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'', with the
-Front-Cover Texts being
-``GNAT Coding Style'' and ``A Guide for GNAT Developers''
-and with no Back-Cover Texts.
-A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
+@insertcopying
@end ifnottex
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 47152e4bfbe..1d875a1f3c4 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -8,15 +8,23 @@
@c o
@c G N A T _ RM o
@c o
-@c Copyright (C) 1995-2008, Free Software Foundation o
-@c o
-@c o
@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
@c o
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@setfilename gnat_rm.info
+@copying
+Copyright @copyright{} 1995-2008, Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover Texts being ``GNAT Reference
+Manual'', and with no Back-Cover Texts. A copy of the license is
+included in the section entitled ``GNU Free Documentation License''.
+@end copying
+
@set EDITION GNAT
@set DEFAULTLANGUAGEVERSION Ada 2005
@set NONDEFAULTLANGUAGEVERSION Ada 95
@@ -33,18 +41,6 @@
* GNAT Reference Manual: (gnat_rm). Reference Manual for GNU Ada tools.
@end direntry
-@copying
-Copyright @copyright{} 1995-2008, Free Software Foundation, Inc.
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'',
-with the Front-Cover Texts being ``GNAT Reference Manual'', and with
-no Back-Cover Texts. A copy of the license is included in the section
-entitled ``GNU Free Documentation License''.
-@end copying
-
@titlepage
@title GNAT Reference Manual
@subtitle GNAT, The GNU Ada Compiler
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 99f3c8631d4..b55f398be8a 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -1,26 +1,30 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
+
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@c o
@c GNAT DOCUMENTATION o
@c o
@c G N A T _ U G N o
@c o
-@c Copyright (C) 1992-2008, AdaCore o
-@c o
-@c GNAT is free software; you can redistribute it and/or modify it under o
-@c terms of the GNU General Public License as published by the Free Soft- o
-@c ware Foundation; either version 2, or (at your option) any later ver- o
-@c sion. GNAT is distributed in the hope that it will be useful, but WITH- o
-@c OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY o
-@c or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License o
-@c for more details. You should have received a copy of the GNU General o
-@c Public License distributed with GNAT; see file COPYING. If not, write o
-@c to the Free Software Foundation, 51 Franklin Street, Fifth Floor, o
-@c Boston, MA 02110-1301, USA. o
+@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
@c o
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+@setfilename gnat_ugn.info
+
+@copying
+Copyright @copyright{} 1995-2005, 2006, 2007, 2008 Free Software Foundation,
+Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts and with no Back-Cover
+Texts. A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+@end copying
+
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@c
@c GNAT_UGN Style Guide
@@ -76,8 +80,6 @@
@c
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
-@setfilename gnat_ugn.info
-
@set NOW January 2007
@c This flag is used where the text refers to conditions that exist when the
@c text was entered into the document but which may change over time.
@@ -118,21 +120,6 @@
@syncodeindex fn cp
@c %**end of header
-@copying
-Copyright @copyright{} 1995-2005, 2006, 2007, 2008 Free Software Foundation,
-Inc.
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'', with the
-Front-Cover Texts being
-``@value{EDITION} User's Guide'',
-and with no Back-Cover Texts.
-A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
-@end copying
-
@titlepage
@title @value{EDITION} User's Guide
@ifset vms
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index 99898223cf2..4da260d67d1 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -1484,25 +1484,11 @@ begin
Exit_Program (E_Fatal);
end if;
- -- Get target parameters
+ -- Initialize packages to be used
Namet.Initialize;
Csets.Initialize;
Snames.Initialize;
- Osint.Add_Default_Search_Dirs;
- Targparm.Get_Target_Parameters;
-
- if VM_Target /= No_VM then
- case VM_Target is
- when JVM_Target => Gcc := new String'("jgnat");
- when CLI_Target => Gcc := new String'("dotnet-gnatcompile");
- when No_VM => raise Program_Error;
- end case;
-
- Ada_Bind_File := True;
- Begin_Info := "-- BEGIN Object file/option list";
- End_Info := "-- END Object file/option list ";
- end if;
-- We always compile with -c
@@ -1510,50 +1496,6 @@ begin
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
new String'("-c");
- -- If the main program is in Ada it is compiled with the following
- -- switches:
-
- -- -gnatA stops reading gnat.adc, since we don't know what
- -- pragmas would work, and we do not need it anyway.
-
- -- -gnatWb allows brackets coding for wide characters
-
- -- -gnatiw allows wide characters in identifiers. This is needed
- -- because bindgen uses brackets encoding for all upper
- -- half and wide characters in identifier names.
-
- if Ada_Bind_File then
- Binder_Options_From_ALI.Increment_Last;
- Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
- new String'("-gnatA");
- Binder_Options_From_ALI.Increment_Last;
- Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
- new String'("-gnatWb");
- Binder_Options_From_ALI.Increment_Last;
- Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
- new String'("-gnatiw");
- end if;
-
- -- Locate all the necessary programs and verify required files are present
-
- Gcc_Path := System.OS_Lib.Locate_Exec_On_Path (Gcc.all);
-
- if Gcc_Path = null then
- Exit_With_Error ("Couldn't locate " & Gcc.all);
- end if;
-
- if Linker_Path = null then
- if VM_Target = CLI_Target then
- Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("ilasm");
-
- if Linker_Path = null then
- Exit_With_Error ("Couldn't locate ilasm");
- end if;
- else
- Linker_Path := Gcc_Path;
- end if;
- end if;
-
if Ali_File_Name = null then
Exit_With_Error ("no ali file given for link");
end if;
@@ -1624,6 +1566,18 @@ begin
:= String_Access (Arg);
end if;
+ -- Set the RTS_*_Path_Name variables, so that the
+ -- correct directories will be set when
+ -- Osint.Add_Default_Search_Dirs will be called later.
+
+ Opt.RTS_Src_Path_Name :=
+ Get_RTS_Search_Dir
+ (Arg (Arg'First + 6 .. Arg'Last), Include);
+
+ Opt.RTS_Lib_Path_Name :=
+ Get_RTS_Search_Dir
+ (Arg (Arg'First + 6 .. Arg'Last), Objects);
+
-- GNAT doesn't support the GCC multilib mechanism.
-- This means that, when a multilib switch is used
-- to request a particular compilation mode, the
@@ -1635,8 +1589,7 @@ begin
-- Pass -mrtp to the linker if --RTS=rtp was passed
- if Linker_Path = Gcc_Path
- and then Arg'Length > 8
+ if Arg'Length > 8
and then Arg (Arg'First + 6 .. Arg'First + 8) = "rtp"
then
Linker_Options.Increment_Last;
@@ -1645,8 +1598,7 @@ begin
-- Pass -fsjlj to the linker if --RTS=sjlj was passed
- elsif Linker_Path = Gcc_Path
- and then Arg'Length > 9
+ elsif Arg'Length > 9
and then Arg (Arg'First + 6 .. Arg'First + 9) = "sjlj"
then
Linker_Options.Increment_Last;
@@ -1660,6 +1612,78 @@ begin
end;
end if;
+ -- Get target parameters
+
+ Osint.Add_Default_Search_Dirs;
+ Targparm.Get_Target_Parameters;
+
+ if VM_Target /= No_VM then
+ case VM_Target is
+ when JVM_Target => Gcc := new String'("jgnat");
+ when CLI_Target => Gcc := new String'("dotnet-gnatcompile");
+ when No_VM => raise Program_Error;
+ end case;
+
+ Ada_Bind_File := True;
+ Begin_Info := "-- BEGIN Object file/option list";
+ End_Info := "-- END Object file/option list ";
+ end if;
+
+ -- If the main program is in Ada it is compiled with the following
+ -- switches:
+
+ -- -gnatA stops reading gnat.adc, since we don't know what
+ -- pragmas would work, and we do not need it anyway.
+
+ -- -gnatWb allows brackets coding for wide characters
+
+ -- -gnatiw allows wide characters in identifiers. This is needed
+ -- because bindgen uses brackets encoding for all upper
+ -- half and wide characters in identifier names.
+
+ if Ada_Bind_File then
+ Binder_Options_From_ALI.Increment_Last;
+ Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
+ new String'("-gnatA");
+ Binder_Options_From_ALI.Increment_Last;
+ Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
+ new String'("-gnatWb");
+ Binder_Options_From_ALI.Increment_Last;
+ Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
+ new String'("-gnatiw");
+ end if;
+
+ -- Locate all the necessary programs and verify required files are present
+
+ Gcc_Path := System.OS_Lib.Locate_Exec_On_Path (Gcc.all);
+
+ if Gcc_Path = null then
+ Exit_With_Error ("Couldn't locate " & Gcc.all);
+ end if;
+
+ if Linker_Path = null then
+ if VM_Target = CLI_Target then
+ Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("ilasm");
+
+ if Linker_Path = null then
+ Exit_With_Error ("Couldn't locate ilasm");
+ end if;
+
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+
+ -- Use Microsoft linker for RTSS modules
+
+ Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("link");
+
+ if Linker_Path = null then
+ Exit_With_Error ("Couldn't locate link");
+ end if;
+
+ else
+ Linker_Path := Gcc_Path;
+ end if;
+ end if;
+
Write_Header;
-- If no output name specified, then use the base name of .ali file name
@@ -1680,6 +1704,11 @@ begin
Linker_Options.Table (Linker_Options.Last) :=
new String'("/OUTPUT=" & Output_File_Name.all);
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) :=
+ new String'("/OUT:" & Output_File_Name.all);
+
else
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) := new String'("-o");
@@ -1869,6 +1898,120 @@ begin
Num_Args := Num_Args - 1;
end if;
end loop;
+
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+
+ -- Remove flags not relevant for Microsoft linker and adapt some
+ -- others.
+
+ for J in reverse Linker_Options.First .. Linker_Options.Last loop
+
+ -- Remove flags that are not accepted
+ if Linker_Options.Table (J)'Length = 0
+ or else Linker_Options.Table (J) (1 .. 2) = "-l"
+ or else Linker_Options.Table (J) (1 .. 3) = "-Wl"
+ or else Linker_Options.Table (J) (1 .. 3) = "-sh"
+ or else Linker_Options.Table (J) (1 .. 8) = "-Xlinker"
+ or else Linker_Options.Table (J) (1 .. 9) = "-mthreads"
+ then
+ Linker_Options.Table (J .. Linker_Options.Last - 1) :=
+ Linker_Options.Table (J + 1 .. Linker_Options.Last);
+ Linker_Options.Decrement_Last;
+ Num_Args := Num_Args - 1;
+
+ -- Replace "-L" by its counterpart "/LIBPATH:" and UNIX "/" by
+ -- Windows "\".
+ elsif Linker_Options.Table (J) (1 .. 2) = "-L" then
+ declare
+ Libpath_Option : constant String_Access := new String'
+ ("/LIBPATH:" &
+ Linker_Options.Table (J)
+ (3 .. Linker_Options.Table (J).all'Last));
+ begin
+ for Index in 10 .. Libpath_Option'Last loop
+ if Libpath_Option (Index) = '/' then
+ Libpath_Option (Index) := '\';
+ end if;
+ end loop;
+
+ Linker_Options.Table (J) := Libpath_Option;
+ end;
+
+ -- Replace "-g" by "/DEBUG"
+ elsif Linker_Options.Table (J) (1 .. 2) = "-g" then
+ Linker_Options.Table (J) := new String'("/DEBUG");
+
+ -- Replace "-o" by "/OUT:"
+ elsif Linker_Options.Table (J) (1 .. 2) = "-o" then
+ Linker_Options.Table (J + 1) := new String'
+ ("/OUT:" & Linker_Options.Table (J + 1).all);
+
+ Linker_Options.Table (J .. Linker_Options.Last - 1) :=
+ Linker_Options.Table (J + 1 .. Linker_Options.Last);
+ Linker_Options.Decrement_Last;
+ Num_Args := Num_Args - 1;
+
+ -- Replace "--stack=" by "/STACK:"
+ elsif Linker_Options.Table (J) (1 .. 8) = "--stack=" then
+ Linker_Options.Table (J) := new String'
+ ("/STACK:" &
+ Linker_Options.Table (J)
+ (9 .. Linker_Options.Table (J).all'Last));
+
+ -- Replace "-v" by its counterpart "/VERBOSE"
+ elsif Linker_Options.Table (J) (1 .. 2) = "-v" then
+ Linker_Options.Table (J) := new String'("/VERBOSE");
+ end if;
+ end loop;
+
+ -- Add some required flags to create RTSS modules
+
+ declare
+ Flags_For_Linker : constant array (1 .. 17) of String_Access :=
+ (new String'("/NODEFAULTLIB"),
+ new String'("/INCREMENTAL:NO"),
+ new String'("/NOLOGO"),
+ new String'("/DRIVER"),
+ new String'("/ALIGN:0x20"),
+ new String'("/SUBSYSTEM:NATIVE"),
+ new String'("/ENTRY:_RtapiProcessEntryCRT@8"),
+ new String'("/RELEASE"),
+ new String'("startupCRT.obj"),
+ new String'("rtxlibcmt.lib"),
+ new String'("oldnames.lib"),
+ new String'("rtapi_rtss.lib"),
+ new String'("Rtx_Rtss.lib"),
+ new String'("libkernel32.a"),
+ new String'("libws2_32.a"),
+ new String'("libmswsock.a"),
+ new String'("libadvapi32.a"));
+ -- These flags need to be passed to Microsoft linker. They
+ -- come from the RTX documentation.
+
+ Gcc_Lib_Path : constant String_Access := new String'
+ ("/LIBPATH:" & Include_Dir_Default_Prefix & "\..\");
+ -- Place to look for gcc related libraries, such as libgcc
+
+ begin
+ -- Replace UNIX "/" by Windows "\" in the path
+
+ for Index in 10 .. Gcc_Lib_Path.all'Last loop
+ if Gcc_Lib_Path (Index) = '/' then
+ Gcc_Lib_Path (Index) := '\';
+ end if;
+ end loop;
+
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) := Gcc_Lib_Path;
+ Num_Args := Num_Args + 1;
+
+ for Index in Flags_For_Linker'Range loop
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) :=
+ Flags_For_Linker (Index);
+ Num_Args := Num_Args + 1;
+ end loop;
+ end;
end if;
-- Remove duplicate stack size setting from the Linker_Options
@@ -1978,6 +2121,15 @@ begin
Linker_Options.Table (Linker_Options.Last) := Static_Libgcc;
Num_Args := Num_Args + 1;
end if;
+
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+
+ -- Force the use of the static libgcc for RTSS modules
+
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) :=
+ new String'("libgcc.a");
+ Num_Args := Num_Args + 1;
end if;
end Clean_Link_Option_Set;
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 3ae13fc84ae..7d055096832 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -659,21 +659,21 @@ package body Make is
-- Compiler, Binder & Linker Data and Subprograms --
----------------------------------------------------
- Gcc : String_Access := Program_Name ("gcc", "gnatmake");
- Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
- Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
+ Gcc : String_Access := Program_Name ("gcc", "gnatmake");
+ Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
+ Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
-- Default compiler, binder, linker programs
- Saved_Gcc : String_Access := null;
- Saved_Gnatbind : String_Access := null;
- Saved_Gnatlink : String_Access := null;
+ Saved_Gcc : String_Access := null;
+ Saved_Gnatbind : String_Access := null;
+ Saved_Gnatlink : String_Access := null;
-- Given by the command line. Will be used, if non null
- Gcc_Path : String_Access :=
+ Gcc_Path : String_Access :=
GNAT.OS_Lib.Locate_Exec_On_Path (Gcc.all);
- Gnatbind_Path : String_Access :=
+ Gnatbind_Path : String_Access :=
GNAT.OS_Lib.Locate_Exec_On_Path (Gnatbind.all);
- Gnatlink_Path : String_Access :=
+ Gnatlink_Path : String_Access :=
GNAT.OS_Lib.Locate_Exec_On_Path (Gnatlink.all);
-- Path for compiler, binder, linker programs, defaulted now for gnatdist.
-- Changed later if overridden on command line.
diff --git a/gcc/ada/mlib-utl.adb b/gcc/ada/mlib-utl.adb
index d743bb138e8..4d15ad85cf3 100644
--- a/gcc/ada/mlib-utl.adb
+++ b/gcc/ada/mlib-utl.adb
@@ -408,7 +408,7 @@ package body MLib.Utl is
if Driver_Name = No_Name then
if Gcc_Exec = null then
if Gcc_Name = null then
- Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
+ Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
end if;
Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all);
diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads
index 6cf7530f7fe..897779b178e 100644
--- a/gcc/ada/osint.ads
+++ b/gcc/ada/osint.ads
@@ -113,13 +113,13 @@ package Osint is
-- to "<target>-gcc". In the specific case where AAMP_On_Target is set, the
-- name "gcc" is mapped to "gnaamp", and names of the form "gnat*" are
-- mapped to "gnaamp*". This function clobbers Name_Buffer and Name_Len.
- -- Also look at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1".
- -- Prog is the default name of the current program being executed, e.g.
- -- "gnatmake", "gnatlink".
+ -- Also look at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1". Prog is the
+ -- default name of the current program being executed, e.g. "gnatmake",
+ -- "gnatlink".
procedure Write_Program_Name;
- -- Writes name of program as invoked to the current output
- -- (normally standard output).
+ -- Writes name of program as invoked to the current output (normally
+ -- standard output).
procedure Fail (S1 : String; S2 : String := ""; S3 : String := "");
pragma No_Return (Fail);
@@ -243,8 +243,8 @@ package Osint is
-- modified by update_path.
procedure Add_Default_Search_Dirs;
- -- This routine adds the default search dirs indicated by the
- -- environment variables and sdefault package.
+ -- This routine adds the default search dirs indicated by the environment
+ -- variables and sdefault package.
procedure Add_Lib_Search_Dir (Dir : String);
-- Add Dir at the end of the library file search path
@@ -256,11 +256,11 @@ package Osint is
(Search_Path : String_Access);
function Get_Next_Dir_In_Path
(Search_Path : String_Access) return String_Access;
- -- These subprograms are used to parse out the directory names in a
- -- search path specified by a Search_Path argument. The procedure
- -- initializes an internal pointer to point to the initial directory
- -- name, and calls to the function return successive directory names,
- -- with a null pointer marking the end of the list.
+ -- These subprograms are used to parse out the directory names in a search
+ -- path specified by a Search_Path argument. The procedure initializes an
+ -- internal pointer to point to the initial directory name, and calls to
+ -- the function return successive directory names, with a null pointer
+ -- marking the end of the list.
type Search_File_Type is (Include, Objects);
@@ -347,10 +347,9 @@ package Osint is
-- LF/CR
-- LF
- -- The source is terminated by an EOF (16#1A#) character, which is
- -- the last character of the returned source buffer (note that any
- -- EOF characters in positions other than the last source character
- -- are treated as representing blanks).
+ -- The source is terminated by an EOF (16#1A#) character, which is the last
+ -- character of the returned source buffer (note that any EOF characters in
+ -- positions other than the last source character are treated as blanks).
--
-- The logical lower bound of the source buffer is the input value of Lo,
-- and on exit Hi is set to the logical upper bound of the source buffer.
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb
index a0efccc3f06..fda3b2ff082 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -914,25 +914,6 @@ package body Rtsfind is
---------------
procedure Check_RPC is
-
- procedure Check_RPC_Failure (Msg : String);
- pragma No_Return (Check_RPC_Failure);
- -- Display Msg on standard error and raise Unrecoverable_Error
-
- -----------------------
- -- Check_RPC_Failure --
- -----------------------
-
- procedure Check_RPC_Failure (Msg : String) is
- begin
- Set_Standard_Error;
- Write_Str (Msg);
- Write_Eol;
- raise Unrecoverable_Error;
- end Check_RPC_Failure;
-
- -- Start of processing for Check_RPC
-
begin
-- Bypass this check if debug flag -gnatdR set
@@ -940,30 +921,44 @@ package body Rtsfind is
return;
end if;
- -- Otherwise we need the check if we are going after one of
- -- the critical entities in System.RPC in stubs mode.
-
- -- ??? Should we do this for other s-parint entities too?
-
- if (Distribution_Stub_Mode = Generate_Receiver_Stub_Body
- or else
- Distribution_Stub_Mode = Generate_Caller_Stub_Body)
- and then (E = RE_Do_Rpc
- or else
- E = RE_Do_Apc
- or else
- E = RE_Params_Stream_Type
- or else
- E = RE_Request_Access)
+ -- Otherwise we need the check if we are going after one of the
+ -- critical entities in System.RPC / System.Partition_Interface.
+
+ if E = RE_Do_Rpc
+ or else
+ E = RE_Do_Apc
+ or else
+ E = RE_Params_Stream_Type
+ or else
+ E = RE_Request_Access
then
- if Get_PCS_Name = Name_No_DSA then
- Check_RPC_Failure ("distribution feature not supported");
+ -- If generating RCI stubs, check that we have a real PCS
+
+ if (Distribution_Stub_Mode = Generate_Receiver_Stub_Body
+ or else
+ Distribution_Stub_Mode = Generate_Caller_Stub_Body)
+ and then Get_PCS_Name = Name_No_DSA
+ then
+ Set_Standard_Error;
+ Write_Str ("distribution feature not supported");
+ Write_Eol;
+ raise Unrecoverable_Error;
+
+ -- In all cases, check Exp_Dist and System.Partition_Interface
+ -- consistency.
elsif Get_PCS_Version /=
Exp_Dist.PCS_Version_Number (Get_PCS_Name)
then
- Check_RPC_Failure ("PCS version mismatch");
-
+ Set_Standard_Error;
+ Write_Str ("PCS version mismatch: expander ");
+ Write_Int (Exp_Dist.PCS_Version_Number (Get_PCS_Name));
+ Write_Str (", PCS (");
+ Write_Name (Get_PCS_Name);
+ Write_Str (") ");
+ Write_Int (Get_PCS_Version);
+ Write_Eol;
+ raise Unrecoverable_Error;
end if;
end if;
end Check_RPC;
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index b6ccb6028fc..f67d34d60f8 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -31,6 +31,7 @@ with Einfo; use Einfo;
with Errout; use Errout;
with Eval_Fat; use Eval_Fat;
with Exp_Ch3; use Exp_Ch3;
+with Exp_Ch9; use Exp_Ch9;
with Exp_Disp; use Exp_Disp;
with Exp_Dist; use Exp_Dist;
with Exp_Tss; use Exp_Tss;
@@ -15811,48 +15812,117 @@ package body Sem_Ch3 is
-- If the private view was tagged, copy the new primitive operations
-- from the private view to the full view.
- -- Note: Subprograms covering interface primitives were previously
- -- propagated to the full view by Derive_Progenitor_Primitives
-
- if Is_Tagged_Type (Full_T)
- and then not Is_Concurrent_Type (Full_T)
- then
+ if Is_Tagged_Type (Full_T) then
declare
- Priv_List : Elist_Id;
- Full_List : constant Elist_Id := Primitive_Operations (Full_T);
- P1, P2 : Elmt_Id;
+ Disp_Typ : Entity_Id;
+ Full_List : Elist_Id;
Prim : Entity_Id;
- D_Type : Entity_Id;
+ Prim_Elmt : Elmt_Id;
+ Priv_List : Elist_Id;
+
+ function Contains
+ (E : Entity_Id;
+ L : Elist_Id) return Boolean;
+ -- Determine whether list L contains element E
+
+ --------------
+ -- Contains --
+ --------------
+
+ function Contains
+ (E : Entity_Id;
+ L : Elist_Id) return Boolean
+ is
+ List_Elmt : Elmt_Id;
+
+ begin
+ List_Elmt := First_Elmt (L);
+ while Present (List_Elmt) loop
+ if Node (List_Elmt) = E then
+ return True;
+ end if;
+
+ Next_Elmt (List_Elmt);
+ end loop;
+
+ return False;
+ end Contains;
+
+ -- Start of processing
begin
if Is_Tagged_Type (Priv_T) then
Priv_List := Primitive_Operations (Priv_T);
+ Prim_Elmt := First_Elmt (Priv_List);
+
+ -- In the case of a concurrent type completing a private tagged
+ -- type, primivies may have been declared in between the two
+ -- views. These subprograms need to be wrapped the same way
+ -- entries and protected procedures are handled because they
+ -- cannot be directly shared by the two views.
+
+ if Is_Concurrent_Type (Full_T) then
+ declare
+ Conc_Typ : constant Entity_Id :=
+ Corresponding_Record_Type (Full_T);
+ Loc : constant Source_Ptr := Sloc (Conc_Typ);
+ Curr_Nod : Node_Id := Parent (Conc_Typ);
+ Wrap_Spec : Node_Id;
- P1 := First_Elmt (Priv_List);
- while Present (P1) loop
- Prim := Node (P1);
+ begin
+ while Present (Prim_Elmt) loop
+ Prim := Node (Prim_Elmt);
- -- Transfer explicit primitives, not those inherited from
- -- parent of partial view, which will be re-inherited on
- -- the full view.
+ if Comes_From_Source (Prim)
+ and then not Is_Abstract_Subprogram (Prim)
+ then
+ Wrap_Spec :=
+ Make_Subprogram_Declaration (Loc,
+ Specification =>
+ Build_Wrapper_Spec (Loc,
+ Subp_Id => Prim,
+ Obj_Typ => Conc_Typ,
+ Formals =>
+ Parameter_Specifications (
+ Parent (Prim))));
+
+ Insert_After (Curr_Nod, Wrap_Spec);
+ Curr_Nod := Wrap_Spec;
+
+ Analyze (Wrap_Spec);
+ end if;
- if Comes_From_Source (Prim) then
- P2 := First_Elmt (Full_List);
- while Present (P2) and then Node (P2) /= Prim loop
- Next_Elmt (P2);
+ Next_Elmt (Prim_Elmt);
end loop;
- -- If not found, that is a new one
+ return;
+ end;
+
+ -- For non-concurrent types, transfer explicit primitives, but
+ -- omit those inherited from the parent of the private view
+ -- since they will be re-inherited later on.
+
+ else
+ Full_List := Primitive_Operations (Full_T);
+
+ while Present (Prim_Elmt) loop
+ Prim := Node (Prim_Elmt);
- if No (P2) then
+ if Comes_From_Source (Prim)
+ and then not Contains (Prim, Full_List)
+ then
Append_Elmt (Prim, Full_List);
end if;
- end if;
- Next_Elmt (P1);
- end loop;
+ Next_Elmt (Prim_Elmt);
+ end loop;
+ end if;
+
+ -- Untagged private view
else
+ Full_List := Primitive_Operations (Full_T);
+
-- In this case the partial view is untagged, so here we locate
-- all of the earlier primitives that need to be treated as
-- dispatching (those that appear between the two views). Note
@@ -15871,10 +15941,9 @@ package body Sem_Ch3 is
or else
Ekind (Prim) = E_Function
then
+ Disp_Typ := Find_Dispatching_Type (Prim);
- D_Type := Find_Dispatching_Type (Prim);
-
- if D_Type = Full_T
+ if Disp_Typ = Full_T
and then (Chars (Prim) /= Name_Op_Ne
or else Comes_From_Source (Prim))
then
@@ -15887,13 +15956,13 @@ package body Sem_Ch3 is
end if;
elsif Is_Dispatching_Operation (Prim)
- and then D_Type /= Full_T
+ and then Disp_Typ /= Full_T
then
-- Verify that it is not otherwise controlled by a
-- formal or a return value of type T.
- Check_Controlling_Formals (D_Type, Prim);
+ Check_Controlling_Formals (Disp_Typ, Prim);
end if;
end if;
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 0116a83517c..04413a19602 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1306,6 +1306,17 @@ package body Sem_Ch6 is
-- If pragma does not appear after the body, check whether there is
-- an inline pragma before any local declarations.
+ function Disambiguate_Spec return Entity_Id;
+ -- When a primitive is declared between the private view and the full
+ -- view of a concurrent type which implements an interface, a special
+ -- mechanism is used to find the corresponding spec of the primitive
+ -- body.
+
+ function Is_Private_Concurrent_Primitive
+ (Subp_Id : Entity_Id) return Boolean;
+ -- Determine whether subprogram Subp_Id is a primitive of a concurrent
+ -- type that implements an interface and has a private view.
+
procedure Set_Trivial_Subprogram (N : Node_Id);
-- Sets the Is_Trivial_Subprogram flag in both spec and body of the
-- subprogram whose body is being analyzed. N is the statement node
@@ -1457,6 +1468,128 @@ package body Sem_Ch6 is
end if;
end Check_Inline_Pragma;
+ -----------------------
+ -- Disambiguate_Spec --
+ -----------------------
+
+ function Disambiguate_Spec return Entity_Id is
+ Priv_Spec : Entity_Id;
+ Spec_N : Entity_Id;
+
+ procedure Replace_Types (To_Corresponding : Boolean);
+ -- Depending on the flag, replace the type of formal parameters of
+ -- Body_Id if it is a concurrent type implementing interfaces with
+ -- the corresponding record type or the other way around.
+
+ procedure Replace_Types (To_Corresponding : Boolean) is
+ Formal : Entity_Id;
+ Formal_Typ : Entity_Id;
+
+ begin
+ Formal := First_Formal (Body_Id);
+ while Present (Formal) loop
+ Formal_Typ := Etype (Formal);
+
+ -- From concurrent type to corresponding record
+
+ if To_Corresponding then
+ if Is_Concurrent_Type (Formal_Typ)
+ and then Present (Corresponding_Record_Type (Formal_Typ))
+ and then Present (Interfaces (
+ Corresponding_Record_Type (Formal_Typ)))
+ then
+ Set_Etype (Formal,
+ Corresponding_Record_Type (Formal_Typ));
+ end if;
+
+ -- From corresponding record to concurrent type
+
+ else
+ if Is_Concurrent_Record_Type (Formal_Typ)
+ and then Present (Interfaces (Formal_Typ))
+ then
+ Set_Etype (Formal,
+ Corresponding_Concurrent_Type (Formal_Typ));
+ end if;
+ end if;
+
+ Next_Formal (Formal);
+ end loop;
+ end Replace_Types;
+
+ -- Start of processing for Disambiguate_Spec
+
+ begin
+ -- Try to retrieve the specification of the body as is. All error
+ -- messages are suppressed because the body may not have a spec in
+ -- its current state.
+
+ Spec_N := Find_Corresponding_Spec (N, False);
+
+ -- It is possible that this is the body of a primitive declared
+ -- between a private and a full view of a concurrent type. The
+ -- controlling parameter of the spec carries the concurrent type,
+ -- not the corresponding record type as transformed by Analyze_
+ -- Subprogram_Specification. In such cases, we undo the change
+ -- made by the analysis of the specification and try to find the
+ -- spec again.
+
+ if No (Spec_N) then
+
+ -- Restore all references of corresponding record types to the
+ -- original concurrent types.
+
+ Replace_Types (To_Corresponding => False);
+ Priv_Spec := Find_Corresponding_Spec (N, False);
+
+ -- The current body truly belongs to a primitive declared between
+ -- a private and a full view. We leave the modified body as is,
+ -- and return the true spec.
+
+ if Present (Priv_Spec)
+ and then Is_Private_Primitive (Priv_Spec)
+ then
+ return Priv_Spec;
+ end if;
+
+ -- In case that this is some sort of error, restore the original
+ -- state of the body.
+
+ Replace_Types (To_Corresponding => True);
+ end if;
+
+ return Spec_N;
+ end Disambiguate_Spec;
+
+ -------------------------------------
+ -- Is_Private_Concurrent_Primitive --
+ -------------------------------------
+
+ function Is_Private_Concurrent_Primitive
+ (Subp_Id : Entity_Id) return Boolean
+ is
+ Formal_Typ : Entity_Id;
+
+ begin
+ if Present (First_Formal (Subp_Id)) then
+ Formal_Typ := Etype (First_Formal (Subp_Id));
+
+ if Is_Concurrent_Record_Type (Formal_Typ) then
+ Formal_Typ := Corresponding_Concurrent_Type (Formal_Typ);
+ end if;
+
+ -- The type of the first formal is a concurrent tagged type with
+ -- a private view.
+
+ return
+ Is_Concurrent_Type (Formal_Typ)
+ and then Is_Tagged_Type (Formal_Typ)
+ and then Has_Private_Declaration (Formal_Typ);
+ end if;
+
+ return False;
+ end Is_Private_Concurrent_Primitive;
+
----------------------------
-- Set_Trivial_Subprogram --
----------------------------
@@ -1581,7 +1714,11 @@ package body Sem_Ch6 is
if Nkind (N) = N_Subprogram_Body_Stub
or else No (Corresponding_Spec (N))
then
- Spec_Id := Find_Corresponding_Spec (N);
+ if Is_Private_Concurrent_Primitive (Body_Id) then
+ Spec_Id := Disambiguate_Spec;
+ else
+ Spec_Id := Find_Corresponding_Spec (N);
+ end if;
-- If this is a duplicate body, no point in analyzing it
@@ -2322,6 +2459,22 @@ package body Sem_Ch6 is
New_Overloaded_Entity (Designator);
Check_Delayed_Subprogram (Designator);
+ -- If the type of the first formal of the current subprogram is a non
+ -- generic tagged private type , mark the subprogram as being a private
+ -- primitive.
+
+ if Present (First_Formal (Designator)) then
+ declare
+ Formal_Typ : constant Entity_Id :=
+ Etype (First_Formal (Designator));
+ begin
+ Set_Is_Private_Primitive (Designator,
+ Is_Tagged_Type (Formal_Typ)
+ and then Is_Private_Type (Formal_Typ)
+ and then not Is_Generic_Actual_Type (Formal_Typ));
+ end;
+ end if;
+
-- Ada 2005 (AI-251): Abstract interface primitives must be abstract
-- or null.
@@ -2435,8 +2588,6 @@ package body Sem_Ch6 is
function Analyze_Subprogram_Specification (N : Node_Id) return Entity_Id is
Designator : constant Entity_Id := Defining_Entity (N);
Formals : constant List_Id := Parameter_Specifications (N);
- Formal : Entity_Id;
- Formal_Typ : Entity_Id;
-- Start of processing for Analyze_Subprogram_Specification
@@ -2466,21 +2617,29 @@ package body Sem_Ch6 is
-- record, to match the proper signature of an overriding operation.
if Ada_Version >= Ada_05 then
- Formal := First_Formal (Designator);
- while Present (Formal) loop
- Formal_Typ := Etype (Formal);
+ declare
+ Formal : Entity_Id;
+ Formal_Typ : Entity_Id;
+ Rec_Typ : Entity_Id;
- if Is_Concurrent_Type (Formal_Typ)
- and then Present (Corresponding_Record_Type (Formal_Typ))
- and then Present (Interfaces
- (Corresponding_Record_Type (Formal_Typ)))
- then
- Set_Etype (Formal,
- Corresponding_Record_Type (Formal_Typ));
- end if;
+ begin
+ Formal := First_Formal (Designator);
+ while Present (Formal) loop
+ Formal_Typ := Etype (Formal);
- Formal := Next_Formal (Formal);
- end loop;
+ if Is_Concurrent_Type (Formal_Typ)
+ and then Present (Corresponding_Record_Type (Formal_Typ))
+ then
+ Rec_Typ := Corresponding_Record_Type (Formal_Typ);
+
+ if Present (Interfaces (Rec_Typ)) then
+ Set_Etype (Formal, Rec_Typ);
+ end if;
+ end if;
+
+ Next_Formal (Formal);
+ end loop;
+ end;
end if;
End_Scope;
@@ -5161,7 +5320,10 @@ package body Sem_Ch6 is
-- Find_Corresponding_Spec --
-----------------------------
- function Find_Corresponding_Spec (N : Node_Id) return Entity_Id is
+ function Find_Corresponding_Spec
+ (N : Node_Id;
+ Post_Error : Boolean := True) return Entity_Id
+ is
Spec : constant Node_Id := Specification (N);
Designator : constant Entity_Id := Defining_Entity (Spec);
@@ -5205,7 +5367,6 @@ package body Sem_Ch6 is
end if;
if not Has_Completion (E) then
-
if Nkind (N) /= N_Subprogram_Body_Stub then
Set_Corresponding_Spec (N, E);
end if;
@@ -5250,14 +5411,15 @@ package body Sem_Ch6 is
return Empty;
end if;
- -- If body already exists, this is an error unless the
- -- previous declaration is the implicit declaration of
- -- a derived subprogram, or this is a spurious overloading
- -- in an instance.
+ -- If the body already exists, then this is an error unless
+ -- the previous declaration is the implicit declaration of a
+ -- derived subprogram, or this is a spurious overloading in an
+ -- instance.
elsif No (Alias (E))
and then not Is_Intrinsic_Subprogram (E)
and then not In_Instance
+ and then Post_Error
then
Error_Msg_Sloc := Sloc (E);
if Is_Imported (E) then
@@ -5269,16 +5431,17 @@ package body Sem_Ch6 is
end if;
end if;
+ -- Child units cannot be overloaded, so a conformance mismatch
+ -- between body and a previous spec is an error.
+
elsif Is_Child_Unit (E)
and then
Nkind (Unit_Declaration_Node (Designator)) = N_Subprogram_Body
and then
Nkind (Parent (Unit_Declaration_Node (Designator))) =
- N_Compilation_Unit
+ N_Compilation_Unit
+ and then Post_Error
then
- -- Child units cannot be overloaded, so a conformance mismatch
- -- between body and a previous spec is an error.
-
Error_Msg_N
("body of child unit does not match previous declaration", N);
end if;
diff --git a/gcc/ada/sem_ch6.ads b/gcc/ada/sem_ch6.ads
index 689ac8b690a..e54c1e1117c 100644
--- a/gcc/ada/sem_ch6.ads
+++ b/gcc/ada/sem_ch6.ads
@@ -136,8 +136,8 @@ package Sem_Ch6 is
Get_Inst : Boolean := False) return Boolean;
-- Check that the types of two formal parameters are conforming. In most
-- cases this is just a name comparison, but within an instance it involves
- -- generic actual types, and in the presence of anonymous access types
- -- it must examine the designated types.
+ -- generic actual types, and in the presence of anonymous access types it
+ -- must examine the designated types.
procedure Create_Extra_Formals (E : Entity_Id);
-- For each parameter of a subprogram or entry that requires an additional
@@ -147,7 +147,9 @@ package Sem_Ch6 is
-- the end of Subp's parameter list (with each subsequent extra formal
-- being attached to the preceding extra formal).
- function Find_Corresponding_Spec (N : Node_Id) return Entity_Id;
+ function Find_Corresponding_Spec
+ (N : Node_Id;
+ Post_Error : Boolean := True) return Entity_Id;
-- Use the subprogram specification in the body to retrieve the previous
-- subprogram declaration, if any.
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index c5edce6d085..16c79d99f04 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -1578,25 +1578,45 @@ package body Sem_Ch8 is
-- an abstract formal subprogram must be dispatching
-- operation).
- case Attribute_Name (Nam) is
- when Name_Input =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Input);
- when Name_Output =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Output);
- when Name_Read =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Read);
- when Name_Write =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Write);
- when others =>
- Error_Msg_N
- ("attribute must be a primitive dispatching operation",
- Nam);
- return;
- end case;
+ begin
+ case Attribute_Name (Nam) is
+ when Name_Input =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Input);
+ when Name_Output =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Output);
+ when Name_Read =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Read);
+ when Name_Write =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Write);
+ when others =>
+ Error_Msg_N
+ ("attribute must be a primitive"
+ & " dispatching operation", Nam);
+ return;
+ end case;
+
+ exception
+
+ -- If no operation was found, and the type is limited,
+ -- the user should have defined one.
+
+ when Program_Error =>
+ if Is_Limited_Type (Prefix_Type) then
+ Error_Msg_NE
+ ("stream operation not defined for type&",
+ N, Prefix_Type);
+ return;
+
+ -- Otherwise, compiler should have generated default
+
+ else
+ raise;
+ end if;
+ end;
-- Rewrite the attribute into the name of its corresponding
-- primitive dispatching subprogram. We can then proceed with
diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb
index 6039cf7406b..52bbbcb953c 100644
--- a/gcc/ada/targparm.adb
+++ b/gcc/ada/targparm.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -54,6 +54,7 @@ package body Targparm is
MOV, -- Machine_Overflows
MRN, -- Machine_Rounds
PAS, -- Preallocated_Stacks
+ RTX, -- RTX_RTSS_Kernel_Module
S64, -- Support_64_Bit_Divides
SAG, -- Support_Aggregates
SCA, -- Support_Composite_Assign
@@ -90,6 +91,7 @@ package body Targparm is
MOV_Str : aliased constant Source_Buffer := "Machine_Overflows";
MRN_Str : aliased constant Source_Buffer := "Machine_Rounds";
PAS_Str : aliased constant Source_Buffer := "Preallocated_Stacks";
+ RTX_Str : aliased constant Source_Buffer := "RTX_RTSS_Kernel_Module";
S64_Str : aliased constant Source_Buffer := "Support_64_Bit_Divides";
SAG_Str : aliased constant Source_Buffer := "Support_Aggregates";
SCA_Str : aliased constant Source_Buffer := "Support_Composite_Assign";
@@ -126,6 +128,7 @@ package body Targparm is
MOV_Str'Access,
MRN_Str'Access,
PAS_Str'Access,
+ RTX_Str'Access,
S64_Str'Access,
SAG_Str'Access,
SCA_Str'Access,
@@ -573,6 +576,7 @@ package body Targparm is
when MOV => Machine_Overflows_On_Target := Result;
when MRN => Machine_Rounds_On_Target := Result;
when PAS => Preallocated_Stacks_On_Target := Result;
+ when RTX => RTX_RTSS_Kernel_Module_On_Target := Result;
when S64 => Support_64_Bit_Divides_On_Target := Result;
when SAG => Support_Aggregates_On_Target := Result;
when SCA => Support_Composite_Assign_On_Target := Result;
diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads
index c40d6d81adc..97192a56143 100644
--- a/gcc/ada/targparm.ads
+++ b/gcc/ada/targparm.ads
@@ -216,6 +216,9 @@ package Targparm is
OpenVMS_On_Target : Boolean := False;
-- Set to True if target is OpenVMS
+ RTX_RTSS_Kernel_Module_On_Target : Boolean := False;
+ -- Set to True if target is RTSS module for RTX
+
type Virtual_Machine_Kind is (No_VM, JVM_Target, CLI_Target);
VM_Target : Virtual_Machine_Kind := No_VM;
-- Kind of virtual machine targetted
diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb
index 416d5d88681..b1f05993608 100644
--- a/gcc/ada/uintp.adb
+++ b/gcc/ada/uintp.adb
@@ -1832,7 +1832,7 @@ package body Uintp is
Den1 := V_Hat + C;
Den2 := V_Hat + D;
- exit when (Den1 * Den2) = Int_0;
+ exit when Den1 = Int_0 or else Den2 = Int_0;
-- Compute Q, the trial quotient
diff --git a/gcc/c-common.c b/gcc/c-common.c
index caac53e7cdd..dac29ea2c7e 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1447,6 +1447,110 @@ vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note)
return false;
}
+/* This is a helper function of build_binary_op.
+
+ For certain operations if both args were extended from the same
+ smaller type, do the arithmetic in that type and then extend.
+
+ BITWISE indicates a bitwise operation.
+ For them, this optimization is safe only if
+ both args are zero-extended or both are sign-extended.
+ Otherwise, we might change the result.
+ Eg, (short)-1 | (unsigned short)-1 is (int)-1
+ but calculated in (unsigned short) it would be (unsigned short)-1.
+*/
+tree shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise)
+{
+ int unsigned0, unsigned1;
+ tree arg0, arg1;
+ int uns;
+ tree type;
+
+ /* Cast OP0 and OP1 to RESULT_TYPE. Doing so prevents
+ excessive narrowing when we call get_narrower below. For
+ example, suppose that OP0 is of unsigned int extended
+ from signed char and that RESULT_TYPE is long long int.
+ If we explicitly cast OP0 to RESULT_TYPE, OP0 would look
+ like
+
+ (long long int) (unsigned int) signed_char
+
+ which get_narrower would narrow down to
+
+ (unsigned int) signed char
+
+ If we do not cast OP0 first, get_narrower would return
+ signed_char, which is inconsistent with the case of the
+ explicit cast. */
+ op0 = convert (result_type, op0);
+ op1 = convert (result_type, op1);
+
+ arg0 = get_narrower (op0, &unsigned0);
+ arg1 = get_narrower (op1, &unsigned1);
+
+ /* UNS is 1 if the operation to be done is an unsigned one. */
+ uns = TYPE_UNSIGNED (result_type);
+
+ /* Handle the case that OP0 (or OP1) does not *contain* a conversion
+ but it *requires* conversion to FINAL_TYPE. */
+
+ if ((TYPE_PRECISION (TREE_TYPE (op0))
+ == TYPE_PRECISION (TREE_TYPE (arg0)))
+ && TREE_TYPE (op0) != result_type)
+ unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
+ if ((TYPE_PRECISION (TREE_TYPE (op1))
+ == TYPE_PRECISION (TREE_TYPE (arg1)))
+ && TREE_TYPE (op1) != result_type)
+ unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
+
+ /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
+
+ /* For bitwise operations, signedness of nominal type
+ does not matter. Consider only how operands were extended. */
+ if (bitwise)
+ uns = unsigned0;
+
+ /* Note that in all three cases below we refrain from optimizing
+ an unsigned operation on sign-extended args.
+ That would not be valid. */
+
+ /* Both args variable: if both extended in same way
+ from same width, do it in that width.
+ Do it unsigned if args were zero-extended. */
+ if ((TYPE_PRECISION (TREE_TYPE (arg0))
+ < TYPE_PRECISION (result_type))
+ && (TYPE_PRECISION (TREE_TYPE (arg1))
+ == TYPE_PRECISION (TREE_TYPE (arg0)))
+ && unsigned0 == unsigned1
+ && (unsigned0 || !uns))
+ return c_common_signed_or_unsigned_type
+ (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
+
+ else if (TREE_CODE (arg0) == INTEGER_CST
+ && (unsigned1 || !uns)
+ && (TYPE_PRECISION (TREE_TYPE (arg1))
+ < TYPE_PRECISION (result_type))
+ && (type
+ = c_common_signed_or_unsigned_type (unsigned1,
+ TREE_TYPE (arg1)))
+ && !POINTER_TYPE_P (type)
+ && int_fits_type_p (arg0, type))
+ return type;
+
+ else if (TREE_CODE (arg1) == INTEGER_CST
+ && (unsigned0 || !uns)
+ && (TYPE_PRECISION (TREE_TYPE (arg0))
+ < TYPE_PRECISION (result_type))
+ && (type
+ = c_common_signed_or_unsigned_type (unsigned0,
+ TREE_TYPE (arg0)))
+ && !POINTER_TYPE_P (type)
+ && int_fits_type_p (arg1, type))
+ return type;
+
+ return result_type;
+}
+
/* Warns if the conversion of EXPR to TYPE may alter a value.
This is a helper function for warnings_for_convert_and_check. */
@@ -1511,42 +1615,73 @@ conversion_warning (tree type, tree expr)
}
else /* 'expr' is not a constant. */
{
+ tree expr_type = TREE_TYPE (expr);
+
/* Warn for real types converted to integer types. */
- if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
+ if (TREE_CODE (expr_type) == REAL_TYPE
&& TREE_CODE (type) == INTEGER_TYPE)
give_warning = true;
- else if (TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
+ else if (TREE_CODE (expr_type) == INTEGER_TYPE
&& TREE_CODE (type) == INTEGER_TYPE)
{
/* Don't warn about unsigned char y = 0xff, x = (int) y; */
expr = get_unwidened (expr, 0);
+ expr_type = TREE_TYPE (expr);
+ /* Don't warn for short y; short x = ((int)y & 0xff); */
+ if (TREE_CODE (expr) == BIT_AND_EXPR
+ || TREE_CODE (expr) == BIT_IOR_EXPR
+ || TREE_CODE (expr) == BIT_XOR_EXPR)
+ {
+ /* It both args were extended from a shortest type, use
+ that type if that is safe. */
+ expr_type = shorten_binary_op (expr_type,
+ TREE_OPERAND (expr, 0),
+ TREE_OPERAND (expr, 1),
+ /* bitwise */1);
+
+ /* If one of the operands is a non-negative constant
+ that fits in the target type, then the type of the
+ other operand does not matter. */
+ if (TREE_CODE (expr) == BIT_AND_EXPR)
+ {
+ tree op0 = TREE_OPERAND (expr, 0);
+ tree op1 = TREE_OPERAND (expr, 1);
+ if ((TREE_CODE (op0) == INTEGER_CST
+ && int_fits_type_p (op0, c_common_signed_type (type))
+ && int_fits_type_p (op0, c_common_unsigned_type (type)))
+ || (TREE_CODE (op1) == INTEGER_CST
+ && int_fits_type_p (op1, c_common_signed_type (type))
+ && int_fits_type_p (op1, c_common_unsigned_type (type))))
+ return;
+ }
+ }
/* Warn for integer types converted to smaller integer types. */
- if (formal_prec < TYPE_PRECISION (TREE_TYPE (expr)))
+ if (formal_prec < TYPE_PRECISION (expr_type))
give_warning = true;
/* When they are the same width but different signedness,
then the value may change. */
- else if ((formal_prec == TYPE_PRECISION (TREE_TYPE (expr))
- && TYPE_UNSIGNED (TREE_TYPE (expr)) != TYPE_UNSIGNED (type))
+ else if ((formal_prec == TYPE_PRECISION (expr_type)
+ && TYPE_UNSIGNED (expr_type) != TYPE_UNSIGNED (type))
/* Even when converted to a bigger type, if the type is
unsigned but expr is signed, then negative values
will be changed. */
- || (TYPE_UNSIGNED (type) && !TYPE_UNSIGNED (TREE_TYPE (expr))))
+ || (TYPE_UNSIGNED (type) && !TYPE_UNSIGNED (expr_type)))
warning (OPT_Wsign_conversion,
"conversion to %qT from %qT may change the sign of the result",
- type, TREE_TYPE (expr));
+ type, expr_type);
}
/* Warn for integer types converted to real types if and only if
all the range of values of the integer type cannot be
represented by the real type. */
- else if (TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
+ else if (TREE_CODE (expr_type) == INTEGER_TYPE
&& TREE_CODE (type) == REAL_TYPE)
{
- tree type_low_bound = TYPE_MIN_VALUE (TREE_TYPE (expr));
- tree type_high_bound = TYPE_MAX_VALUE (TREE_TYPE (expr));
+ tree type_low_bound = TYPE_MIN_VALUE (expr_type);
+ tree type_high_bound = TYPE_MAX_VALUE (expr_type);
REAL_VALUE_TYPE real_low_bound = real_value_from_int_cst (0, type_low_bound);
REAL_VALUE_TYPE real_high_bound = real_value_from_int_cst (0, type_high_bound);
@@ -1556,16 +1691,16 @@ conversion_warning (tree type, tree expr)
}
/* Warn for real types converted to smaller real types. */
- else if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
+ else if (TREE_CODE (expr_type) == REAL_TYPE
&& TREE_CODE (type) == REAL_TYPE
- && formal_prec < TYPE_PRECISION (TREE_TYPE (expr)))
+ && formal_prec < TYPE_PRECISION (expr_type))
give_warning = true;
if (give_warning)
warning (OPT_Wconversion,
"conversion to %qT from %qT may alter its value",
- type, TREE_TYPE (expr));
+ type, expr_type);
}
}
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 1ff5d665532..f600751f0c0 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -743,6 +743,9 @@ extern bool same_scalar_type_ignoring_signedness (tree, tree);
#define c_sizeof(T) c_sizeof_or_alignof_type (T, true, 1)
#define c_alignof(T) c_sizeof_or_alignof_type (T, false, 1)
+/* Subroutine of build_binary_op, used for certain operations. */
+extern tree shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise);
+
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 160229ad8b8..4756e256f38 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -8316,93 +8316,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (shorten && none_complex)
{
- int unsigned0, unsigned1;
- tree arg0, arg1;
- int uns;
- tree type;
-
- /* Cast OP0 and OP1 to RESULT_TYPE. Doing so prevents
- excessive narrowing when we call get_narrower below. For
- example, suppose that OP0 is of unsigned int extended
- from signed char and that RESULT_TYPE is long long int.
- If we explicitly cast OP0 to RESULT_TYPE, OP0 would look
- like
-
- (long long int) (unsigned int) signed_char
-
- which get_narrower would narrow down to
-
- (unsigned int) signed char
-
- If we do not cast OP0 first, get_narrower would return
- signed_char, which is inconsistent with the case of the
- explicit cast. */
- op0 = convert (result_type, op0);
- op1 = convert (result_type, op1);
-
- arg0 = get_narrower (op0, &unsigned0);
- arg1 = get_narrower (op1, &unsigned1);
-
- /* UNS is 1 if the operation to be done is an unsigned one. */
- uns = TYPE_UNSIGNED (result_type);
-
final_type = result_type;
-
- /* Handle the case that OP0 (or OP1) does not *contain* a conversion
- but it *requires* conversion to FINAL_TYPE. */
-
- if ((TYPE_PRECISION (TREE_TYPE (op0))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && TREE_TYPE (op0) != final_type)
- unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
- if ((TYPE_PRECISION (TREE_TYPE (op1))
- == TYPE_PRECISION (TREE_TYPE (arg1)))
- && TREE_TYPE (op1) != final_type)
- unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
-
- /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
-
- /* For bitwise operations, signedness of nominal type
- does not matter. Consider only how operands were extended. */
- if (shorten == -1)
- uns = unsigned0;
-
- /* Note that in all three cases below we refrain from optimizing
- an unsigned operation on sign-extended args.
- That would not be valid. */
-
- /* Both args variable: if both extended in same way
- from same width, do it in that width.
- Do it unsigned if args were zero-extended. */
- if ((TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && unsigned0 == unsigned1
- && (unsigned0 || !uns))
- result_type
- = c_common_signed_or_unsigned_type
- (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
- else if (TREE_CODE (arg0) == INTEGER_CST
- && (unsigned1 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- < TYPE_PRECISION (result_type))
- && (type
- = c_common_signed_or_unsigned_type (unsigned1,
- TREE_TYPE (arg1)))
- && !POINTER_TYPE_P (type)
- && int_fits_type_p (arg0, type))
- result_type = type;
- else if (TREE_CODE (arg1) == INTEGER_CST
- && (unsigned0 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (type
- = c_common_signed_or_unsigned_type (unsigned0,
- TREE_TYPE (arg0)))
- && !POINTER_TYPE_P (type)
- && int_fits_type_p (arg1, type))
- result_type = type;
+ result_type = shorten_binary_op (result_type, op0, op1,
+ shorten == -1);
}
/* Shifts can be shortened if shifting right. */
diff --git a/gcc/config.host b/gcc/config.host
index d6efc6d730b..1d2462911df 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -141,26 +141,14 @@ case ${host} in
prefix=/gnu
local_prefix=/gnu
;;
- hppa1.1-*-pro*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
- hppa1.1-*-osf*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
- hppa1.1-*-rtems*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
- hppa1.1-*-bsd*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
hppa1.0-*-hpux10* | hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
out_host_hook_obj=host-hpux.o
- host_xmake_file="${host_xmake_file} pa/x-ada-hpux10 x-hpux"
+ host_xmake_file="${host_xmake_file} x-hpux"
;;
hppa1.0-*-hpux11* | hppa1.1-*-hpux11* | hppa2*-*-hpux11* | \
hppa*64*-*-hpux11*)
out_host_hook_obj=host-hpux.o
- host_xmake_file="${host_xmake_file} pa/x-ada x-hpux"
+ host_xmake_file="${host_xmake_file} x-hpux"
;;
hppa*-*-linux*)
out_host_hook_obj=host-hpux.o
diff --git a/gcc/config.in b/gcc/config.in
index ca66efe6c8b..b4261d9d9e5 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -93,6 +93,14 @@
#endif
+/* Define if you want operations on GIMPLE (the basic data structure of the
+ high-level optimizers) to be checked for dynamic type safety at runtime.
+ This is moderately expensive. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_GIMPLE_CHECKING
+#endif
+
+
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#ifndef USED_FOR_TARGET
@@ -126,12 +134,6 @@
#undef ENABLE_TREE_CHECKING
#endif
-/* Define if you want operations on GIMPLE (the basic data structure of
- the high-level optimizers) to be checked for dynamic type safety at
- runtime. This is moderately expensive. */
-#ifndef USED_FOR_TARGET
-#undef ENABLE_GIMPLE_CHECKING
-#endif
/* Define if you want all gimple types to be verified after gimplifiation.
This is cheap. */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index dfee7c3740e..a89229ec12a 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -62,6 +62,7 @@ const struct attribute_spec arm_attribute_table[];
void (*arm_lang_output_object_attributes_hook)(void);
/* Forward function declarations. */
+static int arm_compute_static_chain_stack_bytes (void);
static arm_stack_offsets *arm_get_frame_offsets (void);
static void arm_add_gc_roots (void);
static int arm_gen_constant (enum rtx_code, enum machine_mode, rtx,
@@ -10792,6 +10793,24 @@ arm_compute_save_reg0_reg12_mask (void)
}
+/* Compute the number of bytes used to store the static chain register on the
+ stack, above the stack frame. We need to know this accurately to get the
+ alignment of the rest of the stack frame correct. */
+
+static int arm_compute_static_chain_stack_bytes (void)
+{
+ unsigned long func_type = arm_current_func_type ();
+ int static_chain_stack_bytes = 0;
+
+ if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM &&
+ IS_NESTED (func_type) &&
+ df_regs_ever_live_p (3) && crtl->args.pretend_args_size == 0)
+ static_chain_stack_bytes = 4;
+
+ return static_chain_stack_bytes;
+}
+
+
/* Compute a bit mask of which registers need to be
saved on the stack for the current function.
This is used by arm_get_frame_offsets, which may add extra registers. */
@@ -10844,7 +10863,9 @@ arm_compute_save_reg_mask (void)
if (TARGET_REALLY_IWMMXT
&& ((bit_count (save_reg_mask)
- + ARM_NUM_INTS (crtl->args.pretend_args_size)) % 2) != 0)
+ + ARM_NUM_INTS (crtl->args.pretend_args_size +
+ arm_compute_static_chain_stack_bytes())
+ ) % 2) != 0)
{
/* The total number of registers that are going to be pushed
onto the stack is odd. We need to ensure that the stack
@@ -10929,6 +10950,26 @@ thumb1_compute_save_reg_mask (void)
mask |= 1 << reg;
}
+ /* The 504 below is 8 bytes less than 512 because there are two possible
+ alignment words. We can't tell here if they will be present or not so we
+ have to play it safe and assume that they are. */
+ if ((CALLER_INTERWORKING_SLOT_SIZE +
+ ROUND_UP_WORD (get_frame_size ()) +
+ crtl->outgoing_args_size) >= 504)
+ {
+ /* This is the same as the code in thumb1_expand_prologue() which
+ determines which register to use for stack decrement. */
+ for (reg = LAST_ARG_REGNUM + 1; reg <= LAST_LO_REGNUM; reg++)
+ if (mask & (1 << reg))
+ break;
+
+ if (reg > LAST_LO_REGNUM)
+ {
+ /* Make sure we have a register available for stack decrement. */
+ mask |= 1 << LAST_LO_REGNUM;
+ }
+ }
+
return mask;
}
@@ -12064,7 +12105,8 @@ arm_get_frame_offsets (void)
offsets->saved_args = crtl->args.pretend_args_size;
/* In Thumb mode this is incorrect, but never used. */
- offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0);
+ offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0) +
+ arm_compute_static_chain_stack_bytes();
if (TARGET_32BIT)
{
@@ -12111,7 +12153,8 @@ arm_get_frame_offsets (void)
}
/* Saved registers include the stack frame. */
- offsets->saved_regs = offsets->saved_args + saved;
+ offsets->saved_regs = offsets->saved_args + saved +
+ arm_compute_static_chain_stack_bytes();
offsets->soft_frame = offsets->saved_regs + CALLER_INTERWORKING_SLOT_SIZE;
/* A leaf function does not need any stack alignment if it has nothing
on the stack. */
@@ -12203,14 +12246,9 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to)
return offsets->soft_frame - offsets->saved_args;
case ARM_HARD_FRAME_POINTER_REGNUM:
- /* If there is no stack frame then the hard
- frame pointer and the arg pointer coincide. */
- if (offsets->frame == offsets->saved_regs)
- return 0;
- /* FIXME: Not sure about this. Maybe we should always return 0 ? */
- return (frame_pointer_needed
- && cfun->static_chain_decl != NULL
- && ! cfun->machine->uses_anonymous_args) ? 4 : 0;
+ /* This is only non-zero in the case where the static chain register
+ is stored above the frame. */
+ return offsets->frame - offsets->saved_args - 4;
case STACK_POINTER_REGNUM:
/* If nothing has been pushed on the stack at all
@@ -12438,7 +12476,9 @@ arm_expand_prologue (void)
r0 = gen_rtx_REG (SImode, 0);
r1 = gen_rtx_REG (SImode, 1);
- dwarf = gen_rtx_UNSPEC (SImode, NULL_RTVEC, UNSPEC_STACK_ALIGN);
+ /* Use a real rtvec rather than NULL_RTVEC so the rest of the
+ compiler won't choke. */
+ dwarf = gen_rtx_UNSPEC (SImode, rtvec_alloc (0), UNSPEC_STACK_ALIGN);
dwarf = gen_rtx_SET (VOIDmode, r0, dwarf);
insn = gen_movsi (r0, stack_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -12496,6 +12536,9 @@ arm_expand_prologue (void)
insn = emit_set_insn (gen_rtx_REG (SImode, 3), ip_rtx);
else if (args_to_push == 0)
{
+ gcc_assert(arm_compute_static_chain_stack_bytes() == 4);
+ saved_regs += 4;
+
rtx dwarf;
insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx);
@@ -17006,62 +17049,25 @@ thumb1_expand_prologue (void)
been pushed at the start of the prologue and so we can corrupt
it now. */
for (regno = LAST_ARG_REGNUM + 1; regno <= LAST_LO_REGNUM; regno++)
- if (live_regs_mask & (1 << regno)
- && !(frame_pointer_needed
- && (regno == THUMB_HARD_FRAME_POINTER_REGNUM)))
+ if (live_regs_mask & (1 << regno))
break;
- if (regno > LAST_LO_REGNUM) /* Very unlikely. */
- {
- rtx spare = gen_rtx_REG (SImode, IP_REGNUM);
-
- /* Choose an arbitrary, non-argument low register. */
- reg = gen_rtx_REG (SImode, LAST_LO_REGNUM);
-
- /* Save it by copying it into a high, scratch register. */
- emit_insn (gen_movsi (spare, reg));
- /* Add a USE to stop propagate_one_insn() from barfing. */
- emit_insn (gen_prologue_use (spare));
+ gcc_assert(regno <= LAST_LO_REGNUM);
- /* Decrement the stack. */
- emit_insn (gen_movsi (reg, GEN_INT (- amount)));
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
- stack_pointer_rtx, reg));
- RTX_FRAME_RELATED_P (insn) = 1;
- dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -amount));
- RTX_FRAME_RELATED_P (dwarf) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (insn));
-
- /* Restore the low register's original value. */
- emit_insn (gen_movsi (reg, spare));
-
- /* Emit a USE of the restored scratch register, so that flow
- analysis will not consider the restore redundant. The
- register won't be used again in this function and isn't
- restored by the epilogue. */
- emit_insn (gen_prologue_use (reg));
- }
- else
- {
- reg = gen_rtx_REG (SImode, regno);
+ reg = gen_rtx_REG (SImode, regno);
- emit_insn (gen_movsi (reg, GEN_INT (- amount)));
+ emit_insn (gen_movsi (reg, GEN_INT (- amount)));
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
- stack_pointer_rtx, reg));
- RTX_FRAME_RELATED_P (insn) = 1;
- dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -amount));
- RTX_FRAME_RELATED_P (dwarf) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (insn));
- }
+ insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx, reg));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ -amount));
+ RTX_FRAME_RELATED_P (dwarf) = 1;
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
+ REG_NOTES (insn));
}
}
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 35724796da0..46505cc4804 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4259,8 +4259,8 @@ ix86_function_regparm (const_tree type, const_tree decl)
the callee DECL_STRUCT_FUNCTION is gone, so we fall back to
scanning the attributes for the self-realigning property. */
f = DECL_STRUCT_FUNCTION (decl);
- /* Since current internal arg pointer will won't conflict
- with parameter passing regs, so no need to change stack
+ /* Since current internal arg pointer won't conflict with
+ parameter passing regs, so no need to change stack
realignment and adjust regparm number.
Each fixed register usage increases register pressure,
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index b00f6e07a30..fc59b77ac7b 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -114,7 +114,7 @@ Generate sin, cos, sqrt for FPU
mforce-drap
Target Report Var(ix86_force_drap)
-Always use Dynamic Realigned Argument Pointer (DRAP) to realign stack.
+Always use Dynamic Realigned Argument Pointer (DRAP) to realign stack
mfp-ret-in-387
Target Report Mask(FLOAT_RETURNS) Save
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 750eaa199fa..ffd918e8aaa 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -49,8 +49,32 @@ along with GCC; see the file COPYING3. If not see
#define IRIX_SUBTARGET_LINK_SPEC \
"%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}"
#else
+ /* Explicitly hide crt symbols that would normally be marked with
+ a "hidden" visibility attribute.
+
+ We have traditionally disabled this attribute when using the
+ native linker because the native linker's visibility support is
+ not fully-compatible with the GNU linker's. In particular, the
+ native linker does not pull in archive objects purely to resolve
+ references to the object's hidden symbols, whereas the GNU
+ linker does.
+
+ The gcc build system currently hides symbols in some static
+ libraries (typically libgcov.a or libgcc.a) whenever visibility
+ attributes are supported. On targets with GNU semantics, this
+ makes sure that uses of libx.so symbols in one dynamic object are
+ not resolved to libx.a symbols in another dynamic object. But
+ on targets with IRIX semantics, hiding the symbols prevents the
+ static archive from working at all.
+
+ It would probably be better to enable visiblity attributes for
+ IRIX ld and disable the static archives versioning. It shouldn't
+ make anything worse, since libx.a symbols are global by default
+ anyway. However, no-one has volunteered to do this yet. */
+
#define IRIX_SUBTARGET_LINK_SPEC \
"%{w} -_SYSTYPE_SVR4 -woff 131 \
+ %{shared:-hidden_symbol __dso_handle} \
%{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
#endif
diff --git a/gcc/config/mips/irix-crti.asm b/gcc/config/mips/irix-crti.asm
index d6888bbf014..992f8b695dc 100644
--- a/gcc/config/mips/irix-crti.asm
+++ b/gcc/config/mips/irix-crti.asm
@@ -49,3 +49,10 @@ __gcc_fini:
sd $31,0($sp)
sd $28,8($sp)
#endif
+
+/* This object will typically be included in the final link for both
+ shared libraries and executable, and we need to hide the symbols to
+ prevent possible symbol preemption warnings from the SGI linker. */
+.hidden __gcc_init
+.hidden __gcc_fini
+
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 0e03be0fe2a..e67b1a7fed8 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -3948,6 +3948,8 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
insn = emit_call_insn (insn);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3);
+ if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
insn = get_insns ();
end_sequence ();
emit_libcall_block (insn, dest, r3, addr);
@@ -3970,6 +3972,8 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
insn = emit_call_insn (insn);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3);
+ if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
insn = get_insns ();
end_sequence ();
tmp1 = gen_reg_rtx (Pmode);
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 8a926e43c44..def3b53ab95 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -644,12 +644,15 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
/* Define this macro to be the value 1 if unaligned accesses have a cost
many times greater than aligned accesses, for example if they are
emulated in a trap handler. */
+/* Altivec vector memory instructions simply ignore the low bits; SPE
+ vector memory instructions trap on unaligned accesses. */
#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) \
(STRICT_ALIGNMENT \
|| (((MODE) == SFmode || (MODE) == DFmode || (MODE) == TFmode \
|| (MODE) == SDmode || (MODE) == DDmode || (MODE) == TDmode \
|| (MODE) == DImode) \
- && (ALIGN) < 32))
+ && (ALIGN) < 32) \
+ || (VECTOR_MODE_P ((MODE)) && (ALIGN) < GET_MODE_BITSIZE ((MODE))))
/* Standard register usage. */
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e05b0cb8d94..e98283ad6ca 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,17 @@
+2008-07-30 Dodji Seketeli <dseketel@redhat.com>
+
+ PR c++/36767
+ * decl2.c (fix_temporary_vars_context_r): New function.
+ (one_static_initialization_or_destruction): Make sure temporary
+ variables part of the initialiser have their DECL_CONTEXT()
+ properly set.
+
+2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34389
+ * typeck.c (build_binary_op): Encapsulate code into
+ shorten_binary_op.
+
2008-07-29 Jakub Jelinek <jakub@redhat.com>
PR c++/36852
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 05f75f7de84..eb92dfd68cf 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2811,6 +2811,38 @@ get_priority_info (int priority)
|| DECL_ONE_ONLY (decl) \
|| DECL_WEAK (decl)))
+/* Called from one_static_initialization_or_destruction(),
+ via walk_tree.
+ Walks the initializer list of a global variable and looks for
+ temporary variables (DECL_NAME() == NULL and DECL_ARTIFICIAL != 0)
+ and that have their DECL_CONTEXT() == NULL.
+ For each such temporary variable, set their DECL_CONTEXT() to
+ the current function. This is necessary because otherwise
+ some optimizers (enabled by -O2 -fprofile-arcs) might crash
+ when trying to refer to a temporary variable that does not have
+ it's DECL_CONTECT() properly set. */
+static tree
+fix_temporary_vars_context_r (tree *node,
+ int *unused ATTRIBUTE_UNUSED,
+ void *unused1 ATTRIBUTE_UNUSED)
+{
+ gcc_assert (current_function_decl);
+
+ if (TREE_CODE (*node) == BIND_EXPR)
+ {
+ tree var;
+
+ for (var = BIND_EXPR_VARS (*node); var; var = TREE_CHAIN (var))
+ if (TREE_CODE (var) == VAR_DECL
+ && !DECL_NAME (var)
+ && DECL_ARTIFICIAL (var)
+ && !DECL_CONTEXT (var))
+ DECL_CONTEXT (var) = current_function_decl;
+ }
+
+ return NULL_TREE;
+}
+
/* Set up to handle the initialization or destruction of DECL. If
INITP is nonzero, we are initializing the variable. Otherwise, we
are destroying it. */
@@ -2833,6 +2865,19 @@ one_static_initialization_or_destruction (tree decl, tree init, bool initp)
information. */
input_location = DECL_SOURCE_LOCATION (decl);
+ /* Make sure temporary variables in the initialiser all have
+ their DECL_CONTEXT() set to a value different from NULL_TREE.
+ This can happen when global variables initialisers are built.
+ In that case, the DECL_CONTEXT() of the global variables _AND_ of all
+ the temporary variables that might have been generated in the
+ accompagning initialisers is NULL_TREE, meaning the variables have been
+ declared in the global namespace.
+ What we want to do here is to fix that and make sure the DECL_CONTEXT()
+ of the temporaries are set to the current function decl. */
+ cp_walk_tree_without_duplicates (&init,
+ fix_temporary_vars_context_r,
+ NULL);
+
/* Because of:
[class.access.spec]
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index fcf52dc9db4..ba1d0286079 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3810,61 +3810,9 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (shorten && none_complex)
{
- int unsigned0, unsigned1;
- tree arg0 = get_narrower (op0, &unsigned0);
- tree arg1 = get_narrower (op1, &unsigned1);
- /* UNS is 1 if the operation to be done is an unsigned one. */
- int uns = TYPE_UNSIGNED (result_type);
- tree type;
-
final_type = result_type;
-
- /* Handle the case that OP0 does not *contain* a conversion
- but it *requires* conversion to FINAL_TYPE. */
-
- if (op0 == arg0 && TREE_TYPE (op0) != final_type)
- unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
- if (op1 == arg1 && TREE_TYPE (op1) != final_type)
- unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
-
- /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
-
- /* For bitwise operations, signedness of nominal type
- does not matter. Consider only how operands were extended. */
- if (shorten == -1)
- uns = unsigned0;
-
- /* Note that in all three cases below we refrain from optimizing
- an unsigned operation on sign-extended args.
- That would not be valid. */
-
- /* Both args variable: if both extended in same way
- from same width, do it in that width.
- Do it unsigned if args were zero-extended. */
- if ((TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && unsigned0 == unsigned1
- && (unsigned0 || !uns))
- result_type = c_common_signed_or_unsigned_type
- (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
- else if (TREE_CODE (arg0) == INTEGER_CST
- && (unsigned1 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- < TYPE_PRECISION (result_type))
- && (type = c_common_signed_or_unsigned_type
- (unsigned1, TREE_TYPE (arg1)),
- int_fits_type_p (arg0, type)))
- result_type = type;
- else if (TREE_CODE (arg1) == INTEGER_CST
- && (unsigned0 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (type = c_common_signed_or_unsigned_type
- (unsigned0, TREE_TYPE (arg0)),
- int_fits_type_p (arg1, type)))
- result_type = type;
+ result_type = shorten_binary_op (result_type, op0, op1,
+ shorten == -1);
}
/* Comparison operations are shortened too but differently.
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 7b5eb7f2835..aaf83f99774 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -15,7 +15,7 @@ Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation. A copy of
the license is included in the
@c man end
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 127fafe625f..9557ba3bad9 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2957,13 +2957,11 @@ floating point arguments on the stack.
@item force_align_arg_pointer
@cindex @code{force_align_arg_pointer} attribute
-The @code{force_align_arg_pointer} attribute may be applied to
-individual function definitions, assuming that the runtime stack is
-aligned according to the psABI and generating an alternate
-prologue/epilogue that realigns the runtime stack if necessary.
-On the Intel x86, this supports mixing codes that keep a 4-byte aligned
-stack, as specified by i386 psABI, with codes that need a 16-byte
-aligned stack, as required by SSE instructions.
+On the Intel x86, the @code{force_align_arg_pointer} attribute may be
+applied to individual function definitions, generating an alternate
+prologue and epilogue that realigns the runtime stack if necessary.
+This supports mixing legacy codes that run with a 4-byte aligned stack
+with modern codes that keep a 16-byte stack for SSE compatibility.
@item resbank
@cindex @code{resbank} attribute
diff --git a/gcc/doc/fragments.texi b/gcc/doc/fragments.texi
index 450fd50f469..dcb64f441a8 100644
--- a/gcc/doc/fragments.texi
+++ b/gcc/doc/fragments.texi
@@ -172,6 +172,11 @@ some other filename (say @file{specs.install}), that will then be
created out of the built-in specs, and introduce a @file{Makefile}
rule to generate the @file{specs} file that's going to be used at
build time out of your @file{specs.install}.
+
+@item T_CFLAGS
+These are extra flags to pass to the C compiler. They are used both
+when building GCC, and when compiling things with the just-built GCC@.
+This variable is deprecated and should not be used.
@end table
@node Host Fragment
@@ -179,36 +184,5 @@ build time out of your @file{specs.install}.
@cindex host makefile fragment
@cindex @file{x-@var{host}}
-The use of @file{x-@var{host}} fragments is discouraged. You should do
-so only if there is no other mechanism to get the behavior desired.
-Host fragments should never forcibly override variables set by the
-configure script, as they may have been adjusted by the user.
-
-Variables provided for host fragments to set include:
-
-@table @code
-
-@item X_CFLAGS
-@itemx X_CPPFLAGS
-These are extra flags to pass to the C compiler and preprocessor,
-respectively. They are used both when building GCC, and when compiling
-things with the just-built GCC@.
-
-@item XCFLAGS
-These are extra flags to use when building the compiler. They are not
-used when compiling @file{libgcc.a}. However, they @emph{are} used when
-recompiling the compiler with itself in later stages of a bootstrap.
-
-@item BOOT_LDFLAGS
-Flags to be passed to the linker when recompiling the compiler with
-itself in later stages of a bootstrap. You might need to use this if,
-for instance, one of the front ends needs more text space than the
-linker provides by default.
-
-@item EXTRA_PROGRAMS
-A list of additional programs required to use the compiler on this host,
-which should be compiled with GCC and installed alongside the front
-ends. If you set this variable, you must also provide rules to build
-the extra programs.
-
-@end table
+The use of @file{x-@var{host}} fragments is discouraged. You should only
+use it for makefile dependencies.
diff --git a/gcc/doc/gcc.texi b/gcc/doc/gcc.texi
index b97943916f1..41031752bf2 100644
--- a/gcc/doc/gcc.texi
+++ b/gcc/doc/gcc.texi
@@ -41,16 +41,16 @@
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the section entitled ``GNU Free Documentation License''.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
diff --git a/gcc/doc/gccint.texi b/gcc/doc/gccint.texi
index b285ec9b3dd..9fe28c075e0 100644
--- a/gcc/doc/gccint.texi
+++ b/gcc/doc/gccint.texi
@@ -27,16 +27,16 @@
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the section entitled ``GNU Free Documentation License''.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 453709970e7..f2aeb2c9586 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -70,8 +70,9 @@
@c Part 2 Summary Description and Copyright
@copying
-Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
@sp 1
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b66994c8be3..764edc22b18 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10741,14 +10741,12 @@ when this option is used to set the precision to less than extended precision.
@item -mstackrealign
@opindex mstackrealign
-Realign the stack at entry. The @option{-mstackrealign} option will
-assume that the runtime stack is aligned according to the psABI and
-generate an alternate prologue/epilogue that realigns the runtime stack
-if necessary. On the Intel x86, this supports mixing codes that keep a
-4-byte aligned stack, as specified by i386 psABI, with codes that need
-a 16-byte aligned stack, as required by SSE instructions. See also the
-attribute @code{force_align_arg_pointer}, applicable to individual
-functions.
+Realign the stack at entry. On the Intel x86, the @option{-mstackrealign}
+option will generate an alternate prologue and epilogue that realigns the
+runtime stack if necessary. This supports mixing legacy codes that keep
+a 4-byte aligned stack with modern codes that keep a 16-byte stack for
+SSE compatibility. See also the attribute @code{force_align_arg_pointer},
+applicable to individual functions.
@item -mpreferred-stack-boundary=@var{num}
@opindex mpreferred-stack-boundary
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 65177fbf88f..228af27d621 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1135,9 +1135,9 @@ to specify the maximum alignment of a variable on stack.
If not defined, the default value is @code{STACK_BOUNDARY}.
@c FIXME: The default should be @code{PREFERRED_STACK_BOUNDARY}.
-But the fix for PR 32893 indicates that we can only guarantee
-maximum stack alignment on stack up to @code{STACK_BOUNDARY}, not
-@code{PREFERRED_STACK_BOUNDARY}, if stack alignment isn't supported.
+@c But the fix for PR 32893 indicates that we can only guarantee
+@c maximum stack alignment on stack up to @code{STACK_BOUNDARY}, not
+@c @code{PREFERRED_STACK_BOUNDARY}, if stack alignment isn't supported.
@end defmac
@defmac MAX_OFILE_ALIGNMENT
@@ -10610,8 +10610,9 @@ necessary.
@end deftypefn
@deftypefn {Target Hook} rtx TARGET_GET_DRAP_RTX (void)
-Define this macro to an rtx for Dynamic Realign Argument Pointer if
-necessary.
+Define this macro to an rtx for Dynamic Realign Argument Pointer if a
+different argument pointer register is needed to access the function's
+argument list when stack is aligned.
@end deftypefn
@deftypefn {Target Hook} {bool} TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS (void)
diff --git a/gcc/dse.c b/gcc/dse.c
index 4d5120160fa..99233266377 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -783,10 +783,9 @@ replace_inc_dec (rtx *r, void *d)
{
rtx r1 = XEXP (x, 0);
rtx c = gen_int_mode (Pmode, data->size);
- add_insn_before (data->insn,
- gen_rtx_SET (Pmode, r1,
- gen_rtx_PLUS (Pmode, r1, c)),
- NULL);
+ emit_insn_before (gen_rtx_SET (Pmode, r1,
+ gen_rtx_PLUS (Pmode, r1, c)),
+ data->insn);
return -1;
}
@@ -795,10 +794,9 @@ replace_inc_dec (rtx *r, void *d)
{
rtx r1 = XEXP (x, 0);
rtx c = gen_int_mode (Pmode, -data->size);
- add_insn_before (data->insn,
- gen_rtx_SET (Pmode, r1,
- gen_rtx_PLUS (Pmode, r1, c)),
- NULL);
+ emit_insn_before (gen_rtx_SET (Pmode, r1,
+ gen_rtx_PLUS (Pmode, r1, c)),
+ data->insn);
return -1;
}
@@ -809,8 +807,7 @@ replace_inc_dec (rtx *r, void *d)
insn that contained it. */
rtx add = XEXP (x, 0);
rtx r1 = XEXP (add, 0);
- add_insn_before (data->insn,
- gen_rtx_SET (Pmode, r1, add), NULL);
+ emit_insn_before (gen_rtx_SET (Pmode, r1, add), data->insn);
return -1;
}
@@ -827,12 +824,12 @@ static int
replace_inc_dec_mem (rtx *r, void *d)
{
rtx x = *r;
- if (GET_CODE (x) == MEM)
+ if (x != NULL_RTX && MEM_P (x))
{
struct insn_size data;
data.size = GET_MODE_SIZE (GET_MODE (x));
- data.insn = (rtx)d;
+ data.insn = (rtx) d;
for_each_rtx (&XEXP (x, 0), replace_inc_dec, &data);
diff --git a/gcc/final.c b/gcc/final.c
index 787c43abad5..2a9d40ba754 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1744,6 +1744,31 @@ output_alternate_entry_point (FILE *file, rtx insn)
}
}
+/* Given a CALL_INSN, find and return the nested CALL. */
+static rtx
+call_from_call_insn (rtx insn)
+{
+ rtx x;
+ gcc_assert (CALL_P (insn));
+ x = PATTERN (insn);
+
+ while (GET_CODE (x) != CALL)
+ {
+ switch (GET_CODE (x))
+ {
+ default:
+ gcc_unreachable ();
+ case PARALLEL:
+ x = XVECEXP (x, 0, 0);
+ break;
+ case SET:
+ x = XEXP (x, 1);
+ break;
+ }
+ }
+ return x;
+}
+
/* The final scan for one insn, INSN.
Args are same as in `final', except that INSN
is the insn being scanned.
@@ -2609,6 +2634,20 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
targetm.asm_out.unwind_emit (asm_out_file, insn);
#endif
+ if (CALL_P (insn))
+ {
+ rtx x = call_from_call_insn (insn);
+ x = XEXP (x, 0);
+ if (x && MEM_P (x) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+ {
+ tree t;
+ x = XEXP (x, 0);
+ t = SYMBOL_REF_DECL (x);
+ if (t)
+ assemble_external (t);
+ }
+ }
+
/* Output assembler code from the template. */
output_asm_insn (templ, recog_data.operand);
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index f691e4eae70..5402e949db4 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -562,7 +562,10 @@ recognized_function (const cpp_token *fname, unsigned int line, int kind,
/* We only have a partial function declaration,
so remember that we have to add a complete prototype. */
partial_count++;
- partial = obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
+ partial
+ = (struct partial_proto *)
+ obstack_alloc (&scan_file_obstack,
+ sizeof (struct partial_proto));
partial->line_seen = line;
partial->fn = fn;
fn->partial = partial;
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index e8ce99b4461..38a653aad68 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * gfc-internals.texi: Update to GFDL 1.2. Do not list GPL as
+ Invariant Section.
+ * gfortran.texi: Likewise.
+ * intrinsic.texi: Do not list GPL as Invariant Section.
+ * invoke.texi: Likewise. Update copyright years.
+
2008-07-29 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (conv_parent_component_references): New function
diff --git a/gcc/fortran/gfc-internals.texi b/gcc/fortran/gfc-internals.texi
index 330db81c59c..e73d3b59f9a 100644
--- a/gcc/fortran/gfc-internals.texi
+++ b/gcc/fortran/gfc-internals.texi
@@ -34,11 +34,10 @@
Copyright @copyright{} @value{copyrights-gfortran} Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index cf90ceda833..c79a70a407a 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -80,11 +80,10 @@
Copyright @copyright{} @value{copyrights-gfortran} Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index db336bfcd92..8337f74c522 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -7,10 +7,9 @@ For copying conditions, see the file gfortran.texi.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the gfdl(7) man page.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the gfdl(7) man page.
Some basic guidelines for editing this document:
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index f633187a01c..b2370d4de0e 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -5,16 +5,15 @@
@ignore
@c man begin COPYRIGHT
-Copyright @copyright{} 2004, 2005, 2006, 2007
+Copyright @copyright{} 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the gfdl(7) man page.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the gfdl(7) man page.
(a) The FSF's Front-Cover Text is:
diff --git a/gcc/function.c b/gcc/function.c
index 0f08c91c686..b9d9ec59cc0 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1215,7 +1215,7 @@ instantiate_new_reg (rtx x, HOST_WIDE_INT *poffset)
if (x == virtual_incoming_args_rtx)
{
- /* Replace vitural_incoming_args_rtx to internal arg pointer here */
+ /* Replace virtual_incoming_args_rtx to internal arg pointer here */
if (crtl->args.internal_arg_pointer != virtual_incoming_args_rtx)
{
gcc_assert (stack_realign_drap);
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 5811a224cda..b2321e374f8 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * gcj.texi: Update copyright years. Do not list GPL as
+ Invariant Section.
+
2008-07-29 Jakub Jelinek <jakub@redhat.com>
* class.c (build_utf8_ref): Set DECL_SIZE and DECL_SIZE_UNIT
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index 179e620f8c9..af5b06615b0 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -17,7 +17,7 @@
@c the word ``Java'.
@c When this manual is copyrighted.
-@set copyrights-gcj 2001, 2002, 2003, 2004, 2005, 2006, 2007
+@set copyrights-gcj 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
@copying
@c man begin COPYRIGHT
@@ -25,13 +25,12 @@ Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the
+any later version published by the Free Software Foundation; with no
+Invariant Sections, the Front-Cover Texts being (a) (see below), and
+with the Back-Cover Texts being (b) (see below).
+A copy of the license is included in the
@c man end
-section entitled
-``GNU Free Documentation License''.
+section entitled ``GNU Free Documentation License''.
@ignore
@c man begin COPYRIGHT
man page gfdl(7).
diff --git a/gcc/scan.c b/gcc/scan.c
index f697d26ec02..c6d04716271 100644
--- a/gcc/scan.c
+++ b/gcc/scan.c
@@ -35,7 +35,7 @@ make_sstring_space (sstring *str, int count)
if (new_size <= cur_size)
return;
- str->base = xrealloc (str->base, new_size);
+ str->base = (char *) xrealloc (str->base, new_size);
str->ptr = str->base + cur_size;
str->limit = str->base + new_size;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 93b95f105f9..ab4b945f30d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,118 @@
+2008-07-30 H.J. Lu <hongjiu.lu@intel.com>
+ Joey Ye <joey.ye@intel.com>
+
+ * gcc.dg/dfp/func-vararg-alternate-d128-2.c: New.
+ * gcc.dg/dfp/func-vararg-mixed-2.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-1.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-1.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-3.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-4.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-return-1.c: Likewise.
+ * gcc.dg/torture/stackalign/check.h: Likewise.
+ * gcc.dg/torture/stackalign/comp-goto-1.c: Likewise.
+ * gcc.dg/torture/stackalign/fastcall-1.c: Likewise.
+ * gcc.dg/torture/stackalign/global-1.c: Likewise.
+ * gcc.dg/torture/stackalign/inline-1.c: Likewise.
+ * gcc.dg/torture/stackalign/inline-2.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-1.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-2.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-3.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-4.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-5.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-6.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-1.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-2.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-3.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-4.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-5.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-1.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-2.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-3.c: Likewise.
+ * gcc.dg/torture/stackalign/regparm-1.c: Likewise.
+ * gcc.dg/torture/stackalign/ret-struct-1.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-1.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-2.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-3.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-4.c: Likewise.
+ * gcc.dg/torture/stackalign/sibcall-1.c: Likewise.
+ * gcc.dg/torture/stackalign/stackalign.exp: Likewise.
+ * gcc.dg/torture/stackalign/struct-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-2.c: Likewise.
+ * gcc.target/i386/align-main-1.c: Likewise.
+ * gcc.target/i386/align-main-2.c: Likewise.
+ * gcc.target/i386/pr32000-2.c: Likewise.
+ * gcc.target/i386/stackalign/asm-1.c: Likewise.
+ * gcc.target/i386/stackalign/return-1.c: Likewise.
+ * gcc.target/i386/stackalign/return-2.c: Likewise.
+ * gcc.target/i386/stackalign/return-3.c: Likewise.
+ * gcc.target/i386/stackalign/return-4.c: Likewise.
+ * gcc.target/i386/stackalign/return-5.c: Likewise.
+ * gcc.target/i386/stackalign/return-6.c: Likewise.
+ * gcc.target/i386/stackalign/stackalign.exp: Likewise.
+ * g++.dg/torture/stackalign/check.h: Likewise.
+ * g++.dg/torture/stackalign/eh-alloca-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-global-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-inline-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-inline-2.C: Likewise.
+ * g++.dg/torture/stackalign/eh-vararg-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-vararg-2.C: Likewise.
+ * g++.dg/torture/stackalign/stackalign.exp: Likewise.
+ * g++.dg/torture/stackalign/stdcall-1.C: Likewise.
+ * g++.dg/torture/stackalign/test-unwind.h: Likewise.
+ * g++.dg/torture/stackalign/throw-1.C: Likewise.
+ * g++.dg/torture/stackalign/throw-2.C: Likewise.
+ * g++.dg/torture/stackalign/throw-3.C: Likewise.
+ * g++.dg/torture/stackalign/throw-4.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-0.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-1.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-2.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-3.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-4.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-5.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-6.C: Likewise.
+
+ * gcc.target/i386/20060512-1.c: Add -mpreferred-stack-boundary=4.
+ (main): Move "popl" after check.
+ * gcc.target/i386/20060512-3.c: Likewise.
+
+ * gcc.target/i386/20060512-2.c: Add -mpreferred-stack-boundary=4.
+ Remove dg-error.
+
+ * gcc.target/i386/20060512-4.c: Add -mpreferred-stack-boundary=4.
+ Remove dg-warning.
+
+ * lib/target-supports.exp (check_effective_target_unaligned_stack):
+ Always return 0.
+ (check_effective_target_automatic_stack_alignment): New.
+
+2008-07-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36967
+ * gfortran.dg/pr36967.f: New testcase.
+
+2008-07-30 Rafael Avila de Espindola <espindola@google.com>
+
+ * gcc.dg/visibility-14.c: New test.
+ * gcc.dg/visibility-15.c: New test.
+ * gcc.dg/visibility-16.c: New test.
+ * gcc.dg/visibility-17.c: New test.
+ * gcc.dg/visibility-18.c: New test.
+ * gcc.dg/visibility-19.c: New test.
+
+2008-07-30 Dodji Seketeli <dseketel@redhat.com>
+
+ PR c++/36767
+ * g++.dg/parse/crash42.C: New test.
+
+2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34389
+ * gcc.dg/Wconversion-pr34389.c: New.
+ * g++.dg/warn/Wconversion-pr34389.C: New.
+
2008-07-29 Steve Ellcey <sje@cup.hp.com>
* gcc.dg/pr32370.c: Force 64 bits on IA64.
diff --git a/gcc/testsuite/g++.dg/parse/crash42.C b/gcc/testsuite/g++.dg/parse/crash42.C
new file mode 100644
index 00000000000..9cb07d5148d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash42.C
@@ -0,0 +1,9 @@
+// Created by: Dodji Seketeli <dseketel@redhat.com>
+// { dg-do compile }
+// { dg-options "-O2 -fprofile-arcs" }
+// Origin: PR C++/36767
+
+struct A { A (); ~A (); };
+A a[2];
+
+
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C b/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C
new file mode 100644
index 00000000000..f3cd3105386
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C
@@ -0,0 +1,53 @@
+/* PR 34389 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+
+short mask1(short x)
+{
+ short y = 0x7fff;
+ return x & y; /* { dg-bogus "conversion" "conversion" { xfail *-*-* } 8 } */
+}
+
+short mask2(short ssx)
+{
+ short ssy;
+ short ssz;
+
+ ssz = ((int)ssx) & 0x7fff;
+ ssy = ((int)ssx) | 0x7fff;
+ ssz = ((int)ssx) ^ 0x7fff;
+ return ssx & 0x7fff;
+}
+
+short mask3(int si, unsigned int ui)
+{
+ short ss;
+ unsigned short us;
+
+ ss = si & 0x7fff;
+ ss = si & 0xAAAA; /* { dg-warning "conversion" } */
+ ss = ui & 0x7fff;
+ ss = ui & 0xAAAA; /* { dg-warning "conversion" } */
+
+ us = si & 0x7fff;
+ us = si & 0xAAAA; /* { dg-warning "conversion" } */
+ us = ui & 0x7fff;
+ us = ui & 0xAAAA; /* { dg-warning "conversion" } */
+
+ return ss;
+}
+
+short mask4(int x, int y)
+{
+ return x & y; /* { dg-warning "conversion" } */
+}
+
+short mask5(int x)
+{
+ return x & -1; /* { dg-warning "conversion" } */
+}
+
+short mask6(short x)
+{
+ return x & -1;
+}
diff --git a/gcc/testsuite/gcc.dg/Wconversion-pr34389.c b/gcc/testsuite/gcc.dg/Wconversion-pr34389.c
new file mode 100644
index 00000000000..45cdf19ef71
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wconversion-pr34389.c
@@ -0,0 +1,53 @@
+/* PR 34389 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+
+short mask1(short x)
+{
+ short y = 0x7fff;
+ return x & y;
+}
+
+short mask2(short ssx)
+{
+ short ssy;
+ short ssz;
+
+ ssz = ((int)ssx) & 0x7fff;
+ ssy = ((int)ssx) | 0x7fff;
+ ssz = ((int)ssx) ^ 0x7fff;
+ return ssx & 0x7fff;
+}
+
+short mask3(int si, unsigned int ui)
+{
+ short ss;
+ unsigned short us;
+
+ ss = si & 0x7fff;
+ ss = si & 0xAAAA; /* { dg-warning "conversion" } */
+ ss = ui & 0x7fff;
+ ss = ui & 0xAAAA; /* { dg-warning "conversion" } */
+
+ us = si & 0x7fff;
+ us = si & 0xAAAA; /* { dg-warning "conversion" } */
+ us = ui & 0x7fff;
+ us = ui & 0xAAAA; /* { dg-warning "conversion" } */
+
+ return ss;
+}
+
+short mask4(int x, int y)
+{
+ return x & y; /* { dg-warning "conversion" } */
+}
+
+short mask5(int x)
+{
+ return x & -1; /* { dg-warning "conversion" } */
+}
+
+short mask6(short x)
+{
+ return x & -1;
+}
diff --git a/gcc/testsuite/gfortran.dg/pr36967.f b/gcc/testsuite/gfortran.dg/pr36967.f
new file mode 100644
index 00000000000..4f8589771b8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr36967.f
@@ -0,0 +1,25 @@
+! { dg-options "-O2 -fpredictive-commoning" }
+ subroutine foo(x,y,n)
+ integer n
+ real*8 y(n,n,n),x(n,n,n)
+ integer k, j, i
+ do k = 2, n-1
+ do j = 2, n-1
+ do I = 2, n-1
+ y(i,j,k) = y(i,j,k)
+ + + (x(i-1,j-1,k)
+ + + x(i,j-1,k-1)
+ + + x(i,j+1,k-1)
+ + + x(i,j+1,k+1)
+ + + x(i+1,j,k+1))
+ + + (x(i-1,j-1,k-1)
+ + + x(i+1,j-1,k-1)
+ + + x(i-1,j+1,k-1)
+ + + x(i+1,j+1,k-1)
+ + + x(i-1,j+1,k+1)
+ + + x(i+1,j+1,k+1))
+ enddo
+ enddo
+ enddo
+ return
+ end
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 63911b3dbe5..94245a4678b 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1707,7 +1707,7 @@ remove_stmt (gimple stmt)
remove_phi_node (&psi, true);
if (!next
- || !gimple_assign_copy_p (next)
+ || !gimple_assign_ssa_name_copy_p (next)
|| gimple_assign_rhs1 (next) != name)
return;
@@ -1727,9 +1727,10 @@ remove_stmt (gimple stmt)
mark_virtual_ops_for_renaming (stmt);
gsi_remove (&bsi, true);
+ release_defs (stmt);
if (!next
- || !gimple_assign_copy_p (next)
+ || !gimple_assign_ssa_name_copy_p (next)
|| gimple_assign_rhs1 (next) != name)
return;
diff --git a/gnattools/ChangeLog b/gnattools/ChangeLog
index 3c6d39f6ef0..81f32c10965 100644
--- a/gnattools/ChangeLog
+++ b/gnattools/ChangeLog
@@ -1,3 +1,20 @@
+2008-07-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac (x_ada_cflags): Remove.
+ (ADA_CFLAGS): Substitute.
+ * configure: Regenerate.
+ * Makefile.in (ADA_CFLAGS): Substitute.
+ (T_ADA_CFLAGS, X_ADA_CFLAGS, ALL_ADA_CFLAGS): Remove.
+ (TOOLS_FLAGS_TO_PASS_1, TOOLS_FLAGS_TO_PASS_1re,
+ TOOLS_FLAGS_TO_PASS_NATIVE, TOOLS_FLAGS_TO_PASS_CROSS):
+ Pass ADA_CFLAGS.
+
+2008-07-30 Laurent Guerby <laurent@guerby.net>
+
+ PR ada/5911
+ * gnattools/Makefile.in: Replace stamp-gnatlib by
+ stamp-gnatlib-rts.
+
2008-06-26 Chris Proctor <chrisp_42@bigpond.com>
* configure.ac, configure: Fix target specific pairs.
diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in
index efc5f7575f0..f28bc685a49 100644
--- a/gnattools/Makefile.in
+++ b/gnattools/Makefile.in
@@ -45,11 +45,7 @@ CFLAGS=-g
LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
GCC_WARN_CFLAGS = $(LOOSE_WARN) $(NOCOMMON_FLAG)
-ADA_CFLAGS=
-T_ADA_CFLAGS=
-# HPPA is literally the only target which sets X_ADA_CFLAGS
-X_ADA_CFLAGS=@x_ada_cflags@
-ALL_ADA_CFLAGS=$(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
+ADA_CFLAGS=@ADA_CFLAGS@
# Variables for gnattools.
ADAFLAGS= -gnatpg -gnata
@@ -83,6 +79,7 @@ TOOLS_FLAGS_TO_PASS_1= \
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
"exeext=$(exeext)" \
@@ -96,6 +93,7 @@ TOOLS_FLAGS_TO_PASS_1re= \
"CC=../../xgcc -B../../" \
"CFLAGS=$(CFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
"exeext=$(exeext)" \
@@ -112,6 +110,7 @@ TOOLS_FLAGS_TO_PASS_NATIVE= \
"CC=../../xgcc -B../../" \
"CFLAGS=$(CFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)" \
"exeext=$(exeext)" \
@@ -128,6 +127,7 @@ TOOLS_FLAGS_TO_PASS_CROSS= \
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I$(RTS_DIR)../adainclude -I$(RTS_DIR) $(ADA_INCLUDES_FOR_SUBDIR)" \
"exeext=$(exeext)" \
@@ -153,8 +153,8 @@ TOOLS_TARGET_PAIRS = @TOOLS_TARGET_PAIRS@
gnattools: @default_gnattools_target@
# Sanity check
-$(GCC_DIR)/stamp-gnatlib:
- @if [ ! -f $(GCC_DIR)/stamp-gnatlib ] ; \
+$(GCC_DIR)/stamp-gnatlib-rts:
+ @if [ ! -f $(GCC_DIR)/stamp-gnatlib-rts ] ; \
then \
echo "Cannot build gnattools while gnatlib is out of date or unbuilt" ; \
false; \
@@ -183,7 +183,7 @@ $(GCC_DIR)/stamp-tools:
# to be able to build gnatmake without a version of gnatmake around. Once
# everything has been compiled once, gnatmake can be recompiled with itself
# (see target regnattools)
-gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib
+gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
# gnattools1
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
$(TOOLS_FLAGS_TO_PASS_1) \
@@ -195,7 +195,7 @@ gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib
# gnatmake/link can be built with recent gnatmake/link if they are available.
# This is especially convenient for building cross tools or for rebuilding
# the tools when the original bootstrap has already be done.
-regnattools: $(GCC_DIR)/stamp-gnatlib
+regnattools: $(GCC_DIR)/stamp-gnatlib-rts
# gnattools1-re
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
$(TOOLS_FLAGS_TO_PASS_1re) \
diff --git a/gnattools/configure b/gnattools/configure
index de26ec95b2e..3cd9eef4c5c 100755
--- a/gnattools/configure
+++ b/gnattools/configure
@@ -272,7 +272,7 @@ PACKAGE_STRING=
PACKAGE_BUGREPORT=
ac_unique_file="Makefile.in"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S x_ada_cflags default_gnattools_target TOOLS_TARGET_PAIRS EXTRA_GNATTOOLS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S default_gnattools_target TOOLS_TARGET_PAIRS EXTRA_GNATTOOLS ADA_CFLAGS LIBOBJS LTLIBOBJS'
ac_subst_files=''
ac_pwd=`pwd`
@@ -1484,13 +1484,6 @@ echo "${ECHO_T}no, using $LN_S" >&6
fi
-# Determine x_ada_cflags
-case $host in
- hppa*) x_ada_cflags=-mdisable-indexing ;;
- *) x_ada_cflags= ;;
-esac
-
-
# Determine what to build for 'gnattools'
if test $build = $target ; then
# Note that build=target is almost certainly the wrong test; FIXME
@@ -1593,6 +1586,9 @@ case "${target}" in
;;
esac
+# From user or toplevel makefile.
+
+
# Output: create a Makefile.
ac_config_files="$ac_config_files Makefile"
@@ -2250,10 +2246,10 @@ s,@target_vendor@,$target_vendor,;t t
s,@target_os@,$target_os,;t t
s,@target_noncanonical@,$target_noncanonical,;t t
s,@LN_S@,$LN_S,;t t
-s,@x_ada_cflags@,$x_ada_cflags,;t t
s,@default_gnattools_target@,$default_gnattools_target,;t t
s,@TOOLS_TARGET_PAIRS@,$TOOLS_TARGET_PAIRS,;t t
s,@EXTRA_GNATTOOLS@,$EXTRA_GNATTOOLS,;t t
+s,@ADA_CFLAGS@,$ADA_CFLAGS,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/gnattools/configure.ac b/gnattools/configure.ac
index cd5e8402bd9..965dc8e18e5 100644
--- a/gnattools/configure.ac
+++ b/gnattools/configure.ac
@@ -51,13 +51,6 @@ ACX_NONCANONICAL_TARGET
# Need to pass this down for now :-P
AC_PROG_LN_S
-# Determine x_ada_cflags
-case $host in
- hppa*) x_ada_cflags=-mdisable-indexing ;;
- *) x_ada_cflags= ;;
-esac
-AC_SUBST([x_ada_cflags])
-
# Determine what to build for 'gnattools'
if test $build = $target ; then
# Note that build=target is almost certainly the wrong test; FIXME
@@ -160,6 +153,9 @@ case "${target}" in
;;
esac
+# From user or toplevel makefile.
+AC_SUBST(ADA_CFLAGS)
+
# Output: create a Makefile.
AC_CONFIG_FILES([Makefile])
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 72cee069a15..efa3639920d 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * libgomp.texi: Update to GFDL 1.2. Update copyright years.
+ Do not list GPL as Invariant Section.
+
2008-07-28 Ilie Garbacea <ilie@mips.com>
Chao-ying Fu <fu@mips.com>
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index 6794ebe9335..edc37904b71 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -7,13 +7,12 @@
@copying
-Copyright @copyright{} 2006 Free Software Foundation, Inc.
+Copyright @copyright{} 2006, 2007, 2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover
+Invariant Sections being ``Funding Free Software'', the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index e6ab84c6999..34566d8f17a 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -688,7 +688,9 @@ reading and writing.
@c pexecute.txh:266
@deftypefn Extension void pex_free (struct pex_obj @var{obj})
-Clean up and free all data associated with @var{obj}.
+Clean up and free all data associated with @var{obj}. If you have not
+yet called @code{pex_get_times} or @code{pex_get_status}, this will
+try to kill the subprocesses.
@end deftypefn
@@ -814,7 +816,7 @@ the output pipe is you, but you are blocked on the input pipe.
@end deftypefn
-@c pexecute.txh:272
+@c pexecute.txh:274
@deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err})
An interface to permit the easy execution of a
@@ -977,7 +979,7 @@ form @code{VAR=VALUE}, with the exception of the last element that must be
@end deftypefn
-@c pexecute.txh:284
+@c pexecute.txh:286
@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags})
This is the old interface to execute one or more programs. It is
@@ -986,7 +988,7 @@ documented.
@end deftypefn
-@c strsignal.c:539
+@c strsignal.c:541
@deftypefn Supplemental void psignal (int @var{signo}, char *@var{message})
Print @var{message} to the standard error, followed by a colon,
@@ -1005,7 +1007,7 @@ name is unset/removed.
@end deftypefn
-@c pexecute.txh:292
+@c pexecute.txh:294
@deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags})
Another part of the old execution interface.
@@ -1256,7 +1258,7 @@ call to @code{strsignal}.
@end deftypefn
-@c strsignal.c:446
+@c strsignal.c:448
@deftypefn Extension {const char*} strsigno (int @var{signo})
Given an signal number, returns a pointer to a string containing the
@@ -1322,7 +1324,7 @@ that the converted value is unsigned.
@end deftypefn
-@c strsignal.c:500
+@c strsignal.c:502
@deftypefn Extension int strtosigno (const char *@var{name})
Given the symbolic name of a signal, map it to a signal number. If no