From ebe0bcc9014624247112ab45bfd3f2fba19f652b Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Sun, 22 Jan 2012 09:14:31 +0530 Subject: [PATCH] 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 980537c505..976b863159 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 ################## @@ -2303,6 +2322,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 83738c1f78..ac40506e01 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 500a50730b..f62323530f 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 },