From cf002530f8ccc35c75a64d4f53e4d1fc3a9a5bbb Mon Sep 17 00:00:00 2001 From: Stepan Kasal Date: Tue, 15 May 2007 20:46:19 +0200 Subject: [PATCH] build-sys: replace AC_TRY_* by AC_*_IFELSE The AC_TRY_* macros are deprecated. Following the suggestion from autoupdate, I have replaced them by AC_*_IFELSE. Signed-off-by: Stepan Kasal --- configure.ac | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 133f618c..62d293cc 100644 --- a/configure.ac +++ b/configure.ac @@ -92,19 +92,19 @@ fi AM_CONDITIONAL(USE_SLANG, test $use_slang = yes) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define _XOPEN_SOURCE #include -],[ +]], [[ char *c = crypt("abc","pw"); -],,[ +]])],[],[ LIBS="$LIBS -lcrypt" - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _XOPEN_SOURCE #include - ],[ + ]], [[ char *c = crypt("abc","pw"); - ],[ + ]])],[ AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?]) need_libcrypt=yes ],[ @@ -114,47 +114,52 @@ char *c = crypt("abc","pw"); AM_CONDITIONAL(NEED_LIBCRYPT, test x$need_libcrypt = xyes) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -],[ +]], [[ printf(__progname); -],AC_DEFINE(HAVE___PROGNAME, 1, [Do we have __progname?]) -) +]])], +[AC_DEFINE(HAVE___PROGNAME, 1, Do we have __progname?) +]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include -],[ +]], [[ wchar_t wc; wint_t w; w = fgetwc(stdin); if (w == WEOF) exit(1); wc = w; fputwc(wc,stdout); -],AC_DEFINE(HAVE_WIDECHAR,1,[Do we have wide character support?])) +]])], +[AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?) +]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include -],[ +]], [[ int test = SYS_pivot_root; -],have_pivot_root=true) - -AM_CONDITIONAL(HAVE_PIVOT_ROOT, test x$have_pivot_root = xtrue) +]])], +[AM_CONDITIONAL(HAVE_PIVOT_ROOT, true)], +[AM_CONDITIONAL(HAVE_PIVOT_ROOT, false)]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include -],[ +]], [[ int a = 0; struct tm *tm = localtime(0); if (a == -1) /* false */ sleep(tm->tm_gmtoff); -],[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])]) +]])], +[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?]) +]) case "$host" in -- 2.39.5