getopt_long not found, even though it is present
Assume we are on a system which does have /usr/local/include/getopt.h, and support for getopt_long, but where getopt_long is _not_ in libc. Our configure then diagnoses #define HAVE_GETOPT_H 1 /* #undef HAVE_GETOPT_LONG */ which leads a compilation error for tools/wrc/wrc.c which includes "wine/port.h" and <getopt.h>, for _both_ define struct option. As far as I can see, the problem here is that in tools/wrc/wrc.c we check for the presence of HAVE_GETOPT_H, while in wine/port.h we check for HAVE_GETOPT_LONG. The patch below is one way to fix this problem, another way would be to move the #inclusion of <getopt.h> from individual files to wine/port.h. Yet another option would be the hack autoconf to try linking libgnugetopt when looking for getopt_long, but I don't know how to hack this into configure. How should we resolve this? Gerald Index: wrc.c =================================================================== RCS file: /home/wine/wine/tools/wrc/wrc.c,v retrieving revision 1.33 diff -u -3 -p -r1.33 wrc.c --- wrc.c 28 Mar 2003 19:31:49 -0000 1.33 +++ wrc.c 17 Apr 2003 10:18:18 -0000 @@ -32,7 +32,9 @@ #include <ctype.h> #include <signal.h> #ifdef HAVE_GETOPT_H -# include <getopt.h> +# ifdef HAVE_GETOPT_LONG +# include <getopt.h> +# endif #endif #include "wrc.h"
On Thu, 17 Apr 2003, Gerald Pfeifer wrote:
Assume we are on a system which does have /usr/local/include/getopt.h, and support for getopt_long, but where getopt_long is _not_ in libc.
Our configure then diagnoses
#define HAVE_GETOPT_H 1 /* #undef HAVE_GETOPT_LONG */
which leads a compilation error for tools/wrc/wrc.c which includes "wine/port.h" and <getopt.h>, for _both_ define struct option.
I noticed the following fix by Alexandre, which is much nicer than the original hack of mine: revision 1.38 date: 2003/04/20 02:56:14; author: julliard; state: Exp; lines: +3 -0 Check for struct option independently of the getopt_long check. Thanks! Gerald -- Gerald "Jerry" pfeifer(a)dbai.tuwien.ac.at http://www.pfeifer.com/gerald/
participants (1)
-
Gerald Pfeifer