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: Theodore Roth
Subject: Re: [Simulavr-devel] getopt_long patch
Date: Thu, 24 Jan 2002 12:58:47 -0700 (MST)

Thanks.

I'll look into this.

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
:) gnu_getopt.c:1192: redefinition of `__getopt_initialized'
:) gnu_getopt.c:136: `__getopt_initialized' previously defined here
:) gnu_getopt.c:1206: redefinition of `opterr'
:) gnu_getopt.c:150: `opterr' previously defined here
:) gnu_getopt.c:1212: redefinition of `optopt'
:) gnu_getopt.c:156: `optopt' previously defined here
:) gnu_getopt.c:1245: conflicting types for `REQUIRE_ORDER'
:) gnu_getopt.c:189: previous declaration of `REQUIRE_ORDER'
:) gnu_getopt.c:1245: conflicting types for `PERMUTE'
:) gnu_getopt.c:189: previous declaration of `PERMUTE'
:) gnu_getopt.c:1246: conflicting types for `RETURN_IN_ORDER'
:) gnu_getopt.c:190: previous declaration of `RETURN_IN_ORDER'
:) gnu_getopt.c:1277: redefinition of `my_index'
:) gnu_getopt.c:221: `my_index' previously defined here
:) gnu_getopt.c:1367: redefinition of `exchange'
:) gnu_getopt.c:311: `exchange' previously defined here
:) gnu_getopt.c:1452: redefinition of `_getopt_initialize'
:) gnu_getopt.c:396: `_getopt_initialize' previously defined here
:) gnu_getopt.c:1574: redefinition of `_getopt_internal'
:) gnu_getopt.c:518: `_getopt_internal' previously defined here
:) gnu_getopt.c:2030: redefinition of `getopt'
:) gnu_getopt.c:974: `getopt' previously defined here
:) gnu_getopt.c:2227: redefinition of `optarg'
:) gnu_getopt.c:1171: `optarg' previously defined here
:) gnu_getopt.c:2242: redefinition of `optind'
:) gnu_getopt.c:1186: `optind' previously defined here
:) gnu_getopt.c:2248: redefinition of `__getopt_initialized'
:) gnu_getopt.c:1192: `__getopt_initialized' previously defined here
:) gnu_getopt.c:2262: redefinition of `opterr'
:) gnu_getopt.c:1206: `opterr' previously defined here
:) gnu_getopt.c:2268: redefinition of `optopt'
:) gnu_getopt.c:1212: `optopt' previously defined here
:) gnu_getopt.c:2301: redefinition of `REQUIRE_ORDER'
:) gnu_getopt.c:1245: `REQUIRE_ORDER' previously defined here
:) gnu_getopt.c:2301: redefinition of `PERMUTE'
:) gnu_getopt.c:1245: `PERMUTE' previously defined here
:) gnu_getopt.c:2302: redefinition of `RETURN_IN_ORDER'
:) gnu_getopt.c:1246: `RETURN_IN_ORDER' previously defined here
:) gnu_getopt.c:2333: redefinition of `my_index'
:) gnu_getopt.c:1277: `my_index' previously defined here
:) gnu_getopt.c:2423: redefinition of `exchange'
:) gnu_getopt.c:1367: `exchange' previously defined here
:) gnu_getopt.c:2508: redefinition of `_getopt_initialize'
:) gnu_getopt.c:1452: `_getopt_initialize' previously defined here
:) gnu_getopt.c:2630: redefinition of `_getopt_internal'
:) gnu_getopt.c:1574: `_getopt_internal' previously defined here
:) gnu_getopt.c:3086: redefinition of `getopt'
:) gnu_getopt.c:2030: `getopt' previously defined here
:) 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?
:)
:) - -ken
:) - ---------
:) On Thu, Jan 24, 2002 at 11:43:06AM -0700, Theodore A. Roth wrote:
:) > Hi All,
:) >
:) > I'm back home and ready to get back into hacking on simulavr again.
:) >
:) > I just did a quick hack to hopefully make the getopt_long() usage more
:) > portable. Instead of doing autoconf tweaks to check for a working
:) > getopt_long() implementation, I just snarfed the getopt code from gdb-5.1
:) > and added it to the project. I renamed the files with a "gnu_" prefix to
:) > avoid a collision with the existing getopt.h on the build system.
:) >
:) > Attached is a patch for the implementation of the change. I'd like it
:) > tested and criticised before I check it in. This should fix the FreeBSD
:) > problem (getopt_long missing). I need someone (Ken?) to try it on FreeBSD
:) > since I can't do it myself.
:) >
:) >
:) > Ted
:)




reply via email to

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