Skip to content

Commit

Permalink
Merge pull request #2 from UV-CDAT/mac_no_png
Browse files Browse the repository at this point in the history
Mac no png
  • Loading branch information
dnadeau4 committed Sep 18, 2015
2 parents ad0e662 + 8b967f9 commit 49690a4
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 41 deletions.
50 changes: 29 additions & 21 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4465,9 +4465,15 @@ else
fi
HAVE_PNG="yes"
case "${OS}" in
darwin*)
PNG_VERSION="15"
if test -z "/usr/X11R6/include"; then
PNG_VERSION="15"
else
HAVE_PNG="no"
PNG_VERSION=""
fi
;;
*)
PNG_VERSION=""
Expand All @@ -4486,7 +4492,7 @@ else
with_grib2lib=no
fi
if test ${with_grib2lib} == "no" ; then
if test ${with_grib2lib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
GRIB2LIB="-L${EXTERNALS}/lib"
else
Expand All @@ -4495,6 +4501,7 @@ fi
else
GRIB2LIB="-L"${with_grib2lib}
fi
if test ${HAVE_PNG} = "yes"; then
# Check whether --with-pnglib was given.
if test "${with_pnglib+set}" = set; then :
Expand All @@ -4503,16 +4510,16 @@ else
with_pnglib=no
fi
if test ${with_pnglib} == "no" ; then
if test "${EXTERNALS+set}" = set; then
PNGLIB="-L${EXTERNALS}/lib"
if test ${with_pnglib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
PNGLIB="-L${EXTERNALS}/lib"
else
PNGLIB="-L${prefix}/Externals/lib"
fi
else
PNGLIB="-L${prefix}/Externals/lib"
PNGLIB="-L"${with_pnglib}
fi
else
PNGLIB="-L"${with_pnglib}
fi
as_ac_Lib=`$as_echo "ac_cv_lib_png${PNG_VERSION}''_png_error" | $as_tr_sh`
as_ac_Lib=`$as_echo "ac_cv_lib_png${PNG_VERSION}''_png_error" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_error in -lpng${PNG_VERSION}" >&5
$as_echo_n "checking for png_error in -lpng${PNG_VERSION}... " >&6; }
if eval \${$as_ac_Lib+:} false; then :
Expand Down Expand Up @@ -4556,8 +4563,9 @@ else
PNGLIBOK="no"
fi
if test ${PNGLIBOK} == "no" ; then
as_fn_error $? "\"Could not find a working libpng${PNG_VERSION}\"" "$LINENO" 5
if test ${PNGLIBOK} = "no" ; then
as_fn_error $? "\"Could not find a working libpng${PNG_VERSION}\"" "$LINENO" 5
fi
fi
# Check whether --with-jasperlib was given.
Expand All @@ -4567,7 +4575,7 @@ else
with_jasperlib=no
fi
if test ${with_jasperlib} == "no" ; then
if test ${with_jasperlib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
JASPERLIB="-L${EXTERNALS}/lib"
else
Expand Down Expand Up @@ -4618,7 +4626,7 @@ else
JASPERLIBOK="no"
fi
if test ${JASPERLIBOK} == "no" ; then
if test ${JASPERLIBOK} = "no" ; then
as_fn_error $? "\"Could not find a working libjasper\"" "$LINENO" 5
fi
Expand All @@ -4629,7 +4637,7 @@ else
with_grib2lib=no
fi
if test ${with_grib2lib} == "no" ; then
if test ${with_grib2lib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
GRIB2LIB="-L${EXTERNALS}/lib -lgrib2c "${PNGLIB}" -lpng${PNG_VERSION} "${JASPERLIB}" -ljasper -lm"
else
Expand Down Expand Up @@ -4680,7 +4688,7 @@ else
GRIB2LIBOK="no"
fi
if test ${GRIB2LIBOK} == "no" ; then
if test ${GRIB2LIBOK} = "no" ; then
as_fn_error $? "\"Could not find a working libgrib2c\"" "$LINENO" 5
fi
Expand Down Expand Up @@ -5434,7 +5442,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
Expand Down Expand Up @@ -5480,7 +5488,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
Expand All @@ -5504,7 +5512,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
Expand Down Expand Up @@ -5549,7 +5557,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
Expand All @@ -5573,7 +5581,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
Expand Down
48 changes: 28 additions & 20 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ AC_ARG_ENABLE(grib2,
ENABLE_GRIB2=$enableval,
ENABLE_GRIB2=no)

HAVE_PNG="yes"
case "${OS}" in
darwin*)
PNG_VERSION="15"
if test -z "/usr/X11R6/include"; then
PNG_VERSION="15"
else
HAVE_PNG="no"
PNG_VERSION=""
fi
;;
*)
PNG_VERSION=""
Expand All @@ -88,7 +94,7 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
[AS_HELP_STRING([--with-grib2lib],[path where to look for libgrib2c])],
[],
[with_grib2lib=no])
if test ${with_grib2lib} == "no" ; then
if test ${with_grib2lib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
GRIB2LIB="-L${EXTERNALS}/lib"
else
Expand All @@ -97,28 +103,30 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
else
GRIB2LIB="-L"${with_grib2lib}
fi
AC_ARG_WITH([pnglib],
[AS_HELP_STRING([--with-pnglib],[path where to look for libpng])],
[],
[with_pnglib=no])
if test ${with_pnglib} == "no" ; then
if test "${EXTERNALS+set}" = set; then
PNGLIB="-L${EXTERNALS}/lib"
if test ${HAVE_PNG} = "yes"; then
AC_ARG_WITH([pnglib],
[AS_HELP_STRING([--with-pnglib],[path where to look for libpng])],
[],
[with_pnglib=no])
if test ${with_pnglib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
PNGLIB="-L${EXTERNALS}/lib"
else
PNGLIB="-L${prefix}/Externals/lib"
fi
else
PNGLIB="-L${prefix}/Externals/lib"
PNGLIB="-L"${with_pnglib}
fi
AC_CHECK_LIB([png${PNG_VERSION}],[png_error],[PNGLIBOK="yes"],[PNGLIBOK="no"],[${GRIB2LIB} ${PNGLIB}])
if test ${PNGLIBOK} = "no" ; then
AC_MSG_ERROR("[Could not find a working libpng${PNG_VERSION}]")
fi
else
PNGLIB="-L"${with_pnglib}
fi
AC_CHECK_LIB([png${PNG_VERSION}],[png_error],[PNGLIBOK="yes"],[PNGLIBOK="no"],[${GRIB2LIB} ${PNGLIB}])
if test ${PNGLIBOK} == "no" ; then
AC_MSG_ERROR("[Could not find a working libpng${PNG_VERSION}]")
fi
AC_ARG_WITH([jasperlib],
[AS_HELP_STRING([--with-jasperlib],[path where to look for libjasper])],
[],
[with_jasperlib=no])
if test ${with_jasperlib} == "no" ; then
if test ${with_jasperlib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
JASPERLIB="-L${EXTERNALS}/lib"
else
Expand All @@ -128,14 +136,14 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
JASPERLIB="-L"${with_jasperlib}
fi
AC_CHECK_LIB([jasper],[jas_init],[JASPERLIBOK="yes"],[JASPERLIBOK="no"],[${GRIB2LIB} ${JASPERLIB} -ljpeg -lm ])
if test ${JASPERLIBOK} == "no" ; then
if test ${JASPERLIBOK} = "no" ; then
AC_MSG_ERROR("[Could not find a working libjasper]")
fi
AC_ARG_WITH([grib2lib],
[AS_HELP_STRING([--with-grib2lib],[path where to look for libgrib2c])],
[],
[with_grib2lib=no])
if test ${with_grib2lib} == "no" ; then
if test ${with_grib2lib} = "no" ; then
if test "${EXTERNALS+set}" = set; then
GRIB2LIB="-L${EXTERNALS}/lib -lgrib2c "${PNGLIB}" -lpng${PNG_VERSION} "${JASPERLIB}" -ljasper -lm"
else
Expand All @@ -145,7 +153,7 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
GRIB2LIB="-L"${with_grib2lib}" -lgrib2c "${PNGLIB}" -lpng${PNG_VERSION} "${JASPERLIB}" -ljasper -lm"
fi
AC_CHECK_LIB([grib2c],[g2_getfld],[GRIB2LIBOK="yes"],[GRIB2LIBOK="no"],[${GRIB2LIB}])
if test ${GRIB2LIBOK} == "no" ; then
if test ${GRIB2LIBOK} = "no" ; then
AC_MSG_ERROR("[Could not find a working libgrib2c]")
fi
dnl in this case we also need jasper
Expand Down

0 comments on commit 49690a4

Please sign in to comment.