Searching headers mapping to the same HAVE_header variable

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

 



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,

-- 
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)

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://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