Web lists-archives.com

Re: [Mingw-msys] Reconstruction of MSYS-1.0.11 test results - less.




On Wednesday 11 June 2008 13:54, Michael DOUBEZ wrote:
> Ardi a écrit :
> > binary would be more than enough for me.
> > [...snip...]
>
> I put it at the following address:
> http://www.seitai-equilibre.net/pub/getopt.exe

For some reason, this is the only message I've received, from this 
thread; reconstructing from the GMANE archive...

> > miktex_update: getopt: command not found
> 
> Unless someone does it for you, you have two solution:
>    - compile getopt: grab the linux-util sources from
> ftp://ftp.kernel.org/pub/linux/utils/util-linux/ and try to compile
> the getopt program. I did give it a quick try and got an error at
> link:
>    getopt.o:getopt.c:(.text+0x25e): undefined reference to
>     `getopt_long_only'
> You can just comment out the "_only" at the offending line. You won't
> be able to have long option only but it should be fine for your need.

Ah, but I *did* want getopt_long_only(), (for an unrelated application),
so I've provided a replacement for the current MinGW getopt(3) code; you 
will find it in our CVS repository:
http://mingw.cvs.sourceforge.net/mingw/catgets/repl/getopt.c?revision=1.2&view=markup

> If you want the binary I have made, email me. I give no guarantee
> about it working on your computer :).

And, judging from the OP's response...
| I have copied getopt.exe to msys/1.0/bin directory
| but using sh miktex_update -h it gives error:
| [...]

...it didn't!  However, unless Michael built it using the special MSYS 
development tools, this is only to be expected, because the OP is using 
MSYS-1.0.10, and as Cesar has already explained, non-MSYS executables in 
the MSYS /bin directory just will not work; you should either create 
a /local/bin directory, (mapped, by an MSYS automatic loop back mount, 
to /usr/local/bin, which should already be in the $PATH), and put such 
executables there, or, again as Cesar has suggested, put them in some 
other directory of your choice, which is included in your $PATH.

>    - Change the script in order to use getopts instead of getopt but
> then you won't be able to use the long options.

Well, getopts is not a drop in substitute for getopt; to make that work, 
some additional effort is required.  In fact, it is perfectly feasible 
to use getopts, and to retain a long options capability; that too just 
entails a bit of effort.  For working examples, see:
http://mingw.cvs.sourceforge.net/mingw/xscripts/x86-mingw32-build.sh.getopts?revision=1.2&view=markup
http://mingw.cvs.sourceforge.net/mingw/portmaker/template/mingwPORT.getopts?revision=1.1&view=markup

(Neither of which actually use either getopt or getopts, but neither is 
 precluded; I have previously used this technique together with getopts, 
 but I don't seem to have an example readily to hand).

Regards,
Keith.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys