is this a good way to use AC_CHECK_HEADERS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Howdy all!

I have the following in configure.ac, to kill the configure if the
hdf5 header file isn't found.

Problem is, I also have a --with-hdf5=<DIRECTORY> configure argument
to allow the user to specify the location of the hdf5 library.

# If the user wants netcdf-4, we need hdf5.
if test "x$enable_netcdf_4" = xyes; then
   CPPFLAGS="${CPPFLAGS} -I${with_hdf5}/include"
   AC_CHECK_HEADERS([hdf5.h], [], [nc_hdf5_h_missing=yes])
   if test "x$nc_hdf5_h_missing" = xyes; then
      AC_MSG_ERROR([Can't find the hdf5 header and/or library. Specify
      the HDF5 prefix with the --with-hdf5 option to config\
ure.])
   fi
fi

I have to append -I${with_hdf5}/include to the CPPFLAGS. Is this the
usual way to do such a thing?

Or is there a better way?

THanks!

Ed



-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux