# header-test - test for a possible header
#
################################################################
# Copyright (C) 2002 Tom Lord
# 
# See the file "COPYING" for further information about
# the copyright and warranty status of this work.
# 

# header-test variable headerspec
#
# If ${CC} -E exits with 0 status for this input:
# 
#	#include headerspec
# 
# then output:
# 
# 	binary VARIABLE=1
# 
# otherwise:
# 
# 	binary VARIABLE=0
# 

if test $# -ne 2 ; then
  printf "usage: header-test variable-name header-spec\n" 1>&2
  exit 1
fi

variable_name="$1"
header_spec="$2"


rm -f ,test-prog.c

printf "#include %s\n" "$header_spec" > ,test-prog.c

if ${CC} -E ,test-prog.c 2> /dev/null > /dev/null ; then
  printf "binary %s=1\n" "$variable_name" 
else
  printf "binary %s=0\n" "$variable_name"
fi

# arch-tag: Tom Lord Fri Jun 27 14:46:09 2003 (auto-conf-lib/header-test)
#
