michael@0: dnl This Source Code Form is subject to the terms of the Mozilla Public michael@0: dnl License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: dnl MOZ_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]]) michael@0: AC_DEFUN([MOZ_CHECK_HEADER], michael@0: [ dnl Do the transliteration at runtime so arg 1 can be a shell variable. michael@0: ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` michael@0: AC_MSG_CHECKING([for $1]) michael@0: AC_CACHE_VAL(ac_cv_header_$ac_safe, michael@0: [ AC_TRY_COMPILE([$4 michael@0: #include <$1>], , michael@0: eval "ac_cv_header_$ac_safe=yes", michael@0: eval "ac_cv_header_$ac_safe=no") ]) michael@0: if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then michael@0: AC_MSG_RESULT(yes) michael@0: ifelse([$2], , :, [$2]) michael@0: else michael@0: AC_MSG_RESULT(no) michael@0: ifelse([$3], , , [$3]) michael@0: fi michael@0: ]) michael@0: michael@0: dnl MOZ_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]]) michael@0: AC_DEFUN([MOZ_CHECK_HEADERS], michael@0: [ for ac_hdr in $1 michael@0: do michael@0: MOZ_CHECK_HEADER($ac_hdr, michael@0: [ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` michael@0: AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3, [$4]) michael@0: done michael@0: ])