ecantu wrote: |
Ok...this is really kludgy, but it works. I really don't see the need for unistd.h to need to define getopt because any autoconf will find getopt.h on its own, so this workaround will do for this build. I'll keep it around until I see something breaking with future compiles. |
Kludgy? Hell, that's vomit-inducing. I can't even believe you'd consider doing it. There is
no excuse, I repeat,
NO excuse for a piece of user software requiring you to modify system headers. What you're risking there is getting dbg-cli to build and having other stuff mysteriously fail to compile.
The problem here is in the dbg-cli code, and in particular it's autoconfigure setup.
As you have noted, the code uses getopt_long_only, which appears to be used in the place of getopt_long despite having the option of short options. Funky. OSX has no getopt_long_only, but does have getopt_long. So, we can replace the call to getopt_long_only with a call to getopt_long, remove all reference to the included ../getopt and all should be well. A quick hack to dbg/main.cpp and dbg/Makefile (to remove the -lgetopt and -I../getopt) works quite nicely, I find. I'd fix the root problem, but I have more important stuff to do.
Oh, and then you can restore your unistd.h to its former glory.
Simon