Disabling Ghostscript support

"[email protected]" <[email protected]> Thu, 23 Jul 2020 11:46:28 +0200
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
Hello

I was trying to disable Ghostcript support and came up with a patch (attached).

- But gm convert -list delegates still shows formats using gs.
Does delegates.mgk should be modified or coders should make use of HAVE_GS/HAVE_PS macro?

- Is it possible to disable conversion delegation at all, other than deleting delegates.mgk file?

--

Best regards

Przemysław Sobala

_______________________________________________
Graphicsmagick-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help
disable_gs.patch (application/octet-stream, 1.9 KB)
diff -r 6e6b1d7d1d8a configure.ac
--- a/configure.ac	Mon Jul 20 09:47:43 2020 -0500
+++ b/configure.ac	Thu Jul 23 11:40:40 2020 +0200
@@ -817,6 +817,16 @@
   DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
 fi
 
+# Disable Ghostscript
+AC_ARG_WITH(gs,
+              AS_HELP_STRING([--without-gs],
+                             [disable Ghostscript support]),
+              [with_gs=$withval],
+              [with_gs='yes'])
+if test "$with_gs" != 'yes' ; then
+    DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs=$with_gs "
+fi
+
 # Set Ghostscript font directory
 AC_ARG_WITH(gs-font-dir,
               AS_HELP_STRING([--with-gs-font-dir=DIR],
@@ -2999,7 +3009,7 @@
 
 # Set delegate booleans
 have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes' ; fi
-have_gs='no'      ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes' ; fi
+have_gs='no'      ; if test "$with_gs" = "yes" && test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes' ; fi
 have_hp2xx='no'   ; if test "$HPGLDecodeDelegate" !=  "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes' ; fi
 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes' ; fi
 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes' ; fi
@@ -3761,7 +3771,7 @@
 printf "DPS               --with-dps=$with_dps          \t$have_dps\n"
 printf "FlashPIX          --with-fpx=$with_fpx          \t$have_fpx\n"
 printf "FreeType 2.0      --with-ttf=$with_ttf          \t$have_ttf\n"
-printf "Ghostscript       None                  \t$PSDelegate ($GSVersion)\n"
+printf "Ghostscript       --with-gs=$with_gs            \t$have_gs ($PSDelegate $GSVersion)\n"
 result_ghostscript_font_dir='none'
 if test "${ghostscript_font_dir}x" != 'x'
 then