Closed Bug 269601 Opened 20 years ago Closed 20 years ago

Compile fails in nsDeviceContextPS.cpp, problem with Xutil.h (Xrender.h doesn't include Xlib.h)

Categories

(Core Graveyard :: GFX, defect)

Sun
Solaris
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: InvisibleSmiley, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a5) Gecko/20041106 MultiZilla/1.7.0.0e
Build Identifier: 

System is Sparc/Solaris 8, GTK 2.4.13. Trying to compile current Seamonkey
trunk. I'm getting:

CC -o nsDeviceContextPS.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\"
-DHAVE_DEPENDENT_LIBS -I../.. -I./..  -I./../shared
-I../../../dist/include/xpcom -I../../../dist/include/string
-I../../../dist/include/widget -I../../../dist/include/pref
-I../../../dist/include/caps -I../../../dist/include/locale
-I../../../dist/include/uconv -I../../../dist/include/view
-I../../../dist/include/necko -I../../../dist/include/imglib2
-I../../../dist/include/unicharutil -I../../../dist/include/gfx
-I../../../dist/include
-I/home/hatlak/build/mozilla/src/mozilla/dist/include/nspr     -I.
-I/usr/local/include -I/usr/local/include/freetype2   -I/usr/X11R6/include  
-KPIC  -xbuiltin=%all -features=tmplife -mt  -I/usr/X11R6/include  -DNDEBUG
-DTRIMMED -xO4 -I/usr/local/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/local/include-I/usr/local/include/freetype2 -I/usr/X11R6/include
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   
-DMOZILLA_VERSION=\"1.8a5\" -DSOLARIS=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1
-DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1
-DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_UINT=1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".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1
-DJS_THREADSAFE=1 -DNS_PRINT_PREVIEW=1 -DNS_PRINTING=1 -DMOZ_ACCESSIBILITY_ATK=1
-DMOZILLA_LOCALE_VERSION=\"1.8a\" -DMOZILLA_REGION_VERSION=\"1.8a\"
-DMOZILLA_SKIN_VERSION=\"1.5\"  -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT 
-I/usr/X11R6/include nsDeviceContextPS.cpp
"/usr/X11R6/include/X11/Xutil.h", line 117: Error: Type name expected instead of
"Bool".
"/usr/X11R6/include/X11/Xutil.h", line 120: Error: Type name expected instead of
"Pixmap".
"/usr/X11R6/include/X11/Xutil.h", line 121: Error: Type name expected instead of
"Window".
"/usr/X11R6/include/X11/Xutil.h", line 123: Error: Type name expected instead of
"Pixmap".
"/usr/X11R6/include/X11/Xutil.h", line 124: Error: Type name expected instead of
"XID".
"/usr/X11R6/include/X11/Xutil.h", line 161: Error: Type name expected instead of
"Atom".
"/usr/X11R6/include/X11/Xutil.h", line 207: Error: Type name expected instead of
"XPointer".
"/usr/X11R6/include/X11/Xutil.h", line 254: Error: Type name expected instead of
"Visual".
"/usr/X11R6/include/X11/Xutil.h", line 255: Error: Type name expected instead of
"VisualID".
"/usr/X11R6/include/X11/Xutil.h", line 287: Error: Type name expected instead of
"Colormap".
"/usr/X11R6/include/X11/Xutil.h", line 295: Error: Type name expected instead of
"VisualID".
"/usr/X11R6/include/X11/Xutil.h", line 296: Error: Type name expected instead of
"XID".
"/usr/X11R6/include/X11/Xutil.h", line 365: Error: XRectangle is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 383: Error: Display is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 410: Error: Display is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 417: Error: Status is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 419: Error: Display is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 425: Error: Status is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 427: Error: Display is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 434: Error: Status is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 436: Error: Display is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 442: Error: Status is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 444: Error: Display is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 452: Error: Status is not defined.
"/usr/X11R6/include/X11/Xutil.h", line 454: Error: Display is not defined.
Compilation aborted, too many Error messages.
gmake[5]: *** [nsDeviceContextPS.o] Error 1
gmake[5]: Leaving directory `/home/hatlak/build/mozilla/src/mozilla/gfx/src/ps'


.mozconfig:
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --disable-freetype2
ac_add_options --enable-xft
ac_add_options --enable-extensions=all
ac_add_options --enable-calendar
ac_add_options --disable-xprint
ac_add_options --enable-crypto
ac_add_options --disable-debug
ac_add_options --enable-composer
ac_add_options --enable-strip
ac_add_options --disable-installer
ac_add_options --disable-tests
ac_add_options --without-system-nspr
ac_add_options --without-system-zlib
ac_add_options --without-system-jpeg
ac_add_options --without-system-mng
ac_add_options --without-system-png

Interestingly, Firefox 1.0 does compile fine with similar settings (xft, for
example).

Reproducible: Always
Steps to Reproduce:
Try to compile current trunk (CVS), gtk2 toolkit

Actual Results:  
Compile error occurs.

Expected Results:  
Should compile
OS: other → Solaris
Hardware: Other → Sun
On solaris, the standard X headers are in /usr/openwin/include, so apparently
you're using a separate copy of X. On my linux system, <X11/Xutil.h> from
XFree86 includes <X11/Xlib.h>, which directly or indirectly provides definitions
for the special X types.

Jens, what revision of X do you have installed in /usr/X11R6? Do you know where
it came from? Is it possible that the headers in /usr/X11R6 are damaged somehow?
(In reply to comment #1)
> On solaris, the standard X headers are in /usr/openwin/include, so apparently
> you're using a separate copy of X. On my linux system, <X11/Xutil.h> from
> XFree86 includes <X11/Xlib.h>, which directly or indirectly provides definitions
> for the special X types.

Xutils.h on Solaris states:
/* You must include <X11/Xlib.h> before including this file */

I think something similar is also included in the file for Linux, but the
difference is that the Linux file does include Xlib.h by itself, while the
Solaris version does not.

> Jens, what revision of X do you have installed in /usr/X11R6? Do you know where
> it came from? Is it possible that the headers in /usr/X11R6 are damaged somehow?

Unfortunately, I don't know the exact version. "X -version" does not work.
I don't think anything is broken. I have compiled a few packages for GTK 2,
including Firefox 1.0. However, I tried to rebuild, adding /usr/openwin/include
to CPPFLAGS and /usr/openwin/lib to LDFLAGS. It did not get any better (fails
quite early), so I guess it's not a good idea:

gmake[6]: Entering directory
`/home/hatlak/build/mozilla/src/mozilla/directory/c-sdk/ldap/libraries/liblber'
cc -xstrconst -o encode.o -c   -I/usr/local/include -I/usr/openwin/include  -O
-KPIC  -UDEBUG  -DMOZILLA_CLIENT=1 -DNDEBUG=1 -DXP_UNIX=1 -DSVR4=1 -DSYSV=1
-D__svr4=1 -D__svr4__=1 -DSOLARIS=1 -DHAVE_FCNTL_FILE_LOCKING=1
-D_PR_HAVE_OFF64_T=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -D_REENTRANT=1
-DHAVE_POINTER_LOCALTIME_R=1  -DFORCE_PR_LOG -D_PR_PTHREADS
-UHAVE_CVAR_BUILT_ON_SEM -DUSE_WAITPID -DNEEDPROTOS    -DNET_SSL  -DNO_LIBLCACHE
-DLDAP_REFERRALS     -DNS_DOMESTIC  -I../../../ldap/include 
-I/home/hatlak/build/mozilla/src/mozilla/dist/./include   encode.c
"./lber-int.h", line 106: syntax error before or at: LDAP_CALLBACK
"./lber-int.h", line 106: warning: old-style declaration or incorrect type for:
LDAP_CALLBACK
"./lber-int.h", line 106: warning: old-style declaration or incorrect type for: IFP
"./lber-int.h", line 106: warning: syntax error:  empty declaration
"./lber-int.h", line 115: warning: typedef redeclared: Seqorset
"./lber-int.h", line 134: syntax error before or at: ldap_x_iovec
"./lber-int.h", line 134: cannot recover from previous errors
cc: acomp failed for encode.c

The very same step compiles without the changed flags.
(In reply to comment #1)
> On solaris, the standard X headers are in /usr/openwin/include, so apparently
> you're using a separate copy of X. On my linux system, <X11/Xutil.h> from
> XFree86 includes <X11/Xlib.h>, which directly or indirectly provides definitions
> for the special X types.

I did some investigations and apparently I was wrong: I /am/ using /usr/openwin
because on our system, /usr/X11R6 is a symlink to openwin.
Still it holds that <X11/Xutil.h> does /not/ include <X11/Xlib.h> on
Sparc/Solaris, unlike Linux.

> Jens, what revision of X do you have installed in /usr/X11R6? Do you know where
> it came from? Is it possible that the headers in /usr/X11R6 are damaged somehow?

showrev -c /usr/X11R6/bin/X says:
(...)
File: /usr/X11R6/bin/X
======================
File type: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not
stripped 
Command version: X11 Version 6.4.1 28 January 2004
(...)
It has proven to be as I expected: Adding
#include <X11/Xlib.h>
to all affected files (tried some .cpp in mozilla/gfx/src/ps) solves the problem.

Can anyone tell me where the #include line should be placed exactly in order to
cleanly and completely fix the problem? I could not find the right file in the
#include jungle...

A patch fixing the issue would be fine, too. Unfortunately, I'm not much of a
C/C++ programmer, so I will not try.
OK, it seems it's not Mozilla's fault, but in fact mine: I re-ran the compile
with the -H flag, telling cc to list the include paths. On our system, Xrender.h
includes Xutil.h without including Xlib.h first. It seems I installed an Xrender
version (0.8.3) not compatible with Sparc/Solaris out-of-the-box:

http://freedesktop.org/cgi-bin/viewcvs.cgi/xlibs/Xrender/Xrender.h?rev=1.21&view=log

"Add X11/Xlib.h above other X includes to help out Solaris"

Sorry for the confusion. I'm updating the bug summary for making it easier to
find for others and closing this one.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Summary: Compile fails in nsDeviceContextPS.cpp, problem with Xutil.h → Compile fails in nsDeviceContextPS.cpp, problem with Xutil.h (Xrender.h doesn't include Xlib.h)
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.