typedef 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright (C) Igor Sysoev
  2. echo $ngx_n "checking for $ngx_type ...$ngx_c"
  3. cat << END >> $NGX_AUTOCONF_ERR
  4. ----------------------------------------
  5. checking for $ngx_type
  6. END
  7. ngx_found=no
  8. for ngx_try in $ngx_type $ngx_types
  9. do
  10. cat << END > $NGX_AUTOTEST.c
  11. #include <sys/types.h>
  12. #include <signal.h>
  13. #include <sys/socket.h>
  14. #include <sys/time.h>
  15. #include <sys/resource.h>
  16. #include <netinet/in.h>
  17. $NGX_INCLUDE_INTTYPES_H
  18. int main() {
  19. $ngx_try i = 0;
  20. return 0;
  21. }
  22. END
  23. ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
  24. -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
  25. eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
  26. if [ -x $NGX_AUTOTEST ]; then
  27. if [ $ngx_try = $ngx_type ]; then
  28. echo " found"
  29. ngx_found=yes
  30. else
  31. echo ", $ngx_try used"
  32. ngx_found=$ngx_try
  33. fi
  34. fi
  35. rm -f $NGX_AUTOTEST
  36. if [ $ngx_found = no ]; then
  37. echo $ngx_n " $ngx_try not found$ngx_c"
  38. echo "----------" >> $NGX_AUTOCONF_ERR
  39. cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
  40. echo "----------" >> $NGX_AUTOCONF_ERR
  41. echo $ngx_test >> $NGX_AUTOCONF_ERR
  42. echo "----------" >> $NGX_AUTOCONF_ERR
  43. else
  44. break
  45. fi
  46. done
  47. if [ $ngx_found = no ]; then
  48. echo
  49. echo "$0: error: can not define $ngx_type"
  50. exit 1
  51. fi
  52. if [ $ngx_found != yes ]; then
  53. echo "typedef $ngx_found $ngx_type;" >> $NGX_AUTO_CONFIG_H
  54. fi