From: Christophe CURIS <[email protected]>

The use of the conditionals provided by autotools provides a better result
as they avoid unnecessary compilation.

Signed-off-by: Christophe CURIS <[email protected]>
---
 m4/wm_imgfmt_check.m4 | 3 ++-
 wrlib/Makefile.am     | 6 ++++--
 wrlib/gif.c           | 4 ----
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/m4/wm_imgfmt_check.m4 b/m4/wm_imgfmt_check.m4
index 4c44b7a..ef3f478 100644
--- a/m4/wm_imgfmt_check.m4
+++ b/m4/wm_imgfmt_check.m4
@@ -64,7 +64,8 @@ AS_IF([test "x$enable_gif" = "xno"],
          AC_DEFINE_UNQUOTED([USE_GIF],
            [1],
            [defined when valid GIF library with header was found])])
-    ])dnl
+    ])
+    AM_CONDITIONAL([USE_GIF], [test "x$enable_gif" != "xno"])dnl
 ]) dnl AC_DEFUN
 
 
diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am
index c98a60f..dc379a1 100644
--- a/wrlib/Makefile.am
+++ b/wrlib/Makefile.am
@@ -40,9 +40,11 @@ libwraster_la_SOURCES =      \
        ppm.c           \
        png.c           \
        jpeg.c          \
-       tiff.c          \
-       gif.c
+       tiff.c
 
+if USE_GIF
+libwraster_la_SOURCES += gif.c
+endif
 
 LTCOMPILE2=`echo $(LTCOMPILE) | sed -e s/-fomit-frame-pointer//`
 COMPILE2=`echo $(COMPILE) | sed -e s/-fomit-frame-pointer//`
diff --git a/wrlib/gif.c b/wrlib/gif.c
index ebd8729..e1b1a73 100644
--- a/wrlib/gif.c
+++ b/wrlib/gif.c
@@ -22,8 +22,6 @@
 
 #include <config.h>
 
-#ifdef USE_GIF
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -209,5 +207,3 @@ RImage *RLoadGIF(const char *file, int index)
 
        return image;
 }
-
-#endif                         /* USE_GIF */
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to