summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorStepan Kasal2007-05-15 20:46:19 +0200
committerKarel Zak2007-05-16 11:43:30 +0200
commitcf002530f8ccc35c75a64d4f53e4d1fc3a9a5bbb (patch)
treedf47b42056d36268d3f8f469c121ecc20674ec27 /configure.ac
parentbuild-sys: s/AC_HELP_STRING/AS_HELP_STRING/ (diff)
downloadkernel-qcow2-util-linux-cf002530f8ccc35c75a64d4f53e4d1fc3a9a5bbb.tar.gz
kernel-qcow2-util-linux-cf002530f8ccc35c75a64d4f53e4d1fc3a9a5bbb.tar.xz
kernel-qcow2-util-linux-cf002530f8ccc35c75a64d4f53e4d1fc3a9a5bbb.zip
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 <skasal@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac47
1 files changed, 26 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac
index 133f618c8..62d293ccb 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 <unistd.h>
-],[
+]], [[
char *c = crypt("abc","pw");
-],,[
+]])],[],[
LIBS="$LIBS -lcrypt"
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _XOPEN_SOURCE
#include <unistd.h>
- ],[
+ ]], [[
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 <stdio.h>
-],[
+]], [[
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 <wchar.h>
#include <wctype.h>
#include <stdio.h>
-],[
+]], [[
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 <sys/syscall.h>
#include <unistd.h>
-],[
+]], [[
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 <time.h>
#include <unistd.h>
-],[
+]], [[
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