Przeglądaj źródła

build: Use DPKG_CHECK_DECL instead of DPKG_CHECK_DEFINE for TIOCNOTTY

DPKG_CHECK_DEFINE defines the HAVE_symbol to 1 if found, and to 0
otherwise. But the only current user is doing “#ifdef TIOCNOTTY”, which
defeats the test as it's always going to be true, regardless of the
value. Switch to the simplified DPKG_CHECK_DECL, which does not define
the symbol if not found, and remove now unused DPKG_CHECK_DEFINE.
Guillem Jover 16 lat temu
rodzic
commit
20652a829b
2 zmienionych plików z 1 dodań i 17 usunięć
  1. 1 1
      configure.ac
  2. 0 16
      m4/dpkg-types.m4

+ 1 - 1
configure.ac

@@ -99,7 +99,6 @@ fi
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stddef.h error.h locale.h libintl.h kvm.h \
                   sys/cdefs.h sys/syscall.h linux/fiemap.h])
-DPKG_CHECK_DEFINE(TIOCNOTTY, [sys/ioctl.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_BIGENDIAN
@@ -121,6 +120,7 @@ DPKG_FUNC_C99_SNPRINTF
 DPKG_FUNC_ASYNC_SYNC
 DPKG_CHECK_DECL([offsetof], [stddef.h])
 DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
+DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
                          strnlen strerror strsignal \
                          scandir alphasort unsetenv])

+ 0 - 16
m4/dpkg-types.m4

@@ -34,19 +34,3 @@ AC_DEFUN([DPKG_CHECK_DECL],
                            [Define to 1 if ']$1[' is declared in <$2>])],,
                 [[#include <$2>]])
 ])# DPKG_CHECK_DECL
-
-# DPKG_CHECK_DEFINE([DEFINE], [HEADER])
-# -------------------------------------
-# Defines HAVE_DEFINE to 1 if declared in HEADER, 0 otherwise
-AC_DEFUN([DPKG_CHECK_DEFINE],
-[AC_CACHE_CHECK([whether $1 is defined in $2], [dpkg_cv_define_]AS_TR_SH($1),
-[AC_COMPILE_IFELSE(
-	[AC_LANG_PROGRAM([[#include <$2>]], [[int i = $1;]])],
-	[dpkg_cv_define_]AS_TR_SH($1)[=yes],
-	[dpkg_cv_define_]AS_TR_SH($1)[=no])])
-AS_IF([test "x$dpkg_cv_define_[]AS_TR_SH($1)" = "xyes"],
-	[AC_DEFINE([HAVE_]AS_TR_CPP($1), 1,
-	           [Define to 1 if you have the macro ']$1[' in <$2>,
-	            and to 0 if you don't.])],
-	[AC_DEFINE([HAVE_]AS_TR_CPP($1), 0)])[]dnl
-])# DPKG_CHECK_DEFINE