Skip to content

Commit 1639e96

Browse files
committed
Add configure options: --with-hdf5 --with-hdf4 and --with-pnetcdf
1 parent 06ac972 commit 1639e96

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

configure.ac

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,38 @@ enable_hdf5=no
210210
fi
211211
AC_MSG_RESULT([$enable_hdf5])
212212

213+
AC_ARG_WITH([hdf5],
214+
[AS_HELP_STRING([--with-hdf5=/path/to/hdf5], [Specify HDF5 installation path(s):
215+
--with-hdf5=INC,LIB for include directory and library directory separated by a comma
216+
--with-hdf5=DIR for directory containing include/ and lib/ subdirectories
217+
])])
218+
case $withval in
219+
*,*)
220+
hdf5_inc="`echo $withval |cut -f1 -d,`"
221+
hdf5_lib="`echo $withval |cut -f2 -d, -s`"
222+
;;
223+
*)
224+
if test -n "$withval"; then
225+
hdf5_inc="$withval/include"
226+
hdf5_lib="$withval/lib"
227+
fi
228+
;;
229+
esac
230+
if test "x$hdf5_inc" != x ; then
231+
if test "x$CPPFLAGS" = x ; then
232+
CPPFLAGS="-I$hdf5_inc"
233+
else
234+
CPPFLAGS="$CPPFLAGS -I$hdf5_inc"
235+
fi
236+
fi
237+
if test "x$hdf5_lib" != x ; then
238+
if test "x$LDFLAGS" = x ; then
239+
LDFLAGS="-L$hdf5_lib"
240+
else
241+
LDFLAGS="$LDFLAGS -L$hdf5_lib"
242+
fi
243+
fi
244+
213245
# Does the user require dynamic loading?
214246
# This is only for those hdf5 installs that support it.
215247
AC_MSG_CHECKING([do we require hdf5 dynamic-loading support])
@@ -228,6 +260,38 @@ if test "x$enable_hdf4" = xyes -a "x$enable_netcdf_4" = xno; then
228260
fi
229261
AC_MSG_RESULT($enable_hdf4)
230262

263+
AC_ARG_WITH([hdf4],
264+
[AS_HELP_STRING([--with-hdf4=/path/to/hdf4], [Specify HDF4 installation path(s):
265+
--with-hdf4=INC,LIB for include directory and library directory separated by a comma
266+
--with-hdf4=DIR for directory containing include/ and lib/ subdirectories
267+
])])
268+
case $withval in
269+
*,*)
270+
hdf4_inc="`echo $withval |cut -f1 -d,`"
271+
hdf4_lib="`echo $withval |cut -f2 -d, -s`"
272+
;;
273+
*)
274+
if test -n "$withval"; then
275+
hdf4_inc="$withval/include"
276+
hdf4_lib="$withval/lib"
277+
fi
278+
;;
279+
esac
280+
if test "x$hdf4_inc" != x ; then
281+
if test "x$CPPFLAGS" = x ; then
282+
CPPFLAGS="-I$hdf4_inc"
283+
else
284+
CPPFLAGS="$CPPFLAGS -I$hdf4_inc"
285+
fi
286+
fi
287+
if test "x$hdf4_lib" != x ; then
288+
if test "x$LDFLAGS" = x ; then
289+
LDFLAGS="-L$hdf4_lib"
290+
else
291+
LDFLAGS="$LDFLAGS -L$hdf4_lib"
292+
fi
293+
fi
294+
231295
# Does the user want to turn on extra HDF4 file tests?
232296
AC_MSG_CHECKING([whether to fetch some sample HDF4 files from Unidata ftp site to test HDF4 reading (requires wget)])
233297
AC_ARG_ENABLE([hdf4-file-tests], [AS_HELP_STRING([--enable-hdf4-file-tests],
@@ -1125,6 +1189,38 @@ AC_ARG_ENABLE([pnetcdf], [AS_HELP_STRING([--enable-pnetcdf],
11251189
test "x$enable_pnetcdf" = xyes || enable_pnetcdf=no
11261190
AC_MSG_RESULT($enable_pnetcdf)
11271191

1192+
AC_ARG_WITH([pnetcdf],
1193+
[AS_HELP_STRING([--with-pnetcdf=/path/to/pnetcdf], [Specify PnetCDF installation path(s):
1194+
--with-pnetcdf=INC,LIB for include directory and library directory separated by a comma
1195+
--with-pnetcdf=DIR for directory containing include/ and lib/ subdirectories
1196+
])])
1197+
case $withval in
1198+
*,*)
1199+
pnetcdf_inc="`echo $withval |cut -f1 -d,`"
1200+
pnetcdf_lib="`echo $withval |cut -f2 -d, -s`"
1201+
;;
1202+
*)
1203+
if test -n "$withval"; then
1204+
pnetcdf_inc="$withval/include"
1205+
pnetcdf_lib="$withval/lib"
1206+
fi
1207+
;;
1208+
esac
1209+
if test "x$pnetcdf_inc" != x ; then
1210+
if test "x$CPPFLAGS" = x ; then
1211+
CPPFLAGS="-I$pnetcdf_inc"
1212+
else
1213+
CPPFLAGS="$CPPFLAGS -I$pnetcdf_inc"
1214+
fi
1215+
fi
1216+
if test "x$pnetcdf_lib" != x ; then
1217+
if test "x$LDFLAGS" = x ; then
1218+
LDFLAGS="-L$pnetcdf_lib"
1219+
else
1220+
LDFLAGS="$LDFLAGS -L$pnetcdf_lib"
1221+
fi
1222+
fi
1223+
11281224
# See if the PnetCDF lib is available and of the
11291225
# right version (1.6.0 or later)
11301226
if test "x$enable_pnetcdf" = xyes; then

0 commit comments

Comments
 (0)