@@ -72,9 +72,15 @@ AC_ARG_ENABLE(grib2,
7272 ENABLE_GRIB2=$enableval,
7373 ENABLE_GRIB2=no)
7474
75+ HAVE_PNG="yes"
7576case "${OS}" in
7677 darwin*)
77- PNG_VERSION="15"
78+ if [ -d "/usr/X11R6/include" ] then;
79+ PNG_VERSION="15"
80+ else
81+ HAVE_PNG="no"
82+ PNG_VERSION=""
83+ fi
7884 ;;
7985 *)
8086 PNG_VERSION=""
@@ -97,22 +103,24 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
97103 else
98104 GRIB2LIB="-L"${with_grib2lib}
99105 fi
100- AC_ARG_WITH([pnglib],
101- [AS_HELP_STRING([--with-pnglib],[path where to look for libpng])],
102- [],
103- [with_pnglib=no])
104- if test ${with_pnglib} == "no" ; then
105- if test "${EXTERNALS+set}" = set; then
106- PNGLIB="-L${EXTERNALS}/lib"
106+ if test ${HAVE_PNG} == "yes"; then
107+ AC_ARG_WITH([pnglib],
108+ [AS_HELP_STRING([--with-pnglib],[path where to look for libpng])],
109+ [],
110+ [with_pnglib=no])
111+ if test ${with_pnglib} == "no" ; then
112+ if test "${EXTERNALS+set}" = set; then
113+ PNGLIB="-L${EXTERNALS}/lib"
114+ else
115+ PNGLIB="-L${prefix}/Externals/lib"
116+ fi
107117 else
108- PNGLIB="-L${prefix}/Externals/lib"
118+ PNGLIB="-L"${with_pnglib}
119+ fi
120+ AC_CHECK_LIB([png${PNG_VERSION}],[png_error],[PNGLIBOK="yes"],[PNGLIBOK="no"],[${GRIB2LIB} ${PNGLIB}])
121+ if test ${PNGLIBOK} == "no" ; then
122+ AC_MSG_ERROR("[Could not find a working libpng${PNG_VERSION}]")
109123 fi
110- else
111- PNGLIB="-L"${with_pnglib}
112- fi
113- AC_CHECK_LIB([png${PNG_VERSION}],[png_error],[PNGLIBOK="yes"],[PNGLIBOK="no"],[${GRIB2LIB} ${PNGLIB}])
114- if test ${PNGLIBOK} == "no" ; then
115- AC_MSG_ERROR("[Could not find a working libpng${PNG_VERSION}]")
116124 fi
117125 AC_ARG_WITH([jasperlib],
118126 [AS_HELP_STRING([--with-jasperlib],[path where to look for libjasper])],
0 commit comments