GNOME Bugzilla – Bug 126376
Uncoinditional definition of _XOPEN_SOURCE breaks build on NetBSD
Last modified: 2006-04-23 07:25:29 UTC
I got the following compile error: <-- snip --> ... gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include -I/usr/local/include/free type2 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/loc al/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include -I/usr/local/include/atk-1.0 -I/usr/local/include/pango-1.0 -I/usr/X11R6/include -I/usr/X11R6/include -O2 -m cpu=v8 -I/usr/X11R6/include -I/usr/X11R6/include -O2 -mcpu=v8 -c pty.c -Wp,-MD,. deps/pty.TPlo -fPIC -DPIC -o .libs/pty.o In file included from pty.c:23: /usr/include/sys/socket.h:186: parse error before `u_char' /usr/include/sys/socket.h:186: warning: no semicolon at end of struct or union /usr/include/sys/socket.h:187: warning: data definition has no type or storage c lass /usr/include/sys/socket.h:189: parse error before `}' pty.c: In function `_vte_pty_read_ptypair': pty.c:818: `u_char' undeclared (first use in this function) pty.c:818: (Each undeclared identifier is reported only once pty.c:818: for each function it appears in.) pty.c:818: parse error before `)' gmake[2]: *** [pty.lo] Error 1 gmake[2]: Leaving directory `/aux/adrian/build/vte-0.11.10/src' gmake[1]: *** [all-recursive] Error 1 <-- snip --> The declaration of u_char in /usr/include/sys/types.h is: <-- snip --> ... #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; ... <-- snip --> The compilation breaks because of the unconditional definition of _XOPEN_SOURCE in configure.in .
Adding the portability keyword.
Created attachment 34517 [details] [review] patch This patch fixes the problem by only defining XOPEN_SOURCE on solaris, since that's the only place it's needed
2006-04-23 Behdad Esfahbod <behdad@gnome.org> Bug 126376 – Uncoinditional definition of _XOPEN_SOURCE breaks build on NetBSD Patch from Dan Winship. * configure.in: * gnome-pty-helper/configure.in: Define XOPEN_SOURCE on solaris only.