1# onceonly.m4 serial 4 (gettext-0.15) 2dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. 3dnl This file is free software; the Free Software Foundation 4dnl gives unlimited permission to copy and/or distribute it, 5dnl with or without modifications, as long as this notice is preserved. 6 7dnl This file defines some "once only" variants of standard autoconf macros. 8dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS 9dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS 10dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS 11dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC 12dnl The advantage is that the check for each of the headers/functions/decls 13dnl will be put only once into the 'configure' file. It keeps the size of 14dnl the 'configure' file down, and avoids redundant output when 'configure' 15dnl is run. 16dnl The drawback is that the checks cannot be conditionalized. If you write 17dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi 18dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to 19dnl empty, and the check will be inserted before the body of the AC_DEFUNed 20dnl function. 21 22dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf 23dnl have this macro built-in. But about AC_CHECK_DECLS_ONCE: note that in 24dnl autoconf >= 2.60 the symbol separator is a comma, whereas here it is 25dnl whitespace. 26 27dnl Autoconf version 2.57 or newer is recommended. 28AC_PREREQ(2.54) 29 30# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of 31# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). 32AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ 33 : 34 AC_FOREACH([gl_HEADER_NAME], [$1], [ 35 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]), 36 [-./], [___])), [ 37 AC_CHECK_HEADERS(gl_HEADER_NAME) 38 ]) 39 AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, 40 [-./], [___]))) 41 ]) 42]) 43 44# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of 45# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). 46AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ 47 : 48 AC_FOREACH([gl_FUNC_NAME], [$1], [ 49 AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ 50 AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME])) 51 ]) 52 AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) 53 ]) 54]) 55 56# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of 57# AC_CHECK_DECLS(DECL1, DECL2, ...). 58AC_DEFUN([AC_CHECK_DECLS_ONCE], [ 59 : 60 AC_FOREACH([gl_DECL_NAME], [$1], [ 61 AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ 62 AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) 63 ]) 64 AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) 65 ]) 66]) 67