Do not #include when not used (might not exits). Use defined(DISABLE_GS) instead of DISABLE_GS, to avoid gcc preprocessor warning (-Wundef). diff -ur dvisvgm-0.8.7.orig/src/DVIToSVG.cpp dvisvgm-0.8.7/src/DVIToSVG.cpp --- dvisvgm-0.8.7.orig/src/DVIToSVG.cpp 2009-11-09 17:36:55.000000000 +0100 +++ dvisvgm-0.8.7/src/DVIToSVG.cpp 2009-11-18 00:30:05.000000000 +0100 @@ -18,6 +18,13 @@ ** along with this program; if not, see . ** *************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#define VERSION_STR VERSION " (" TARGET_SYSTEM ")" +#else +#define VERSION_STR "" +#endif + #include #include #include @@ -50,20 +57,13 @@ #include "DvisvgmSpecialHandler.h" #include "EmSpecialHandler.h" //#include "HtmlSpecialHandler.h" -#if !DISABLE_GS +#if !defined(DISABLE_GS) #include "PsSpecialHandler.h" #endif #include "TpicSpecialHandler.h" /////////////////////////////////// -#ifdef HAVE_CONFIG_H -#include "config.h" -#define VERSION_STR VERSION " (" TARGET_SYSTEM ")" -#else -#define VERSION_STR "" -#endif - using namespace std; // static class variables diff -ur dvisvgm-0.8.7.orig/src/Ghostscript.cpp dvisvgm-0.8.7/src/Ghostscript.cpp --- dvisvgm-0.8.7.orig/src/Ghostscript.cpp 2009-11-06 22:17:58.000000000 +0100 +++ dvisvgm-0.8.7/src/Ghostscript.cpp 2009-11-18 00:30:50.000000000 +0100 @@ -19,7 +19,7 @@ *************************************************************************/ #include "Ghostscript.h" -#if !DISABLE_GS +#if !defined(DISABLE_GS) #include #include diff -ur dvisvgm-0.8.7.orig/src/Ghostscript.h dvisvgm-0.8.7/src/Ghostscript.h --- dvisvgm-0.8.7.orig/src/Ghostscript.h 2009-11-06 22:17:58.000000000 +0100 +++ dvisvgm-0.8.7/src/Ghostscript.h 2009-11-18 00:33:30.000000000 +0100 @@ -26,7 +26,9 @@ #endif #include -#if HAVE_LIBGS +#if defined(DISABLE_GS) + #include "iapi.h" +#elif HAVE_LIBGS #include #else #include "DLLoader.h" @@ -37,7 +39,7 @@ #define _Windows #endif -#if DISABLE_GS +#if defined(DISABLE_GS) struct Ghostscript { typedef int (GSDLLCALLPTR Stdin) (void *caller, char *buf, int len);