diff --git a/acconfig.h b/acconfig.h index 42532f16f..03a0f644f 100644 --- a/acconfig.h +++ b/acconfig.h @@ -13,6 +13,9 @@ #undef HAVE_U_INT32_T #undef HAVE_U_INT64_T +#undef ssize_t +#undef sig_atomic_t + /* Define this if struct utmp have ut_user */ #undef HAVE_UT_USER @@ -94,6 +97,13 @@ /* Define this if struct sockaddr has sa_len */ #undef SOCKADDR_HAS_SA_LEN +/* Define to isoc_realloc if you have a broken realloc */ +#undef BROKEN_REALLOC +#ifdef BROKEN_REALLOC +#define realloc(X, Y) isoc_realloc((X), (Y)) +#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y)) +#endif + #undef VOID_RETSIGTYPE #ifdef VOID_RETSIGTYPE @@ -161,4 +171,5 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #define LOGIN_PATH BINDIR "/login" #endif - +/* operating system kludges ahead */ +#undef SunOS diff --git a/acinclude.m4 b/acinclude.m4 index 682002ba6..2e2fcb9bc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -580,3 +580,19 @@ LN_S="$ac_cv_prog_LN_S" AC_MSG_RESULT($ac_cv_prog_LN_S) AC_SUBST(LN_S)dnl ]) + +dnl test for sig_atomic_t + +AC_DEFUN(AC_TYPE_SIG_ATOMIC_T, +[AC_MSG_CHECKING(for sig_atomic_t) +AC_CACHE_VAL(ac_cv_type_sig_atomic_t, +AC_TRY_COMPILE( +[#include ], +[sig_atomic_t foo = 1;], +ac_cv_type_sig_atomic_t=yes, +ac_cv_type_sig_atomic_t=no)) +if test "$ac_cv_type_sig_atomic_t" = no; then + AC_DEFINE(sig_atomic_t, int)dnl +fi +AC_MSG_RESULT($ac_cv_type_sig_atomic_t) +]) diff --git a/configure.in b/configure.in index e80a3744e..2baf0306f 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,12 @@ AC_CANONICAL_HOST CANONICAL_HOST=$host AC_SUBST(CANONICAL_HOST) +case "$host" in +*-*-sunos4*) + AC_DEFINE(SunOS, 4) + ;; +esac + dnl Checks for programs. AC_PROG_CC @@ -22,7 +28,7 @@ AC_PROG_AWK AC_KRB_PROG_LN_S if test "$GCC" = "yes"; then - WFLAGS="-Wall -Wno-unused -Wconversion -Wmissing-prototypes" + WFLAGS="-Wall -Wno-unused -Wmissing-prototypes" fi AC_SUBST(WFLAGS) CFLAGS="-g" @@ -172,6 +178,22 @@ AC_BROKEN(seteuid strcasecmp strdup strerror strftime) AC_BROKEN(strlwr strnlen strsep strtok_r strupr unsetenv) AC_BROKEN(verr verrx vsyslog vwarn vwarnx warn warnx) +AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [ +ac_cv_func_realloc_broken=no +AC_TRY_RUN([ +#include +#include + +int main() +{ + return realloc(NULL, 17) == NULL; +} +],:, ac_cv_func_realloc_broken=yes, :) +]) +if test "$ac_cv_func_realloc_broken" = yes ; then + AC_DEFINE(BROKEN_REALLOC) +fi + dnl AC_KRB_FUNC_GETCWD_BROKEN dnl @@ -251,6 +273,8 @@ AC_TYPE_PID_T AC_TYPE_UID_T AC_TYPE_OFF_T AC_TYPE_SIZE_T +AC_CHECK_TYPE(ssize_t, int) +AC_TYPE_SIG_ATOMIC_T dnl AC_SUBST(LIBOBJS)