Skip to content

Commit 49690a4

Browse files
committed
Merge pull request #2 from UV-CDAT/mac_no_png
Mac no png
2 parents ad0e662 + 8b967f9 commit 49690a4

File tree

2 files changed

+57
-41
lines changed

2 files changed

+57
-41
lines changed

configure

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4465,9 +4465,15 @@ else
44654465
fi
44664466
44674467
4468+
HAVE_PNG="yes"
44684469
case "${OS}" in
44694470
darwin*)
4470-
PNG_VERSION="15"
4471+
if test -z "/usr/X11R6/include"; then
4472+
PNG_VERSION="15"
4473+
else
4474+
HAVE_PNG="no"
4475+
PNG_VERSION=""
4476+
fi
44714477
;;
44724478
*)
44734479
PNG_VERSION=""
@@ -4486,7 +4492,7 @@ else
44864492
with_grib2lib=no
44874493
fi
44884494
4489-
if test ${with_grib2lib} == "no" ; then
4495+
if test ${with_grib2lib} = "no" ; then
44904496
if test "${EXTERNALS+set}" = set; then
44914497
GRIB2LIB="-L${EXTERNALS}/lib"
44924498
else
@@ -4495,6 +4501,7 @@ fi
44954501
else
44964502
GRIB2LIB="-L"${with_grib2lib}
44974503
fi
4504+
if test ${HAVE_PNG} = "yes"; then
44984505
44994506
# Check whether --with-pnglib was given.
45004507
if test "${with_pnglib+set}" = set; then :
@@ -4503,16 +4510,16 @@ else
45034510
with_pnglib=no
45044511
fi
45054512
4506-
if test ${with_pnglib} == "no" ; then
4507-
if test "${EXTERNALS+set}" = set; then
4508-
PNGLIB="-L${EXTERNALS}/lib"
4513+
if test ${with_pnglib} = "no" ; then
4514+
if test "${EXTERNALS+set}" = set; then
4515+
PNGLIB="-L${EXTERNALS}/lib"
4516+
else
4517+
PNGLIB="-L${prefix}/Externals/lib"
4518+
fi
45094519
else
4510-
PNGLIB="-L${prefix}/Externals/lib"
4520+
PNGLIB="-L"${with_pnglib}
45114521
fi
4512-
else
4513-
PNGLIB="-L"${with_pnglib}
4514-
fi
4515-
as_ac_Lib=`$as_echo "ac_cv_lib_png${PNG_VERSION}''_png_error" | $as_tr_sh`
4522+
as_ac_Lib=`$as_echo "ac_cv_lib_png${PNG_VERSION}''_png_error" | $as_tr_sh`
45164523
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_error in -lpng${PNG_VERSION}" >&5
45174524
$as_echo_n "checking for png_error in -lpng${PNG_VERSION}... " >&6; }
45184525
if eval \${$as_ac_Lib+:} false; then :
@@ -4556,8 +4563,9 @@ else
45564563
PNGLIBOK="no"
45574564
fi
45584565
4559-
if test ${PNGLIBOK} == "no" ; then
4560-
as_fn_error $? "\"Could not find a working libpng${PNG_VERSION}\"" "$LINENO" 5
4566+
if test ${PNGLIBOK} = "no" ; then
4567+
as_fn_error $? "\"Could not find a working libpng${PNG_VERSION}\"" "$LINENO" 5
4568+
fi
45614569
fi
45624570
45634571
# Check whether --with-jasperlib was given.
@@ -4567,7 +4575,7 @@ else
45674575
with_jasperlib=no
45684576
fi
45694577
4570-
if test ${with_jasperlib} == "no" ; then
4578+
if test ${with_jasperlib} = "no" ; then
45714579
if test "${EXTERNALS+set}" = set; then
45724580
JASPERLIB="-L${EXTERNALS}/lib"
45734581
else
@@ -4618,7 +4626,7 @@ else
46184626
JASPERLIBOK="no"
46194627
fi
46204628
4621-
if test ${JASPERLIBOK} == "no" ; then
4629+
if test ${JASPERLIBOK} = "no" ; then
46224630
as_fn_error $? "\"Could not find a working libjasper\"" "$LINENO" 5
46234631
fi
46244632
@@ -4629,7 +4637,7 @@ else
46294637
with_grib2lib=no
46304638
fi
46314639
4632-
if test ${with_grib2lib} == "no" ; then
4640+
if test ${with_grib2lib} = "no" ; then
46334641
if test "${EXTERNALS+set}" = set; then
46344642
GRIB2LIB="-L${EXTERNALS}/lib -lgrib2c "${PNGLIB}" -lpng${PNG_VERSION} "${JASPERLIB}" -ljasper -lm"
46354643
else
@@ -4680,7 +4688,7 @@ else
46804688
GRIB2LIBOK="no"
46814689
fi
46824690
4683-
if test ${GRIB2LIBOK} == "no" ; then
4691+
if test ${GRIB2LIBOK} = "no" ; then
46844692
as_fn_error $? "\"Could not find a working libgrib2c\"" "$LINENO" 5
46854693
fi
46864694
@@ -5434,7 +5442,7 @@ else
54345442
We can't simply define LARGE_OFF_T to be 9223372036854775807,
54355443
since some C++ compilers masquerading as C compilers
54365444
incorrectly reject 9223372036854775807. */
5437-
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
5445+
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
54385446
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
54395447
&& LARGE_OFF_T % 2147483647 == 1)
54405448
? 1 : -1];
@@ -5480,7 +5488,7 @@ else
54805488
We can't simply define LARGE_OFF_T to be 9223372036854775807,
54815489
since some C++ compilers masquerading as C compilers
54825490
incorrectly reject 9223372036854775807. */
5483-
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
5491+
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
54845492
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
54855493
&& LARGE_OFF_T % 2147483647 == 1)
54865494
? 1 : -1];
@@ -5504,7 +5512,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55045512
We can't simply define LARGE_OFF_T to be 9223372036854775807,
55055513
since some C++ compilers masquerading as C compilers
55065514
incorrectly reject 9223372036854775807. */
5507-
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
5515+
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
55085516
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
55095517
&& LARGE_OFF_T % 2147483647 == 1)
55105518
? 1 : -1];
@@ -5549,7 +5557,7 @@ else
55495557
We can't simply define LARGE_OFF_T to be 9223372036854775807,
55505558
since some C++ compilers masquerading as C compilers
55515559
incorrectly reject 9223372036854775807. */
5552-
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
5560+
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
55535561
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
55545562
&& LARGE_OFF_T % 2147483647 == 1)
55555563
? 1 : -1];
@@ -5573,7 +5581,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55735581
We can't simply define LARGE_OFF_T to be 9223372036854775807,
55745582
since some C++ compilers masquerading as C compilers
55755583
incorrectly reject 9223372036854775807. */
5576-
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
5584+
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
55775585
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
55785586
&& LARGE_OFF_T % 2147483647 == 1)
55795587
? 1 : -1];

configure.in

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,15 @@ AC_ARG_ENABLE(grib2,
7272
ENABLE_GRIB2=$enableval,
7373
ENABLE_GRIB2=no)
7474

75+
HAVE_PNG="yes"
7576
case "${OS}" in
7677
darwin*)
77-
PNG_VERSION="15"
78+
if test -z "/usr/X11R6/include"; then
79+
PNG_VERSION="15"
80+
else
81+
HAVE_PNG="no"
82+
PNG_VERSION=""
83+
fi
7884
;;
7985
*)
8086
PNG_VERSION=""
@@ -88,7 +94,7 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
8894
[AS_HELP_STRING([--with-grib2lib],[path where to look for libgrib2c])],
8995
[],
9096
[with_grib2lib=no])
91-
if test ${with_grib2lib} == "no" ; then
97+
if test ${with_grib2lib} = "no" ; then
9298
if test "${EXTERNALS+set}" = set; then
9399
GRIB2LIB="-L${EXTERNALS}/lib"
94100
else
@@ -97,28 +103,30 @@ 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])],
119127
[],
120128
[with_jasperlib=no])
121-
if test ${with_jasperlib} == "no" ; then
129+
if test ${with_jasperlib} = "no" ; then
122130
if test "${EXTERNALS+set}" = set; then
123131
JASPERLIB="-L${EXTERNALS}/lib"
124132
else
@@ -128,14 +136,14 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
128136
JASPERLIB="-L"${with_jasperlib}
129137
fi
130138
AC_CHECK_LIB([jasper],[jas_init],[JASPERLIBOK="yes"],[JASPERLIBOK="no"],[${GRIB2LIB} ${JASPERLIB} -ljpeg -lm ])
131-
if test ${JASPERLIBOK} == "no" ; then
139+
if test ${JASPERLIBOK} = "no" ; then
132140
AC_MSG_ERROR("[Could not find a working libjasper]")
133141
fi
134142
AC_ARG_WITH([grib2lib],
135143
[AS_HELP_STRING([--with-grib2lib],[path where to look for libgrib2c])],
136144
[],
137145
[with_grib2lib=no])
138-
if test ${with_grib2lib} == "no" ; then
146+
if test ${with_grib2lib} = "no" ; then
139147
if test "${EXTERNALS+set}" = set; then
140148
GRIB2LIB="-L${EXTERNALS}/lib -lgrib2c "${PNGLIB}" -lpng${PNG_VERSION} "${JASPERLIB}" -ljasper -lm"
141149
else
@@ -145,7 +153,7 @@ if test "X$ENABLE_GRIB2" = "Xyes"; then
145153
GRIB2LIB="-L"${with_grib2lib}" -lgrib2c "${PNGLIB}" -lpng${PNG_VERSION} "${JASPERLIB}" -ljasper -lm"
146154
fi
147155
AC_CHECK_LIB([grib2c],[g2_getfld],[GRIB2LIBOK="yes"],[GRIB2LIBOK="no"],[${GRIB2LIB}])
148-
if test ${GRIB2LIBOK} == "no" ; then
156+
if test ${GRIB2LIBOK} = "no" ; then
149157
AC_MSG_ERROR("[Could not find a working libgrib2c]")
150158
fi
151159
dnl in this case we also need jasper

0 commit comments

Comments
 (0)