summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-14 04:10:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-14 04:10:39 +0000
commitc25084921670dfe33a0871ee7b94c102fea0ea3a (patch)
treef0df3bfdc54529ba5c345f5536f7164acf7746d4 /configure.in
parentae2fe781dd4aae16a2f03a4b9fb93514eb9886d4 (diff)
prototypes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in51
1 files changed, 45 insertions, 6 deletions
diff --git a/configure.in b/configure.in
index 84aabbe496..2665d083df 100644
--- a/configure.in
+++ b/configure.in
@@ -72,6 +72,50 @@ AC_PROG_MAKE_SET
# checks for UNIX variants that set C preprocessor variables
AC_MINIX
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(void*)
+
+AC_MSG_CHECKING(for prototypes)
+AC_CACHE_VAL(rb_cv_have_prototypes,
+ [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
+ rb_cv_have_prototypes=yes,
+ rb_cv_have_prototypes=no)])
+AC_MSG_RESULT($rb_cv_have_prototypes)
+if test "$rb_cv_have_prototypes" = yes; then
+ AC_DEFINE(HAVE_PROTOTYPES)
+fi
+
+AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
+AC_CACHE_VAL(rb_cv_stdarg,
+ [AC_TRY_COMPILE([
+#include <stdarg.h>
+int foo(int x, ...) {
+ va_list va;
+ va_start(va, x);
+ va_arg(va, int);
+ va_arg(va, char *);
+ va_arg(va, double);
+ return 0;
+}
+], [return foo(10, "", 3.14);],
+ rb_cv_stdarg=yes,
+ rb_cv_stdarg=no)])
+AC_MSG_RESULT($rb_cv_stdarg)
+if test "$rb_cv_stdarg" = yes; then
+ AC_DEFINE(HAVE_STDARG_PROTOTYPES)
+fi
+
+AC_MSG_CHECKING(for gcc attribute noreturn)
+AC_CACHE_VAL(rb_cv_have_attr_noreturn,
+ [AC_TRY_COMPILE([void exit(int x) __attribute__ ((noreturn));], [],
+ rb_cv_have_attr_noreturn=yes,
+ rb_cv_have_attr_noreturn=no)])
+AC_MSG_RESULT($rb_cv_have_attr_noreturn)
+if test "$rb_cv_have_attr_noreturn" = yes; then
+ AC_DEFINE(HAVE_ATTR_NORETURN)
+fi
+
dnl Checks for libraries.
case "$host_os" in
nextstep*) ;;
@@ -88,8 +132,7 @@ AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
sys/select.h sys/time.h sys/times.h sys/param.h sys/wait.h\
- syscall.h a.out.h string.h utime.h memory.h\
- varargs.h stdarg.h)
+ syscall.h a.out.h string.h utime.h memory.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
@@ -100,10 +143,6 @@ AC_STRUCT_ST_BLOCKS
LIBOBJS="$save_LIBOBJS"
AC_STRUCT_ST_RDEV
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(void*)
-
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL