diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2023-04-10 15:30:18 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2023-04-10 15:30:18 +0000 |
commit | 01ec2711b8be4b6349d3f86f155a3eca79f7c928 (patch) | |
tree | b7bd88ff269df272333c7719178ee9ecd7769997 /app | |
parent | 61318a4e2ebd8582caff59b877910a343942ae7e (diff) |
Update to xhost 1.0.9
Diffstat (limited to 'app')
-rw-r--r-- | app/xhost/COPYING | 2 | ||||
-rw-r--r-- | app/xhost/ChangeLog | 65 | ||||
-rw-r--r-- | app/xhost/Makefile.am | 11 | ||||
-rw-r--r-- | app/xhost/Makefile.in | 19 | ||||
-rw-r--r-- | app/xhost/aclocal.m4 | 84 | ||||
-rw-r--r-- | app/xhost/compile | 17 | ||||
-rw-r--r-- | app/xhost/config.h.in | 3 | ||||
-rw-r--r-- | app/xhost/configure | 298 | ||||
-rw-r--r-- | app/xhost/configure.ac | 27 | ||||
-rw-r--r-- | app/xhost/man/Makefile.in | 2 | ||||
-rw-r--r-- | app/xhost/xhost.c | 102 |
11 files changed, 517 insertions, 113 deletions
diff --git a/app/xhost/COPYING b/app/xhost/COPYING index bca8d40f7..0f884221b 100644 --- a/app/xhost/COPYING +++ b/app/xhost/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2000, 2004, 2022, Oracle and/or its affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/app/xhost/ChangeLog b/app/xhost/ChangeLog index abd8a7cbf..201d3dd11 100644 --- a/app/xhost/ChangeLog +++ b/app/xhost/ChangeLog @@ -1,3 +1,66 @@ +commit f9a30c707c14fc1ab75f7cc90c9c1eb6fcec3b6d +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Mon Dec 12 15:41:52 2022 -0800 + + xhost 1.0.9 + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 728ba52d5dc966e423d9416647c2e903c95d2217 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Sat Dec 3 10:10:05 2022 -0800 + + Simplify i18n of 'unable to get ... address for ...' error message + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 167ad7fa3a339da96798da49d05c3125045a87c2 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Mon Nov 7 16:03:47 2022 -0800 + + Use gettext() to localize messages if available + + Originally fixed for Solaris in May 2000 by Steve Swales under + Sun bug 4256527 "xhost messages not internationalized" + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 4b54c211e5e86d6ed62386ad9b7d676808b55766 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Mon Nov 7 14:21:28 2022 -0800 + + Recognize raw IPv6 numeric address + + Originally fixed for Solaris in Oct. 2002 under Sun bug 4759889 + "xhost does not accept raw IPv6 numeric address" + + Before this fix: + % xhost +2001:DB8::11 + xhost: unknown address family "2001" + xhost: bad hostname "2001:DB8::11" + + After this fix: + % xhost +2001:DB8::11 + 2001:DB8::11 being added to access control list + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 1d7015ba70362b09ac6a001d77e693a03fa0375e +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Mon Dec 6 14:31:13 2021 -0800 + + Build xz tarballs instead of bzip2 + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 8de485ec2760ba7de2391c3864d4fe62ceeb23d6 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Mon Dec 6 14:31:10 2021 -0800 + + gitlab CI: add a basic build test + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + commit 997135c6e37faa50f8b42a5f95c0cc8461ed6be9 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Tue Feb 19 14:50:20 2019 -0800 @@ -807,7 +870,7 @@ Date: Wed Jul 20 19:31:57 2005 +0000 configure cache, you cache it, and the cached value is probably wrong. commit 8b783444a5341f4698027d3a66650c179bc8fa2e -Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> +Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> Date: Tue Jul 5 21:12:45 2005 +0000 Add autogen.sh for xhost diff --git a/app/xhost/Makefile.am b/app/xhost/Makefile.am index 4c67a4fc8..07f36b290 100644 --- a/app/xhost/Makefile.am +++ b/app/xhost/Makefile.am @@ -19,3 +19,14 @@ ChangeLog: dist-hook: ChangeLog INSTALL EXTRA_DIST = README.md + +if USE_GETTEXT +AM_CPPFLAGS = -DLOCALEDIR='"$(LOCALEDIR)"' + +noinst_DATA = xhost.po + +xhost.po: $(xhost_SOURCES:%=$(srcdir)/%) + $(AM_V_GEN)xgettext -d xhost -n $(xhost_SOURCES:%=$(srcdir)/%) + +CLEANFILES = xhost.po +endif diff --git a/app/xhost/Makefile.in b/app/xhost/Makefile.in index 56cf87ee7..b08d90aba 100644 --- a/app/xhost/Makefile.in +++ b/app/xhost/Makefile.in @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -114,6 +115,7 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +DATA = $(noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -158,9 +160,9 @@ am__relativize = \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz GZIP_ENV = --best -DIST_TARGETS = dist-bzip2 dist-gzip +DIST_TARGETS = dist-xz dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -208,6 +210,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LOCALEDIR = @LOCALEDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -280,6 +283,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -294,6 +298,9 @@ AM_CFLAGS = $(CWARNFLAGS) $(XHOST_CFLAGS) $(XAU_CFLAGS) xhost_LDADD = $(XHOST_LIBS) MAINTAINERCLEANFILES = ChangeLog INSTALL EXTRA_DIST = README.md +@USE_GETTEXT_TRUE@AM_CPPFLAGS = -DLOCALEDIR='"$(LOCALEDIR)"' +@USE_GETTEXT_TRUE@noinst_DATA = xhost.po +@USE_GETTEXT_TRUE@CLEANFILES = xhost.po all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -620,6 +627,7 @@ distdir: $(DISTFILES) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) + dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) @@ -627,7 +635,6 @@ dist-bzip2: distdir dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) - dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) @@ -735,7 +742,7 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile $(PROGRAMS) config.h +all-am: Makefile $(PROGRAMS) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ @@ -763,6 +770,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -877,6 +885,9 @@ ChangeLog: dist-hook: ChangeLog INSTALL +@USE_GETTEXT_TRUE@xhost.po: $(xhost_SOURCES:%=$(srcdir)/%) +@USE_GETTEXT_TRUE@ $(AM_V_GEN)xgettext -d xhost -n $(xhost_SOURCES:%=$(srcdir)/%) + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/app/xhost/aclocal.m4 b/app/xhost/aclocal.m4 index fae8ce654..c4968d629 100644 --- a/app/xhost/aclocal.m4 +++ b/app/xhost/aclocal.m4 @@ -19,9 +19,9 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) -dnl +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) + dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> dnl @@ -62,7 +62,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -163,7 +163,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -173,11 +173,11 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -194,7 +194,7 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full @@ -1318,7 +1318,7 @@ AC_SUBST([am__untar]) dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl -dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. +dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates. 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"), @@ -1355,7 +1355,7 @@ dnl DEALINGS IN THE SOFTWARE. # 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.19.2]) +m4_define([vers_have], [1.20.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,, @@ -1376,7 +1376,7 @@ AM_MAINTAINER_MODE # 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_TOOL(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, @@ -1686,7 +1686,7 @@ AC_SUBST(MAKE_HTML) # 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 # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-xmlto option, it allows maximum flexibilty in making decisions +# the --with-xmlto option, it allows maximum flexibility in making decisions # as whether or not to use the xmlto package. When DEFAULT is not specified, # --with-xmlto assumes 'auto'. # @@ -1900,7 +1900,7 @@ AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) # 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 # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-asciidoc option, it allows maximum flexibilty in making decisions +# the --with-asciidoc option, it allows maximum flexibility in making decisions # as whether or not to use the asciidoc package. When DEFAULT is not specified, # --with-asciidoc assumes 'auto'. # @@ -1970,7 +1970,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) # 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 # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-doxygen option, it allows maximum flexibilty in making decisions +# the --with-doxygen option, it allows maximum flexibility in making decisions # as whether or not to use the doxygen package. When DEFAULT is not specified, # --with-doxygen assumes 'auto'. # @@ -2054,7 +2054,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) # 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 # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-groff option, it allows maximum flexibilty in making decisions +# the --with-groff option, it allows maximum flexibility in making decisions # as whether or not to use the groff package. When DEFAULT is not specified, # --with-groff assumes 'auto'. # @@ -2162,7 +2162,7 @@ AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) # 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 # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-fop option, it allows maximum flexibilty in making decisions +# the --with-fop option, it allows maximum flexibility in making decisions # as whether or not to use the fop package. When DEFAULT is not specified, # --with-fop assumes 'auto'. # @@ -2256,7 +2256,7 @@ AC_SUBST([M4], [$ac_cv_path_M4]) # 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 # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-ps2pdf option, it allows maximum flexibilty in making decisions +# the --with-ps2pdf option, it allows maximum flexibility in making decisions # as whether or not to use the ps2pdf package. When DEFAULT is not specified, # --with-ps2pdf assumes 'auto'. # @@ -2311,7 +2311,7 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) # not at the appropriate level. This macro enables a builder to skip all # documentation targets except traditional man pages. # Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibilty in controlling documentation building. +# maximum flexibility in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc @@ -2344,7 +2344,7 @@ AC_MSG_RESULT([$build_docs]) # # This macro enables a builder to skip all developer documentation. # Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibilty in controlling documentation building. +# maximum flexibility in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc @@ -2377,7 +2377,7 @@ AC_MSG_RESULT([$build_devel_docs]) # # This macro enables a builder to skip all functional specification targets. # Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibilty in controlling documentation building. +# maximum flexibility in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc @@ -2852,7 +2852,11 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) AC_DEFUN([XORG_COMPILER_BRAND], [ AC_LANG_CASE( [C], [ - AC_REQUIRE([AC_PROG_CC_C99]) + dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC + dnl and complains that AC_PROG_CC_C99 is obsolete + m4_version_prereq([2.70], + [AC_REQUIRE([AC_PROG_CC])], + [AC_REQUIRE([AC_PROG_CC_C99])]) ], [C++], [ AC_REQUIRE([AC_PROG_CXX]) @@ -2868,7 +2872,7 @@ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) # Minimum version: 1.16.0 # # Test if the compiler works when passed the given flag as a command line argument. -# If it succeeds, the flag is appeneded to the given variable. If not, it tries the +# If it succeeds, the flag is appended to the given variable. If not, it tries the # next flag in the list until there are no more options. # # Note that this does not guarantee that the compiler supports the flag as some @@ -2884,7 +2888,11 @@ AC_LANG_COMPILER_REQUIRE AC_LANG_CASE( [C], [ - AC_REQUIRE([AC_PROG_CC_C99]) + dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC + dnl and complains that AC_PROG_CC_C99 is obsolete + m4_version_prereq([2.70], + [AC_REQUIRE([AC_PROG_CC])], + [AC_REQUIRE([AC_PROG_CC_C99])]) define([PREFIX], [C]) define([CACHE_PREFIX], [cc]) define([COMPILER], [$CC]) @@ -3015,7 +3023,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) 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]], [-Wredundant-decls]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # These are currently disabled because they are noisy. They will be enabled @@ -3025,7 +3033,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # 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 +# Turn some warnings into errors, so we don't accidentally get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then @@ -3134,23 +3142,35 @@ AC_SUBST([BASE_]PREFIX[FLAGS]) AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) ]) # XORG_STRICT_OPTION +# XORG_DEFAULT_NOCODE_OPTIONS +# --------------------------- +# Minimum version: 1.20.0 +# +# Defines default options for X.Org modules which don't compile code, +# such as fonts, bitmaps, cursors, and docs. +# +AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [ +AC_REQUIRE([AC_PROG_INSTALL]) +XORG_RELEASE_VERSION +XORG_CHANGELOG +XORG_INSTALL +XORG_MANPAGE_SECTIONS +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], + [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) +]) # XORG_DEFAULT_NOCODE_OPTIONS + # XORG_DEFAULT_OPTIONS # -------------------- # Minimum version: 1.3.0 # -# Defines default options for X.Org modules. +# Defines default options for X.Org modules which compile code. # AC_DEFUN([XORG_DEFAULT_OPTIONS], [ AC_REQUIRE([AC_PROG_INSTALL]) XORG_COMPILER_FLAGS XORG_CWARNFLAGS XORG_STRICT_OPTION -XORG_RELEASE_VERSION -XORG_CHANGELOG -XORG_INSTALL -XORG_MANPAGE_SECTIONS -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], - [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) +XORG_DEFAULT_NOCODE_OPTIONS ]) # XORG_DEFAULT_OPTIONS # XORG_INSTALL() diff --git a/app/xhost/compile b/app/xhost/compile index a85b723c7..df363c8fb 100644 --- a/app/xhost/compile +++ b/app/xhost/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/app/xhost/config.h.in b/app/xhost/config.h.in index d756f9dc2..97adc71f0 100644 --- a/app/xhost/config.h.in +++ b/app/xhost/config.h.in @@ -99,6 +99,9 @@ /* Support UNIX socket connections */ #undef UNIXCONN +/* Define to 1 if you want to use the gettext() function. */ +#undef USE_GETTEXT + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE diff --git a/app/xhost/configure b/app/xhost/configure index 77f2cbaca..445345f41 100644 --- a/app/xhost/configure +++ b/app/xhost/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xhost 1.0.8. +# Generated by GNU Autoconf 2.69 for xhost 1.0.9. # -# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xhost/issues>. +# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xhost/-/issues>. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -267,7 +267,7 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: https://gitlab.freedesktop.org/xorg/app/xhost/issues +$0: https://gitlab.freedesktop.org/xorg/app/xhost/-/issues $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do @@ -581,9 +581,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xhost' PACKAGE_TARNAME='xhost' -PACKAGE_VERSION='1.0.8' -PACKAGE_STRING='xhost 1.0.8' -PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xhost/issues' +PACKAGE_VERSION='1.0.9' +PACKAGE_STRING='xhost 1.0.9' +PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xhost/-/issues' PACKAGE_URL='' ac_unique_file="Makefile.am" @@ -627,6 +627,9 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +USE_GETTEXT_FALSE +USE_GETTEXT_TRUE +LOCALEDIR XAU_LIBS XAU_CFLAGS XHOST_LIBS @@ -731,6 +734,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -763,6 +767,7 @@ enable_tcp_transport enable_ipv6 enable_local_transport enable_secure_rpc +with_localedir ' ac_precious_vars='build_alias host_alias @@ -818,6 +823,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1070,6 +1076,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1207,7 +1222,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1320,7 +1335,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xhost 1.0.8 to adapt to many kinds of systems. +\`configure' configures xhost 1.0.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1360,6 +1375,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1390,7 +1406,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xhost 1.0.8:";; + short | recursive ) echo "Configuration of xhost 1.0.9:";; esac cat <<\_ACEOF @@ -1420,6 +1436,12 @@ Optional Features: Enable os-specific local transport --enable-secure-rpc Enable Secure RPC +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-localedir=<path> Path to install message files in (default: + datadir/locale) + Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -1443,7 +1465,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to <https://gitlab.freedesktop.org/xorg/app/xhost/issues>. +Report bugs to <https://gitlab.freedesktop.org/xorg/app/xhost/-/issues>. _ACEOF ac_status=$? fi @@ -1506,7 +1528,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xhost configure 1.0.8 +xhost configure 1.0.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1665,9 +1687,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------------------------------------- ## -## Report this to https://gitlab.freedesktop.org/xorg/app/xhost/issues ## -## ------------------------------------------------------------------- ##" +( $as_echo "## --------------------------------------------------------------------- ## +## Report this to https://gitlab.freedesktop.org/xorg/app/xhost/-/issues ## +## --------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2032,7 +2054,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xhost $as_me 1.0.8, which was +It was created by xhost $as_me 1.0.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2861,7 +2883,7 @@ fi # Define the identity of the package. PACKAGE='xhost' - VERSION='1.0.8' + VERSION='1.0.9' cat >>confdefs.h <<_ACEOF @@ -6747,7 +6769,124 @@ $as_echo "$supported" >&6; } fi -# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) + + + + + + + + + + + + + +xorg_testset_save_CFLAGS="$CFLAGS" + +if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + xorg_cv_cc_flag_unknown_warning_option=yes +else + xorg_cv_cc_flag_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + xorg_cv_cc_flag_unused_command_line_argument=yes +else + xorg_cv_cc_flag_unused_command_line_argument=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +found="no" + + if test $found = "no" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + fi + + CFLAGS="$CFLAGS -Wredundant-decls" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5 +$as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; } + cacheid=xorg_cv_cc_flag__Wredundant_decls + if eval \${$cacheid+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval $cacheid=yes +else + eval $cacheid=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 +$as_echo "$supported" >&6; } + if test "$supported" = "yes" ; then + BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" + found="yes" + fi + fi + + @@ -6874,7 +7013,7 @@ $as_echo "$supported" >&6; } # 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 +# Turn some warnings into errors, so we don't accidentally get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then @@ -10546,6 +10685,8 @@ fi + + cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF @@ -10748,12 +10889,13 @@ AM_BACKSLASH='\' + # Checks for pkg-config packages # - Both CFLAGS & LIBS needed: pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XHOST" >&5 -$as_echo_n "checking for XHOST... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xproto >= 7.0.22 x11 xmuu" >&5 +$as_echo_n "checking for xproto >= 7.0.22 x11 xmuu... " >&6; } if test -n "$XHOST_CFLAGS"; then pkg_cv_XHOST_CFLAGS="$XHOST_CFLAGS" @@ -10793,7 +10935,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -10820,7 +10962,7 @@ Alternatively, you may set the environment variables XHOST_CFLAGS and XHOST_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -10844,8 +10986,8 @@ fi # - Only CFLAGS needed, not libs: pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XAU" >&5 -$as_echo_n "checking for XAU... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xau" >&5 +$as_echo_n "checking for xau... " >&6; } if test -n "$XAU_CFLAGS"; then pkg_cv_XAU_CFLAGS="$XAU_CFLAGS" @@ -10885,7 +11027,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -10912,7 +11054,7 @@ Alternatively, you may set the environment variables XAU_CFLAGS and XAU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -11431,6 +11573,100 @@ fi done +# Internationalization & localization support +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gettext" >&5 +$as_echo_n "checking for library containing gettext... " >&6; } +if ${ac_cv_search_gettext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gettext (); +int +main () +{ +return gettext (); + ; + return 0; +} +_ACEOF +for ac_lib in '' intl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_gettext=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_gettext+:} false; then : + break +fi +done +if ${ac_cv_search_gettext+:} false; then : + +else + ac_cv_search_gettext=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gettext" >&5 +$as_echo "$ac_cv_search_gettext" >&6; } +ac_res=$ac_cv_search_gettext +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + USE_GETTEXT="yes" +else + USE_GETTEXT="no" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to install localized messages" >&5 +$as_echo_n "checking where to install localized messages... " >&6; } + +# Check whether --with-localedir was given. +if test "${with_localedir+set}" = set; then : + withval=$with_localedir; LOCALEDIR=${withval} +else + LOCALEDIR=${datadir}/locale +fi + +if test "x$LOCALEDIR" = "xno" -o "x$USE_GETTEXT" = "xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: nowhere" >&5 +$as_echo "nowhere" >&6; } + USE_GETTEXT="no" +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCALEDIR" >&5 +$as_echo "$LOCALEDIR" >&6; } +fi + +if test "x$USE_GETTEXT" = "xyes" ; then + +$as_echo "#define USE_GETTEXT 1" >>confdefs.h + +fi + if test "x$USE_GETTEXT" = "xyes"; then + USE_GETTEXT_TRUE= + USE_GETTEXT_FALSE='#' +else + USE_GETTEXT_TRUE='#' + USE_GETTEXT_FALSE= +fi + + + ac_config_files="$ac_config_files Makefile man/Makefile" cat >confcache <<\_ACEOF @@ -11570,6 +11806,10 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${USE_GETTEXT_TRUE}" && test -z "${USE_GETTEXT_FALSE}"; then + as_fn_error $? "conditional \"USE_GETTEXT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -11967,7 +12207,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xhost $as_me 1.0.8, which was +This file was extended by xhost $as_me 1.0.9, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12027,13 +12267,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to <https://gitlab.freedesktop.org/xorg/app/xhost/issues>." +Report bugs to <https://gitlab.freedesktop.org/xorg/app/xhost/-/issues>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xhost config.status 1.0.8 +xhost config.status 1.0.9 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/app/xhost/configure.ac b/app/xhost/configure.ac index e8bf86cc5..60a74c21e 100644 --- a/app/xhost/configure.ac +++ b/app/xhost/configure.ac @@ -2,13 +2,13 @@ dnl Process this file with autoconf to create configure. # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([xhost], [1.0.8], - [https://gitlab.freedesktop.org/xorg/app/xhost/issues], [xhost]) +AC_INIT([xhost], [1.0.9], + [https://gitlab.freedesktop.org/xorg/app/xhost/-/issues], [xhost]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) # Initialize Automake -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-xz]) # Set common system defines for POSIX extensions, such as _GNU_SOURCE # Must be called before any macros that run the compiler (like @@ -45,6 +45,27 @@ esac # Checks for library functions. AC_CHECK_FUNCS([inet_aton]) +# Internationalization & localization support +AC_SEARCH_LIBS([gettext], [intl], [USE_GETTEXT="yes"], [USE_GETTEXT="no"]) +AC_MSG_CHECKING([where to install localized messages]) +AC_ARG_WITH([localedir], AS_HELP_STRING([--with-localedir=<path>], + [Path to install message files in (default: datadir/locale)]), + [LOCALEDIR=${withval}], [LOCALEDIR=${datadir}/locale]) +if test "x$LOCALEDIR" = "xno" -o "x$USE_GETTEXT" = "xno" ; then + AC_MSG_RESULT([nowhere]) + USE_GETTEXT="no" +else + AC_SUBST([LOCALEDIR]) + AC_MSG_RESULT([$LOCALEDIR]) +fi + +if test "x$USE_GETTEXT" = "xyes" ; then + AC_DEFINE([USE_GETTEXT], 1, + [Define to 1 if you want to use the gettext() function.]) +fi +AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes") + + AC_CONFIG_FILES([ Makefile man/Makefile]) diff --git a/app/xhost/man/Makefile.in b/app/xhost/man/Makefile.in index a559708ad..3e66c0b8d 100644 --- a/app/xhost/man/Makefile.in +++ b/app/xhost/man/Makefile.in @@ -152,6 +152,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LOCALEDIR = @LOCALEDIR@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -224,6 +225,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/app/xhost/xhost.c b/app/xhost/xhost.c index 639850601..1c855ee32 100644 --- a/app/xhost/xhost.c +++ b/app/xhost/xhost.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2004, 2022, Oracle and/or its affiliates. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -119,6 +119,13 @@ extern int getdomainname(char *name, size_t len); #endif #endif +#ifdef USE_GETTEXT +# include <locale.h> /* setlocale() */ +# include <libintl.h> /* gettext(), textdomain(), etc. */ +#else +# define gettext(a) (a) +#endif + static int change_host(Display *dpy, char *name, Bool add); static const char *get_hostname(XHostAddress *ha); static int local_xerror(Display *dpy, XErrorEvent *rep); @@ -179,15 +186,29 @@ main(int argc, char *argv[]) Bool enabled = False; Display *dpy; +#ifdef USE_GETTEXT + const char *domaindir; + + setlocale(LC_ALL, ""); + textdomain("xhost"); + + /* mainly for debugging */ + if ((domaindir = getenv("TEXTDOMAINDIR")) == NULL) { + domaindir = LOCALEDIR; + } + bindtextdomain("xhost", domaindir); +#endif + ProgramName = argv[0]; if (argc == 2 && !strcmp(argv[1], "-help")) { - fprintf(stderr, "usage: %s [[+-]hostname ...]\n", argv[0]); + fprintf(stderr, gettext("usage: %s [[+-]hostname ...]\n"), argv[0]); exit(1); } if ((dpy = XOpenDisplay(NULL)) == NULL) { - fprintf(stderr, "%s: unable to open display \"%s\"\n", + fprintf(stderr, + gettext("%s: unable to open display \"%s\"\n"), ProgramName, XDisplayName (NULL)); exit(1); } @@ -199,9 +220,9 @@ main(int argc, char *argv[]) sethostent(1); /* don't close the data base each time */ list = XListHosts(dpy, &nhosts, &enabled); if (enabled) - printf ("access control enabled, only authorized clients can connect\n"); + printf (gettext("access control enabled, only authorized clients can connect\n")); else - printf ("access control disabled, clients can connect from any host\n"); + printf (gettext("access control disabled, clients can connect from any host\n")); if (nhosts != 0) { for (i = 0; i < nhosts; i++ ) { @@ -230,16 +251,16 @@ main(int argc, char *argv[]) printf("SI:"); break; default: - printf("<unknown family type %d>:", list[i].family); + printf(gettext("<unknown family type %d>:"), list[i].family); break; } printf ("%s", hostname); } else { - printf ("<unknown address in family %d>", + printf (gettext("<unknown address in family %d>"), list[i].family); } if (nameserver_timedout) { - printf("\t(no nameserver response within %d seconds)\n", + printf(gettext("\t(no nameserver response within %d seconds)\n"), NAMESERVER_TIMEOUT); nameserver_timedout = 0; } else @@ -256,26 +277,26 @@ main(int argc, char *argv[]) if (*arg == '-') { if (!argv[i][1] && ((i+1) == argc)) { - printf ("access control enabled, only authorized clients can connect\n"); + printf (gettext("access control enabled, only authorized clients can connect\n")); XEnableAccessControl(dpy); } else { arg = argv[i][1]? &argv[i][1] : argv[++i]; if (!change_host (dpy, arg, False)) { - fprintf (stderr, "%s: bad hostname \"%s\"\n", + fprintf (stderr, gettext("%s: bad hostname \"%s\"\n"), ProgramName, arg); nfailed++; } } } else { if (*arg == '+' && !argv[i][1] && ((i+1) == argc)) { - printf ("access control disabled, clients can connect from any host\n"); + printf (gettext("access control disabled, clients can connect from any host\n")); XDisableAccessControl(dpy); } else { if (*arg == '+') { arg = argv[i][1]? &argv[i][1] : argv[++i]; } if (!change_host (dpy, arg, True)) { - fprintf (stderr, "%s: bad hostname \"%s\"\n", + fprintf (stderr, gettext("%s: bad hostname \"%s\"\n"), ProgramName, arg); nfailed++; } @@ -316,12 +337,13 @@ change_host(Display *dpy, char *name, Bool add) #endif #endif char *cp; - static const char *add_msg = "being added to access control list"; - static const char *remove_msg = "being removed from access control list"; + const char *add_msg = gettext("being added to access control list"); + const char *remove_msg = gettext("being removed from access control list"); namelen = strlen(name); if ((lname = (char *)malloc(namelen+1)) == NULL) { - fprintf (stderr, "%s: malloc bombed in change_host\n", ProgramName); + fprintf (stderr, gettext("%s: malloc bombed in change_host\n"), + ProgramName); exit (1); } for (i = 0; i < namelen; i++) { @@ -333,7 +355,7 @@ change_host(Display *dpy, char *name, Bool add) family = FamilyInternet; name += 5; #else - fprintf (stderr, "%s: not compiled for TCP/IP\n", ProgramName); + fprintf (stderr, gettext("%s: not compiled for TCP/IP\n"), ProgramName); free(lname); return 0; #endif @@ -343,7 +365,7 @@ change_host(Display *dpy, char *name, Bool add) family = FamilyInternet6; name += 6; #else - fprintf (stderr, "%s: not compiled for IPv6\n", ProgramName); + fprintf (stderr, gettext("%s: not compiled for IPv6\n"), ProgramName); free(lname); return 0; #endif @@ -355,14 +377,14 @@ change_host(Display *dpy, char *name, Bool add) family = FamilyInternet6; name += 7; #else - fprintf (stderr, "%s: not compiled for IPv6\n", ProgramName); + fprintf (stderr, gettext("%s: not compiled for IPv6\n"), ProgramName); free(lname); return 0; #endif } #endif /* ACCEPT_INETV6 */ else if (!strncmp("dnet:", lname, 5)) { - fprintf (stderr, "%s: not compiled for DECnet\n", ProgramName); + fprintf (stderr, gettext("%s: not compiled for DECnet\n"), ProgramName); free(lname); return 0; } @@ -371,7 +393,7 @@ change_host(Display *dpy, char *name, Bool add) family = FamilyNetname; name += 4; #else - fprintf (stderr, "%s: not compiled for Secure RPC\n", ProgramName); + fprintf (stderr, gettext("%s: not compiled for Secure RPC\n"), ProgramName); free(lname); return 0; #endif @@ -381,7 +403,7 @@ change_host(Display *dpy, char *name, Bool add) family = FamilyKrb5Principal; name +=4; #else - fprintf (stderr, "%s: not compiled for Kerberos 5\n", ProgramName); + fprintf (stderr, gettext("%s: not compiled for Kerberos 5\n"), ProgramName); free(lname); return 0; #endif @@ -394,11 +416,21 @@ change_host(Display *dpy, char *name, Bool add) name += 3; } if (family == FamilyWild && (cp = strchr(lname, ':'))) { - *cp = '\0'; - fprintf (stderr, "%s: unknown address family \"%s\"\n", - ProgramName, lname); - free(lname); - return 0; +#ifdef IPv6 + /* + * Check to see if inet_pton() can grok it as an IPv6 address + */ + if (inet_pton(AF_INET6, lname, &addr6.s6_addr) == 1) { + family = FamilyInternet6; + } else +#endif + { + *cp = '\0'; + fprintf (stderr, gettext("%s: unknown address family \"%s\"\n"), + ProgramName, lname); + free(lname); + return 0; + } } free(lname); @@ -408,8 +440,8 @@ change_host(Display *dpy, char *name, Bool add) cp = strchr(name, ':'); if (cp == NULL || cp == name) { - fprintf(stderr, - "%s: type must be specified for server interpreted family \"%s\"\n", + fprintf(stderr, gettext( + "%s: type must be specified for server interpreted family \"%s\"\n"), ProgramName, name); return 0; } @@ -437,7 +469,7 @@ change_host(Display *dpy, char *name, Bool add) retval = krb5_parse_name(name, &princ); if (retval) { krb5_init_ets(); /* init krb errs for error_message() */ - fprintf(stderr, "%s: cannot parse Kerberos name: %s\n", + fprintf(stderr, gettext("%s: cannot parse Kerberos name: %s\n"), ProgramName, error_message(retval)); return 0; } @@ -464,7 +496,7 @@ change_host(Display *dpy, char *name, Bool add) XAddHost(dpy, &ha); else XRemoveHost(dpy, &ha); - printf( "non-network local connections %s\n", add ? add_msg : remove_msg); + printf( gettext("non-network local connections %s\n"), add ? add_msg : remove_msg); return 1; } /* @@ -483,12 +515,12 @@ change_host(Display *dpy, char *name, Bool add) *cp = '\0'; pwd = getpwnam(name); if (!pwd) { - fprintf(stderr, "no such user \"%s\"\n", name); + fprintf(stderr, gettext("no such user \"%s\"\n"), name); return 0; } getdomainname(domainname, sizeof(domainname)); if (!user2netname(username, pwd->pw_uid, domainname)) { - fprintf(stderr, "failed to get netname for \"%s\"\n", name); + fprintf(stderr, gettext("failed to get netname for \"%s\"\n"), name); return 0; } netname = username; @@ -600,7 +632,7 @@ change_host(Display *dpy, char *name, Bool add) familyMsg = "inet "; } - fprintf(stderr, "%s: unable to get %saddress for \"%s\"\n", + fprintf(stderr, gettext("%s: unable to get %saddress for \"%s\"\n"), ProgramName, familyMsg, name); } freeaddrinfo(addresses); @@ -842,13 +874,13 @@ local_xerror(Display *dpy, XErrorEvent *rep) { if ((rep->error_code == BadAccess) && (rep->request_code == X_ChangeHosts)) { fprintf (stderr, - "%s: must be on local machine to add or remove hosts.\n", + gettext("%s: must be on local machine to add or remove hosts.\n"), ProgramName); return 1; } else if ((rep->error_code == BadAccess) && (rep->request_code == X_SetAccessControl)) { fprintf (stderr, - "%s: must be on local machine to enable or disable access control.\n", + gettext("%s: must be on local machine to enable or disable access control.\n"), ProgramName); return 1; } else if ((rep->error_code == BadValue) && |