diff --git a/Makefile.am b/Makefile.am index e4842026..a7590db7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST = mksymlinks.sh +EXTRA_DIST = mksymlinks.sh acsite.m4 acconfig.h dist-hook: tar cf - src/metar | (cd $(distdir); tar xvf -) diff --git a/acconfig.h b/acconfig.h index 4e22afc2..a5fe5539 100644 --- a/acconfig.h +++ b/acconfig.h @@ -181,6 +181,9 @@ /* Define if you have the wait3 system call. */ #undef HAVE_WAIT3 +/* Define if you have zlib installed system wide. */ +#undef HAVE_ZLIB + /* Define as __inline if that's what the C compiler calls it. */ #undef inline diff --git a/configure.in b/configure.in index 7061ba35..2c2e266c 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ dnl $Id$ AC_INIT(src/bucket/newbucket.cxx) dnl Initialize the automake stuff -AM_INIT_AUTOMAKE(SimGear, 0.0.2) +AM_INIT_AUTOMAKE(SimGear, 0.0.3) dnl Checks for programs. AC_PROG_MAKE_SET @@ -198,7 +198,9 @@ fi dnl Check for system installed zlib AC_CHECK_HEADER(zlib.h) -if test "x$ac_cv_header_zlib_h" != "xyes"; then +if test "x$ac_cv_header_zlib_h" = "xyes"; then + AC_DEFINE( HAVE_ZLIB ) +else echo "no zlib found, building." fi AM_CONDITIONAL(HAVE_ZLIB, test "x$ac_cv_header_zlib_h" = "xyes" ) diff --git a/mksymlinks.sh b/mksymlinks.sh index e654cf19..8b8cc960 100755 --- a/mksymlinks.sh +++ b/mksymlinks.sh @@ -37,3 +37,6 @@ ln -s ../../misc/fgstream.hxx src/simgear/misc/fgstream.hxx ln -s ../../misc/zfstream.hxx src/simgear/misc/zfstream.hxx ln -s ../../xgl/xgl.h src/simgear/xgl/xgl.h + +ln -s ../../zlib/zlib.h src/simgear/zlib/zlib.h +ln -s ../../zlib/zconf.h src/simgear/zlib/zconf.h diff --git a/simgear/math/Makefile.am b/simgear/math/Makefile.am index 5bac7d07..4faaf013 100644 --- a/simgear/math/Makefile.am +++ b/simgear/math/Makefile.am @@ -1,5 +1,11 @@ includedir = @includedir@/math +if HAVE_ZLIB +ZLIB_INCL = +else +ZLIB_INCL = -I$(top_builddir)/src/zlib +endif + lib_LIBRARIES = libsgmath.a include_HEADERS = \ @@ -29,4 +35,4 @@ libsgmath_a_SOURCES = \ polar3d.cxx \ vector.cxx -INCLUDES += -I$(top_builddir)/src +INCLUDES += -I$(top_builddir)/src $(ZLIB_INCL) diff --git a/simgear/misc/Makefile.am b/simgear/misc/Makefile.am index 26112ff7..44d4a796 100644 --- a/simgear/misc/Makefile.am +++ b/simgear/misc/Makefile.am @@ -3,7 +3,7 @@ includedir = @includedir@/misc if HAVE_ZLIB ZLIB_INCL = else -ZLIB_INCL = -I$(top_builddir)/zlib +ZLIB_INCL = -I$(top_builddir)/src/zlib endif lib_LIBRARIES = libsgmisc.a @@ -23,4 +23,4 @@ libsgmisc_a_SOURCES = \ texcoord.cxx \ zfstream.cxx -INCLUDES += -I$(top_builddir)/src +INCLUDES += -I$(top_builddir)/src $(ZLIB_INCL) diff --git a/simgear/misc/zfstream.hxx b/simgear/misc/zfstream.hxx index 41b3d04d..b093499f 100644 --- a/simgear/misc/zfstream.hxx +++ b/simgear/misc/zfstream.hxx @@ -26,7 +26,11 @@ #include -#include +#ifdef HAVE_ZLIB +# include +#else +# include +#endif #ifdef FG_HAVE_STD_INCLUDES