change target libs to not try to link stuff

Geoff Keating geoffk@cygnus.com
Thu Aug 3 12:23:00 GMT 2000


While the target libs are being built, you can't try to link programs,
as (a) not all the required files are done yet and (b) this might not
be possibly anyway, as you might not know which board is being
targetted.  (Apparently, this was the result of a long discussion
which happened before my time, and I certainly don't want to drag
something like that up again.)

Anyway, this makes a combined-tree cross build able to build libobjc,
libf77, and libchill.  The C and C++ libraries have always done this.

If no-one has any objections, I'll commit it in a day or so.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/libs-ccworks.patch=================
libchill/ChangeLog:
2000-08-03  Geoff Keating  <geoffk@cygnus.com>

	* configure.in: Replace AC_PROG_CC with a substitute that
	does not call AC_PROG_CC_WORKS.
	* configure: Regenerated.

libf2c/ChangeLog:
2000-08-03  Geoff Keating  <geoffk@cygnus.com>

	* configure.in: Replace AC_PROG_CC with a substitute that
	does not call AC_PROG_CC_WORKS.
	* libF77/configure.in: Likewise.
	* libI77/configure.in: Likewise.
	* libU77/configure.in: Likewise.
	* configure: Regenerated.
	* libF77/configure: Likewise.
	* libI77/configure: Likewise.
	* libU77/configure: Likewise.

libobjc/ChangeLog:
2000-08-03  Geoff Keating  <geoffk@cygnus.com>

	* configure.in: Replace AC_PROG_CC with a substitute that
	does not call AC_PROG_CC_WORKS.  Suppress the libtool
	call to AC_EXEEXT.

Index: libchill/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libchill/configure.in,v
retrieving revision 1.9
diff -p -u -u -p -r1.9 configure.in
--- configure.in	2000/05/31 23:54:07	1.9
+++ configure.in	2000/08/03 19:00:16
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 #   Contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GNU CC.
@@ -66,7 +66,45 @@ fi
 dnl Checks for programs.
 # For chill we'll set CC to point at the built gcc, but this will get it into
 # the makefiles
-AC_PROG_CC
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
 
 test "$AR" || AR=ar
 AC_SUBST(AR)
Index: libf2c/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/configure.in,v
retrieving revision 1.27
diff -p -u -u -p -r1.27 configure.in
--- configure.in	2000/05/18 17:44:27	1.27
+++ configure.in	2000/08/03 19:00:30
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 #   Contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GNU Fortran.
@@ -66,7 +66,45 @@ fi
 dnl Checks for programs.
 # For g77 we'll set CC to point at the built gcc, but this will get it into
 # the makefiles
-AC_PROG_CC
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
 
 dnl These should be inherited in the recursive make, but ensure they are
 dnl defined:
Index: libf2c/libF77/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/libF77/configure.in,v
retrieving revision 1.3
diff -p -u -u -p -r1.3 configure.in
--- configure.in	2000/03/12 19:20:47	1.3
+++ configure.in	2000/08/03 19:00:41
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1997, 1998, 2000 Free Software Foundation, Inc.
 #   Contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GNU Fortran.
@@ -25,7 +25,45 @@ AC_INIT(getarg_.c)
 dnl Checks for programs.
 # For g77 we'll set CC to point at the built gcc, but this will get it into
 # the makefiles
-AC_PROG_CC
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
 
 test "$AR" || AR=ar
 AC_SUBST(AR)
Index: libf2c/libI77/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/libI77/configure.in,v
retrieving revision 1.2
diff -p -u -u -p -r1.2 configure.in
--- configure.in	1998/11/23 13:58:47	1.2
+++ configure.in	2000/08/03 19:00:42
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1997, 1998, 2000 Free Software Foundation, Inc.
 #   Contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GNU Fortran.
@@ -25,7 +25,45 @@ AC_INIT(ftell_.c)
 dnl Checks for programs.
 # For g77 we'll set CC to point at the built gcc, but this will get it into
 # the makefiles
-AC_PROG_CC
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
 
 test "$AR" || AR=ar
 AC_SUBST(AR)
Index: libf2c/libU77/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libf2c/libU77/configure.in,v
retrieving revision 1.8
diff -p -u -u -p -r1.8 configure.in
--- configure.in	1999/10/12 08:39:35	1.8
+++ configure.in	2000/08/03 19:00:43
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
 #   Contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of the GNU Fortran libU77 library.
@@ -26,7 +26,45 @@ AC_CONFIG_HEADER(config.h:config.hin)
 dnl Checks for programs.
 # For g77 we'll set CC to point at the built gcc, but this will get it into
 # the makefiles
-AC_PROG_CC
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
 dnl AC_C_CROSS
 dnl Gives misleading `(cached)' message from the check.
 if test "$CROSS";then
Index: libobjc/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libobjc/configure.in,v
retrieving revision 1.12
diff -p -u -u -p -r1.12 configure.in
--- configure.in	2000/07/29 19:19:43	1.12
+++ configure.in	2000/08/03 19:00:54
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 #   Contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GNU Objective C.
@@ -67,7 +67,49 @@ fi
 dnl Checks for programs.
 # For ObjC we'll set CC to point at the built gcc, but this will get it into
 # the makefiles
-AC_PROG_CC
+# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable.  This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  AC_PROG_CC_G
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+AC_PROVIDE([AC_PROG_CC])
+dnl FIXME! FIXME!  This is so evil.
+dnl We can't call AC_EXEEXT because we can't link executables.
+AC_PROVIDE([AC_EXEEXT])
+])
+
+LIB_AC_PROG_CC
 
 test "$AR" || AR=ar
 AC_SUBST(AR)
============================================================


More information about the Gcc-patches mailing list