When I tried to install this package under MacPorts, the configure script found udunits2/udunits2.h, but the compilation failed. A closer look revealed that the compiler was searching for /usr/include/udunits2/udunits2.h, whereas MacPorts stores the actual header in /opt/local/include/udunits2/udunits2.h.
In configure.ac, the AC_CHECK_HEADER macro searches for headers in the default locations used by the compiler. If udunits2/udunits2.h is found, configure.ac assumes that the headers are stored under /usr/include. This will cause problems on any system with header files stored outside /usr/include (such as MacPorts).
When I tried to install this package under MacPorts, the configure script found udunits2/udunits2.h, but the compilation failed. A closer look revealed that the compiler was searching for /usr/include/udunits2/udunits2.h, whereas MacPorts stores the actual header in /opt/local/include/udunits2/udunits2.h.
In configure.ac, the
AC_CHECK_HEADER
macro searches for headers in the default locations used by the compiler. If udunits2/udunits2.h is found, configure.ac assumes that the headers are stored under /usr/include. This will cause problems on any system with header files stored outside /usr/include (such as MacPorts).