use HAVE_ instead of HAS_ macros for consistency.

This commit is contained in:
matthieu
2015-11-11 21:18:12 +00:00
parent f08e325b48
commit 300ba5c057
7 changed files with 453 additions and 360 deletions

View File

@@ -79,8 +79,8 @@ bin_PROGRAMS = xconsole$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL NEWS compile config.guess config.sub depcomp \
$(srcdir)/config.h.in $(top_srcdir)/configure COPYING \
ChangeLog INSTALL compile config.guess config.sub depcomp \
install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac

View File

@@ -1243,7 +1243,7 @@ AC_SUBST([am__untar])
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl
dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
dnl
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
dnl to deal in the Software without restriction, including without limitation
@@ -1276,10 +1276,10 @@ dnl DEALINGS IN THE SOFTWARE.
# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
#
#
# See the "minimum version" comment for each macro you use to see what
# See the "minimum version" comment for each macro you use to see what
# version you require.
m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.16.2])
m4_define([vers_have], [1.19.0])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,,
@@ -1299,7 +1299,7 @@ m4_undefine([maj_needed])
# such as man pages and config files
AC_DEFUN([XORG_PROG_RAWCPP],[
AC_REQUIRE([AC_PROG_CPP])
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
# Check for flag to avoid builtin definitions - assumes unix is predefined,
@@ -1329,6 +1329,7 @@ if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
AC_MSG_RESULT([no])
else
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
TRADITIONALCPPFLAGS="-traditional"
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
AC_MSG_RESULT([yes])
else
@@ -1337,6 +1338,7 @@ else
fi
rm -f conftest.$ac_ext
AC_SUBST(RAWCPPFLAGS)
AC_SUBST(TRADITIONALCPPFLAGS)
]) # XORG_PROG_RAWCPP
# XORG_MANPAGE_SECTIONS()
@@ -1861,9 +1863,10 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
]) # XORG_WITH_ASCIIDOC
# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
# --------------------------------
# -------------------------------------------
# Minimum version: 1.5.0
# Minimum version for optional DEFAULT argument: 1.11.0
# Minimum version for optional DOT checking: 1.18.0
#
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
@@ -1883,6 +1886,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
#
AC_DEFUN([XORG_WITH_DOXYGEN],[
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
AC_ARG_VAR([DOT], [Path to the dot graphics utility])
m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(doxygen,
AS_HELP_STRING([--with-doxygen],
@@ -1926,6 +1930,20 @@ m4_ifval([$1],
AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
fi])
fi])
dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
dnl HAVE_DOT = @HAVE_DOT@
HAVE_DOT=no
if test "x$have_doxygen" = "xyes"; then
AC_PATH_PROG([DOT], [dot])
if test "x$DOT" != "x"; then
HAVE_DOT=yes
fi
fi
AC_SUBST([HAVE_DOT])
AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
]) # XORG_WITH_DOXYGEN
@@ -2108,6 +2126,29 @@ fi])
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
]) # XORG_WITH_FOP
# XORG_WITH_M4([MIN-VERSION])
# ---------------------------
# Minimum version: 1.19.0
#
# This macro attempts to locate an m4 macro processor which supports
# -I option and is only useful for modules relying on M4 in order to
# expand macros in source code files.
#
# Interface to module:
# M4: returns the path of the m4 program found
# returns the path set by the user in the environment
#
AC_DEFUN([XORG_WITH_M4], [
AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
[AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
[[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
[AC_MSG_ERROR([could not find m4 that supports -I option])],
[$PATH:/usr/gnu/bin])])
AC_SUBST([M4], [$ac_cv_path_M4])
]) # XORG_WITH_M4
# XORG_WITH_PS2PDF([DEFAULT])
# ----------------
# Minimum version: 1.6.0
@@ -2562,7 +2603,8 @@ AC_ARG_ENABLE(malloc0returnsnull,
AC_MSG_CHECKING([whether malloc(0) returns NULL])
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
AC_RUN_IFELSE([AC_LANG_PROGRAM([
AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([
#include <stdlib.h>
],[
char *m0, *r0, *c0, *p;
@@ -2572,9 +2614,9 @@ if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
c0 = calloc(0,10);
exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
])],
[MALLOC_ZERO_RETURNS_NULL=yes],
[MALLOC_ZERO_RETURNS_NULL=no],
[MALLOC_ZERO_RETURNS_NULL=yes])
[xorg_cv_malloc0_returns_null=yes],
[xorg_cv_malloc0_returns_null=no])])
MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
fi
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
@@ -2785,18 +2827,18 @@ fi
found="no"
m4_foreach([flag], m4_cdr($@), [
if test $found = "no" ; then
if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
fi
if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
fi
PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
AC_MSG_CHECKING([if ]COMPILER[ supports]flag[])
AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
AC_CACHE_VAL($cacheid,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
@@ -2863,7 +2905,7 @@ AC_LANG_CASE(
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
]
)
@@ -2872,16 +2914,17 @@ AC_LANG_CASE(
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# These are currently disabled because they are noisy. They will be enabled
# in the future once the codebase is sufficiently modernized to silence
# them. For now, I don't want them to drown out the other warnings.
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
# Turn some warnings into errors, so we don't accidently get successful builds
# when there are problems that should be fixed.
@@ -3055,7 +3098,7 @@ dnl
# XORG_RELEASE_VERSION
# --------------------
# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
AC_DEFUN([XORG_RELEASE_VERSION],[
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
[`echo $PACKAGE_VERSION | cut -d . -f 1`],

View File

@@ -6,12 +6,6 @@
/* ENOSYS: Not implemented */
#undef BROKEN_SETRESUID
/* Define to 1 if you have the 'openpty' function. */
#undef HAS_OPENPTY
/* Define to 1 if you have the 'setproctitle function. */
#undef HAS_SETPROCTITLE
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -21,9 +15,15 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the 'openpty' function. */
#undef HAVE_OPENPTY
/* Define to 1 if you have the <pty.h> header file. */
#undef HAVE_PTY_H
/* Define to 1 if you have the 'setproctitle function. */
#undef HAVE_SETPROCTITLE
/* Define to 1 if you have the `setresgid' function. */
#undef HAVE_SETRESGID

694
app/xconsole/configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -52,9 +52,9 @@ AC_ARG_WITH(appdefaultdir,
AC_SUBST(appdefaultdir)
AC_SEARCH_LIBS(openpty, [util])
AC_CHECK_FUNC(openpty, [HAS_OPENPTY="yes"])
if test "x$HAS_OPENPTY" = "xyes" ; then
AC_DEFINE([HAS_OPENPTY], 1,
AC_CHECK_FUNC(openpty, [HAVE_OPENPTY="yes"])
if test "x$HAVE_OPENPTY" = "xyes" ; then
AC_DEFINE([HAVE_OPENPTY], 1,
[Define to 1 if you have the 'openpty' function.])
AC_CHECK_HEADERS([util.h libutil.h pty.h], [break])
fi
@@ -66,16 +66,16 @@ AC_ARG_ENABLE(privsep,
[USE_PRIVSEP="$enableval"],
USE_PRIVSEP="no")
# Privilege separation requires openpty()
if test "x$HAS_OPENPTY" = "xno" ; then
if test "x$HAVE_OPENPTY" = "xno" ; then
AC_MSG_ERROR([privilege separation code requires openpty()])
USE_PRIVSEP="no"
fi
if test "x$USE_PRIVSEP" = "xyes" ; then
AC_DEFINE([USE_PRIVSEP], 1, [Define to 1 to use privilege separation])
AC_SEARCH_LIBS(setproctitle, [util])
AC_CHECK_FUNC(setproctitle, [HAS_SETPROCTITLE="yes"])
if test "x$HAS_SETPROCTILE" = "xyes" ; then
AC_DEFINE([HAS_SETPROCTITLE], 1,
AC_CHECK_FUNC(setproctitle, [HAVE_SETPROCTITLE="yes"])
if test "x$HAVE_SETPROCTILE" = "xyes" ; then
AC_DEFINE([HAVE_SETPROCTITLE], 1,
[Define to 1 if you have the 'setproctitle function.])
fi
AC_CHECK_FUNCS(setresuid, [

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: privsep.c,v 1.4 2008/03/24 21:24:52 matthieu Exp $ */
/* $OpenBSD: privsep.c,v 1.5 2015/11/11 21:18:13 matthieu Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -44,10 +44,10 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef HAS_UTIL_H
#ifdef HAVE_UTIL_H
#include <util.h>
#endif
#ifdef HAS_PTY_H
#ifdef HAVE_PTY_H
#inlude <pty.h>
#endif
@@ -172,7 +172,7 @@ priv_init(uid_t uid, gid_t gid)
/* son */
for (i = 1; i <= _NSIG; i++)
signal(i, SIG_DFL);
#ifdef HAS_SETPROCTILE
#ifdef HAVE_SETPROCTILE
setproctitle("[priv]");
#endif
close(socks[1]);

View File

@@ -65,7 +65,7 @@ extern char *_XawTextGetSTRING(TextWidget ctx, XawTextPosition left,
#include <X11/Shell.h>
#include <ctype.h>
#include <stdlib.h>
#ifdef HAS_OPENPTY
#ifdef HAVE_OPENPTY
# ifdef HAVE_UTIL_H
# include <util.h>
# endif
@@ -175,7 +175,7 @@ static XrmOptionDescRec options[] = {
# endif
# if defined (SVR4) || defined (USE_PTS)
# include <termios.h>
# ifndef HAS_OPENPTY
# ifndef HAVE_OPENPTY
# include <sys/stropts.h> /* for I_PUSH */
# endif
# ifdef sun
@@ -827,7 +827,7 @@ get_pty(int *pty, int *tty, char *ttydev, char *ptydev)
return 1;
}
return 0;
#elif HAS_OPENPTY
#elif HAVE_OPENPTY
if (openpty(pty, tty, NULL, NULL, NULL) == -1) {
return 1;
}