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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC_NO_EXECUTABLES in libbanshee/configure.in


Diego Novillo <dnovillo@redhat.com> writes:

> Andreas,
>
> According to cvs ann, you added GCC_NO_EXECUTABLES to configure.in back
> in Feb29.  We get an error from that line when configuring the branch
>
> src/libbanshee/configure: line 2882: GCC_NO_EXECUTABLES: command not found
>
> However, things seem to work just the same.
>
> Could you take a look?

Oops, I've never seen that before - but it appears here also.

Can you try the appended patch?  I'm CC'ing gcc-patches to get your
approval ;-)

This patch works for me (just tested on x86_64-linux-gnu).

Ok to commit?

Andreas

2004-03-26  Andreas Jaeger  <aj@suse.de>

	* configure.in: Define GCC_NO_EXECUTABLES.
	* configure: Regenerated.

============================================================
Index: configure.in
--- configure.in	29 Feb 2004 17:20:33 -0000	1.1.2.5
+++ configure.in	26 Mar 2004 08:20:09 -0000
@@ -3,6 +3,10 @@ AC_INIT(engine/flowrow-sort.c, 0.9, dber
 AM_INIT_AUTOMAKE(libbanshee, 0.9)
 AM_CONFIG_HEADER(config.h)
 
+# The autoconf 2.5x version of the no-executables hack.
+sinclude(../config/no-executables.m4)
+GCC_NO_EXECUTABLES
+
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
@@ -13,7 +17,6 @@ AC_PROG_RANLIB
 # FIXME: Replace `main' with a function in `-lm':
 #AC_CHECK_LIB([m], [main])
 
-GCC_NO_EXECUTABLES
 
 if test x$GCC = xyes; then
   ac_libbanshee_warn_cflags='-W -Wall -pedantic -Wwrite-strings  -Wstrict-prototypes -Wmissing-prototypes'
============================================================
Index: configure
--- configure	29 Feb 2004 17:20:33 -0000	1.1.2.9
+++ configure	26 Mar 2004 08:20:11 -0000
@@ -1680,6 +1680,31 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(inst
           ac_config_headers="$ac_config_headers config.h"
 
 
+# The autoconf 2.5x version of the no-executables hack.
+# GCC_NO_EXECUTABLES
+# -----------------
+# FIXME: The GCC team has specific needs which the current Autoconf
+# framework cannot solve elegantly.  This macro implements a dirty
+# hack until Autoconf is able to provide the services its users
+# need.
+#
+# Several of the support libraries that are often built with GCC can't
+# assume the tool-chain is already capable of linking a program: the
+# compiler often expects to be able to link with some of such
+# libraries.
+#
+# In several of these libraries, workarounds have been introduced to
+# avoid the AC_PROG_CC_WORKS test, that would just abort their
+# configuration.  The introduction of AC_EXEEXT, enabled either by
+# libtool or by CVS autoconf, have just made matters worse.
+#
+# Unlike the previous AC_NO_EXECUTABLES, this test does not
+# disable link tests at autoconf time, but at configure time.
+# This allows AC_NO_EXECUTABLES to be invoked conditionally.
+# GCC_NO_EXECUTABLES
+
+
+
 # Checks for programs.
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2032,6 +2057,40 @@ main ()
   return 0;
 }
 _ACEOF
+# FIXME: Cleanup?
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  gcc_no_link=no
+else
+  gcc_no_link=yes
+fi
+
+if test x$gcc_no_link = xyes; then
+  # Setting cross_compile will disable run tests; it will
+  # also disable AC_CHECK_FILE but that's generally
+  # correct if we can't link.
+  cross_compiling=yes
+  EXEEXT=
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
@@ -2168,6 +2227,7 @@ echo "${ECHO_T}$ac_cv_exeext" >&6
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
+fi
 echo "$as_me:$LINENO: checking for suffix of object files" >&5
 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
 if test "${ac_cv_objext+set}" = set; then
@@ -2879,7 +2939,6 @@ fi
 # FIXME: Replace `main' with a function in `-lm':
 #AC_CHECK_LIB([m], [main])
 
-GCC_NO_EXECUTABLES
 
 if test x$GCC = xyes; then
   ac_libbanshee_warn_cflags='-W -Wall -pedantic -Wwrite-strings  -Wstrict-prototypes -Wmissing-prototypes'
@@ -3987,6 +4046,12 @@ echo "$as_me:$LINENO: result: $ac_cv_fun
 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
 test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
 
+if test x$gcc_no_link = xyes; then
+  if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+    ac_cv_func_mmap_fixed_mapped=no
+  fi
+fi
+if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
 
 
 for ac_header in stdlib.h unistd.h
@@ -4139,7 +4204,12 @@ echo $ECHO_N "checking for $ac_func... $
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  if test x$gcc_no_link = xyes; then
+  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
@@ -4390,6 +4460,7 @@ _ACEOF
 fi
 rm -f conftest.mmap
 
+fi
 
 for ac_func in vprintf
 do
@@ -4399,7 +4470,12 @@ echo $ECHO_N "checking for $ac_func... $
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  if test x$gcc_no_link = xyes; then
+  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
@@ -4476,7 +4552,12 @@ echo $ECHO_N "checking for _doprnt... $E
 if test "${ac_cv_func__doprnt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  if test x$gcc_no_link = xyes; then
+  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
@@ -4569,7 +4650,12 @@ echo $ECHO_N "checking for $ac_func... $
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  if test x$gcc_no_link = xyes; then
+  { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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