summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2011-07-15 20:03:50 -0600
committerHenry Stiles <henry.stiles@artifex.com>2011-07-15 20:03:50 -0600
commit9b7298f794a4d9bdf5f2bc9dd8401cbfa458a018 (patch)
treebc6f4e7d31811f0807aa656afd1fb03722e5c99d
parent10fa3cdcae73e526d6279e5a70522d821d08469d (diff)
Autoconf changes for X11 and threads.
-rw-r--r--config.mak.in14
-rw-r--r--configure.ac45
-rw-r--r--main/pcl6_gcc.mak37
3 files changed, 63 insertions, 33 deletions
diff --git a/config.mak.in b/config.mak.in
index 784ab0cd6..ab6042ed3 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -2,3 +2,17 @@
CONFDEFS?=@HAVE_MKSTEMP@ @HAVE_SSE2@ @HAVE_BSWAP32@ @HAVE_BYTESWAP_H@
+
+STDLIBS?=@PTHREAD_LIBS@ -lm
+
+SYNC?=@SYNC@
+
+XINCLUDE?=@XINCLUDE@
+XLIBDIRS?=@XLIBDIRS@
+XLIBDIR?=@XLIBDIR@
+XLIBS?=@XLIBS@
+X11DEVS?=@X11DEVS@
+
+
+
+
diff --git a/configure.ac b/configure.ac
index ac8c34ba4..70a475173 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,4 +140,49 @@ AC_ARG_ENABLE([byteswap-h], AC_HELP_STRING([--disable-byteswap-h],
AC_SUBST(HAVE_BYTESWAP_H)
+dnl --------------------------------------------------
+dnl Check for libraries and x11 includes/libraries
+dnl --------------------------------------------------
+
+SYNC="nosync"
+PTHREAD_LIBS=""
+AC_CHECK_LIB(pthread, pthread_create, [
+ SYNC=posync;
+ PTHREAD_LIBS="-lpthread"
+])
+AC_SUBST(SYNC)
+AC_SUBST(PTHREAD_LIBS)
+
+AC_PATH_X
+
+XINCLUDE=""
+XLIBDIRS=""
+XLIBDIR=""
+XLIBS=""
+X11DEVS=""
+
+if test -z "$no_x"; then
+ # workaround autoconf bug which used to depend on xmkmf to set the
+ # $x_includes directory. Danger quadrigraph ahead!
+ if test ! -z "$x_libraries && test -z "$x_includes; then
+ includedir="include"
+ x_includes=$(echo $x_libraries | sed 's|@<:@^/@:>@*$||')
+ x_includes="$x_includes$includedir"
+ fi
+ if test ! -z "$x_includes"; then
+ XINCLUDE=-I$x_includes
+ fi
+ if test ! -z "$x_libraries"; then
+ XLIBDIRS=-L$x_libraries
+ XLIBDIR=-L$x_libraries
+ fi
+ XLIBS="Xt SM ICE Xext X11"
+ X11DEVS='$(DD)x11.dev $(DD)x11alpha.dev $(DD)x11mono.dev $(DD)x11cmyk.dev'
+fi
+
+AC_SUBST(XINCLUDE)
+AC_SUBST(XLIBDIRS)
+AC_SUBST(XLIBDIR)
+AC_SUBST(XLIBS)
+AC_SUBST(X11DEVS)
AC_OUTPUT(config.mak)
diff --git a/main/pcl6_gcc.mak b/main/pcl6_gcc.mak
index 0b70da047..752701322 100644
--- a/main/pcl6_gcc.mak
+++ b/main/pcl6_gcc.mak
@@ -16,15 +16,9 @@ MAKEFILE+= ../main/pcl6_gcc.mak
# PL_SCALER?=ufst
PL_SCALER?=afs
-# if 1 this will build the x11 devices.
-WANT_X11?=1
-
# Embed the fonts in the executable.
BUNDLE_FONTS?=1
-# define if this is a cygwin system, we should get rid of this.
-CYGWIN?=
-
# extra cflags
XCFLAGS?=
@@ -128,6 +122,8 @@ XPSOBJDIR?=$(GENDIR)
SVGGENDIR?=$(GENDIR)
SVGOBJDIR?=$(GENDIR)
+DD?=$(GLGENDIR)/
+
TARGET_DEVS?=$(PXLOBJDIR)/pjl.dev $(PXLOBJDIR)/pxl.dev $(PCLOBJDIR)/pcl5c.dev $(PCLOBJDIR)/hpgl2c.dev
TARGET_XE?=$(GENDIR)/pcl6
TARGET_LIB?=$(GENDIR)/pcl6.a
@@ -204,17 +200,9 @@ GCFLAGS?=-Wall -Wundef -Wstrict-prototypes -Wmissing-declarations \
CFLAGS?= $(GCFLAGS) $(XCFLAGS)
-XINCLUDE?=-I/usr/X11R6/include
-XLIBDIRS?=-L/usr/X11R6/lib
-XLIBDIR?=
-XLIBS?=Xt SM ICE Xext X11
-
CCLD?=gcc
-DD?=$(GLGENDIR)/
-
-
-DEVICES_DEVS?=$(DD)ljet4.dev $(DD)djet500.dev $(DD)cljet5pr.dev $(DD)cljet5c.dev\
+DEVICE_DEVS?=$(DD)ljet4.dev $(DD)djet500.dev $(DD)cljet5pr.dev $(DD)cljet5c.dev\
$(DD)bit.dev $(DD)bitcmyk.dev $(DD)bitrgb.dev $(DD)bitrgbtags.dev \
$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcxcmyk.dev $(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev\
$(DD)pamcmyk32.dev $(DD)pamcmyk4.dev\
@@ -228,6 +216,7 @@ DEVICES_DEVS?=$(DD)ljet4.dev $(DD)djet500.dev $(DD)cljet5pr.dev $(DD)cljet5c.dev
$(DD)png16m.dev $(DD)pngmono.dev $(DD)pngmonod.dev $(DD)jpeg.dev\
$(DD)plan.dev $(DD)planm.dev $(DD)plang.dev $(DD)planc.dev $(DD)plank.dev\
$(DD)wtscmyk.dev $(DD)wtsimdi.dev\
+ $(X11DEVS)\
$(DD)romfs$(COMPILE_INITS).dev
FEATURE_DEVS?=$(DD)colimlib.dev $(DD)dps2lib.dev $(DD)path1lib.dev\
@@ -239,24 +228,6 @@ FEATURE_DEVS?=$(DD)colimlib.dev $(DD)dps2lib.dev $(DD)path1lib.dev\
$(DD)cidlib.dev $(DD)psf0lib.dev $(DD)psf1lib.dev $(DD)psf2lib.dev\
$(DD)lzwd.dev $(DD)sicclib.dev
-# cygwin does not have threads at this time, so we don't include the
-# thread library
-ifeq ($(CYGWIN), TRUE)
- SYNC=nosync
- CFLAGS+=-DHAVE_STDINT_H
- STDLIBS=-lm
-else
- SYNC=posync
- # some systems may need -ldl as well as pthread
- STDLIBS=-lm -lpthread -ldl
-endif
-
-ifeq ($(WANT_X11), 1)
- DEVICE_DEVS?=$(DD)x11.dev $(DD)x11alpha.dev $(DD)x11mono.dev $(DD)x11cmyk.dev $(DEVICES_DEVS)
-else
- DEVICE_DEVS?=$(DEVICES_DEVS)
-endif
-
#miscellaneous
XOBJS?=$(GLOBJDIR)/gsargs.o $(GLOBJDIR)/gconfig.o $(GLOBJDIR)/gscdefs.o