simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] getopt_long patch


From: ken restivo
Subject: Re: [Simulavr-devel] getopt_long patch
Date: Thu, 24 Jan 2002 14:54:48 -0800
User-agent: Mutt/1.3.25i

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That was exactly it.

It looks like I applied the patch twice.
It looks like I applied the patch twice.

Started again from a clean CVS, built it, and it runs w/o curses, no problem.

Then decided to try it without the --disable-curses switch. Configured just 
fine (configure was able to find initscr and resizeterm). 

But:
gmake[3]: Entering directory `/usr/home/ken/simulavr/src/disp'
gcc -DHAVE_CONFIG_H -I. -I. -I../../src     -g -O2 -c disp.c
disp.c:39: getopt.h: No such file or directory

I was able to build it successfully by hand:
gcc -DHAVE_CONFIG_H -I/usr/local/include -I. -I../../src     -g -O2 -c disp.c
gcc  -g -O2  -o disp  disp.o -L/usr/local/lib -lncurses -lgnugetopt 

After this, the curses stuff in disp seems to work just fine on this platform. 
Very cool.

- -ken
- -----------

On Thu, Jan 24, 2002 at 01:59:21PM -0700, Theodore A. Roth wrote:
> Ken,
> 
> This looks suspiciously like the compiler is trying to cat two copies of 
> gnu_getopt.c together and compile the resulting file. gnu_getopt.c is 1057 
> lines long and the redefinition of optarg is offset by that much. The 
> patch looks ok to me. I was able to duplicate the failure by appending
> gnu_getopt.c to itself and #if'ing out the ELIDE_CODE definition.
> 
> I don't think it's the inclusion of unistd.h (or stdlib.h) that is the 
> problem since the error messages are for redefinitions not redeclarations.
> 
> Can you check your gnu_getopt.c file for duplication?
> 
> Ted
> 
> :)On Thu, 24 Jan 2002, ken restivo wrote:
> :)
> :):) Pretty good. Got a clean CVS checkout, patch applied OK. Then
> :):) ./bootstrap from my GNU/Linux box. Then ./configure
> :):) --with-avr-includes=/usr/local/avr/include --disable-curses on the
> :):) FreeBSD 4.3 box with no errors.
> :):)
> :):) However:
> :):)
> :):) gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c gnu_getopt.c
> :):) gnu_getopt.c:1171: redefinition of `optarg'
> :):) gnu_getopt.c:115: `optarg' previously defined here
> :):) gnu_getopt.c:1186: redefinition of `optind'
> :):) gnu_getopt.c:130: `optind' previously defined here
> 
> <snip>
> 
> :):) gmake[3]: *** [gnu_getopt.o] Error 1
> :):)
> :):) The related globals appear to be declared in /usr/include/unistd.h on 
> FreeBSD:
> :):)  extern char *optarg;            /* getopt(3) external variables */
> :):)  extern int optind, opterr, optopt;
> :):)  int  getopt __P((int, char * const [], const char *));
> :):)
> :):) Since you don't have a FreeBSD system, this may help:
> :):)  http://www.freebsd.org/cgi/cvsweb.cgi/src/include
> :):)
> :):) I would guess that an #ifndef may fix this?
> :):)
> 
> 
> 
> _______________________________________________
> Simulavr-devel mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/simulavr-devel

- -- 
- ------------------
One world. Many gods. Plenty for everyone.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8UJC1e8HF+6xeOIcRAnXQAJ42vjAKqBy7E0A9yFlf58mUO9Fb1QCguGIk
Gflc1snfIPiUrgf7uYhqvuM=
=YoYK
-----END PGP SIGNATURE-----



reply via email to

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