Back to the Main Page. | ac_auto_include_headers |
Download the M4 Source. |
AC_AUTO_INCLUDE_HEADERS (HEADER-FILE, INCLUDE-FILE ...)
2002-03-04 0.5.65 : InstalledPackages
Scott Pakin <pakin@uiuc.edu>
license: AllPermissive
AC_AUTO_INCLUDE_HEADERS([config-inc.h], [sys/foobar.h])
#ifdef HAVE_SYS_FOOBAR_H
# include <sys/foobar.h>
#endif
cat <<\CIH_EOF > config-inc.h
/* This file was generated automatically by configure. */
#ifndef _CONFIG_INC_H_
#define _CONFIG_INC_H_
#include <stdio.h>
CIH_EOF
AC_AUTO_INCLUDE_HEADERS([config-inc.h], [arpa/inet.h dlfcn.h errno.h])
echo "#endif" >> config-inc.h
cat config.h | perl -ane '/ HAVE_\S+_H / && do {$_=$F[$#F-1]; s/^HAVE_//; s/_H/.h/; s|_|/|g; tr/A-Z/a-z/; print "$_ "}'
AC_DEFUN([AC_AUTO_INCLUDE_HEADERS], [touch $1 for ac_auto_include_file in $2; do ac_auto_include_have=`echo $ac_auto_include_file | sed 'y%./*abcdefghijklmnopqrstuvwxyz%__PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[^_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]%_%g'` echo "#ifdef HAVE_$ac_auto_include_have" >> $1 echo "# include <$ac_auto_include_file>" >> $1 echo "#endif" >> $1 echo "" >> $1 done])