Julien ÉLIE
2013-12-12 21:02:44 UTC
Hi all,
When using AC_CHECK_HEADERS([filename]), a HAVE_FILENAME (with uppercase chars)
variable is defined to 1 if the filename header is found.
Characters not suitable for a variable name in filename are mapped to underscores.
I have a question about how to deal with looking for two different headers that
lead to the same HAVE_FILENAME variable.
For instance: how to properly search for gdbm/ndbm.h and gdbm-ndbm.h?
Using:
AC_CHECK_HEADERS([gdbm/ndbm.h gdbm-ndbm.h], [break])
does not help much.
As the result of the search is cached in $ac_cv_header_filename, maybe
using the following piece of code is the expected way to deal with the issue?
AC_CHECK_HEADER([gdbm/ndbm.h])
AS_IF([test x"$ac_cv_header_gdbm_ndbm_h" != xno],
[AC_DEFINE([HAVE_GDBM_NDBM_H], [1],
[Define if you have the <gdbm/ndbm.h> header file.])],
[AS_UNSET([ac_cv_header_gdbm_ndbm_h])
AC_CHECK_HEADER([gdbm-ndbm.h])
AS_IF([test x"$ac_cv_header_gdbm_ndbm_h" != xno],
[AC_DEFINE([HAVE_GDBM_NDBM_H_DASH], [1],
[Define if you have the <gdbm-ndbm.h> header file.])])])
If you know a better way to do that, I would be interested in hearing it.
Thanks beforehand,
When using AC_CHECK_HEADERS([filename]), a HAVE_FILENAME (with uppercase chars)
variable is defined to 1 if the filename header is found.
Characters not suitable for a variable name in filename are mapped to underscores.
I have a question about how to deal with looking for two different headers that
lead to the same HAVE_FILENAME variable.
For instance: how to properly search for gdbm/ndbm.h and gdbm-ndbm.h?
Using:
AC_CHECK_HEADERS([gdbm/ndbm.h gdbm-ndbm.h], [break])
does not help much.
As the result of the search is cached in $ac_cv_header_filename, maybe
using the following piece of code is the expected way to deal with the issue?
AC_CHECK_HEADER([gdbm/ndbm.h])
AS_IF([test x"$ac_cv_header_gdbm_ndbm_h" != xno],
[AC_DEFINE([HAVE_GDBM_NDBM_H], [1],
[Define if you have the <gdbm/ndbm.h> header file.])],
[AS_UNSET([ac_cv_header_gdbm_ndbm_h])
AC_CHECK_HEADER([gdbm-ndbm.h])
AS_IF([test x"$ac_cv_header_gdbm_ndbm_h" != xno],
[AC_DEFINE([HAVE_GDBM_NDBM_H_DASH], [1],
[Define if you have the <gdbm-ndbm.h> header file.])])])
If you know a better way to do that, I would be interested in hearing it.
Thanks beforehand,
--
Julien ÉLIE
« – Nous ne connaissons pas leur langue, donc, sous aucun prétexte
il ne faut parler aux Goths !
– Mais on peut leur taper dessus ? » (Astérix)
Julien ÉLIE
« – Nous ne connaissons pas leur langue, donc, sous aucun prétexte
il ne faut parler aux Goths !
– Mais on peut leur taper dessus ? » (Astérix)