diff --git a/configure.ac b/configure.ac index 96a6a656..adb57405 100644 --- a/configure.ac +++ b/configure.ac @@ -257,6 +257,9 @@ if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then exit 1 fi +AC_CHECK_LIB(tiff, TIFFOpen,,,) +AM_CONDITIONAL(HAVE_LIBTIFF, test x$ac_cv_lib_tiff_TIFFOpen = xyes) + AC_LANG_PUSH(C++) # needed for plib 1.8.x or later AC_CHECK_LIB(plibul, ulInit,,,) diff --git a/src/Lib/HGT/Makefile.am b/src/Lib/HGT/Makefile.am index 09188874..b4ee8cb9 100644 --- a/src/Lib/HGT/Makefile.am +++ b/src/Lib/HGT/Makefile.am @@ -8,7 +8,7 @@ testhgt_SOURCES = testhgt.cxx testhgt_LDADD = \ $(top_builddir)/src/Lib/HGT/libHGT.a \ - -lsgbucket -lsgmisc -lsgdebug -lz + -lsgbucket -lsgmisc -lsgdebug -lz -lplibul INCLUDES = -I$(top_srcdir)/src diff --git a/src/Lib/HGT/hgt.cxx b/src/Lib/HGT/hgt.cxx index 55fe4ee0..61c39757 100644 --- a/src/Lib/HGT/hgt.cxx +++ b/src/Lib/HGT/hgt.cxx @@ -87,7 +87,7 @@ TGHgt::open ( const SGPath &f ) { if ( file_name.extension() == "zip" ) { // extract the .zip file to /tmp and point the file name // to the extracted file - SGPath tmp_dir = tempnam( 0, "hgt" ); + SGPath tmp_dir = string( tempnam( 0, "hgt" ) ); tmp_dir.append( "dummy" ); tmp_dir.create_dir( 0700 ); cout << "Extracting " << file_name.str() << " to " << tmp_dir.dir() << endl; diff --git a/src/Prep/DemChop/.gitignore b/src/Prep/DemChop/.gitignore index 7a1dbdfc..bae6e7fb 100644 --- a/src/Prep/DemChop/.gitignore +++ b/src/Prep/DemChop/.gitignore @@ -1,4 +1,5 @@ demchop fillvoids hgtchop +srtmchop testassem diff --git a/src/Prep/DemChop/Makefile.am b/src/Prep/DemChop/Makefile.am index 9e38595a..06d357ba 100644 --- a/src/Prep/DemChop/Makefile.am +++ b/src/Prep/DemChop/Makefile.am @@ -23,7 +23,10 @@ #--------------------------------------------------------------------------- -bin_PROGRAMS = demchop hgtchop srtmchop fillvoids testassem +bin_PROGRAMS = demchop hgtchop fillvoids testassem +if HAVE_LIBTIFF +bin_PROGRAMS+=srtmchop +endif demchop_SOURCES = \ demchop.cxx point2d.hxx @@ -38,16 +41,18 @@ hgtchop_SOURCES = \ hgtchop_LDADD = \ $(top_builddir)/src/Lib/HGT/libHGT.a \ - -lsgbucket -lsgmisc -lsgdebug -lsgxml -lz + -lsgbucket -lsgmisc -lsgdebug -lsgxml -lz -lplibul $(base_LIBS) +if HAVE_LIBTIFF srtmchop_SOURCES = \ srtmchop.cxx point2d.hxx srtmchop_LDADD = \ $(top_builddir)/src/Lib/HGT/libHGT.a \ - -lsgbucket -lsgmisc -lsgdebug -lsgxml -lz + -lsgbucket -lsgmisc -lsgdebug -lsgxml -lz -lplibul -ltiff $(base_LIBS) +endif fillvoids_SOURCES = \ fillvoids.cxx diff --git a/src/Prep/DemChop/srtmchop.cxx b/src/Prep/DemChop/srtmchop.cxx index d213315a..f05d4a27 100644 --- a/src/Prep/DemChop/srtmchop.cxx +++ b/src/Prep/DemChop/srtmchop.cxx @@ -168,7 +168,7 @@ bool TGSrtmTiff::open( const SGPath &f ) { if ( ext == "zip" ) { // extract the .zip file to /tmp and point the file name // to the extracted file - SGPath tmp_dir = tempnam( 0, "hgt" ); + SGPath tmp_dir = string( tempnam( 0, "hgt" ) ); tmp_dir.append( "dummy" ); tmp_dir.create_dir( 0700 ); cout << "Extracting " << file_name.str() << " to " << tmp_dir.dir() << endl;