l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Solved bug (Was: Re: idl4-0.8.3 (chacmos) compile bug?)


From: Farid Hajji
Subject: Solved bug (Was: Re: idl4-0.8.3 (chacmos) compile bug?)
Date: Wed, 15 May 2002 21:35:28 +0200 (CEST)

Hi Andreas,

> >gmake[1]: Entering directory `/tmp/idl4_0_8_3/examples/chacmos/booter'
> >..//../..//src/idl4 -I/tmp/l4-ka/apps/include ../idl/booter.idl -s -h
> > ../include/interfaces/booter_server.h
> [...]
> >gcc -Wall -I../include -I..//../..//src/include/user 
> > -I/tmp/l4-ka/apps/include  -x c++ -c -o calls.o calls.c
> >calls.c:3: interfaces/booter_server.h: No such file or directory
> 
> I was unable to reproduce the problem on my local system.
> Could you please send additional information, e.g. whether IDL4
> actually succeeds in creating chacmos/include/interfaces/booter_server.h?
> In the gmake output, everything seems fine; gcc should have found the
> file in the include path, which was supplied correctly (-I../include).

Okay, I've found the culprit: ${IDL4}/src/base/main.cc:parse_args()
uses getopt() if __GNU_LIBRARY__ is not #define'd (that's the case on
FreeBSD). But getopt() bails out of the while loop, the first time
it discovers an argument that is not listed in the permissible options.
This is in accordance to IEEE Std 1003.2 (POSIX 2), but causes breakage
when you call idl4 like this:

  ..//../..//src/idl4 -I/tmp/l4-ka/apps/include ../idl/booter.idl -s -h
                      ../include/interfaces/booter_server.h

Just switching the order of the arguments solves the problem here:

  ..//../..//src/idl4 -I/tmp/l4-ka/apps/include
                      -s -h ../include/interfaces/booter_server.h
                      ../idl/booter.idl

Here's a patch for ${IDL4}/examples/chacmos/Makeconf:

====== cut here ====== cut here ====== cut here ====== cut here ======
--- Makeconf.orig       Wed May 15 21:15:37 2002
+++ Makeconf    Wed May 15 21:16:08 2002
@@ -57,10 +57,10 @@
        $(CPP) $(CPPFLAGS) -c -o $@ $<
 
 $(TOPDIR)include/interfaces/%_server.h:        $(TOPDIR)idl/%.idl $(IDL4)
-       $(IDL4) -I$(HAZELNUT)/apps/include $< -s -h $@
+       $(IDL4) -I$(HAZELNUT)/apps/include -s -h $@ $<
 
 $(TOPDIR)include/interfaces/%_client.h:        $(TOPDIR)idl/%.idl $(IDL4)
-       $(IDL4) -I$(HAZELNUT)/apps/include $< -c -h $@
+       $(IDL4) -I$(HAZELNUT)/apps/include -c -h $@ $<
 
 $(IDL4):
        $(MAKE) -C $(IDL4DIR)/src all
====== cut here ====== cut here ====== cut here ====== cut here ======

And the patch for ${IDL4}/examples/test/Makefile:

====== cut here ====== cut here ====== cut here ====== cut here ======
--- Makefile.orig       Wed May 15 21:18:35 2002
+++ Makefile    Wed May 15 21:19:33 2002
@@ -75,13 +75,13 @@
        $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
 
 test_client.h: $(IDL) $(IDL4)
-       $(IDL4) $(IDL) $(IDLFLAGS) -c
+       $(IDL4) $(IDLFLAGS) -c $(IDL)
 
 test_server.h: $(IDL) $(IDL4)
-       $(IDL4) $(IDL) $(IDLFLAGS) -s
+       $(IDL4) $(IDLFLAGS) -s $(IDL)
 
 test_template.c:       $(IDL) $(IDL4)
-       $(IDL4) $(IDL) $(IDLFLAGS) -t
+       $(IDL4) $(IDLFLAGS) -t $(IDL)
 
 $(TARGET):     $(OBJS) Makefile
        $(LD) $(LDFLAGS) -Ttext=$(LINK_ADDR) -o $@ $(CRT0) $(OBJS) $(LIBS)
====== cut here ====== cut here ====== cut here ====== cut here ======

Everything compiles fine after this.

An alternative to changing Makeconf and Makefile above would be to use
a (not really portable) extension to POSIX 2 by using the optreset
variable. I have no idea if that would work outside of FreeBSD's
getopt(3) implementation though, so it may be better to avoid it
altogether.

>          - Andreas
> 
> ---
> Andreas Haeberlen
> System Architecture Group, University of Karlsruhe, Germany
> address@hidden, phone: +49 (721) 608-4055

Regards,

-Farid.

-- 
Farid Hajji -- Unix Systems and Network Admin | Phone: +49-2131-67-555
Broicherdorfstr. 83, D-41564 Kaarst, Germany  | address@hidden
- - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -
One OS To Rule Them All And In The Darkness Bind Them... --Bill Gates.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]