home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 April / PCO0499.ISO / filesbbs / os2 / apach134.arj / APACH134.ZIP / src / helpers / checkheader.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1998-09-16  |  695 b   |  35 lines

  1. #!/bin/sh
  2. ##
  3. ##  checkheader.sh -- Check whether a C header file exists
  4. ##  Written by Ralf S. Engelschall for the Apache configuration mechanism
  5. ##
  6. #
  7. # This script falls under the Apache License.
  8. # See http://www.apache.org/docs/LICENSE
  9.  
  10.  
  11. header=$1
  12. rc=1
  13. if [ ".$CPP" = . ]; then
  14.     CPP='NOT-AVAILABLE'
  15. fi
  16. if [ ".$CPP" != ".NOT-AVAILABLE" ]; then
  17.     #   create a test C source
  18.     cat >conftest.c <<EOF
  19. #include <$header>
  20. Syntax Error
  21. EOF
  22.     (eval "$CPP conftest.c >/dev/null") 2>conftest.out
  23.     my_error=`grep -v '^ *+' conftest.out`
  24.     if [ ".$my_error" = . ]; then
  25.         rc=0
  26.     fi
  27. else
  28.     if [ -f "/usr/include/$header" ]; then
  29.         rc=0
  30.     fi
  31. fi
  32. rm -f conftest.*
  33. exit $rc
  34.     
  35.