[x264-devel] Re: fun with getopt and x264

Tuukka Toivonen tuukkat at ee.oulu.fi
Mon Jul 25 11:25:53 CEST 2005


On Fri, 22 Jul 2005, Phil Jensen wrote:

> extras/getopt.c:43:20: getopt.h: No such file or directory
> x264.c:32:20: getopt.h: No such file or directory
>
> What I've done previously is modify those two files to reference:
>
> #include "getopt.h" (instead of <getopt.h> inside of extras/getopt.c), and
> #include "extras/getopt.h" (instead of <getopt.h> insode of x264.c)
>
> For me, this allows x264 to build and I don't see any other issues (other than
> some .depend weirdness).  I checked a bunch of my Solaris 8 and 9 boxes here on
> campus and can't seem to find a stock Solaris getopt.h.  I'm wondering how the

Looking from Single Unix Specification v2, it seems that
getopt-function is defined in unistd.h and therefore there indeed
might not be getopt.h in a base system, and even _if_ there would
be, it should not be used as extras/getopt.h might be different.

So: definitely extras/getopt.h should be used when using
extras/getopt.c, and if it isn't it's broken. So I recommend using:

#if HAVE_GETOPT_LONG
#include <getopt.h>
#else
#include "extras/getopt.h"
#endif

> Should I contribute a patch with the above include statements inside of an
> #ifdef SYS_SunOS?  Hope you have a good weekend!

Mmm... no, otherwise we'd need a check for every system, I'd
recommend doing it as above.

But yes please, a patch would be nice.

The Solaris boxes we have here are administered by our admins,
and they are doing good work, which means they've installed
large amount of extra software on the boxes. Maybe the
getopt.h came from a wrong place.

(hope you don't mind if I cc this to x264-devel)

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list