From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: Re: config.h changes comitted -- ./autogen.sh run required. Date: Sat, 29 Mar 2003 08:59:25 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87brzvrtbm.fsf@zip.com.au> References: <87brzznfy8.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1048892553 4504 80.91.224.249 (28 Mar 2003 23:02:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2003 23:02:33 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Mar 29 00:02:28 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18z2rk-0001AQ-00 for ; Sat, 29 Mar 2003 00:02:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18z2r0-0000hS-07 for guile-devel@m.gmane.org; Fri, 28 Mar 2003 18:01:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18z2qF-00087C-00 for guile-devel@gnu.org; Fri, 28 Mar 2003 18:00:55 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18z2pf-0007ZL-00 for guile-devel@gnu.org; Fri, 28 Mar 2003 18:00:20 -0500 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.10.13) id 18z2pT-0007VJ-00 for guile-devel@gnu.org; Fri, 28 Mar 2003 18:00:09 -0500 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) h2SN01Rk006959 for ; Sat, 29 Mar 2003 10:00:01 +1100 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h2SN01oJ009767 for ; Sat, 29 Mar 2003 10:00:01 +1100 (EST) Original-Received: from localhost (ppp100.dyn228.pacific.net.au [203.143.228.100]) by wisma.pacific.net.au (8.12.8/8.12.8) with ESMTP id h2SMxxqn010198 for ; Sat, 29 Mar 2003 09:59:59 +1100 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 18z2oo-0000tW-00; Sat, 29 Mar 2003 08:59:26 +1000 Original-To: guile-devel@gnu.org In-Reply-To: <87brzznfy8.fsf@raven.i.defaultvalue.org> (Rob Browning's message of "Tue, 25 Mar 2003 18:12:47 -0600") User-Agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2120 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2120 I think libguile/Makefile.am ends up using plain $(CC) to link gen-scmconfig, rather than $(CC_FOR_BUILD). And $(OBJEXT) in the rule for gen-scmconfig.$(OBJEXT) will be the cross-compiler's objext I think. As a suggestion, it might be easier to make a rule for a combined compile and link, to keep right away from the $(CC) setups, gen-scmconfig$(EXEEXT_FOR_BUILD): gen-scmconfig.c ... $(CC_FOR_BUILD) `test -f 'gen-scmconfig.c' || echo '$(srcdir)/'\`gen-scmconfig.c -o gen-scmconfig$(EXEEXT_FOR_BUILD) If you're not planning to build on djgpp or mingw then $(EXEEXT_FOR_BUILD) can be dispensed with. I hit my head against some of this for gmp recently (in the next release it'll run some stuff on the build system). The couple of macros below might be of use for inspiration or consideration. (The CC_FOR_BUILD search below assumes that nothing particular in the way of types or sizes is needed from the build compiler, just a compiler that will create a working executable.) AC_ARG_VAR on CC_FOR_BUILD is a good idea, if nothing else. It shows the variable in configure --help, and preserves the value across re-configures. dnl GMP_PROG_CC_FOR_BUILD dnl --------------------- dnl Establish CC_FOR_BUILD, a C compiler for the build system. dnl dnl If CC_FOR_BUILD is set, it's used without testing, likewise the old dnl style HOST_CC, otherwise some likely candidates are tried, as per dnl configfsf.guess. AC_DEFUN(GMP_PROG_CC_FOR_BUILD, [AC_REQUIRE([AC_PROG_CC]) if test -n "$CC_FOR_BUILD"; then GMP_PROG_CC_FOR_BUILD_WORKS($CC_FOR_BUILD,, [AC_MSG_ERROR([Specified CC_FOR_BUILD doesn't seem to work])]) elif test -n "$HOST_CC"; then GMP_PROG_CC_FOR_BUILD_WORKS($HOST_CC, [CC_FOR_BUILD=$HOST_CC], [AC_MSG_ERROR([Specified HOST_CC doesn't seem to work])]) else for i in "$CC" "$CC $CFLAGS $CPPFLAGS" cc gcc c89 c99; do GMP_PROG_CC_FOR_BUILD_WORKS($i, [CC_FOR_BUILD=$i break]) done if test -z "$CC_FOR_BUILD"; then AC_MSG_ERROR([Cannot find a build system compiler]) fi fi AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler]) AC_SUBST(CC_FOR_BUILD) ]) dnl GMP_PROG_CC_FOR_BUILD_WORKS(cc/cflags[,[action-if-good][,action-if-bad]]) dnl ------------------------------------------------------------------------- dnl See if the given cc/cflags works on the build system. dnl dnl It seems easiest to just use the default compiler output, rather than dnl figuring out the .exe or whatever at this stage. AC_DEFUN(GMP_PROG_CC_FOR_BUILD_WORKS, [AC_MSG_CHECKING([build system compiler $1]) rm -f conftest* a.out b.out a.exe a_out.exe cat >conftest.c <&AC_FD_CC 2>&1; then cc_for_build_works=yes fi fi rm -f conftest* a.out b.out a.exe a_out.exe AC_MSG_RESULT($cc_for_build_works) if test "$cc_for_build_works" = yes; then ifelse([$2],,:,[$2]) else ifelse([$3],,:,[$3]) fi ]) dnl GMP_PROG_EXEEXT_FOR_BUILD dnl ------------------------- dnl Determine EXEEXT_FOR_BUILD, the build system executable suffix. dnl dnl The idea is to find what "-o conftest$foo" will make it possible to run dnl the program with ./conftest. On Unix-like systems this is of course dnl nothing, for DOS it's ".exe", or for a strange RISC OS foreign file dnl system cross compile it can be ",ff8" apparently. Not sure if the dnl latter actually applies to a build-system executable, maybe it doesn't, dnl but it won't hurt to try. AC_DEFUN(GMP_PROG_EXEEXT_FOR_BUILD, [AC_REQUIRE([GMP_PROG_CC_FOR_BUILD]) AC_CACHE_CHECK([for build system executable suffix], gmp_cv_prog_exeext_for_build, [cat >conftest.c <&AC_FD_CC; then gmp_cv_prog_exeext_for_build=$i break fi fi done rm -f conftest* if test "${gmp_cv_prog_exeext_for_build+set}" != set; then AC_MSG_ERROR([Cannot determine executable suffix]) fi ]) AC_SUBST(EXEEXT_FOR_BUILD,$gmp_cv_prog_exeext_for_build) ]) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel