[kaffe] CVS kaffe (robilad): Check for libgif if libungif is not found

Kaffe CVS cvs-commits at kaffe.org
Tue Sep 20 14:49:25 PDT 2005


PatchSet 6922 
Date: 2005/09/20 21:44:38
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Check for libgif if libungif is not found

2005-09-20  Dalibor Topic  <robilad at kaffe.org>

* configure.ac: Check for libgif if libungif is not found.
It's a different name for the library, apparently.

Reported by:  Riccardo Mottola  <riccardo at kaffe.org>

Members: 
	ChangeLog:1.4444->1.4445 
	configure:1.491->1.492 
	configure.ac:1.172->1.173 
	config/config.h.in:1.152->1.153 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4444 kaffe/ChangeLog:1.4445
--- kaffe/ChangeLog:1.4444	Tue Sep 20 19:53:41 2005
+++ kaffe/ChangeLog	Tue Sep 20 21:44:38 2005
@@ -1,5 +1,12 @@
 2005-09-20  Dalibor Topic  <robilad at kaffe.org>
 
+	* configure.ac: Check for libgif if libungif is not found.
+	It's a different name for the library, apparently.
+
+	Reported by:  Riccardo Mottola  <riccardo at kaffe.org>
+
+2005-09-20  Dalibor Topic  <robilad at kaffe.org>
+
 	* FAQ/FAQ.classlibrary-compile:
 	Added information on how to obtain Kaffe's patched kjc's
 	source code.
Index: kaffe/configure
diff -u kaffe/configure:1.491 kaffe/configure:1.492
--- kaffe/configure:1.491	Tue Sep 20 02:17:28 2005
+++ kaffe/configure	Tue Sep 20 21:44:42 2005
@@ -46574,6 +46574,88 @@
 GIF_LIBS=`echo "$LIBS" | sed "s% $KSAVE_LIBS$%%"`
 LIBS="$KSAVE_LIBS"
 
+           # If libungif can not be found, check for libgif
+	   if test x"$ac_cv_lib_ungif_DGifOpen" != x"yes"; then
+	     KSAVE_LIBS="$LIBS"
+LIBS="$GIF_LIBS $KSAVE_LIBS"
+
+echo "$as_me:$LINENO: checking for DGifOpen in -lgif" >&5
+echo $ECHO_N "checking for DGifOpen in -lgif... $ECHO_C" >&6
+if test "${ac_cv_lib_gif_DGifOpen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgif  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char DGifOpen ();
+int
+main ()
+{
+DGifOpen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gif_DGifOpen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_gif_DGifOpen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_gif_DGifOpen" >&5
+echo "${ECHO_T}$ac_cv_lib_gif_DGifOpen" >&6
+if test $ac_cv_lib_gif_DGifOpen = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGIF 1
+_ACEOF
+
+  LIBS="-lgif $LIBS"
+
+fi
+
+GIF_LIBS=`echo "$LIBS" | sed "s% $KSAVE_LIBS$%%"`
+LIBS="$KSAVE_LIBS"
+
+           fi
         fi
 
 	LIBS=$OLIBS
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.172 kaffe/configure.ac:1.173
--- kaffe/configure.ac:1.172	Tue Sep 20 02:17:29 2005
+++ kaffe/configure.ac	Tue Sep 20 21:44:50 2005
@@ -1715,6 +1715,10 @@
 	if test x"$kaffe_cv_gif_lib_version" = x"yes"; then
 	   AC_DEFINE(HAVE_GIF_LIB_H, 1, [Do we have the right version of libungif])
 	   AC_CHECK_LIBRARY(ungif,DGifOpen,GIF_LIBS)
+           # If libungif can not be found, check for libgif
+	   if test x"$ac_cv_lib_ungif_DGifOpen" != x"yes"; then
+	     AC_CHECK_LIBRARY(gif,DGifOpen,GIF_LIBS)
+           fi
         fi
 
 	LIBS=$OLIBS
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.152 kaffe/config/config.h.in:1.153
--- kaffe/config/config.h.in:1.152	Thu Sep 15 03:35:48 2005
+++ kaffe/config/config.h.in	Tue Sep 20 21:44:50 2005
@@ -275,6 +275,9 @@
 /* Define to 1 if you have the `gcc' library (-lgcc). */
 #undef HAVE_LIBGCC
 
+/* Define to 1 if you have the `gif' library (-lgif). */
+#undef HAVE_LIBGIF
+
 /* Define to 1 if you have the `jpeg' library (-ljpeg). */
 #undef HAVE_LIBJPEG
 




More information about the kaffe mailing list