Nelson Beebe's diverse-*nix-platform report from ghostscript-8.51rc1 showed the repeat of a number of issues with protability and the autoconf build that were not addressed between 8.50 and 8.51. I'm openning this as a critical placeholder to make sure this gets addressed for 8.52. The original report is available at http://ghostscript.com/pipermail/gs-devel/2005-April/003208.html Results reproduced below: Last night, I ran test builds of ghostscript-8.51rc1 in 26 build environments on about 20 flavors of Unix. About half failed, most for the same reason: >> /bin/sh <./obj/ldt.tr >> /usr/bin/ld: cannot find -lXt This failure was common on BSD, Mac OS, and more recent GNU/Linux systems. Once I added -L/usr/X11R6/lib to the ldt.tr file manually, the link succeeded. This should be handled by configure, but it isn't: % grep X11R6 configure /usr/X11R6/include /usr/include/X11R6 /usr/local/X11R6/include /usr/local/include/X11R6 # Check for libraries that X11R6 Xt/Xaw programs need. There are checks for header file locations, but not library locations. On SGI IRIX 6.5, I get unresolved symbols at link time: % /bin/sh <./obj/ldt.tr ld32: ERROR 33 : Unresolved text symbol "png_set_invert_alpha" -- 1st referenced by ./obj/gdevpng.o. ld32: ERROR 33 : Unresolved text symbol "png_set_bKGD" -- 1st referenced by ./obj/gdevpng.o. The problem here is that ldt.tr contains NO -L option, so the obsolete /usr/lib32/libpng.so library is used instead. Once I added -L/usr/local/lib to that file, linking succeeded. On Compaq/DEC Alpha OSF/1 4.0, compilation fails in the jasper library: cc -std1 -DHAVE_MKSTEMP -DHAVE_HYPOT -O \ -DGX_COLOR_INDEX_TYPE="unsigned long int" -ieee \ -I/usr/local/include -O -DGX_COLOR_INDEX_TYPE="unsigned long \ int" -ieee -I/usr/local/include -I./obj/ \ -Ijasper/src/libjasper/include -DJAS_CONFIGURE \ -DEXCLUDE_BMP_SUPPORT=1 -DEXCLUDE_JPG_SUPPORT=1 \ -DEXCLUDE_MIF_SUPPORT=1 -DEXCLUDE_PGX_SUPPORT=1 \ -DEXCLUDE_PNM_SUPPORT=1 -DEXCLUDE_RAS_SUPPORT=1 \ -DEXCLUDE_PNG_SUPPORT=1 -o ./obj/jpc_qmfb.o -c \ jasper/src/libjasper/jpc/jpc_qmfb.c ... cc: Error: jasper/src/libjasper/jpc/jpc_qmfb.c, line 147: In the declaration of "splitbuf", "bufsize" is not constant, but occurs in a context that requires a constant expression. (needconstexpr) jpc_fix_t splitbuf[bufsize]; ---------------------------^ cc: Error: jasper/src/libjasper/jpc/jpc_qmfb.c, line 271: In the declaration of "joinbuf", "bufsize" is not constant, but occurs in a context that requires a constant expression. (needconstexpr) jpc_fix_t joinbuf[bufsize]; --------------------------^ make: *** [obj/jpc_qmfb.o] Error 1 The same error showed up on a few other systems as well. The build with gcc on that system succeeded: evidently, an extension to Standard C is being used, and that MUST be eliminated. On OpenBSD 3.2, I get this failure: gcc -DHAVE_MKSTEMP -DHAVE_HYPOT -O2 -Wall -Wstrict-prototypes \ -Wmissing-declarations -Wmissing-prototypes -Wcast-qual \ -Wwrite-strings -fno-builtin -fno-common \ -DSYS_TYPES_HAS_STDINT_TYPES -DGX_COLOR_INDEX_TYPE="unsigned \ long long" -I./src -I./obj -I./obj -I./src \ -Ijasper/src/libjasper/include -DJAS_CONFIGURE -o \ ./obj/zfjpx.o -c ./src/zfjpx.c In file included from jasper/src/libjasper/include/jasper/jas_types.h:131, from jasper/src/libjasper/include/jasper/jasper.h:66, from src/sjpx.h:27, from src/zfjpx.c:34: /usr/include/stdbool.h:13: error: parse error before '(' token On IBM AIX 4.2, I get this failure: gcc -DHAVE_MKSTEMP -DHAVE_HYPOT -O2 -Wall -Wstrict-prototypes \ -Wmissing-declarations -Wmissing-prototypes -Wcast-qual \ -Wwrite-strings -fno-builtin -fno-common \ -DGX_COLOR_INDEX_TYPE="unsigned long long" -I./obj -I./src \ -o ./obj/gxhintn.o -c ./src/gxhintn.c \ ./src/gxhintn.c: In function `mul_shift': ./src/gxhintn.c:157: `int64_t' undeclared (first use in this function) ... The good news is that builds succeeded with the latest Sun Studio 10 compilers on Solaris 8, 9, and 10 (SPARC and x86).
Some followup notes: The -lXt issue would seem to be an autoconf bug. Fix and submit upstream? I would argue (as last time) that the obsolete png library on IRIX is a system config problem, but look for reasonable work-arounds. The C99 issue with jasper should be fixed. The stdbool issue is already documented as bug 687518. The AIX int64_t problem is another hole in our stdint replacement scheme. a config.log would be helpful there.
The '... "bufsize" is not constant, but occurs in a context that requires a constant' could also be a config problem. I noticed the respective errors appear in lines protected by '#ifdef HAVE_VLA', and HAVE_VLA comes from jasper/configure.ac.
Re-assigning bugs which still have work to do.
Bug still reproducible in Ghostscript 9.03
I'm closing this because this kind of "catch-all" bug is impossible to manage sensibly, and would likely rattle on in perpetuity. I would prefer individual issues reported in individual bugs.