summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Garrigues <bertrand.garrigues@laposte.net>2014-09-01 00:54:13 +0200
committerBertrand Garrigues <bertrand.garrigues@laposte.net>2014-09-01 00:54:13 +0200
commit2235499abc144ca01754ec6588b7a460e3ebf2c4 (patch)
treea9261372f10ef156f30400a667e6c0f6a31c147f
parentad2e14b709270ba81260a31c9854a2d7feffc44d (diff)
downloadgroff-git-2235499abc144ca01754ec6588b7a460e3ebf2c4.tar.gz
Add automake conditional to build without X support
-rw-r--r--TESTS19
-rw-r--r--configure.ac10
-rw-r--r--font/devX100-12/devX100-12.am2
-rw-r--r--font/devX100/devX100.am2
-rw-r--r--font/devX75-12/devX75-12.am4
-rw-r--r--font/devX75/devX75.am2
-rw-r--r--src/devices/xditview/xditview.am9
-rw-r--r--src/libs/libxutil/libxutil.am3
-rw-r--r--src/utils/xtotroff/xtotroff.am4
9 files changed, 51 insertions, 4 deletions
diff --git a/TESTS b/TESTS
index 6bd036c9d..f7e270965 100644
--- a/TESTS
+++ b/TESTS
@@ -322,9 +322,28 @@ the install tree).
- All phases now succeed
+3. Additional tests
+
+3.1 Build without X support
+
+ Calling configure with option --without-x doesn't build:
+ - gxidview
+ - libxutil.a
+ - xtotroff
+
+ The following fonts are not installed:
+ - dev/X100
+ - devX100-12
+ - devX75
+ - devX75-12
+
+ 'make distcheck' passes correctly, and the tarball generated by
+ 'make dist' is identical to the one generated with X support.
+
Notes
-----
- Gnulib: some files of src/libs/libgroff could be replaced by their
gnulib equivalent
- Gnulib: git-version-gen could be used
+
diff --git a/configure.ac b/configure.ac
index bb02e3254..7ceec6098 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,16 @@ GROFF_PNMTOPS_NOSETPAGE
gl_GLIBC21
gl_LOCALCHARSET
+# If X11 is not available, don't build:
+# font/devX75
+# font/devX75-12
+# font/devX100
+# font/devX100-12
+# src/devices/xditview
+# src/utils/xtotroff
+# src/libs/libxutil
+AM_CONDITIONAL([WITHOUT_X11], [test "x$groff_no_x" = "xyes"])
+
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/font/devX100-12/devX100-12.am b/font/devX100-12/devX100-12.am
index 6da28fc92..6a576ce52 100644
--- a/font/devX100-12/devX100-12.am
+++ b/font/devX100-12/devX100-12.am
@@ -18,7 +18,9 @@ DEVX10012FONTS = \
font/devX100-12/NBI \
font/devX100-12/S
+if !WITHOUT_X11
devX10012fontdir = $(fontdir)/devX100-12
devX10012font_DATA = $(DEVX10012FONTS)
+endif
EXTRA_DIST += $(DEVX10012FONTS)
diff --git a/font/devX100/devX100.am b/font/devX100/devX100.am
index 057c83d71..4f319539e 100644
--- a/font/devX100/devX100.am
+++ b/font/devX100/devX100.am
@@ -18,7 +18,9 @@ DEVX100FONTS = \
font/devX100/NBI \
font/devX100/S
+if !WITHOUT_X11
devX100fontdir = $(fontdir)/devX100
devX100font_DATA = $(DEVX100FONTS)
+endif
EXTRA_DIST += $(DEVX100FONTS)
diff --git a/font/devX75-12/devX75-12.am b/font/devX75-12/devX75-12.am
index 055e4e9e5..dcd2f3ee0 100644
--- a/font/devX75-12/devX75-12.am
+++ b/font/devX75-12/devX75-12.am
@@ -17,8 +17,8 @@ DEVX7512FONTS = \
font/devX75-12/NB \
font/devX75-12/NBI \
font/devX75-12/S
-
+if !WITHOUT_X11
devX7512fontdir = $(fontdir)/devX75-12
devX7512font_DATA = $(DEVX7512FONTS)
-
+endif
EXTRA_DIST += $(DEVX7512FONTS)
diff --git a/font/devX75/devX75.am b/font/devX75/devX75.am
index 9e8c78cce..8f3c7e67f 100644
--- a/font/devX75/devX75.am
+++ b/font/devX75/devX75.am
@@ -18,7 +18,9 @@ DEVX75FONTS = \
font/devX75/NBI \
font/devX75/S
+if !WITHOUT_X11
devX75fontdir = $(fontdir)/devX75
devX75font_DATA = $(DEVX75FONTS)
+endif
EXTRA_DIST += $(DEVX75FONTS)
diff --git a/src/devices/xditview/xditview.am b/src/devices/xditview/xditview.am
index 75dda1d97..93f291cd9 100644
--- a/src/devices/xditview/xditview.am
+++ b/src/devices/xditview/xditview.am
@@ -30,6 +30,9 @@ GXDITVIEWSOURCES = \
src/devices/xditview/Menu.h \
src/devices/xditview/Dvi.h
+if WITHOUT_X11
+EXTRA_DIST += $(GXDITVIEWSOURCES)
+else
xditview_srcdir = $(top_srcdir)/src/devices/xditview
bin_PROGRAMS += gxditview
gxditview_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS) -Dlint \
@@ -51,6 +54,7 @@ src/devices/xditview/gxditview-xditview.$(OBJEXT): $(XDITVIEW_GENHDRS)
src/devices/xditview/GXditview-ad.h: $(xditview_srcdir)/GXditview.ad
@echo Making $@
$(SHELL) $(xditview_srcdir)/ad2c $(xditview_srcdir)/GXditview.ad > $@
+endif
EXTRA_DIST += \
src/devices/xditview/ad2c \
@@ -77,6 +81,10 @@ EXTRA_DIST += \
install-data-local: install_xditview
uninstall-local: uninstall_xditview
+if WITHOUT_X11
+install_xditview:
+uninstall_xditview:
+else
install_xditview: $(xditview_srcdir)/GXditview.ad $(xditview_srcdir)/GXditview-color.ad
-test -d $(DESTDIR)$(appresdir) \
|| $(mkinstalldirs) $(DESTDIR)$(appresdir)
@@ -97,3 +105,4 @@ uninstall_xditview:
rm -f $(DESTDIR)$(appresdir)/GXditview
rm -f $(DESTDIR)$(appresdir)/GXditview-color
+endif
diff --git a/src/libs/libxutil/libxutil.am b/src/libs/libxutil/libxutil.am
index bca14505c..9962e4cde 100644
--- a/src/libs/libxutil/libxutil.am
+++ b/src/libs/libxutil/libxutil.am
@@ -1,7 +1,8 @@
-# TODO: X management
+if !WITHOUT_X11
noinst_LIBRARIES += libxutil.a
libxutil_a_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS)
libxutil_a_SOURCES = \
src/libs/libxutil/DviChar.c \
src/libs/libxutil/XFontName.c \
src/libs/libxutil/xmalloc.c
+endif
diff --git a/src/utils/xtotroff/xtotroff.am b/src/utils/xtotroff/xtotroff.am
index 7a76584d8..b6876474f 100644
--- a/src/utils/xtotroff/xtotroff.am
+++ b/src/utils/xtotroff/xtotroff.am
@@ -1,8 +1,10 @@
+if !WITHOUT_X11
bin_PROGRAMS += xtotroff
man1_MANS += src/utils/xtotroff/xtotroff.n
-EXTRA_DIST += src/utils/xtotroff/xtotroff.man
xtotroff_SOURCES = src/utils/xtotroff/xtotroff.c
XLIBS=$(LIBXUTIL) $(LIBGROFF)
xtotroff_LDADD = libxutil.a libgroff.a $(X_LIBS) $(X_PRE_LIBS) \
-lXaw -lXt -lX11 $(X_EXTRA_LIBS) $(LIBM)
xtotroff_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS)
+endif
+EXTRA_DIST += src/utils/xtotroff/xtotroff.man