unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* building gen-scmconfig.c on FreeBSD
@ 2004-09-08  6:22 Andreas Vögele
  2004-09-08 22:26 ` Kevin Ryde
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Vögele @ 2004-09-08  6:22 UTC (permalink / raw)


On FreeBSD string.h includes the system header strings.h.  The problem 
is that Guile provides another file called strings.h which is included 
instead of the system header file. This causes the build of 
gen-scmconfig to fail since Guile's strings.h includes scmconfig.h 
which hasn't been created at this stage.

It seems that there is already a workaround for this problem in 
linguile/Makefile.am:

  ## Prevent automake from adding extra -I options
  DEFS = @DEFS@

Unfortunately, that workaround no longer helps since recent versions of 
automake seem to work differently.  I tried to use "DEFS = @DEFS@ 
-I/usr/include" so that /usr/include is searched before the 
DEFAULT_INCLUDES. But that didn't work since GCC seems to search the 
current directory before the directories added with -I. I also tried to 
use -I- without success.

I figured out that gen-scmconfig can be built with CC_FOR_BUILD instead 
of COMPILE.  I'm wondering if the rule

gen-scmconfig.$(OBJEXT): gen-scmconfig.c
	if [ "$(cross_compiling)" = "yes" ]; then \
		$(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<; \
	else \
		$(COMPILE) -c -o $@ $<; \
	fi

in libguile/Makefile.am couldn't be replaced with

gen-scmconfig.$(OBJEXT): gen-scmconfig.c
	$(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<;

Does anybody know a better solution?



_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building gen-scmconfig.c on FreeBSD
  2004-09-08  6:22 building gen-scmconfig.c on FreeBSD Andreas Vögele
@ 2004-09-08 22:26 ` Kevin Ryde
  2004-09-14 19:18   ` Rob Browning
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2004-09-08 22:26 UTC (permalink / raw)
  Cc: bug-guile

Andreas Vögele <voegelas@gmx.net> writes:
>
> gen-scmconfig.$(OBJEXT): gen-scmconfig.c
> 	$(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<;

Yep, I'd been meaning to do that.  But probably omitting $INCLUDES,
since they're likely to be host-system things, not build-system.
$DEFS probably only has -DHAVE_CONFIG_H, and may be unnecessary too.

One thing for a proper cross-compile is to figure out
$OBJEXT_FOR_BUILD, which may be different from the host system.  I'd
planned to go straight to an executable rather than through an obj.


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building gen-scmconfig.c on FreeBSD
  2004-09-08 22:26 ` Kevin Ryde
@ 2004-09-14 19:18   ` Rob Browning
  2004-09-15 22:19     ` Kevin Ryde
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Browning @ 2004-09-14 19:18 UTC (permalink / raw)
  Cc: bug-guile

Kevin Ryde <user42@zip.com.au> writes:

> Andreas Vögele <voegelas@gmx.net> writes:
>>
>> gen-scmconfig.$(OBJEXT): gen-scmconfig.c
>> 	$(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<;
>
> Yep, I'd been meaning to do that.  But probably omitting $INCLUDES,
> since they're likely to be host-system things, not build-system.
> $DEFS probably only has -DHAVE_CONFIG_H, and may be unnecessary too.
>
> One thing for a proper cross-compile is to figure out
> $OBJEXT_FOR_BUILD, which may be different from the host system.  I'd
> planned to go straight to an executable rather than through an obj.

I can't recall offhand.  Is CC_FOR_BUILD for executables that will be
run on the host system?  If not, then we shouldn't be using it at all.
gen-scmconfig has to be run at build time by the host to generate the
header, so it needs to be built by the host's compiler.  Note that
gen-scmconfig.c doesn't (and must not) depend on any target specific
computations like sizeof(foo), etc.  It is solely used as a portable
way to generate scmconfig.h, taking into account the contents of
config.h.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building gen-scmconfig.c on FreeBSD
  2004-09-14 19:18   ` Rob Browning
@ 2004-09-15 22:19     ` Kevin Ryde
  2004-09-16  5:28       ` Rob Browning
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2004-09-15 22:19 UTC (permalink / raw)
  Cc: bug-guile

Rob Browning <rlb@defaultvalue.org> writes:
>
> Is CC_FOR_BUILD for executables that will be run on the host system?

No, for the build system.

> If not, then we shouldn't be using it at all.
> gen-scmconfig has to be run at build time by the host to generate the
> header, so it needs to be built by the host's compiler.

You mean the build compiler I think.

> gen-scmconfig.c doesn't (and must not) depend on any target specific
> computations like sizeof(foo), etc.  It is solely used as a portable
> way to generate scmconfig.h, taking into account the contents of
> config.h.

Yep, which is why using $(INCLUDES), which is for the host compiler,
seems doubtful.


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building gen-scmconfig.c on FreeBSD
  2004-09-15 22:19     ` Kevin Ryde
@ 2004-09-16  5:28       ` Rob Browning
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Browning @ 2004-09-16  5:28 UTC (permalink / raw)
  Cc: bug-guile

Kevin Ryde <user42@zip.com.au> writes:

>> If not, then we shouldn't be using it at all.
>> gen-scmconfig has to be run at build time by the host to generate the
>> header, so it needs to be built by the host's compiler.
>
> You mean the build compiler I think.

Yep, I was using the wrong meaning for host -- I was thinking of the
machine "hosting" the compilation.

> Yep, which is why using $(INCLUDES), which is for the host compiler,
> seems doubtful.

Agreed.  That sounds wrong.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-16  5:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-08  6:22 building gen-scmconfig.c on FreeBSD Andreas Vögele
2004-09-08 22:26 ` Kevin Ryde
2004-09-14 19:18   ` Rob Browning
2004-09-15 22:19     ` Kevin Ryde
2004-09-16  5:28       ` Rob Browning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).