changeset 4528:353efa800ebe

Support building using system giflib (USE_SYSTEM_GIF, GIF_CFLAGS, GIF_LIBS)
author andrew
date Thu, 04 Aug 2011 05:05:30 +0100
parents 4a96e2fb4ca2
children 4da6bd3bb35e
files make/jdk_generic_profile.sh make/sun/splashscreen/FILES_c.gmk make/sun/splashscreen/Makefile src/share/native/sun/awt/splashscreen/splashscreen_gif.c
diffstat 4 files changed, 29 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/make/jdk_generic_profile.sh	Thu Aug 04 04:05:44 2011 +0100
+++ b/make/jdk_generic_profile.sh	Thu Aug 04 05:05:30 2011 +0100
@@ -442,8 +442,17 @@
 export PNG_CFLAGS
 export PNG_LIBS
 
+# Export variables for system giflib
+# GIF_CFLAGS and GIF_LIBS tell the compiler how to compile and
+# link against giflib
+if [ "${GIF_LIBS}" = "" ] ; then
+    GIF_LIBS="-lgif"
+fi
+export GIF_LIBS
+
 # IcedTea defaults; use system libraries
 export USE_SYSTEM_LCMS=true
 export USE_SYSTEM_ZLIB=true
 export USE_SYSTEM_JPEG=true
 export USE_SYSTEM_PNG=true
+export USE_SYSTEM_GIF=true
--- a/make/sun/splashscreen/FILES_c.gmk	Thu Aug 04 04:05:44 2011 +0100
+++ b/make/sun/splashscreen/FILES_c.gmk	Thu Aug 04 05:05:30 2011 +0100
@@ -30,10 +30,7 @@
 	splashscreen_impl.c \
 	splashscreen_jpeg.c \
 	splashscreen_png.c \
-	splashscreen_sys.c \
-	dgif_lib.c \
-	gif_err.c \
-	gifalloc.c
+	splashscreen_sys.c
 
 ifndef USE_SYSTEM_ZLIB
 FILES_c += \
@@ -117,3 +114,10 @@
 	pngwtran.c \
 	pngwutil.c
 endif
+
+ifndef USE_SYSTEM_GIF
+FILES_c += \
+	dgif_lib.c \
+	gif_err.c \
+	gifalloc.c
+endif
--- a/make/sun/splashscreen/Makefile	Thu Aug 04 04:05:44 2011 +0100
+++ b/make/sun/splashscreen/Makefile	Thu Aug 04 05:05:30 2011 +0100
@@ -74,6 +74,9 @@
   ifdef USE_SYSTEM_PNG
     OTHER_LDLIBS += $(PNG_LIBS)
   endif
+  ifdef USE_SYSTEM_GIF
+    OTHER_LDLIBS += $(GIF_LIBS)
+  endif
 else # PLATFORM
   CFLAGS += -DWITH_WIN32
   OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll
@@ -85,7 +88,9 @@
 #
 vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/splashscreen
 vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)
-vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/giflib
+ifndef USE_SYSTEM_GIF
+  vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/giflib
+endif
 ifndef USE_SYSTEM_ZLIB
   vpath %.c   $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
 endif
@@ -111,6 +116,11 @@
 else
   CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/libpng
 endif
+ifdef USE_SYSTEM_GIF
+  CPPFLAGS += $(GIF_CFLAGS)
+else
+  CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/giflib
+endif
 
 # Shun the less than portable MMX assembly code in pnggccrd.c,
 # and use alternative implementations in C.
--- a/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	Thu Aug 04 04:05:44 2011 +0100
+++ b/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	Thu Aug 04 05:05:30 2011 +0100
@@ -26,7 +26,7 @@
 #include "splashscreen_impl.h"
 #include "splashscreen_gfx.h"
 
-#include "../giflib/gif_lib.h"
+#include <gif_lib.h>
 
 #define GIF_TRANSPARENT     0x01
 #define GIF_USER_INPUT      0x02