diff -ur ../gdal-1.2.3/GNUmakefile ./GNUmakefile --- ../gdal-1.2.3/GNUmakefile Wed Sep 1 19:19:10 2004 +++ ./GNUmakefile Sat Nov 20 15:02:58 2004 @@ -5,6 +5,7 @@ include GDALmake.opt GDAL_OBJ = $(GDAL_ROOT)/frmts/o/*.o \ + $(GDAL_ROOT)/frmts/o/gdal-tiff.a \ $(GDAL_ROOT)/gcore/*.o \ $(GDAL_ROOT)/port/*.o \ $(GDAL_ROOT)/alg/*.o diff -ur ../gdal-1.2.3/configure.in ./configure.in --- ../gdal-1.2.3/configure.in Sat Sep 25 15:56:48 2004 +++ ./configure.in Sat Nov 20 16:57:25 2004 @@ -101,6 +101,9 @@ OPT_GDAL_FORMATS= EXTRA_INCLUDES= +dnl Honor the users wishes +LIBS="$LDFLAGS $LIBS" + dnl --------------------------------------------------------------------------- dnl Check if user requests /usr/local to be included. dnl --------------------------------------------------------------------------- @@ -159,7 +162,7 @@ CFLAGS="$CFLAGS $THREAD_FLAG" CXXFLAGS="$CXXFLAGS $THREAD_FLAG" -LIBS="$THREAD_LIB $LIBS" +LIBS="$LIBS $THREAD_LIB" dnl --------------------------------------------------------------------------- dnl Check if libz is available. @@ -177,7 +180,7 @@ elif test "$with_libz" != "no" -a "$with_libz" != "internal" ; then - LIBS="-L$with_libz -L$with_libz/lib $LIBS" + LIBS="$LIBS -L$with_libz -L$with_libz/lib" LIBZ_SETTING=external AC_MSG_RESULT([using libz library from $with_libz]) @@ -184,7 +187,7 @@ fi if test "$LIBZ_SETTING" = "external" ; then - LIBS="-lz $LIBS" + LIBS="$LIBS -lz" elif test "$with_libz" = "no" ; then LIBZ_SETTING=no AC_MSG_RESULT([not using libz at all.]) @@ -219,7 +222,7 @@ AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime) if test "$GRASS_SETTING" = "grass57+" ; then - LIBS="-L$with_grass/lib -lgrass_I -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS" + LIBS="$LIBS -L$with_grass/lib -lgrass_I -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime" GRASS_INCLUDE="-I$with_grass/include" else AC_MSG_ERROR([--with-grass=$with_grass requested, but libraries not found!]) @@ -235,7 +238,7 @@ AC_CHECK_LIB(grass5,G_gisinit_2,GRASS_SETTING=libgrass,GRASS_SETTING=no,) if test "$GRASS_SETTING" = "libgrass" ; then - LIBS="-lgrass5 $LIBS" + LIBS="$LIBS -lgrass5" fi else @@ -243,7 +246,7 @@ AC_CHECK_LIB(grass5,G_gisinit_2,GRASS_SETTING=libgrass,GRASS_SETTING=no,-L$with_libgrass/lib) if test "$GRASS_SETTING" = "libgrass" ; then - LIBS="-L$with_libgrass -L$with_libgrass/lib -lgrass5 $LIBS" + LIBS="$LIBS -L$with_libgrass -L$with_libgrass/lib -lgrass5" GRASS_INCLUDE="-I$with_libgrass -I$with_libgrass/include $EXTRA_INCLUDES" else AC_MSG_ERROR([--with-libgrass=$with_grass requested, but libgrass5 not found!]) @@ -274,7 +277,7 @@ AC_CHECK_LIB(cfitsio,ffopen,FITS_SETTING=external,FITS_SETTING=no,) if test "$FITS_SETTING" = "external" ; then - LIBS="-lcfitsio $LIBS" + LIBS="$LIBS -lcfitsio" echo "using pre-installed libcfitsio." else echo "libcfitsio not found - FITS support disabled" @@ -283,7 +286,7 @@ else FITS_SETTING=external - LIBS="-L$with_cfitsio -L$with_cfitsio/lib -lcfitsio $LIBS" + LIBS="$LIBS -L$with_cfitsio -L$with_cfitsio/lib -lcfitsio" EXTRA_INCLUDES="-I$with_cfitsio -I$with_cfitsio/include $EXTRA_INCLUDES" echo "using libcfitsio from $with_cfitsio." @@ -312,7 +315,7 @@ AC_CHECK_LIB(netcdf,nc_open,NETCDF_SETTING=yes,NETCDF_SETTING=no,) if test "$NETCDF_SETTING" = "yes" ; then - LIBS="-lnetcdf $LIBS" + LIBS="$LIBS -lnetcdf" echo "using pre-installed libnetcdf." else echo "libnetcdf not found - netCDF support disabled" @@ -321,7 +324,7 @@ else NETCDF_SETTING=yes - LIBS="-L$with_netcdf -L$with_netcdf/lib -lnetcdf $LIBS" + LIBS="$LIBS -L$with_netcdf -L$with_netcdf/lib -lnetcdf" EXTRA_INCLUDES="-I$with_netcdf -I$with_netcdf/include $EXTRA_INCLUDES" echo "using libnetcdf from $with_netcdf." @@ -354,7 +357,7 @@ PNG_SETTING=internal fi if test "$PNG_SETTING" = "external" ; then - LIBS="-lpng $LIBS" + LIBS="$LIBS -lpng" echo "using pre-installed libpng." else echo "using internal png code." @@ -369,7 +372,7 @@ else PNG_SETTING=external - LIBS="-L$with_png -L$with_png/lib -lpng $LIBS" + LIBS="$LIBS -L$with_png -L$with_png/lib -lpng" EXTRA_INCLUDES="-I$with_png -I$with_png/include $EXTRA_INCLUDES" echo "using libpng from $with_png." @@ -401,7 +404,7 @@ fi if test "$TIFF_SETTING" = "external" ; then - LIBS="-ltiff $LIBS" + LIBS="$LIBS -ltiff" echo "using pre-installed libtiff." else echo "using internal TIFF code." @@ -417,10 +420,10 @@ TIFF_SETTING=external if test -r $with_libtiff/tiff.h ; then - LIBS="-L$with_libtiff -ltiff $LIBS" + LIBS="$LIBS -L$with_libtiff -ltiff" EXTRA_INCLUDES="-I$with_libtiff $EXTRA_INCLUDES" else - LIBS="-L$with_libtiff/lib -ltiff $LIBS" + LIBS="$LIBS -L$with_libtiff/lib -ltiff" EXTRA_INCLUDES="-I$with_libtiff/include $EXTRA_INCLUDES" fi @@ -446,7 +449,7 @@ fi if test "$GEOTIFF_SETTING" = "external" ; then - LIBS="-lgeotiff $LIBS" + LIBS="$LIBS -lgeotiff" echo "using pre-installed libgeotiff." else echo "using internal GeoTIFF code." @@ -461,11 +464,14 @@ else GEOTIFF_SETTING=external + + dnl We now require libgeotiff 1.2.1 (for XTIFFClientOpen). + AC_CHECK_LIB(geotiff,XTIFFClientOpen,GEOTIFF_SETTING=external,AC_MSG_ERROR([We require at least GeoTIFF 1.2.1. Consider using the one supplied with GDAL])) if test -r $with_geotiff/libgeotiff.a ; then - LIBS="-L$with_geotiff -lgeotiff $LIBS" + LIBS="$LIBS -L$with_geotiff -lgeotiff" EXTRA_INCLUDES="-I$with_geotiff $EXTRA_INCLUDES" else - LIBS="-L$with_geotiff/lib -lgeotiff $LIBS" + LIBS="$LIBS -L$with_geotiff/lib -lgeotiff" EXTRA_INCLUDES="-I$with_geotiff/include $EXTRA_INCLUDES" fi @@ -512,7 +518,8 @@ fi if test "$JPEG_SETTING" = "external" ; then - LIBS="-ljpeg $LIBS" + # Users definitions are always first + LIBS="$LIBS -ljpeg " echo "using pre-installed libjpeg." else echo "using internal jpeg code." @@ -527,7 +534,12 @@ else JPEG_SETTING=external - LIBS="-L$with_jpeg -L$with_jpeg/lib -ljpeg $LIBS" + if test -f "$with_jpeg/libjpeg.so" -o -f "$with_jpeg/libjpeg.a"; then + LIBS="$LIBS -L$with_jpeg" + elif test -f "$with_jpeg/lib/libjpeg.so" -o -f "$with_jpeg/lib/libjpeg.a"; then + LIBS="$LIBS -L$with_jpeg/lib" + fi + LIBS="$LIBS -ljpeg" EXTRA_INCLUDES="-I$with_jpeg -I$with_jpeg/include $EXTRA_INCLUDES" echo "using libjpeg from $with_jpeg." @@ -557,7 +569,7 @@ AC_CHECK_LIB(gif,DGifOpenFileName,GIF_SETTING=external,GIF_SETTING=internal,) if test "$GIF_SETTING" = "external" ; then - LIBS="-lgif $LIBS" + LIBS="$LIBS -lgif" echo "using pre-installed libgif." else echo "using internal gif code." @@ -571,8 +583,17 @@ else + LIBS="$LIBS -L$with_gif -L$with_gif/lib" + AC_CHECK_LIB(gif,DGifOpenFileName,GIF_MINUSL=-lgif, + AC_CHECK_LIB(ungif, DGifOpenFileName,GIF_MINUSL=-lungif, + AC_MSG_ERROR([Could not find a usable libgif or libungif in $with-gif]) + ,),) + if test "$GIF_MINUSL" = "-lungif"; then + AC_MSG_WARN([This GDAL library will not be able to produce compressed GIF, ]) + AC_MSG_WARN([thus generated GIF files will become extremely large.]) + fi + LIBS="$LIBS $GIF_MINUSL" GIF_SETTING=external - LIBS="-L$with_gif -L$with_gif/lib -lgif $LIBS" EXTRA_INCLUDES="-I$with_gif -I$with_gif/include $EXTRA_INCLUDES" echo "using libgif from $with_gif." @@ -605,13 +626,13 @@ AC_CHECK_LIB(ogdi31,cln_GetLayerCapabilities,HAVE_OGDI=yes,HAVE_OGDI=no,) if test "$HAVE_OGDI" = "yes" ; then - LIBS="-logdi31 $LIBS" + LIBS="$LIBS -logdi31" fi else HAVE_OGDI=yes - LIBS="-L$with_ogdi -L$with_ogdi/lib -logdi31 $LIBS" + LIBS="$LIBS -L$with_ogdi -L$with_ogdi/lib -logdi31" OGDI_INCLUDE="-I$with_ogdi -I$with_ogdi/include" echo "using libogdi31 from $with_ogdi." @@ -698,7 +719,7 @@ AC_CHECK_LIB(mfhdf,SDreaddata,HAVE_HDF4=yes,HAVE_HDF4=no,-ldf) if test "$HAVE_HDF4" = "yes" ; then - LIBS="-lmfhdf -ldf $LIBS" + LIBS="$LIBS -lmfhdf -ldf" fi dnl Some Linux distros install hdf include files here. @@ -715,7 +736,7 @@ fi ORIG_LIBS="$LIBS" - LIBS="-L$HDF_LIB_DIR $LIBS" + LIBS="$LIBS -L$HDF_LIB_DIR" AC_CHECK_LIB(mfhdf,SDreaddata,HDF_LIB_NAME="-lmfhdf -ldf",HDF_LIB_NAME=missing,-ldf) if test "$HDF_LIB_NAME" = "missing" ; then @@ -779,12 +800,12 @@ AC_CHECK_LIB(jasper,pgx_decode,HAVE_JASPER=yes,HAVE_JASPER=no,) if test "$HAVE_JASPER" = "yes" ; then - LIBS="-ljasper $LIBS" + LIBS="$LIBS -ljasper" fi else HAVE_JASPER=yes - LIBS="-L$with_jasper -L$with_jasper/lib -ljasper $LIBS" + LIBS="$LIBS -L$with_jasper -L$with_jasper/lib -ljasper" EXTRA_INCLUDES="-I$with_jasper -I$with_jasper/include $EXTRA_INCLUDES" AC_MSG_NOTICE([using JasPer library from $with_jasper.]) @@ -825,7 +846,7 @@ AC_CHECK_LIB(NCSEcw,NCScbmOpenFileView,ECW_SETTING=yes,ECW_SETTING=no,) if test "$ECW_SETTING" = "yes" ; then - LIBS="-lNCSEcw $LIBS" + LIBS="$LIBS -lNCSEcw" fi else @@ -833,10 +854,10 @@ AC_MSG_CHECKING([for libNCSEcw.so]) ECW_SETTING=yes if test -r $with_ecw/lib/libNCSEcw.so ; then - LIBS="-L$with_ecw/lib -lNCSEcw $LIBS" + LIBS="$LIBS -L$with_ecw/lib -lNCSEcw" AC_MSG_RESULT([found in $with_ecw/lib.]) elif test -r $with_ecw/bin/libNCSEcw.so ; then - LIBS="-L$with_ecw/bin -lNCSEcw $LIBS" + LIBS="$LIBS -L$with_ecw/bin -lNCSEcw" AC_MSG_RESULT([found in $with_ecw/bin.]) else AC_MSG_ERROR([not found in $with_ecw/lib or $with_ecw/bin.]) @@ -903,13 +924,13 @@ HAVE_MRSID=yes MRSID_INCLUDE="-I$with_mrsid/include" - LIBS="-lMrSIDDecode -llt_xTrans -lpthread $LIBS" + LIBS="$LIBS -lMrSIDDecode -llt_xTrans -lpthread" MRSID_FLAGS=-DMRSID_DSDK_VERSION_32 if test -r "$with_mrsid/bin/lib/libMrSIDDecode.a" ; then - LIBS="-L$with_mrsid/bin/lib $LIBS" + LIBS="$LIBS -L$with_mrsid/bin/lib" else - LIBS="-L$with_mrsid/lib $LIBS" + LIBS="$LIBS -L$with_mrsid/lib" fi AC_MSG_CHECKING([for lt_colorSpace.h in $with_mrsid/include]) @@ -929,12 +950,12 @@ HAVE_MRSID=yes MRSID_INCLUDE="-I$with_mrsid/include/base -I$with_mrsid/include/metadata -I$with_mrsid/include/mrsid_readers -I$with_mrsid/include/j2k_readers -I$with_mrsid/include/support" - LIBS="-lltidsdk -lpthread $LIBS" + LIBS="$LIBS -lltidsdk -lpthread" if test -r "$with_mrsid/lib/libltidsdk.a" ; then - LIBS="-L$with_mrsid/lib $LIBS" + LIBS="$LIBS -L$with_mrsid/lib" else - LIBS="-L$with_mrsid/lib/Release $LIBS" + LIBS="$LIBS -L$with_mrsid/lib/Release" fi AC_MSG_CHECKING([for MG3ImageWriter.h in $with_mrsid/include/mrsid_writers]) @@ -942,7 +963,7 @@ AC_MSG_RESULT([found MrSID ESDK version 4.0.x.]) MRSID_FLAGS="-DMRSID_ESDK_VERSION_40 $MRSID_FLAGS" MRSID_INCLUDE="-I$with_mrsid/include/mrsid_writers -I$with_mrsid/include/j2k_writers $MRSID_INCLUDE" - LIBS="-L$with_mrsid/3rd-party/lib/Release -lcryptopp -lltiesdk $LIBS" + LIBS="$LIBS -L$with_mrsid/3rd-party/lib/Release -lcryptopp -lltiesdk" fi else @@ -1066,15 +1087,15 @@ fi if test "$with_xerces_lib" != "" ; then - LIBS="$with_xerces_lib $LIBS" + LIBS="$LIBS $with_xerces_lib" else if test -f $with_xerces/lib/libxerces-c.so ; then - LIBS="-L$with_xerces/lib -lxerces-c -lpthread $LIBS" + LIBS="$LIBS -L$with_xerces/lib -lxerces-c -lpthread" elif test -f $with_xerces/lib/libxerces-c1_6_0.so ; then - LIBS="-lxerces-c1_6_0 -lpthread $LIBS" - LIBS="-L$with_xerces/lib $LIBS" + LIBS="$LIBS -lxerces-c1_6_0 -lpthread" + LIBS="$LIBS -L$with_xerces/lib" else - LIBS="-L$with_xerces/lib -lxerces-c -lpthread $LIBS" + LIBS="$LIBS -L$with_xerces/lib -lxerces-c -lpthread" fi fi if test "$with_xerces_inc" != "" ; then @@ -1137,13 +1158,13 @@ fi if test "$ODBC_SETTING" = "yes" ; then - LIBS="-lodbc $LIBS" + LIBS="$LIBS -lodbc" fi else ODBC_SETTING=yes - LIBS="-L$with_odbc -L$with_odbc/lib -lodbc $LIBS" + LIBS="$LIBS -L$with_odbc -L$with_odbc/lib -lodbc" EXTRA_INCLUDES="-I$with_odbc -I$with_odbc/include $EXTRA_INCLUDES" echo "using odbc library from $with_odbc." @@ -1174,13 +1195,13 @@ HAVE_OCI=yes ORACLE_HOME="$with_oci" OCI_INCLUDE="-I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/rdbms/public" - LIBS="-L$ORACLE_HOME/lib $LIBS" + LIBS="$LIBS -L$ORACLE_HOME/lib" AC_MSG_RESULT([using OCI library from $with_oci]) fi if test "$HAVE_OCI" = "yes" ; then - LIBS="-lclntsh $LIBS" + LIBS="$LIBS -lclntsh" fi AC_SUBST(HAVE_OCI,$HAVE_OCI) @@ -1304,7 +1325,7 @@ if test "$GEOS_CONFIG" != "no" ; then - LIBS="`$GEOS_CONFIG --libs` $LIBS" + LIBS="$LIBS `$GEOS_CONFIG --libs`" GEOS_INC=-I"`$GEOS_CONFIG --includes`" HAVE_GEOS=yes diff -ur ../gdal-1.2.3/frmts/gtiff/GNUmakefile ./frmts/gtiff/GNUmakefile --- ../gdal-1.2.3/frmts/gtiff/GNUmakefile Wed Dec 17 09:24:24 2003 +++ ./frmts/gtiff/GNUmakefile Sat Nov 20 14:44:44 2004 @@ -41,7 +41,7 @@ $(GDAL_LIB) $(LIBS) -o epsg_to_wkt lib-tiff: - (cd libtiff; $(MAKE) install-obj) + (cd libtiff; $(MAKE) install-lib) lib-geotiff: (cd libgeotiff; $(MAKE) install-obj) diff -ur ../gdal-1.2.3/frmts/gtiff/libtiff/GNUmakefile ./frmts/gtiff/libtiff/GNUmakefile --- ../gdal-1.2.3/frmts/gtiff/libtiff/GNUmakefile Sun Aug 1 11:37:26 2004 +++ ./frmts/gtiff/libtiff/GNUmakefile Sat Nov 20 14:48:58 2004 @@ -39,7 +39,7 @@ tif_write.o \ tif_zip.o -O_OBJ = $(foreach file,$(OBJ),../../o/$(file)) +O_OBJ = $(foreach file,$(OBJ),$(file)) ALL_C_FLAGS = $(CFLAGS) -DZIP_SUPPORT -DPIXARLOG_SUPPORT -I../../zlib @@ -72,6 +72,13 @@ @echo install-obj: $(O_OBJ) + +gdal-tiff.a: $(O_OBJ) + #for FILE in $(OBJ); do ar r gdal-libtiff.a $(FILE); done + ar r gdal-tiff.a $(OBJ) + +install-lib: gdal-tiff.a + cp gdal-tiff.a ../../o/ ../../o/%.o: %.c $(CC) -c -I$(GDAL_ROOT)/port $(ALL_C_FLAGS) $< -o $@ diff -ur ../gdal-1.2.3/port/cpl_port.h ./port/cpl_port.h --- ../gdal-1.2.3/port/cpl_port.h Tue Jan 6 21:42:32 2004 +++ ./port/cpl_port.h Wed Nov 3 09:57:48 2004 @@ -150,7 +150,9 @@ #include #include +//#ifdef HAVE_MATH_H #include +//#endif #include #include #include @@ -157,6 +159,8 @@ #include #include +// #include + #ifdef HAVE_LOCALE_H # include #endif @@ -174,6 +178,16 @@ # define USE_DMALLOC # include #endif + +#if !defined(__LIMITS__H__) && defined(HAVE_LIMITS_H) +# include +#endif + +/* +#include +#include +#include +*/ /* ==================================================================== */ /* Base portability stuff ... this stuff may need to be */