ghostscript-esp fails to build with USE="-X" It wants to include X11 header files which are not available. Complete flags are: [ebuild U ] app-text/ghostscript-esp-8.15.1 [7.07.1-r10] USE="cjk cups -X -emacs -gtk -threads%" 0 kB Compile dies with: i686-pc-linux-gnu-gcc -DHAVE_MKSTEMP -DHAVE_HYPOT -O2 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wcast-qual -Wwrite-strings -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long" -march=pentium2 -Os -pipe -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"/usr/lib/ghostscript/8.15\" -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MALLOC_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_ST_BLOCKS=1 -DTIME_WITH_SYS_TIME=1 -DSIZEOF_UNSIGNED_LONG_INT=4 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_JPEGLIB_H=1 -DDONT_HAVE_JMEMSYS_H=1 -DHAVE_ZLIB_H=1 -DHAVE_PNG_H=1 -DX_DISPLAY_MISSING=1 -DHAVE_MKSTEMP=1 -DHAVE_HYPOT=1 -DHAVE_UNISTD_H=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DRETSIGTYPE=void -DLSTAT_FOLLOWS_SLASHED_SYMLINK=1 -DHAVE_VPRINTF=1 -DHAVE_BZERO=1 -DHAVE_DUP2=1 -DHAVE_FLOOR=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_MEMCHR=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_MKDIR=1 -DHAVE_MKFIFO=1 -DHAVE_MODF=1 -DHAVE_POW=1 -DHAVE_PUTENV=1 -DHAVE_RINT=1 -DHAVE_SETENV=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRERROR=1 -DHAVE_STRRCHR=1 -DHAVE_STRSPN=1 -DHAVE_STRSTR=1 -fPIC -shared -I./obj -I./src -o ./obj/gdevxalt.o -c ./src/gdevxalt.c In file included from ./src/gdevxalt.c:22: ./src/x_.h:135:24: X11/Xlib.h: No such file or directory ./src/x_.h:136:26: X11/Xproto.h: No such file or directory ./src/x_.h:137:25: X11/Xatom.h: No such file or directory ./src/x_.h:138:25: X11/Xutil.h: No such file or directory ./src/x_.h:139:29: X11/Intrinsic.h: No such file or directory ./src/x_.h:140:30: X11/StringDefs.h: No such file or directory ./src/x_.h:141:25: X11/Shell.h: No such file or directory In file included from ./src/gdevx.h:28, from ./src/gdevxalt.c:28: ./src/gdevxcmp.h:40: error: syntax error before "XColor" ./src/gdevxcmp.h:40: warning: no semicolon at end of struct or union ./src/gdevxcmp.h:42: error: syntax error before '}' token In file included from ./src/gdevxalt.c:28: ./src/gdevx.h:31: error: syntax error before "gdev_x_resources" ./src/gdevx.h:31: warning: type defaults to `int' in declaration of `gdev_x_resources' ./src/gdevx.h:31: warning: data definition has no type or storage class ./src/gdevx.h:33: error: syntax error before "gdev_x_fallback_resources" ./src/gdevx.h:33: warning: type defaults to `int' in declaration of `gdev_x_fallback_resources' ./src/gdevx.h:33: warning: data definition has no type or storage class ./src/gdevx.h:70: error: syntax error before "XImage" ./src/gdevx.h:70: warning: no semicolon at end of struct or union ./src/gdevx.h:73: warning: type defaults to `int' in declaration of `dpy' ./src/gdevx.h:73: warning: data definition has no type or storage class ./src/gdevx.h:74: error: syntax error before '*' token ./src/gdevx.h:74: warning: type defaults to `int' in declaration of `scr' ./src/gdevx.h:74: warning: data definition has no type or storage class ./src/gdevx.h:75: error: syntax error before '*' token ./src/gdevx.h:75: warning: type defaults to `int' in declaration of `vinfo' ./src/gdevx.h:75: warning: data definition has no type or storage class ./src/gdevx.h:76: error: syntax error before "cmap" ./src/gdevx.h:76: warning: type defaults to `int' in declaration of `cmap' ./src/gdevx.h:76: warning: data definition has no type or storage class ./src/gdevx.h:77: error: syntax error before "win" ./src/gdevx.h:77: warning: type defaults to `int' in declaration of `win' ./src/gdevx.h:77: warning: data definition has no type or storage class ./src/gdevx.h:78: error: syntax error before "gc" ./src/gdevx.h:78: warning: type defaults to `int' in declaration of `gc' ./src/gdevx.h:78: warning: data definition has no type or storage class ./src/gdevx.h:81: error: syntax error before "pwin" ./src/gdevx.h:81: warning: type defaults to `int' in declaration of `pwin' ./src/gdevx.h:81: warning: data definition has no type or storage class ./src/gdevx.h:84: error: syntax error before "bpixmap" ./src/gdevx.h:84: warning: type defaults to `int' in declaration of `bpixmap' ./src/gdevx.h:84: warning: data definition has no type or storage class ./src/gdevx.h:87: error: syntax error before "mwin" ./src/gdevx.h:87: warning: type defaults to `int' in declaration of `mwin' ./src/gdevx.h:87: warning: data definition has no type or storage class ./src/gdevx.h:89: error: syntax error before "NEXT" ./src/gdevx.h:89: warning: type defaults to `int' in declaration of `NEXT' ./src/gdevx.h:89: warning: type defaults to `int' in declaration of `PAGE' ./src/gdevx.h:89: warning: type defaults to `int' in declaration of `DONE' ./src/gdevx.h:89: warning: data definition has no type or storage class ./src/gdevx.h:96: error: syntax error before "dest" ./src/gdevx.h:96: warning: type defaults to `int' in declaration of `dest' ./src/gdevx.h:96: warning: data definition has no type or storage class ./src/gdevx.h:102: error: syntax error before "Pixmap" ./src/gdevx.h:102: warning: no semicolon at end of struct or union ./src/gdevx.h:103: warning: type defaults to `int' in declaration of `gc' ./src/gdevx.h:103: warning: data definition has no type or storage class ./src/gdevx.h:105: error: syntax error before '}' token ./src/gdevx.h:105: warning: type defaults to `int' in declaration of `cp' ./src/gdevx.h:105: warning: data definition has no type or storage class ./src/gdevx.h:110: error: syntax error before "Pixmap" ./src/gdevx.h:110: warning: no semicolon at end of struct or union ./src/gdevx.h:111: warning: type defaults to `int' in declaration of `no_pixmap' ./src/gdevx.h:111: warning: data definition has no type or storage class ./src/gdevx.h:115: error: syntax error before '}' token ./src/gdevx.h:115: warning: type defaults to `int' in declaration of `ht' ./src/gdevx.h:115: warning: data definition has no type or storage class ./src/gdevx.h:120: error: syntax error before "fid" ./src/gdevx.h:120: warning: type defaults to `int' in declaration of `fid' ./src/gdevx.h:120: warning: data definition has no type or storage class ./src/gdevx.h:140: error: syntax error before "background" ./src/gdevx.h:140: warning: type defaults to `int' in declaration of `background' ./src/gdevx.h:140: warning: type defaults to `int' in declaration of `foreground' ./src/gdevx.h:140: warning: data definition has no type or storage class ./src/gdevx.h:169: error: syntax error before "borderColor" ./src/gdevx.h:169: warning: type defaults to `int' in declaration of `borderColor' ./src/gdevx.h:169: warning: data definition has no type or storage class ./src/gdevx.h:170: error: syntax error before "borderWidth" ./src/gdevx.h:170: warning: type defaults to `int' in declaration of `borderWidth' ./src/gdevx.h:170: warning: data definition has no type or storage class ./src/gdevx.h:171: error: syntax error before "geometry" ./src/gdevx.h:171: warning: type defaults to `int' in declaration of `geometry' ./src/gdevx.h:171: warning: data definition has no type or storage class ./src/gdevx.h:173: error: syntax error before "palette" ./src/gdevx.h:173: warning: type defaults to `int' in declaration of `palette' ./src/gdevx.h:173: warning: data definition has no type or storage class ./src/gdevx.h:174: error: syntax error before "regularFonts" ./src/gdevx.h:174: warning: type defaults to `int' in declaration of `regularFonts' ./src/gdevx.h:174: warning: data definition has no type or storage class ./src/gdevx.h:175: error: syntax error before "symbolFonts" ./src/gdevx.h:175: warning: type defaults to `int' in declaration of `symbolFonts' ./src/gdevx.h:175: warning: data definition has no type or storage class ./src/gdevx.h:176: error: syntax error before "dingbatFonts" ./src/gdevx.h:176: warning: type defaults to `int' in declaration of `dingbatFonts' ./src/gdevx.h:176: warning: data definition has no type or storage class ./src/gdevx.h:180: error: syntax error before "useXFonts" ./src/gdevx.h:180: warning: type defaults to `int' in declaration of `useXFonts' ./src/gdevx.h:180: warning: type defaults to `int' in declaration of `useFontExtensions' ./src/gdevx.h:180: warning: type defaults to `int' in declaration of `useScalableFonts' ./src/gdevx.h:180: warning: type defaults to `int' in declaration of `logXFonts' ./src/gdevx.h:180: warning: data definition has no type or storage class ./src/gdevx.h:184: error: syntax error before "useBackingPixmap" ./src/gdevx.h:184: warning: type defaults to `int' in declaration of `useBackingPixmap' ./src/gdevx.h:184: warning: data definition has no type or storage class ./src/gdevx.h:185: error: syntax error before "useXPutImage" ./src/gdevx.h:185: warning: type defaults to `int' in declaration of `useXPutImage' ./src/gdevx.h:185: warning: data definition has no type or storage class ./src/gdevx.h:186: error: syntax error before "useXSetTile" ./src/gdevx.h:186: warning: type defaults to `int' in declaration of `useXSetTile' ./src/gdevx.h:186: warning: data definition has no type or storage class ./src/gdevx.h:225: error: syntax error before "XTextItem" ./src/gdevx.h:225: warning: no semicolon at end of struct or union ./src/gdevx.h:228: error: syntax error before '}' token ./src/gdevx.h:228: warning: type defaults to `int' in declaration of `text' ./src/gdevx.h:228: warning: data definition has no type or storage class ./src/gdevx.h:238: error: syntax error before '}' token ./src/gdevx.h:238: warning: type defaults to `int' in declaration of `gx_device_X' ./src/gdevx.h:238: warning: data definition has no type or storage class ./src/gdevx.h:246: error: syntax error before '*' token ./src/gdevx.h:246: warning: function declaration isn't a prototype ./src/gdevx.h:249: error: syntax error before '*' token ./src/gdevx.h:249: warning: function declaration isn't a prototype ./src/gdevx.h:250: error: syntax error before '*' token ./src/gdevx.h:250: warning: function declaration isn't a prototype ./src/gdevx.h:251: error: syntax error before '*' token ./src/gdevx.h:251: warning: function declaration isn't a prototype ./src/gdevx.h:259: error: syntax error before '*' token ./src/gdevx.h:259: warning: function declaration isn't a prototype ./src/gdevx.h:260: error: syntax error before '*' token ./src/gdevx.h:260: warning: function declaration isn't a prototype ./src/gdevx.h:261: error: syntax error before '*' token ./src/gdevx.h:261: warning: function declaration isn't a prototype ./src/gdevx.h:264: error: syntax error before '*' token ./src/gdevx.h:264: warning: function declaration isn't a prototype ./src/gdevx.h:265: error: syntax error before '*' token ./src/gdevx.h:265: warning: function declaration isn't a prototype ./src/gdevxalt.c:30: error: syntax error before "gs_x11_device" ./src/gdevxalt.c:30: warning: type defaults to `int' in declaration of `gs_x11_device' ./src/gdevxalt.c:30: warning: data definition has no type or storage class ./src/gdevxalt.c:31: error: syntax error before "gs_x11alpha_device" ./src/gdevxalt.c:31: warning: type defaults to `int' in declaration of `gs_x11alpha_device' ./src/gdevxalt.c:31: warning: data definition has no type or storage class ./src/gdevxalt.c: In function `x_wrap_get_params': ./src/gdevxalt.c:353: error: syntax error before "save_dev" ./src/gdevxalt.c:359: error: `save_dev' undeclared (first use in this function) ./src/gdevxalt.c:359: error: (Each undeclared identifier is reported only once ./src/gdevxalt.c:359: error: for each function it appears in.) ./src/gdevxalt.c:359: error: syntax error before ')' token ./src/gdevxalt.c:364: error: syntax error before ')' token ./src/gdevxalt.c: At top level: ./src/gdevxalt.c:853: warning: no previous prototype for 'gs_shared_init' ./src/gdevxalt.c: In function `gs_shared_init': ./src/gdevxalt.c:854: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:855: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:856: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:857: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:858: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:859: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:860: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:861: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c:862: warning: passing arg 1 of `gs_lib_register_device' from incompatible pointer type ./src/gdevxalt.c: At top level: ./src/gdevx.h:31: warning: array 'gdev_x_resources' assumed to have one element ./src/gdevx.h:33: warning: array 'gdev_x_fallback_resources' assumed to have one element make: *** [obj/gdevxalt.o] Error 1 !!! ERROR: app-text/ghostscript-esp-8.15.1 failed. Call stack: ebuild.sh, line 1894: Called dyn_compile ebuild.sh, line 941: Called src_compile !!! make failed !!! If you need support, post the topmost build error, and the call stack if relevant. # emerge info Gentoo Base System version 1.12.0_pre15 Portage 2.1_pre4-r1 (default-linux/x86/2005.0, gcc-3.4.5, glibc-2.3.6-r2, 2.6.13-gentoo-r3 i686) ================================================================= System uname: 2.6.13-gentoo-r3 i686 Celeron (Mendocino) distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] dev-lang/python: 2.4.2-r1 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="x86 ~x86" ACCEPT_LICENSE="" ARCH="x86" AUTOCLEAN="yes" BASH_ENV="/etc/spork/is/not/valid/profile.env" CBUILD="i686-pc-linux-gnu" CCACHE_SIZE="2G" CFLAGS="-march=pentium2 -Os -pipe" CHOST="i686-pc-linux-gnu" CLEAN_DELAY="5" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=pentium2 -Os -pipe" DISTCC_DIR="/var/tmp/portage/.distcc" DISTCC_VERBOSE="1" DISTDIR="/usr/portage/distfiles" ELIBC="glibc" EMERGE_WARNING_DELAY="10" FEATURES="autoconfig ccache distlocks fixpackages sandbox sfperms strict" FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P ${DISTDIR} ${URI}" GENTOO_MIRRORS="ftp://ftp.easynet.nl/mirror/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo" HOME="/root" KERNEL="linux" LOGNAME="root" LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.flac=01;35:*.mp3=01;35:*.mpc=00;36:*.ogg=00;36:*.wav=00;36:*.mid=00;36:*.midi=00;36:*.au=00;36:*.flac=00;36:*.aac=00;36:" MAKEOPTS="-j3" PATH="/sbin:/bin:/usr/sbin:/usr/bin" PKGDIR="/usr/portage/packages" PORTAGE_ARCHLIST="ppc s390 amd64 ppc64 m68k arm sparc sh mips ia64 alpha ppc-macos hppa x86" PORTAGE_BINHOST_CHUNKSIZE="3000" PORTAGE_CALLER="emerge" PORTAGE_GID="250" PORTAGE_MASTER_PID="30553" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/etc/portage/overlay" PRELINK_PATH="" PRELINK_PATH_MASK="" PWD="/root" RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P ${DISTDIR} ${URI}" RPMDIR="/usr/portage/rpm" RSYNC_RETRIES="3" RSYNC_TIMEOUT="180" SHELL="/bin/bash" SHLVL="1" SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage" TERM="xterm" USE="acl apache2 bash-completion berkdb bzip2 cjk crypt cups dba foomaticdb gd gdbm gif imap jpeg mime ncurses nls nptl nptlonly pam pcre perl pic png ppds python readline samba session slang ssl tcpd tiff truetype unicode utf8 vhosts x86 xml xml2 xsl zlib elibc_glibc kernel_linux userland_GNU" USER="root" USERLAND="GNU" USE_EXPAND="DVB_CARDS ELIBC FCDSL_CARDS FRITZCAPI_CARDS INPUT_DEVICES KERNEL LINGUAS USERLAND VIDEO_CARDS" USE_EXPAND_HIDDEN="" USE_ORDER="env:pkg:conf:defaults" XARGS="xargs -r" _="/usr/bin/emerge"
Can you please try to remove "--with-omni" from the ebuild? I suspect that has caused the problem.
The offending flag is "--enable-dynamic", which is probably not dynamic enough :) It builds fine with --with-omni, but I already had libxml2 installed.
I just committed a little diff, I hope it helps: --- ghostscript-esp-8.15.1.ebuild.orig 2006-02-06 07:18:31.000000000 +0100 +++ ghostscript-esp-8.15.1.ebuild 2006-02-06 07:21:20.000000000 +0100 @@ -16,7 +16,7 @@ LICENSE="GPL-2 LGPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" -IUSE="X cups cjk emacs gtk threads" +IUSE="X cups cjk emacs gtk threads xml" DEP="virtual/libc >=media-libs/jpeg-6b @@ -26,6 +26,7 @@ X? ( || ( x11-libs/libXt virtual/x11 ) ) gtk? ( >=x11-libs/gtk+-2.0 ) cups? ( >=net-print/cups-1.1.20 ) + xml? ( >=dev-libs/libxml2-2.6.8 ) !virtual/ghostscript" RDEPEND="${DEP} @@ -73,7 +74,7 @@ src_compile() { local myconf - myconf="--enable-dynamic --with-ijs --with-omni --with-jbig2dec" + myconf="--with-ijs --with-jbig2dec" # gs -DPARANOIDSAFER out.ps myconf="${myconf} --with-fontconfig --with-fontpath=/usr/share/fonts:/usr/share/fonts/ttf/zh_TW:/usr/share/fonts/ttf/zh_CN:/usr/share/fonts/arphicfonts:/usr/share/fonts/ttf/korean/baekmuk:/usr/share/fonts/baekmuk-fonts:/usr/X11R6/lib/X11/fonts/truetype:/usr/share/fonts/kochi-substitute" @@ -81,6 +82,8 @@ econf $(use_with X x) \ $(use_enable cups) \ $(use_enable threads) \ + $(use_enable X dynamic) \ + $(use_with xml omni) \ ${myconf} || die "econf failed" emake -j1 || die "make failed" emake so -j1 || die "make failed"
Even though it should, it doesn't fix it. It seems the --*-dynamic flag is broken. with --enable-dynamic, it wants the X11 headers with --disable-dynamic, it also wants the X11 headers Not sure what to make of it, but without $(use_enable X dynamic) ghostscript-esp emerges fine.
Upstream also has a bugreport concerning this issue http://www.cups.org/espgs/str.php?L1351+P0+S-2+C0+I0+E0+Q
Also found here with slightly different output to original poster: My use flags are for ghostscript-esp: USE="cups -X -cjk -emacs -gtk -threads% -xml%" 0 kB i686-pc-linux-gnu-gcc -DHAVE_MKSTEMP -DHAVE_HYPOT -O2 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wcast-qual -Wwrite-strings -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long" -O22 -march=athlon -ftracer -pipe -fomit-frame-pointer -DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"/usr/lib/ghostscript/8.15\" -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MALLOC_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_ST_BLOCKS=1 -DTIME_WITH_SYS_TIME=1 -DSIZEOF_UNSIGNED_LONG_INT=4 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_JPEGLIB_H=1 -DDONT_HAVE_JMEMSYS_H=1 -DHAVE_ZLIB_H=1 -DHAVE_PNG_H=1 -DX_DISPLAY_MISSING=1 -DHAVE_MKSTEMP=1 -DHAVE_HYPOT=1 -DHAVE_UNISTD_H=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DRETSIGTYPE=void -DLSTAT_FOLLOWS_SLASHED_SYMLINK=1 -DHAVE_VPRINTF=1 -DHAVE_BZERO=1 -DHAVE_DUP2=1 -DHAVE_FLOOR=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_MEMCHR=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_MKDIR=1 -DHAVE_MKFIFO=1 -DHAVE_MODF=1 -DHAVE_POW=1 -DHAVE_PUTENV=1 -DHAVE_RINT=1 -DHAVE_SETENV=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRERROR=1 -DHAVE_STRRCHR=1 -DHAVE_STRSPN=1 -DHAVE_STRSTR=1 -fPIC -shared -I./obj -I./src -o ./obj/gdevxalt.o -c ./src/gdevxalt.c In file included from ./src/gdevxalt.c:22: ./src/x_.h:135:24: X11/Xlib.h: No such file or directory ./src/x_.h:136:26: X11/Xproto.h: No such file or directory ./src/x_.h:137:25: X11/Xatom.h: No such file or directory ./src/x_.h:138:25: X11/Xutil.h: No such file or directory ./src/x_.h:139:29: X11/Intrinsic.h: No such file or directory ./src/x_.h:140:30: X11/StringDefs.h: No such file or directory ./src/x_.h:141:25: X11/Shell.h: No such file or directory distcc[1610] ERROR: compile ./src/gdevxalt.c on 192.168.0.248/1 failed make: *** [obj/gdevxalt.o] Error 1 !!! ERROR: app-text/ghostscript-esp-8.15.1 failed. Call stack: ebuild.sh, line 1894: Called dyn_compile ebuild.sh, line 941: Called src_compile !!! make failed !!! If you need support, post the topmost build error, and the call stack if relevant.
I removed the dynamic line completely, that should fix it.