This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: autoconf 2.50 updates - libjava


On Mon, May 28, 2001 at 10:48:55PM -0300, Alexandre Oliva wrote:
> On May 27, 2001, "Zack Weinberg" <zackw@Stanford.EDU> wrote:
> 
> > I have a patch which disables all the tests libtool wants to run in
> > the AC_NO_EXECUTABLES case -
> 
> I've been holding my breath since yesterday expecting this patch.
> When do you plan to put an end to the suspense? :-D

I didn't send it in because it isn't enough, there are other linkage
checks that are not so easily suppressed.  But here you are, anyway.

-- 
zw   The MacsBug debugger symbol displayed as the pc location for the memory
     manager's code has been changed from BowelsOfTheMemoryMgr to the more
     descriptive name YourHeapIsProbablyCorrupt.
     	-- Apple Tech Note 2010

	* libtool.m4: Change ifdef([AC_PROVIDE_whatever]) to
	AC_PROVIDE_IFELSE([whatever]) throughout.
	Suppress AC_TRY_LINK tests if AC_NO_EXECUTABLES has run.

	* auto-compat.m4: New file.

===================================================================
Index: libtool.m4
--- libtool.m4	2001/05/20 18:55:56	1.8
+++ libtool.m4	2001/05/29 03:00:44
@@ -23,6 +23,7 @@
 ## the same distribution terms that you use for the rest of that program.
 
 # serial 46 AC_PROG_LIBTOOL
+
 AC_DEFUN([AC_PROG_LIBTOOL],
 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
@@ -122,9 +123,9 @@ test "$enable_static" = no && libtool_fl
 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
 test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
 test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN],
 [libtool_flags="$libtool_flags --enable-dlopen"])
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [libtool_flags="$libtool_flags --enable-win32-dll"])
 AC_ARG_ENABLE(libtool-lock,
   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
@@ -166,7 +167,9 @@ case $host in
   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
     [AC_LANG_SAVE
      AC_LANG_C
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_PROVIDE_IFELSE([AC_NO_EXECUTABLES],
+	[lt_cv_cc_needs_belf=no],
+	[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
      AC_LANG_RESTORE])
   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
@@ -174,7 +177,7 @@ case $host in
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
@@ -182,11 +185,14 @@ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
 
   # recent cygwin and mingw systems supply a stub DllMain which the user
   # can override, but on older systems we have to supply one
-  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
-    [AC_TRY_LINK([],
-      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
-      DllMain (0, 0, 0);],
-      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
+  AC_CACHE_CHECK([if libtool should supply DllMain function],
+    lt_cv_need_dllmain,
+    [AC_PROVIDE_IFELSE([AC_NO_EXECUTABLES],
+      [lt_cv_need_dllmain=no],
+      [AC_TRY_LINK([],
+	[extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+	DllMain (0, 0, 0);],
+	[lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])])
 
   case $host/$CC in
   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
@@ -195,7 +201,10 @@ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
     SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS -mdll"
     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
-      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
+      [AC_PROVIDE_IFELSE([AC_NO_EXECUTABLES],
+        [lt_cv_cc_dll_switch=-mdll],
+	[AC_TRY_LINK([], [],
+	  [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])])
     CFLAGS="$SAVE_CFLAGS" ;;
   *-*-cygwin* | *-*-pw32*)
     # cygwin systems need to pass --dll to the linker, and not link
===================================================================
Index: auto-compat.m4
--- auto-compat.m4	Tue May  5 13:32:27 1998
+++ auto-compat.m4	Mon May 28 20:00:44 2001
@@ -0,0 +1,64 @@
+## auto-compat.m4 - Backward compat macros for autoconf.  -*- Shell-script -*-
+## Copyright 2001 Free Software Foundation, Inc.
+## Originally by Zack Weinberg <zackw@stanford.edu>, 2001
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+## This file provides a few macros which are available in autoconf 2.50
+## but not in autoconf 2.13.  Its purpose is to let us generate configure
+## scripts with either version during this transition period.
+
+## AC_NO_EXECUTABLES: Disable certain tests which do not work while we
+## are building runtime libraries.  Link-tests will fail, since the
+## just-built compiler will try to link with the libraries we are about
+## to build.
+ifdef([AC_NO_EXECUTABLES],,
+[AC_DEFUN([AC_NO_EXECUTABLES],
+[AC_BEFORE([$0],[AC_TRY_COMPILER])dnl
+AC_BEFORE([$0],[AC_EXEEXT])dnl
+undefine([AC_TRY_COMPILER])dnl
+undefine([AC_EXEEXT])dnl
+undefine([AC_TRY_LINK])dnl
+define([AC_TRY_COMPILER],
+[$]2=yes
+[$]3=maybe)dnl
+define([AC_EXEEXT],
+[AC_REQUIRE([AC_CYGWIN])
+AC_REQUIRE([AC_MINGW32])
+AC_MSG_CHECKING([for executable suffix])
+AC_CACHE_VAL(ac_cv_exeext,
+[if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+  ac_cv_exeext=.exe
+else
+  ac_cv_exeext=
+fi
+test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+])
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+AC_MSG_RESULT(${ac_cv_exeext})
+dnl Setting ac_exeext will implicitly change the ac_link command.
+ac_exeext=$EXEEXT
+AC_SUBST(EXEEXT)])dnl
+define([AC_TRY_LINK],
+[errprint([AC_TRY_LINK tests are disabled by $0
+])m4exit(2)])dnl
+])dnl definition
+])dnl endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]