W3C home > Mailing lists > Public > www-amaya@w3.org > April to June 2000

Re: libs jpeg, png, and z; why are they compiled in?

From: H. Nanosecond <aldomel@ix.netcom.com>
Date: Mon, 17 Apr 2000 20:43:40 -0400 (EDT)
Message-Id: <200004180043.UAA28890@smtp10.atl.mindspring.net>
To: Irene.Vatton@inrialpes.fr
CC: www-amaya@w3.org
Oh that makes sense. Here is a bit that can let configure try to find
the correct verisions, thanks. the option --with-included-jpeg turns it off.



diff --recursive -u --exclude=mybuild Amaya-original/amaya/Makefile.in Amaya/amaya/Makefile.in
--- Amaya-original/amaya/Makefile.in	Tue Mar  7 11:45:48 2000
+++ Amaya/amaya/Makefile.in	Mon Apr 17 17:46:51 2000
@@ -84,13 +84,13 @@
 ../tablelib/libThotTable.a : force
 	@(cd ../tablelib ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" libThotTable)
 
-../libjpeg.a : force
+../libjpeg.a : @MAKEJPEG@ force
 	@(cd ../libjpeg ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)")
 
-../libpng.a : force
+../libpng.a : @MAKEPNG@ force
 	@(cd ../libpng ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)")
 
-../libz.a : force
+../libz.a : @MAKEPNG@ force
 	@(cd ../libpng/zlib ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)")
 
 ../tools/mkdep/mkdep : 
@@ -161,7 +161,7 @@
 
 AMAYA_LIBS= ../thotlib/libThotEditor.a ../tablelib/libThotTable.a \
             libCSS.a $(AMAYA_OPTION_LIBS) \
-            ../libpng.a ../libz.a ../libjpeg.a
+            @LIBPNG@ @LIBZ@ @LIBJPEG@
 
 HTML2THOT_LIBS= -L../thotlib/ -lThotKernel -L.. -lz
 
diff --recursive -u --exclude=mybuild Amaya-original/thotlib/image/jpeghandler.c Amaya/thotlib/image/jpeghandler.c
--- Amaya-original/thotlib/image/jpeghandler.c	Mon Mar  6 03:43:35 2000
+++ Amaya/thotlib/image/jpeghandler.c	Mon Apr 17 18:05:20 2000
@@ -30,7 +30,12 @@
 #include "application.h"
 #include "jconfig.h"
 
-#include "jinclude.h"
+/* #include "jinclude.h" 
+why is this included? it isn't installed on most systems so makes an error
+From jinclude.h:
+ * NOTE: this file is NOT intended to be included by applications using the
+  * JPEG library.  Most applications need only include jpeglib.h.
+*/
 #include "jpeglib.h"
 
 
--- Amaya-original/configure.in	Tue Mar  7 11:55:14 2000
+++ Amaya/configure.in	Mon Apr 17 20:19:14 2000
@@ -52,6 +52,52 @@
 AC_PATH_PROG(AR, ar, /usr/bin/ar, $PATH:/bin:/usr/bin:/usr/ucb/bin)
 AC_PATH_PROG(DIFF, diff, /usr/bin/diff, $PATH:/bin:/usr/bin:/usr/ucb/bin)
 
+
+AC_ARG_WITH(more-shared, [  --with-included-jpeg  Use provided libjpeg, libpng.])
+if test "$with_included_jpeg" != "yes" ; then
+dnl
+    AC_MSG_CHECKING([for libjpeg version = 6b])
+    AC_EGREP_CPP([x 62  x],
+        [#include <jpeglib.h>
+         x JPEG_LIB_VERSION x],
+dnl
+        AC_MSG_RESULT([yes])
+        LIBJPEG='-ljpeg'
+        MAKEJPEG=['#'],
+dnl
+        AC_MSG_RESULT([no])
+        LIBJPEG='../libjpeg.a'      dnl LIBJPEG goes into amaya/Makefile.in
+        )
+dnl    
+dnl
+    AC_MSG_CHECKING([for libpng version = 1.0.1])
+    AC_EGREP_CPP([x \"1.0.1\"  x],
+        [#include <png.h>
+	x PNG_LIBPNG_VER_STRING x],
+dnl
+        AC_MSG_RESULT([yes])
+        LIBPNG='-lpng'
+        LIBZ=''
+	MAKEPNG=['#'],
+dnl
+        AC_MSG_RESULT([no])
+        LIBPNG='../libpng.a'
+        LIBZ='../libz.a'
+        )
+else
+    LIBJPEG='../libjpeg.a'
+    LIBPNG='../libpng.a'
+    LIBZ='../libz.a'
+fi
+dnl
+AC_SUBST(LIBJPEG)
+AC_SUBST(LIBPNG)
+AC_SUBST(LIBZ)
+AC_SUBST(MAKEJPEG)
+AC_SUBST(MAKEPNG)
+dnl
+dnl
+
 dnl
 dnl Checks for libraries.
 dnl
@@ -571,7 +617,9 @@
 FUNC="\$(THOTDIR)/thotlib/internals/f"
 SCHEMAS="\$(THOTDIR)/schemas"
 SCHEMASOPERA="\$(THOTDIR)/schemasOPERA"
-JPEGINCL="-I\$(THOTDIR)/libjpeg"
+test "$LIBJPEG" = '../libjpeg.a'  && JPEGINCL="-I\$(THOTDIR)/libjpeg"
+#test "$LIBPNG" = '../libpng.a'  && PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
+#there is a modified header file we need
 PNGINCL="-I\$(THOTDIR)/libpng -I\$(THOTDIR)/libpng/zlib"
 
 dnl
Received on Tuesday, 18 April 2000 02:52:48 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 April 2014 11:01:34 UTC