[gimp/metadata-browser] build: Add check for Ghostscript



commit 93b8e1797c0f1b98decb1da90d711f798632de28
Author: Mukund Sivaraman <muks banu com>
Date:   Sun Jan 22 09:14:31 2012 +0530

    build: Add check for Ghostscript

 configure.ac                   |   20 ++++++++++++++++++++
 plug-ins/common/Makefile.am    |    4 +++-
 plug-ins/common/plugin-defs.pl |    2 +-
 3 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b3362a9..3425d43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1171,6 +1171,25 @@ if test "x$have_zlib" = xyes && test "x$have_libbzip2" = xyes; then
    have_compressor=yes
 fi
 
+
+###############################
+# Check for Ghostscript library
+###############################
+
+have_gs=yes
+if test -z "$GS_LIBS"; then
+  AC_CHECK_LIB(gs, gsapi_new_instance,
+    [AC_CHECK_HEADER(ghostscript/iapi.h,
+      FILE_PS='file-ps$(EXEEXT)'; GS_LIBS='-lgs',
+      [have_gs="no (Ghostscript header files not found)"])],
+    [have_gs="no (Ghostscript library not found)"])
+fi
+
+AC_SUBST(FILE_PS)
+AM_CONDITIONAL(HAVE_GS, test "x$have_gs" = xyes)
+AC_SUBST(GS_LIBS)
+
+
 ##################
 # Check for libpng
 ##################
@@ -2305,6 +2324,7 @@ Optional Features:
 Optional Plug-Ins:
   Ascii Art:           $have_libaa
   Compressor:          $have_compressor
+  Ghostscript:         $have_gs
   Help Browser:        $have_webkit
   LCMS:                $have_lcms
   JPEG:                $jpeg_ok
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index 83738c1..ac40506 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -111,7 +111,7 @@ libexec_PROGRAMS = \
 	file-pix \
 	$(FILE_PNG) \
 	file-pnm \
-	file-ps \
+	$(FILE_PS) \
 	$(FILE_PSP) \
 	file-raw \
 	file-sunras \
@@ -196,6 +196,7 @@ EXTRA_PROGRAMS = \
 	file-pdf-load \
 	file-pdf-save \
 	file-png \
+	file-ps \
 	file-psp \
 	file-svg \
 	file-tiff-load \
@@ -1381,6 +1382,7 @@ file_ps_LDADD = \
 	$(libgimpcolor)		\
 	$(libgimpbase)		\
 	$(GTK_LIBS)		\
+	$(GS_LIBS)		\
 	$(RT_LIBS)		\
 	$(INTLLIBS)		\
 	$(file_ps_RC)
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index 500a507..f623235 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -67,7 +67,7 @@
     'file-pnm' => { ui => 1 },
     'file-pdf-load' => { ui => 1, optional => 1, libs => 'POPPLER_LIBS', cflags => 'POPPLER_CFLAGS' },
     'file-pdf-save' => { ui => 1, optional => 1, libs => 'CAIRO_PDF_LIBS', cflags => 'CAIRO_PDF_CFLAGS' },
-    'file-ps' => { ui => 1 },
+    'file-ps' => { ui => 1, optional => 1, libs => 'GS_LIBS' },
     'file-psp' => { ui => 1, optional => 1, libs => 'Z_LIBS' },
     'file-raw' => { ui => 1 },
     'file-sunras' => { ui => 1 },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]