mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-14 21:29:14 +00:00
Update to xinit 1.3.0
This commit is contained in:
@@ -1,3 +1,240 @@
|
||||
commit cc92823c61f9f4d31a25d107017198d1e16d4fcf
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat Oct 30 16:44:22 2010 -0700
|
||||
|
||||
xinit 1.3.0
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit b5ff96271ebf30422f0a4af487ba9b35ce9c2e80
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Thu Sep 23 20:26:42 2010 -0700
|
||||
|
||||
config: Remove unnecessary calls from configure.ac
|
||||
|
||||
AC_PROG_CC, AC_PROG_SED, & AC_PROG_INSTALL are provided by
|
||||
XORG_DEFAULT_OPTIONS 1.8
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 4afe755b28f48390b16d16434cd14a756ef464ce
|
||||
Author: Gaetan Nadon <memsize@videotron.ca>
|
||||
Date: Tue Jul 20 18:45:18 2010 -0400
|
||||
|
||||
config: update AC_PREREQ statement to 2.60
|
||||
|
||||
Unrelated to the previous patches, the new value simply reflects
|
||||
the reality that the minimum level for autoconf to configure
|
||||
all x.org modules is 2.60 dated June 2006.
|
||||
|
||||
ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
|
||||
|
||||
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
|
||||
|
||||
commit d15d988eaf63d4f840d09ba12caade6bea5f7618
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Mon Jul 12 16:55:03 2010 -0700
|
||||
|
||||
launchd: Explicitly search /sbin
|
||||
|
||||
Previously, launchd wasn't found if /sbin wasn't in the user's PATH.
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=29028
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit 908273df8c0a7a13ff20e4ed4b7b470521f12ce2
|
||||
Author: David Shao <davshao@gmail.com>
|
||||
Date: Fri May 21 12:44:53 2010 -0700
|
||||
|
||||
DragonFly BSD: includes for PRIO_PROCESS and setpriority() in xinit.c
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 8464a8ab360b72f6817b19ce99b12f0793fbee74
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Mon May 3 00:25:30 2010 -0700
|
||||
|
||||
darwin: Make __APPLE__ path in startx POSIX compliant
|
||||
|
||||
http://xquartz.macosforge.org/trac/ticket/399
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit e4548fe62d58d7cb891dc142c400c22031d471fb
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Sun Apr 25 03:21:43 2010 +0700
|
||||
|
||||
Remove OS/2 leftovers
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit c82295911409c611c097ef2e1269a78d54314304
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Thu Apr 15 11:40:33 2010 -0700
|
||||
|
||||
Enable support for an xinitrc.d directory
|
||||
|
||||
This was already done on darwin and Gentoo. Now others can benefit.
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
||||
Reviewed-by: Rémi Cardona <remi@gentoo.org>
|
||||
Reviewed-by: James Cloos <cloos@jhcloos.com>
|
||||
|
||||
commit 7f9d31e6342ffe5f2903fb2f4e5d3a1e4e5ed1df
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:29 2010 +0700
|
||||
|
||||
Rationalize errors output
|
||||
|
||||
Implement Errorx/Fatalx in addition to existing Error/Fatal, replace
|
||||
all fprintf(stderr)/exit with Fatal, all fprintf(stderr) with Error.
|
||||
|
||||
Additionally harmonize capitalization and punctuation of error messages.
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 3676185a3e3bf1e57362ed4978825d9d6d53592c
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:28 2010 +0700
|
||||
|
||||
Fix comment indentation
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit c0f6753d2de16826300a04232e54fbd3aa54c406
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:27 2010 +0700
|
||||
|
||||
Use signals from Unix98 and drop pre-POSIX compatibility
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 15cf3d560ab5b6847d8891208080ac964c1682fb
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:26 2010 +0700
|
||||
|
||||
Use sigaction(2) instead of signal(2) to handle SIGUSR1 and SIGALRM
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit fa009dcc191e1d70937e5fb4dd8ae8d9c151a607
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:25 2010 +0700
|
||||
|
||||
sys/wait.h is in Unix98
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit a13649f91f3856040f53c47d14a2cccff943c702
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:24 2010 +0700
|
||||
|
||||
setpriority and PRIO_PROCESS are in Unix98
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 598cb2f5e433014b02eec6270a73bcb95cd7b15a
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:23 2010 +0700
|
||||
|
||||
SIGTT{IN,OU} is in Unix98
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit ce5aa4e7a30bff3207695b9ce8cbdcd56ff7b36c
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:22 2010 +0700
|
||||
|
||||
SIGCHLD is in Unix98
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit d12f1f2dd625f507cf8a504854dad0a9efd86259
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:21 2010 +0700
|
||||
|
||||
killpg(2) is in Unix98
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 36e3f13a32c8ced264d666f1091db7e1bb523e86
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:20 2010 +0700
|
||||
|
||||
waitpid(2) is in Unix98
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 63ba277c694104b3f01d0a1adee7903631607694
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:19 2010 +0700
|
||||
|
||||
Use EXIT_{SUCCESS, FAILURE} from C90 instead of homegrown equivalents
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit a63c31f74e1c11509b561ab9687138f5c960df0f
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:18 2010 +0700
|
||||
|
||||
Stop converting functions' return types to void
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 5dea0c1caaeb0d7f1280fd28c80c3c1bc10c34d0
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:17 2010 +0700
|
||||
|
||||
Simplify environment juggling by using fork() instead of vfork()
|
||||
|
||||
xinit used to copy process environment in order to give client correct DISPLAY
|
||||
and WINDOWPATH variables. It was not possible to do it in client process because
|
||||
it was vforked, not forked.
|
||||
|
||||
As vfork() usage was not entirely correct (manpage specifies that behaviour is
|
||||
undefined if there are any memory modifications between vfork and exec), switch
|
||||
to fork(), move setting environment variables to client process and and drop all
|
||||
the manual mucking with environment.
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 2df4ba3b0ef40cefcac2774e042dad0d2df17424
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Apr 14 03:03:16 2010 +0700
|
||||
|
||||
Fix whitespace
|
||||
|
||||
File was indented with mix of 8-space and tab symbols and inconsistently
|
||||
formatted. Apply more-or-less consistent formatting and reindent everything to
|
||||
4-space.
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 0ffa7f2402ae06371aa09a513798a4400b5727c0
|
||||
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Date: Wed Mar 31 18:15:03 2010 +0700
|
||||
|
||||
Nuke OS/2 and LynxOS support remnants.
|
||||
|
||||
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit eb541d73b35716e1deaccc3c328473e04a5ef024
|
||||
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
|
||||
Date: Mon Mar 15 15:41:48 2010 -0700
|
||||
|
||||
@@ -78,7 +78,7 @@ MAINTAINERCLEANFILES = ChangeLog INSTALL
|
||||
CLEANFILES = xinitrc startx $(appman_DATA) $(launchagents_DATA)
|
||||
|
||||
EXTRA_DIST = xinitrc.cpp startx.cpp org.x.startx.plist.cpp $(appman_PRE) \
|
||||
startx.cmd xinitrc.cmd xinit.def autogen.sh
|
||||
autogen.sh
|
||||
|
||||
.PHONY: ChangeLog INSTALL
|
||||
|
||||
|
||||
@@ -70,8 +70,8 @@ bin_PROGRAMS = xinit$(EXEEXT)
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure $(top_srcdir)/cpprules.in AUTHORS \
|
||||
COPYING ChangeLog INSTALL NEWS compile config.guess config.sub \
|
||||
depcomp install-sh missing
|
||||
COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \
|
||||
install-sh missing
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
@@ -337,7 +337,7 @@ xinitrc_DATA = xinitrc
|
||||
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
||||
CLEANFILES = xinitrc startx $(appman_DATA) $(launchagents_DATA)
|
||||
EXTRA_DIST = xinitrc.cpp startx.cpp org.x.startx.plist.cpp $(appman_PRE) \
|
||||
startx.cmd xinitrc.cmd xinit.def autogen.sh
|
||||
autogen.sh
|
||||
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
182
app/xinit/aclocal.m4
vendored
182
app/xinit/aclocal.m4
vendored
@@ -740,34 +740,6 @@ AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_PROG_CC_C_O
|
||||
# --------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake.
|
||||
AC_DEFUN([AM_PROG_CC_C_O],
|
||||
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
# FIXME: we rely on the cache variable name because
|
||||
# there is no other way.
|
||||
set dummy $CC
|
||||
ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
|
||||
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
|
||||
@@ -1025,7 +997,7 @@ AC_SUBST([am__untar])
|
||||
|
||||
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
|
||||
dnl
|
||||
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
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"),
|
||||
@@ -1062,7 +1034,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.8.0])
|
||||
m4_define([vers_have], [1.11.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,,
|
||||
@@ -1213,6 +1185,7 @@ MAN_SUBSTS="\
|
||||
-e 's|__xservername__|Xorg|g' \
|
||||
-e 's|__xconfigfile__|xorg.conf|g' \
|
||||
-e 's|__projectroot__|\$(prefix)|g' \
|
||||
-e 's|__apploaddir__|\$(appdefaultdir)|g' \
|
||||
-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
|
||||
-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
|
||||
-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
|
||||
@@ -1241,13 +1214,20 @@ PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
|
||||
fi])
|
||||
])
|
||||
|
||||
# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
|
||||
# the path and the name of the doc stylesheet
|
||||
if test "x$XORG_SGML_PATH" != "x" ; then
|
||||
AC_MSG_RESULT([$XORG_SGML_PATH])
|
||||
STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
|
||||
XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_SUBST(XORG_SGML_PATH)
|
||||
AC_SUBST(STYLESHEET_SRCDIR)
|
||||
AC_SUBST(XSL_STYLESHEET)
|
||||
AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
|
||||
]) # XORG_CHECK_SGML_DOCTOOLS
|
||||
|
||||
# XORG_CHECK_LINUXDOC
|
||||
@@ -1363,15 +1343,17 @@ AC_SUBST(MAKE_PDF)
|
||||
AC_SUBST(MAKE_HTML)
|
||||
]) # XORG_CHECK_DOCBOOK
|
||||
|
||||
# XORG_WITH_XMLTO([MIN-VERSION])
|
||||
# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
|
||||
# ----------------
|
||||
# Minimum version: 1.5.0
|
||||
# Minimum version for optional DEFAULT argument: 1.11.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
|
||||
# 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
|
||||
# as whether or not to use the xmlto package.
|
||||
# as whether or not to use the xmlto package. When DEFAULT is not specified,
|
||||
# --with-xmlto assumes 'auto'.
|
||||
#
|
||||
# Interface to module:
|
||||
# HAVE_XMLTO: used in makefiles to conditionally generate documentation
|
||||
@@ -1380,14 +1362,20 @@ AC_SUBST(MAKE_HTML)
|
||||
# --with-xmlto: 'yes' user instructs the module to use xmlto
|
||||
# 'no' user instructs the module not to use xmlto
|
||||
#
|
||||
# Added in version 1.10.0
|
||||
# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
|
||||
# xmlto for text output requires either lynx, links, or w3m browsers
|
||||
#
|
||||
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
|
||||
#
|
||||
AC_DEFUN([XORG_WITH_XMLTO],[
|
||||
AC_ARG_VAR([XMLTO], [Path to xmlto command])
|
||||
m4_define([_defopt], m4_default([$2], [auto]))
|
||||
AC_ARG_WITH(xmlto,
|
||||
AS_HELP_STRING([--with-xmlto],
|
||||
[Use xmlto to regenerate documentation (default: yes, if installed)]),
|
||||
[use_xmlto=$withval], [use_xmlto=auto])
|
||||
[Use xmlto to regenerate documentation (default: ]_defopt[)]),
|
||||
[use_xmlto=$withval], [use_xmlto=]_defopt)
|
||||
m4_undefine([_defopt])
|
||||
|
||||
if test "x$use_xmlto" = x"auto"; then
|
||||
AC_PATH_PROG([XMLTO], [xmlto])
|
||||
@@ -1411,6 +1399,8 @@ elif test "x$use_xmlto" = x"no" ; then
|
||||
else
|
||||
AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
|
||||
fi
|
||||
|
||||
# Test for a minimum version of xmlto, if provided.
|
||||
m4_ifval([$1],
|
||||
[if test "$have_xmlto" = yes; then
|
||||
# scrape the xmlto version
|
||||
@@ -1425,18 +1415,31 @@ m4_ifval([$1],
|
||||
AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
# Test for the ability of xmlto to generate a text target
|
||||
have_xmlto_text=no
|
||||
cat > conftest.xml << "EOF"
|
||||
EOF
|
||||
AS_IF([test "$have_xmlto" = yes],
|
||||
[AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
|
||||
[have_xmlto_text=yes],
|
||||
[AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
|
||||
rm -f conftest.xml
|
||||
AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
|
||||
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
|
||||
]) # XORG_WITH_XMLTO
|
||||
|
||||
# XORG_WITH_ASCIIDOC([MIN-VERSION])
|
||||
# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
|
||||
# ----------------
|
||||
# Minimum version: 1.5.0
|
||||
# Minimum version for optional DEFAULT argument: 1.11.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
|
||||
# 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
|
||||
# as whether or not to use the asciidoc package.
|
||||
# as whether or not to use the asciidoc package. When DEFAULT is not specified,
|
||||
# --with-asciidoc assumes 'auto'.
|
||||
#
|
||||
# Interface to module:
|
||||
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
|
||||
@@ -1449,10 +1452,12 @@ AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
|
||||
#
|
||||
AC_DEFUN([XORG_WITH_ASCIIDOC],[
|
||||
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
|
||||
m4_define([_defopt], m4_default([$2], [auto]))
|
||||
AC_ARG_WITH(asciidoc,
|
||||
AS_HELP_STRING([--with-asciidoc],
|
||||
[Use asciidoc to regenerate documentation (default: yes, if installed)]),
|
||||
[use_asciidoc=$withval], [use_asciidoc=auto])
|
||||
[Use asciidoc to regenerate documentation (default: ]_defopt[)]),
|
||||
[use_asciidoc=$withval], [use_asciidoc=]_defopt)
|
||||
m4_undefine([_defopt])
|
||||
|
||||
if test "x$use_asciidoc" = x"auto"; then
|
||||
AC_PATH_PROG([ASCIIDOC], [asciidoc])
|
||||
@@ -1493,15 +1498,17 @@ fi])
|
||||
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
|
||||
]) # XORG_WITH_ASCIIDOC
|
||||
|
||||
# XORG_WITH_DOXYGEN([MIN-VERSION])
|
||||
# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
|
||||
# --------------------------------
|
||||
# Minimum version: 1.5.0
|
||||
# Minimum version for optional DEFAULT argument: 1.11.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
|
||||
# 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
|
||||
# as whether or not to use the doxygen package.
|
||||
# as whether or not to use the doxygen package. When DEFAULT is not specified,
|
||||
# --with-doxygen assumes 'auto'.
|
||||
#
|
||||
# Interface to module:
|
||||
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
|
||||
@@ -1514,10 +1521,12 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
|
||||
#
|
||||
AC_DEFUN([XORG_WITH_DOXYGEN],[
|
||||
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
|
||||
m4_define([_defopt], m4_default([$2], [auto]))
|
||||
AC_ARG_WITH(doxygen,
|
||||
AS_HELP_STRING([--with-doxygen],
|
||||
[Use doxygen to regenerate documentation (default: yes, if installed)]),
|
||||
[use_doxygen=$withval], [use_doxygen=auto])
|
||||
[Use doxygen to regenerate documentation (default: ]_defopt[)]),
|
||||
[use_doxygen=$withval], [use_doxygen=]_defopt)
|
||||
m4_undefine([_defopt])
|
||||
|
||||
if test "x$use_doxygen" = x"auto"; then
|
||||
AC_PATH_PROG([DOXYGEN], [doxygen])
|
||||
@@ -1558,15 +1567,17 @@ fi])
|
||||
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
|
||||
]) # XORG_WITH_DOXYGEN
|
||||
|
||||
# XORG_WITH_GROFF
|
||||
# XORG_WITH_GROFF([DEFAULT])
|
||||
# ----------------
|
||||
# Minimum version: 1.6.0
|
||||
# Minimum version for optional DEFAULT argument: 1.11.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
|
||||
# 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
|
||||
# as whether or not to use the groff package.
|
||||
# as whether or not to use the groff package. When DEFAULT is not specified,
|
||||
# --with-groff assumes 'auto'.
|
||||
#
|
||||
# Interface to module:
|
||||
# HAVE_GROFF: used in makefiles to conditionally generate documentation
|
||||
@@ -1577,6 +1588,12 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
|
||||
# --with-groff: 'yes' user instructs the module to use groff
|
||||
# 'no' user instructs the module not to use groff
|
||||
#
|
||||
# Added in version 1.9.0:
|
||||
# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
|
||||
# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
|
||||
# psselect from the psutils package.
|
||||
# the ghostcript package. Refer to the grohtml man pages
|
||||
#
|
||||
# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
|
||||
#
|
||||
# OS and distros often splits groff in a basic and full package, the former
|
||||
@@ -1589,10 +1606,12 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
|
||||
#
|
||||
AC_DEFUN([XORG_WITH_GROFF],[
|
||||
AC_ARG_VAR([GROFF], [Path to groff command])
|
||||
m4_define([_defopt], m4_default([$1], [auto]))
|
||||
AC_ARG_WITH(groff,
|
||||
AS_HELP_STRING([--with-groff],
|
||||
[Use groff to regenerate documentation (default: yes, if installed)]),
|
||||
[use_groff=$withval], [use_groff=auto])
|
||||
[Use groff to regenerate documentation (default: ]_defopt[)]),
|
||||
[use_groff=$withval], [use_groff=]_defopt)
|
||||
m4_undefine([_defopt])
|
||||
|
||||
if test "x$use_groff" = x"auto"; then
|
||||
AC_PATH_PROG([GROFF], [groff])
|
||||
@@ -1616,6 +1635,7 @@ elif test "x$use_groff" = x"no" ; then
|
||||
else
|
||||
AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
|
||||
fi
|
||||
|
||||
# We have groff, test for the presence of the macro packages
|
||||
if test "x$have_groff" = x"yes"; then
|
||||
AC_MSG_CHECKING([for ${GROFF} -ms macros])
|
||||
@@ -1633,20 +1653,38 @@ if test "x$have_groff" = x"yes"; then
|
||||
fi
|
||||
AC_MSG_RESULT([$groff_mm_works])
|
||||
fi
|
||||
|
||||
# We have groff, test for HTML dependencies, one command per package
|
||||
if test "x$have_groff" = x"yes"; then
|
||||
AC_PATH_PROGS(GS_PATH, [gs gswin32c])
|
||||
AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
|
||||
AC_PATH_PROG(PSSELECT_PATH, [psselect])
|
||||
if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
|
||||
have_groff_html=yes
|
||||
else
|
||||
have_groff_html=no
|
||||
AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set Automake conditionals for Makefiles
|
||||
AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
|
||||
AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
|
||||
AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
|
||||
AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
|
||||
]) # XORG_WITH_GROFF
|
||||
|
||||
# XORG_WITH_FOP
|
||||
# XORG_WITH_FOP([DEFAULT])
|
||||
# ----------------
|
||||
# Minimum version: 1.6.0
|
||||
# Minimum version for optional DEFAULT argument: 1.11.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
|
||||
# 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
|
||||
# as whether or not to use the fop package.
|
||||
# as whether or not to use the fop package. When DEFAULT is not specified,
|
||||
# --with-fop assumes 'auto'.
|
||||
#
|
||||
# Interface to module:
|
||||
# HAVE_FOP: used in makefiles to conditionally generate documentation
|
||||
@@ -1659,10 +1697,12 @@ AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
|
||||
#
|
||||
AC_DEFUN([XORG_WITH_FOP],[
|
||||
AC_ARG_VAR([FOP], [Path to fop command])
|
||||
m4_define([_defopt], m4_default([$1], [auto]))
|
||||
AC_ARG_WITH(fop,
|
||||
AS_HELP_STRING([--with-fop],
|
||||
[Use fop to regenerate documentation (default: yes, if installed)]),
|
||||
[use_fop=$withval], [use_fop=auto])
|
||||
[Use fop to regenerate documentation (default: ]_defopt[)]),
|
||||
[use_fop=$withval], [use_fop=]_defopt)
|
||||
m4_undefine([_defopt])
|
||||
|
||||
if test "x$use_fop" = x"auto"; then
|
||||
AC_PATH_PROG([FOP], [fop])
|
||||
@@ -1689,15 +1729,17 @@ fi
|
||||
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
|
||||
]) # XORG_WITH_FOP
|
||||
|
||||
# XORG_WITH_PS2PDF
|
||||
# XORG_WITH_PS2PDF([DEFAULT])
|
||||
# ----------------
|
||||
# Minimum version: 1.6.0
|
||||
# Minimum version for optional DEFAULT argument: 1.11.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
|
||||
# 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
|
||||
# as whether or not to use the ps2pdf package.
|
||||
# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
|
||||
# --with-ps2pdf assumes 'auto'.
|
||||
#
|
||||
# Interface to module:
|
||||
# HAVE_PS2PDF: used in makefiles to conditionally generate documentation
|
||||
@@ -1710,10 +1752,12 @@ AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
|
||||
#
|
||||
AC_DEFUN([XORG_WITH_PS2PDF],[
|
||||
AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
|
||||
m4_define([_defopt], m4_default([$1], [auto]))
|
||||
AC_ARG_WITH(ps2pdf,
|
||||
AS_HELP_STRING([--with-ps2pdf],
|
||||
[Use ps2pdf to regenerate documentation (default: yes, if installed)]),
|
||||
[use_ps2pdf=$withval], [use_ps2pdf=auto])
|
||||
[Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
|
||||
[use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
|
||||
m4_undefine([_defopt])
|
||||
|
||||
if test "x$use_ps2pdf" = x"auto"; then
|
||||
AC_PATH_PROG([PS2PDF], [ps2pdf])
|
||||
@@ -1764,14 +1808,12 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
|
||||
# parm1: specify the default value, yes or no.
|
||||
#
|
||||
AC_DEFUN([XORG_ENABLE_DOCS],[
|
||||
default=$1
|
||||
if test "x$default" = x ; then
|
||||
default="yes"
|
||||
fi
|
||||
m4_define([default], m4_default([$1], [yes]))
|
||||
AC_ARG_ENABLE(docs,
|
||||
AS_HELP_STRING([--enable-docs],
|
||||
[Enable building the documentation (default: yes)]),
|
||||
[build_docs=$enableval], [build_docs=$default])
|
||||
[Enable building the documentation (default: ]default[)]),
|
||||
[build_docs=$enableval], [build_docs=]default)
|
||||
m4_undefine([default])
|
||||
AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
|
||||
AC_MSG_CHECKING([whether to build documentation])
|
||||
AC_MSG_RESULT([$build_docs])
|
||||
@@ -1799,14 +1841,12 @@ AC_MSG_RESULT([$build_docs])
|
||||
# parm1: specify the default value, yes or no.
|
||||
#
|
||||
AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
|
||||
devel_default=$1
|
||||
if test "x$devel_default" = x ; then
|
||||
devel_default="yes"
|
||||
fi
|
||||
m4_define([devel_default], m4_default([$1], [yes]))
|
||||
AC_ARG_ENABLE(devel-docs,
|
||||
AS_HELP_STRING([--enable-devel-docs],
|
||||
[Enable building the developer documentation (default: yes)]),
|
||||
[build_devel_docs=$enableval], [build_devel_docs=$devel_default])
|
||||
[Enable building the developer documentation (default: ]devel_default[)]),
|
||||
[build_devel_docs=$enableval], [build_devel_docs=]devel_default)
|
||||
m4_undefine([devel_default])
|
||||
AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
|
||||
AC_MSG_CHECKING([whether to build developer documentation])
|
||||
AC_MSG_RESULT([$build_devel_docs])
|
||||
@@ -1834,14 +1874,12 @@ AC_MSG_RESULT([$build_devel_docs])
|
||||
# parm1: specify the default value, yes or no.
|
||||
#
|
||||
AC_DEFUN([XORG_ENABLE_SPECS],[
|
||||
spec_default=$1
|
||||
if test "x$spec_default" = x ; then
|
||||
spec_default="yes"
|
||||
fi
|
||||
m4_define([spec_default], m4_default([$1], [yes]))
|
||||
AC_ARG_ENABLE(specs,
|
||||
AS_HELP_STRING([--enable-specs],
|
||||
[Enable building the specs (default: yes)]),
|
||||
[build_specs=$enableval], [build_specs=$spec_default])
|
||||
[Enable building the specs (default: ]spec_default[)]),
|
||||
[build_specs=$enableval], [build_specs=]spec_default)
|
||||
m4_undefine([spec_default])
|
||||
AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
|
||||
AC_MSG_CHECKING([whether to build functional specifications])
|
||||
AC_MSG_RESULT([$build_specs])
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2009-10-06.20; # UTC
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -1,14 +1,8 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#undef HAVE_FORK
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `killpg' function. */
|
||||
#undef HAVE_KILLPG
|
||||
|
||||
/* launchd support available */
|
||||
#undef HAVE_LAUNCHD
|
||||
|
||||
@@ -36,24 +30,9 @@
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vfork' function. */
|
||||
#undef HAVE_VFORK
|
||||
|
||||
/* Define to 1 if you have the <vfork.h> header file. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define to 1 if `fork' works. */
|
||||
#undef HAVE_WORKING_FORK
|
||||
|
||||
/* Define to 1 if `vfork' works. */
|
||||
#undef HAVE_WORKING_VFORK
|
||||
|
||||
/* Prefix to use for launchd identifiers */
|
||||
#undef LAUNCHD_ID_PREFIX
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
@@ -81,17 +60,8 @@
|
||||
/* Patch version of this package */
|
||||
#undef PACKAGE_VERSION_PATCHLEVEL
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define as `fork' if `vfork' does not work. */
|
||||
#undef vfork
|
||||
|
||||
1876
app/xinit/configure
vendored
1876
app/xinit/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -20,31 +20,23 @@ dnl PERFORMANCE OF THIS SOFTWARE.
|
||||
dnl
|
||||
dnl Process this file with autoconf to create configure.
|
||||
|
||||
AC_PREREQ([2.57])
|
||||
AC_INIT(xinit,[1.2.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xinit)
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xinit], [1.3.0],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xinit])
|
||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
# Require xorg-macros: XORG_DEFAULT_OPTIONS
|
||||
# Require X.Org macros 1.8 or later for AC_PROG_SED in XORG_DEFAULT_OPTIONS
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
[m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.3)
|
||||
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.8)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
XORG_PROG_RAWCPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PATH_PROG(SED,sed)
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_FORK
|
||||
|
||||
AC_CHECK_FUNCS([killpg])
|
||||
|
||||
m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
|
||||
|
||||
|
||||
@@ -129,7 +121,7 @@ AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH],
|
||||
|
||||
if test "x$LAUNCHD" = "xauto"; then
|
||||
unset LAUNCHD
|
||||
AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
|
||||
AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin])
|
||||
fi
|
||||
|
||||
TIGER_LAUNCHD=no
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/* OS/2 REXX */
|
||||
/*
|
||||
* This is just a sample implementation of a slightly less primitive
|
||||
* interface than xinit. It looks for user xinitrc.cmd and xservrc.cmd
|
||||
* files, then system xinitrc.cmd and xservrc.cmd files, else lets xinit choose
|
||||
* its default. The system xinitrc should probably do things like check
|
||||
* for Xresources files and merge them in, startup up a window manager,
|
||||
* and pop a clock and serveral xterms.
|
||||
*
|
||||
* Site administrators are STRONGLY urged to write nicer versions.
|
||||
*/
|
||||
'@echo off'
|
||||
ADDRESS CMD
|
||||
env = 'OS2ENVIRONMENT'
|
||||
x11root = VALUE('X11ROOT',,env)
|
||||
IF x11root = '' THEN DO
|
||||
SAY "The environment variable X11ROOT is not set. X/OS2 won't run without it."
|
||||
EXIT
|
||||
END
|
||||
|
||||
home = VALUE('HOME',,env)
|
||||
IF home = '' THEN home = x11root
|
||||
os_shell = VALUE('X11SHELL',,env)
|
||||
IF os_shell = '' THEN os_shell = VALUE('SHELL',,env)
|
||||
IF os_shell = '' THEN os_shell = VALUE('OS2_SHELL',,env)
|
||||
IF os_shell = '' THEN DO
|
||||
SAY "There is no command interpreter in OS2_SHELL ???"
|
||||
EXIT
|
||||
END
|
||||
|
||||
userclientrc = home'\xinitrc.cmd'
|
||||
userserverrc = home'\xservrc.cmd'
|
||||
sysclientrc = x11root'\usr\X11R6\lib\X11\xinit\xinitrc.cmd'
|
||||
sysserverrc = x11root'\usr\X11R6\lib\X11\xinit\xservrc.cmd'
|
||||
clientargs = ''
|
||||
serverargs = ''
|
||||
|
||||
IF exists(userclientrc) THEN
|
||||
clientargs = userclientrc
|
||||
ELSE
|
||||
IF exists(sysclientrc) THEN
|
||||
clientargs = sysclientrc
|
||||
|
||||
IF exists(userserverrc) THEN
|
||||
serverargs = userserverrc
|
||||
ELSE
|
||||
IF exists(sysserverrc) THEN
|
||||
serverargs = sysserverrc
|
||||
|
||||
whoseargs = "client"
|
||||
PARSE ARG all
|
||||
|
||||
DO i=1 TO WORDS(all)
|
||||
cur = WORD(all,i)
|
||||
IF \(FILESPEC('DRIVE',cur) = '') THEN DO
|
||||
IF whoseargs = "client" THEN
|
||||
clientargs = cur
|
||||
ELSE
|
||||
serverargs = cur
|
||||
END
|
||||
ELSE
|
||||
IF cur = "--" THEN
|
||||
whoseargs = "server"
|
||||
ELSE
|
||||
IF whoseargs = "client" THEN
|
||||
clientargs = clientargs' 'cur
|
||||
ELSE
|
||||
serverargs = serverargs' 'cur
|
||||
END
|
||||
|
||||
xinit = x11root'\usr\X11R6\bin\xinit'
|
||||
xinit os_shell' /c 'clientargs' -- 'serverargs
|
||||
|
||||
RETURN
|
||||
|
||||
exists:
|
||||
IF STREAM(arg(1), 'C', 'QUERY EXISTS') = '' THEN
|
||||
RETURN 0
|
||||
ELSE
|
||||
RETURN 1
|
||||
@@ -87,15 +87,15 @@ if [ "x$X11_PREFS_DOMAIN" = x ] ; then
|
||||
fi
|
||||
|
||||
XCOMM Initialize defaults (this will cut down on "safe" error messages)
|
||||
if ! defaults read $X11_PREFS_DOMAIN cache_fonts >& /dev/null ; then
|
||||
if ! defaults read $X11_PREFS_DOMAIN cache_fonts > /dev/null 2>&1 ; then
|
||||
defaults write $X11_PREFS_DOMAIN cache_fonts -bool true
|
||||
fi
|
||||
|
||||
if ! defaults read $X11_PREFS_DOMAIN no_auth >& /dev/null ; then
|
||||
if ! defaults read $X11_PREFS_DOMAIN no_auth > /dev/null 2>&1 ; then
|
||||
defaults write $X11_PREFS_DOMAIN no_auth -bool false
|
||||
fi
|
||||
|
||||
if ! defaults read $X11_PREFS_DOMAIN nolisten_tcp >& /dev/null ; then
|
||||
if ! defaults read $X11_PREFS_DOMAIN nolisten_tcp > /dev/null 2>&1 ; then
|
||||
defaults write $X11_PREFS_DOMAIN nolisten_tcp -bool true
|
||||
fi
|
||||
|
||||
@@ -126,14 +126,17 @@ if [ x`defaults read $X11_PREFS_DOMAIN nolisten_tcp` = x1 ] ; then
|
||||
defaultserverargs="$defaultserverargs -nolisten tcp"
|
||||
fi
|
||||
|
||||
if defaults read $X11_PREFS_DOMAIN dpi >& /dev/null ; then
|
||||
if defaults read $X11_PREFS_DOMAIN dpi > /dev/null 2>&1 ; then
|
||||
defaultserverargs="$defaultserverargs -dpi `defaults read $X11_PREFS_DOMAIN dpi`"
|
||||
fi
|
||||
|
||||
for ((d=0; ; d++)) ; do
|
||||
[[ -e /tmp/.X$d-lock ]] || break
|
||||
d=0
|
||||
while true ; do
|
||||
[ -e /tmp/.X$d-lock ] || break
|
||||
d=$(($d + 1))
|
||||
done
|
||||
defaultdisplay=":$d"
|
||||
unset d
|
||||
|
||||
#else
|
||||
enable_xauth=1
|
||||
@@ -278,7 +281,8 @@ if [ x"$enable_xauth" = x1 ] ; then
|
||||
add :$dummy . $mcookie
|
||||
EOF
|
||||
#if defined(__APPLE__) || defined(__CYGWIN__)
|
||||
serverargs=${serverargs}" -auth '"${xserverauthfile//\'/\'\\\'\'}"'"
|
||||
xserverauthfilequoted=$(echo ${xserverauthfile} | sed "s/'/'\\\\''/g")
|
||||
serverargs=${serverargs}" -auth '"${xserverauthfilequoted}"'"
|
||||
#else
|
||||
serverargs=${serverargs}" -auth "${xserverauthfile}
|
||||
#endif
|
||||
|
||||
@@ -36,23 +36,8 @@ in this Software without prior written authorization from The Open Group.
|
||||
#include <ctype.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef X_POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE X_POSIX_C_SOURCE
|
||||
#include <signal.h>
|
||||
#undef _POSIX_C_SOURCE
|
||||
#else
|
||||
#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
|
||||
#include <signal.h>
|
||||
#else
|
||||
#define _POSIX_SOURCE
|
||||
#include <signal.h>
|
||||
#undef _POSIX_SOURCE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SYSV
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <setjmp.h>
|
||||
#include <stdarg.h>
|
||||
@@ -64,51 +49,18 @@ in this Software without prior written authorization from The Open Group.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(SIGCHLD) && defined(SIGCLD)
|
||||
#define SIGCHLD SIGCLD
|
||||
#endif
|
||||
#ifdef __UNIXOS2__
|
||||
#define INCL_DOSMODULEMGR
|
||||
#include <os2.h>
|
||||
#define setpgid(a,b)
|
||||
#define setuid(a)
|
||||
#define setgid(a)
|
||||
#define SHELL "cmd.exe"
|
||||
#define XINITRC "xinitrc.cmd"
|
||||
#define XSERVERRC "xservrc.cmd"
|
||||
char **envsave; /* to circumvent an UNIXOS2 problem */
|
||||
#define environ envsave
|
||||
#endif
|
||||
/* For PRIO_PROCESS and setpriority() */
|
||||
#if defined(__DragonFly__) || defined(__OpenBSD__)
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#endif /* __DragonFly__ || __OpenBSD__ */
|
||||
|
||||
#include <stdlib.h>
|
||||
extern char **environ;
|
||||
char **newenviron = NULL;
|
||||
char **newenvironlast = NULL;
|
||||
|
||||
#ifndef SHELL
|
||||
#define SHELL "sh"
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WORKING_VFORK
|
||||
# ifndef vfork
|
||||
# define vfork() fork()
|
||||
# endif
|
||||
#else
|
||||
# ifdef HAVE_VFORK_H
|
||||
# include <vfork.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
#define HAS_EXECVPE
|
||||
#endif
|
||||
|
||||
#ifdef HAS_EXECVPE
|
||||
#define Execvpe(path, argv, envp) execvpe(path, argv, envp)
|
||||
#else
|
||||
#define Execvpe(path, argv, envp) execvp(path, argv)
|
||||
#endif
|
||||
|
||||
const char *bindir = BINDIR;
|
||||
const char * const server_names[] = {
|
||||
#ifdef __APPLE__
|
||||
@@ -140,8 +92,6 @@ char xserverrcbuf[256];
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define OK_EXIT 0
|
||||
#define ERR_EXIT 1
|
||||
|
||||
static char *default_server = "X";
|
||||
static char *default_display = ":0"; /* choose most efficient */
|
||||
@@ -153,18 +103,12 @@ static char **client = clientargv + 2; /* make sure room for sh .xinitrc args *
|
||||
static char *displayNum = NULL;
|
||||
static char *program = NULL;
|
||||
static Display *xd = NULL; /* server connection */
|
||||
#ifndef SYSV
|
||||
#if defined(__CYGWIN__) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(CSRG_BASED) || defined(__UNIXOS2__) || defined(Lynx) || defined(__APPLE__)
|
||||
int status;
|
||||
#else
|
||||
union wait status;
|
||||
#endif
|
||||
#endif /* SYSV */
|
||||
int serverpid = -1;
|
||||
int clientpid = -1;
|
||||
volatile int gotSignal = 0;
|
||||
|
||||
static void Execute ( char **vec, char **envp );
|
||||
static void Execute(char **vec);
|
||||
static Bool waitforserver(void);
|
||||
static Bool processTimeout(int timeout, char *string);
|
||||
static int startServer(char *server[]);
|
||||
@@ -172,58 +116,38 @@ static int startClient ( char *client[] );
|
||||
static int ignorexio(Display *dpy);
|
||||
static void shutdown(void);
|
||||
static void set_environment(void);
|
||||
static void Fatal(char *msg);
|
||||
static void Error ( char *fmt, ... );
|
||||
|
||||
#ifdef RETSIGTYPE /* autoconf AC_TYPE_SIGNAL */
|
||||
# define SIGVAL RETSIGTYPE
|
||||
#endif /* RETSIGTYPE */
|
||||
static void Fatal(const char *fmt, ...);
|
||||
static void Error(const char *fmt, ...);
|
||||
static void Fatalx(const char *fmt, ...);
|
||||
static void Errorx(const char *fmt, ...);
|
||||
|
||||
static SIGVAL
|
||||
static void
|
||||
sigCatch(int sig)
|
||||
{
|
||||
/* On system with POSIX signals, just interrupt the system call */
|
||||
gotSignal = sig;
|
||||
}
|
||||
|
||||
static SIGVAL
|
||||
sigAlarm(int sig)
|
||||
static void
|
||||
sigIgnore(int sig)
|
||||
{
|
||||
#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__UNIXOS2__) || defined(__APPLE__)
|
||||
signal (sig, sigAlarm);
|
||||
#endif
|
||||
}
|
||||
|
||||
static SIGVAL
|
||||
sigUsr1(int sig)
|
||||
{
|
||||
#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__UNIXOS2__) || defined(__APPLE__)
|
||||
signal (sig, sigUsr1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
Execute(char **vec, /* has room from up above */
|
||||
char **envp)
|
||||
Execute(char **vec) /* has room from up above */
|
||||
{
|
||||
Execvpe (vec[0], vec, envp);
|
||||
#ifndef __UNIXOS2__
|
||||
execvp(vec[0], vec);
|
||||
if (access(vec[0], R_OK) == 0) {
|
||||
vec--; /* back it up to stuff shell in */
|
||||
vec[0] = SHELL;
|
||||
Execvpe (vec[0], vec, envp);
|
||||
execvp(vec[0], vec);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef __UNIXOS2__
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
#else
|
||||
int
|
||||
main(int argc, char *argv[], char *envp[])
|
||||
#endif
|
||||
{
|
||||
register char **sptr = server;
|
||||
register char **cptr = client;
|
||||
@@ -232,46 +156,20 @@ main(int argc, char *argv[], char *envp[])
|
||||
int client_given = 0, server_given = 0;
|
||||
int client_args_given = 0, server_args_given = 0;
|
||||
int start_of_client_args, start_of_server_args;
|
||||
struct sigaction sa;
|
||||
struct sigaction sa, si;
|
||||
#ifdef __APPLE__
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
vproc_transaction_t vt;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
envsave = envp; /* circumvent an EMX problem */
|
||||
|
||||
/* Check whether the system will run at all */
|
||||
if (_emx_rev < 50) {
|
||||
APIRET rc;
|
||||
HMODULE hmod;
|
||||
char name[CCHMAXPATH];
|
||||
char fail[9];
|
||||
fputs ("This program requires emx.dll revision 50 (0.9c) "
|
||||
"or later.\n", stderr);
|
||||
rc = DosLoadModule (fail, sizeof (fail), "emx", &hmod);
|
||||
if (rc == 0) {
|
||||
rc = DosQueryModuleName (hmod, sizeof (name), name);
|
||||
if (rc == 0)
|
||||
fprintf (stderr, "Please delete or update `%s'.\n", name);
|
||||
DosFreeModule (hmod);
|
||||
}
|
||||
exit (2);
|
||||
}
|
||||
#endif
|
||||
program = *argv++;
|
||||
argc--;
|
||||
/*
|
||||
* copy the client args.
|
||||
*/
|
||||
if (argc == 0 ||
|
||||
#ifndef __UNIXOS2__
|
||||
(**argv != '/' && **argv != '.')) {
|
||||
#else
|
||||
(**argv != '/' && **argv != '\\' && **argv != '.' &&
|
||||
!(isalpha(**argv) && (*argv)[1]==':'))) {
|
||||
#endif
|
||||
for (ptr = default_client; *ptr; )
|
||||
*cptr++ = *ptr++;
|
||||
} else {
|
||||
@@ -293,19 +191,8 @@ main(int argc, char *argv[], char *envp[])
|
||||
* Copy the server args.
|
||||
*/
|
||||
if (argc == 0 ||
|
||||
#ifndef __UNIXOS2__
|
||||
(**argv != '/' && **argv != '.')) {
|
||||
*sptr++ = default_server;
|
||||
#else
|
||||
(**argv != '/' && **argv != '\\' && **argv != '.' &&
|
||||
!(isalpha(**argv) && (*argv)[1]==':'))) {
|
||||
*sptr = getenv("XSERVER");
|
||||
if (!*sptr) {
|
||||
Error("No XSERVER environment variable set");
|
||||
exit(1);
|
||||
}
|
||||
*sptr++;
|
||||
#endif
|
||||
} else {
|
||||
server_given = 1;
|
||||
*sptr++ = *argv++;
|
||||
@@ -333,10 +220,10 @@ main(int argc, char *argv[], char *envp[])
|
||||
|
||||
xinitrcbuf[0] = '\0';
|
||||
if ((cp = getenv("XINITRC")) != NULL) {
|
||||
(void) snprintf (xinitrcbuf, sizeof(xinitrcbuf), "%s", cp);
|
||||
snprintf(xinitrcbuf, sizeof(xinitrcbuf), "%s", cp);
|
||||
required = True;
|
||||
} else if ((cp = getenv("HOME")) != NULL) {
|
||||
(void) snprintf (xinitrcbuf, sizeof(xinitrcbuf),
|
||||
snprintf(xinitrcbuf, sizeof(xinitrcbuf),
|
||||
"%s/%s", cp, XINITRC);
|
||||
}
|
||||
if (xinitrcbuf[0]) {
|
||||
@@ -344,9 +231,7 @@ main(int argc, char *argv[], char *envp[])
|
||||
client += start_of_client_args - 1;
|
||||
client[0] = xinitrcbuf;
|
||||
} else if (required) {
|
||||
fprintf (stderr,
|
||||
"%s: warning, no client init file \"%s\"\n",
|
||||
program, xinitrcbuf);
|
||||
Error("warning, no client init file \"%s\"", xinitrcbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,10 +246,10 @@ main(int argc, char *argv[], char *envp[])
|
||||
|
||||
xserverrcbuf[0] = '\0';
|
||||
if ((cp = getenv("XSERVERRC")) != NULL) {
|
||||
(void) snprintf (xserverrcbuf, sizeof(xserverrcbuf), "%s", cp);
|
||||
snprintf(xserverrcbuf, sizeof(xserverrcbuf), "%s", cp);
|
||||
required = True;
|
||||
} else if ((cp = getenv("HOME")) != NULL) {
|
||||
(void) snprintf (xserverrcbuf, sizeof(xserverrcbuf),
|
||||
snprintf(xserverrcbuf, sizeof(xserverrcbuf),
|
||||
"%s/%s", cp, XSERVERRC);
|
||||
}
|
||||
if (xserverrcbuf[0]) {
|
||||
@@ -372,24 +257,15 @@ main(int argc, char *argv[], char *envp[])
|
||||
server += start_of_server_args - 1;
|
||||
server[0] = xserverrcbuf;
|
||||
} else if (required) {
|
||||
fprintf (stderr,
|
||||
"%s: warning, no server init file \"%s\"\n",
|
||||
program, xserverrcbuf);
|
||||
Error("warning, no server init file \"%s\"", xserverrcbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* put the display name into the environment
|
||||
*/
|
||||
set_environment ();
|
||||
|
||||
/*
|
||||
* Start the server and client.
|
||||
*/
|
||||
#ifdef SIGCHLD
|
||||
signal(SIGCHLD, SIG_DFL); /* Insurance */
|
||||
#endif
|
||||
|
||||
/* Let those signal interrupt the wait() call in the main loop */
|
||||
memset(&sa, 0, sizeof sa);
|
||||
@@ -403,8 +279,13 @@ main(int argc, char *argv[], char *envp[])
|
||||
sigaction(SIGHUP, &sa, NULL);
|
||||
sigaction(SIGPIPE, &sa, NULL);
|
||||
|
||||
signal(SIGALRM, sigAlarm);
|
||||
signal(SIGUSR1, sigUsr1);
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.sa_handler = sigIgnore;
|
||||
sigemptyset(&si.sa_mask);
|
||||
si.sa_flags = SA_RESTART;
|
||||
|
||||
sigaction(SIGALRM, &si, NULL);
|
||||
sigaction(SIGUSR1, &si, NULL);
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
@@ -436,15 +317,15 @@ main(int argc, char *argv[], char *envp[])
|
||||
shutdown();
|
||||
|
||||
if (gotSignal != 0) {
|
||||
Error("unexpected signal %d.\n", gotSignal);
|
||||
exit(ERR_EXIT);
|
||||
Errorx("unexpected signal %d", gotSignal);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (serverpid < 0)
|
||||
Fatal("Server error.\n");
|
||||
Fatalx("server error");
|
||||
if (clientpid < 0)
|
||||
Fatal("Client error.\n");
|
||||
exit(OK_EXIT);
|
||||
Fatalx("client error");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -477,7 +358,8 @@ waitforserver(void)
|
||||
}
|
||||
}
|
||||
|
||||
fprintf (stderr, "giving up.\r\n");
|
||||
Errorx("giving up");
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -491,20 +373,8 @@ processTimeout(int timeout, char *string)
|
||||
static char *laststring;
|
||||
|
||||
for (;;) {
|
||||
#if defined(SYSV) || defined(__UNIXOS2__)
|
||||
alarm(1);
|
||||
if ((pidfound = wait(NULL)) == serverpid)
|
||||
break;
|
||||
alarm(0);
|
||||
#else /* SYSV */
|
||||
#if defined(SVR4) || defined(_POSIX_SOURCE) || defined(Lynx) || defined(__APPLE__)
|
||||
if ((pidfound = waitpid(serverpid, &status, WNOHANG)) == serverpid)
|
||||
break;
|
||||
#else
|
||||
if ((pidfound = wait3(&status, WNOHANG, NULL)) == serverpid)
|
||||
break;
|
||||
#endif
|
||||
#endif /* SYSV */
|
||||
if (timeout) {
|
||||
if (i == 0 && string != laststring)
|
||||
fprintf(stderr, "\r\nwaiting for %s ", string);
|
||||
@@ -526,9 +396,7 @@ static int
|
||||
startServer(char *server[])
|
||||
{
|
||||
sigset_t mask, old;
|
||||
#ifdef __UNIXOS2__
|
||||
sigset_t pendings;
|
||||
#endif
|
||||
const char * const *cpp;
|
||||
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, SIGUSR1);
|
||||
@@ -544,44 +412,31 @@ startServer(char *server[])
|
||||
/*
|
||||
* don't hang on read/write to control tty
|
||||
*/
|
||||
#ifdef SIGTTIN
|
||||
(void) signal(SIGTTIN, SIG_IGN);
|
||||
#endif
|
||||
#ifdef SIGTTOU
|
||||
(void) signal(SIGTTOU, SIG_IGN);
|
||||
#endif
|
||||
signal(SIGTTIN, SIG_IGN);
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
/*
|
||||
* ignore SIGUSR1 in child. The server
|
||||
* will notice this and send SIGUSR1 back
|
||||
* at xinit when ready to accept connections
|
||||
*/
|
||||
(void) signal(SIGUSR1, SIG_IGN);
|
||||
signal(SIGUSR1, SIG_IGN);
|
||||
/*
|
||||
* prevent server from getting sighup from vhangup()
|
||||
* if client is xterm -L
|
||||
*/
|
||||
#ifndef __UNIXOS2__
|
||||
setpgid(0,getpid());
|
||||
#endif
|
||||
Execute (server, environ);
|
||||
Error ("no server \"%s\" in PATH\n", server[0]);
|
||||
{
|
||||
const char * const *cpp;
|
||||
Execute(server);
|
||||
|
||||
fprintf (stderr,
|
||||
"\nUse the -- option, or make sure that %s is in your path and\n",
|
||||
bindir);
|
||||
fprintf (stderr,
|
||||
"that \"%s\" is a program or a link to the right type of server\n",
|
||||
server[0]);
|
||||
fprintf (stderr,
|
||||
"for your display. Possible server names include:\n\n");
|
||||
for (cpp = server_names; *cpp; cpp++) {
|
||||
Error("unable to run server \"%s\"", server[0]);
|
||||
|
||||
fprintf(stderr, "Use the -- option, or make sure that %s is in your path and\n", bindir);
|
||||
fprintf(stderr, "that \"%s\" is a program or a link to the right type of server\n", server[0]);
|
||||
fprintf(stderr, "for your display. Possible server names include:\n\n");
|
||||
for (cpp = server_names; *cpp; cpp++)
|
||||
fprintf(stderr, " %s\n", *cpp);
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
exit (ERR_EXIT);
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
break;
|
||||
case -1:
|
||||
@@ -590,9 +445,7 @@ startServer(char *server[])
|
||||
/*
|
||||
* don't nice server
|
||||
*/
|
||||
#ifdef PRIO_PROCESS
|
||||
setpriority(PRIO_PROCESS, serverpid, -1);
|
||||
#endif
|
||||
|
||||
errno = 0;
|
||||
if(! processTimeout(0, "")) {
|
||||
@@ -609,23 +462,12 @@ startServer(char *server[])
|
||||
*/
|
||||
alarm(15);
|
||||
|
||||
#ifdef __UNIXOS2__
|
||||
/*
|
||||
* fg2003/05/06: work around a problem in EMX: sigsuspend()
|
||||
* does not deliver pending signals when called but when
|
||||
* returning; so if SIGUSR1 has already been sent by the
|
||||
* server, we would still have to await SIGALRM
|
||||
*/
|
||||
sigemptyset(&pendings);
|
||||
sigpending(&pendings);
|
||||
if (!sigismember(&pendings, SIGUSR1))
|
||||
#endif /* __UNIXOS2__ */
|
||||
sigsuspend(&old);
|
||||
alarm(0);
|
||||
sigprocmask(SIG_SETMASK, &old, NULL);
|
||||
|
||||
if (waitforserver() == 0) {
|
||||
Error("unable to connect to X server\r\n");
|
||||
Error("unable to connect to X server");
|
||||
shutdown();
|
||||
serverpid = -1;
|
||||
}
|
||||
@@ -653,23 +495,17 @@ setWindowPath(void)
|
||||
size_t len;
|
||||
prop = XInternAtom(xd, "XFree86_VT", False);
|
||||
if (prop == None) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "no XFree86_VT atom\n");
|
||||
#endif
|
||||
Errorx("Unable to intern XFree86_VT atom");
|
||||
return;
|
||||
}
|
||||
if (XGetWindowProperty(xd, DefaultRootWindow(xd), prop, 0, 1,
|
||||
False, AnyPropertyType, &actualtype, &actualformat,
|
||||
&nitems, &bytes_after, &buf)) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "no XFree86_VT property\n");
|
||||
#endif
|
||||
Errorx("No XFree86_VT property detected on X server, WINDOWPATH won't be set");
|
||||
return;
|
||||
}
|
||||
if (nitems != 1) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "%lu items in XFree86_VT property!\n", nitems);
|
||||
#endif
|
||||
Errorx("XFree86_VT property unexpectedly has %lu items instead of 1", nitems);
|
||||
XFree(buf);
|
||||
return;
|
||||
}
|
||||
@@ -688,17 +524,13 @@ setWindowPath(void)
|
||||
num = (*(uint32_t *)(void *)buf);
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "format %d in XFree86_VT property!\n", actualformat);
|
||||
#endif
|
||||
Errorx("XFree86_VT property has unexpected format %d", actualformat);
|
||||
XFree(buf);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "type %lx in XFree86_VT property!\n", actualtype);
|
||||
#endif
|
||||
Errorx("XFree86_VT property has unexpected type %lx", actualtype);
|
||||
XFree(buf);
|
||||
return;
|
||||
}
|
||||
@@ -706,61 +538,57 @@ setWindowPath(void)
|
||||
windowpath = getenv("WINDOWPATH");
|
||||
numn = snprintf(nums, sizeof(nums), "%lu", num);
|
||||
if (!windowpath) {
|
||||
len = 10 + 1 + numn + 1;
|
||||
len = numn + 1;
|
||||
newwindowpath = malloc(len);
|
||||
if (newwindowpath == NULL)
|
||||
return;
|
||||
snprintf(newwindowpath, len, "WINDOWPATH=%s", nums);
|
||||
snprintf(newwindowpath, len, "%s", nums);
|
||||
} else {
|
||||
len = 10 + 1 + strlen(windowpath) + 1 + numn + 1;
|
||||
len = strlen(windowpath) + 1 + numn + 1;
|
||||
newwindowpath = malloc(len);
|
||||
if (newwindowpath == NULL)
|
||||
return;
|
||||
snprintf(newwindowpath, len, "WINDOWPATH=%s:%s",
|
||||
snprintf(newwindowpath, len, "%s:%s",
|
||||
windowpath, nums);
|
||||
}
|
||||
*newenvironlast++ = newwindowpath;
|
||||
*newenvironlast = NULL;
|
||||
if (setenv("WINDOWPATH", newwindowpath, TRUE) == -1)
|
||||
Error("unable to set WINDOWPATH");
|
||||
|
||||
|
||||
free(newwindowpath);
|
||||
}
|
||||
|
||||
static int
|
||||
startClient(char *client[])
|
||||
{
|
||||
clientpid = fork();
|
||||
if (clientpid == 0) {
|
||||
set_environment();
|
||||
setWindowPath();
|
||||
if ((clientpid = vfork()) == 0) {
|
||||
|
||||
if (setuid(getuid()) == -1) {
|
||||
Error("cannot change uid: %s\n", strerror(errno));
|
||||
_exit(ERR_EXIT);
|
||||
Error("cannot change uid");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
setpgid(0, getpid());
|
||||
environ = newenviron;
|
||||
#ifdef __UNIXOS2__
|
||||
#undef environ
|
||||
environ = newenviron;
|
||||
client[0] = (char*)__XOS2RedirRoot(client[0]);
|
||||
#endif
|
||||
Execute (client,newenviron);
|
||||
Error ("no program named \"%s\" in PATH\r\n", client[0]);
|
||||
fprintf (stderr,
|
||||
"\nSpecify a program on the command line or make sure that %s\r\n", bindir);
|
||||
fprintf (stderr,
|
||||
"is in your path.\r\n");
|
||||
fprintf (stderr, "\n");
|
||||
_exit (ERR_EXIT);
|
||||
}
|
||||
return (clientpid);
|
||||
}
|
||||
Execute(client);
|
||||
Error("Unable to run program \"%s\"", client[0]);
|
||||
|
||||
#ifndef HAVE_KILLPG
|
||||
#define killpg(pgrp, sig) kill(-(pgrp), sig)
|
||||
#endif
|
||||
fprintf(stderr, "Specify a program on the command line or make sure that %s\n", bindir);
|
||||
fprintf(stderr, "is in your path.\n\n");
|
||||
|
||||
_exit(EXIT_FAILURE);
|
||||
} else {
|
||||
return clientpid;
|
||||
}
|
||||
}
|
||||
|
||||
static jmp_buf close_env;
|
||||
|
||||
static int
|
||||
ignorexio(Display *dpy)
|
||||
{
|
||||
fprintf (stderr, "%s: connection to X server lost.\r\n", program);
|
||||
Errorx("connection to X server lost");
|
||||
longjmp(close_env, 1);
|
||||
/*NOTREACHED*/
|
||||
return 0;
|
||||
@@ -777,101 +605,91 @@ shutdown(void)
|
||||
}
|
||||
|
||||
/* HUP all local clients to allow them to clean up */
|
||||
errno = 0;
|
||||
if ((killpg(clientpid, SIGHUP) != 0) &&
|
||||
(errno != ESRCH))
|
||||
Error("can't send HUP to process group %d\r\n",
|
||||
clientpid);
|
||||
if (killpg(clientpid, SIGHUP) < 0 && errno != ESRCH)
|
||||
Error("can't send HUP to process group %d", clientpid);
|
||||
}
|
||||
|
||||
if (serverpid < 0)
|
||||
return;
|
||||
errno = 0;
|
||||
|
||||
if (killpg(serverpid, SIGTERM) < 0) {
|
||||
if (errno == EPERM)
|
||||
Fatal("Can't kill X server\r\n");
|
||||
if (errno == ESRCH)
|
||||
return;
|
||||
}
|
||||
if (! processTimeout(10, "X server to shut down")) {
|
||||
fprintf (stderr, "\r\n");
|
||||
return;
|
||||
Fatal("can't kill X server");
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
"\r\n%s: X server slow to shut down, sending KILL signal.\r\n",
|
||||
program);
|
||||
fflush(stderr);
|
||||
errno = 0;
|
||||
if (!processTimeout(10, "X server to shut down"))
|
||||
return;
|
||||
|
||||
Errorx("X server slow to shut down, senging KILL signal");
|
||||
|
||||
if (killpg(serverpid, SIGKILL) < 0) {
|
||||
if (errno == ESRCH)
|
||||
return;
|
||||
}
|
||||
if (processTimeout(3, "server to die")) {
|
||||
fprintf (stderr, "\r\n");
|
||||
Fatal("Can't kill server\r\n");
|
||||
}
|
||||
fprintf (stderr, "\r\n");
|
||||
return;
|
||||
Error("can't SIGKILL X server");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* make a new copy of environment that has room for DISPLAY
|
||||
*/
|
||||
if (processTimeout(3, "server to die"))
|
||||
Fatalx("X server refuses to die");
|
||||
}
|
||||
|
||||
static void
|
||||
set_environment(void)
|
||||
{
|
||||
int nenvvars;
|
||||
char **newPtr, **oldPtr;
|
||||
static char displaybuf[512];
|
||||
|
||||
/* count number of environment variables */
|
||||
for (oldPtr = environ; *oldPtr; oldPtr++) ;
|
||||
|
||||
nenvvars = (oldPtr - environ);
|
||||
newenviron = (char **) malloc ((nenvvars + 3) * sizeof(char **));
|
||||
if (!newenviron) {
|
||||
fprintf (stderr,
|
||||
"%s: unable to allocate %d pointers for environment\n",
|
||||
program, nenvvars + 3);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* put DISPLAY=displayname as first element */
|
||||
snprintf (displaybuf, sizeof(displaybuf), "DISPLAY=%s", displayNum);
|
||||
newPtr = newenviron;
|
||||
*newPtr++ = displaybuf;
|
||||
|
||||
/* copy pointers to other variables */
|
||||
for (oldPtr = environ; *oldPtr; oldPtr++) {
|
||||
if (strncmp (*oldPtr, "DISPLAY=", 8) != 0
|
||||
&& strncmp (*oldPtr, "WINDOWPATH=", 11) != 0) {
|
||||
*newPtr++ = *oldPtr;
|
||||
}
|
||||
}
|
||||
*newPtr = NULL;
|
||||
newenvironlast=newPtr;
|
||||
return;
|
||||
if (setenv("DISPLAY", displayNum, TRUE) == -1)
|
||||
Fatal("unable to set DISPLAY");
|
||||
}
|
||||
|
||||
static void
|
||||
Fatal(char *msg)
|
||||
verror(const char *fmt, va_list ap)
|
||||
{
|
||||
Error(msg);
|
||||
exit(ERR_EXIT);
|
||||
fprintf(stderr, "%s: ", program);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, ": %s\n", strerror(errno));
|
||||
}
|
||||
|
||||
static void
|
||||
Error(char *fmt, ...)
|
||||
verrorx(const char *fmt, va_list ap)
|
||||
{
|
||||
fprintf(stderr, "%s: ", program);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
static void
|
||||
Fatal(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
fprintf(stderr, "%s: ", program);
|
||||
if (errno > 0)
|
||||
fprintf (stderr, "%s (errno %d): ", strerror(errno), errno);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
verror(fmt, ap);
|
||||
va_end(ap);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void
|
||||
Fatalx(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
verrorx(fmt, ap);
|
||||
va_end(ap);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void
|
||||
Error(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
verror(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static void
|
||||
Errorx(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
verrorx(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
NAME xinit NOTWINDOWCOMPAT
|
||||
DESCRIPTION "@#XFREE86:4.4.0#@ $XFree86: xc/programs/xinit/xinit.def,v 3.2 2002/05/31 18:46:13 dawes Exp $"
|
||||
PROTMODE
|
||||
EXETYPE OS2
|
||||
@@ -1,61 +0,0 @@
|
||||
/* OS/2 REXX */
|
||||
'@echo off'
|
||||
env = 'OS2ENVIRONMENT'
|
||||
x11root = VALUE('X11ROOT',,env)
|
||||
IF x11root = '' THEN DO
|
||||
SAY "The environment variable X11ROOT is not set. X/OS2 won't run without it."
|
||||
EXIT
|
||||
END
|
||||
home = VALUE('HOME',,env)
|
||||
IF home = '' THEN home = x11root
|
||||
|
||||
userresources = home'\.Xresources'
|
||||
usermodmap = home'\.Xmodmap'
|
||||
sysresources = x11root'\usr\X11R6\lib\X11\xinit\.Xresources'
|
||||
sysmodmap = x11root'\usr\X11R6\lib\X11\xinit\.Xmodmap'
|
||||
xbitmapdir = x11root'\usr\X11R6\include\X11\bitmaps'
|
||||
manpath = VALUE('MANPATH',,env)
|
||||
|
||||
/* merge in defaults */
|
||||
IF exists(sysresources) THEN
|
||||
'xrdb -merge 'sysresources
|
||||
|
||||
IF exists(sysmodmap) THEN
|
||||
'xmodmap 'sysmodmap
|
||||
|
||||
IF exists(userresources) THEN
|
||||
'xrdb -merge 'userresources
|
||||
|
||||
IF exists(usermodmap) THEN
|
||||
'xmodmap 'usermodmap
|
||||
|
||||
/* start some nice :-) test programs */
|
||||
'xsetroot -bitmap 'xbitmapdir'\xos2'
|
||||
/* also try out the following ones:
|
||||
* 'xsetroot -bitmap 'xbitmapdir'\xfree1'
|
||||
* 'xsetroot -bitmap 'xbitmapdir'\xfree2'
|
||||
*/
|
||||
|
||||
/****** WARNING! *********
|
||||
* Below some programs are started minimized, some are started detached.
|
||||
* In general, those that spawn other shells are minimized, others may be
|
||||
* detached. You might be tempted to run the xterm's as well as detached.
|
||||
* This works, but leaves you with an independent xterm/cmd pair, when the
|
||||
* server shuts down, which you can only see in watchcat, not the process list.
|
||||
* If you start and stop x11 multiple times, this will let you run out of
|
||||
* PTYs, and will lead to a large number of background sessions.
|
||||
*/
|
||||
'detach xclock -update 1 -geometry 100x100-1+1'
|
||||
'start/min/n "Login Xterm" xterm -sb -geometry 80x25+0+0 -name login'
|
||||
IF manpath \= '' THEN
|
||||
'detach xman -geometry 100x100-105+1'
|
||||
/* 'startx/min/n "Xterm 1" xterm -sb -geometry 80x50+494+51' */
|
||||
/* 'startx/min/n "Xterm 2" xterm -sb -geometry 80x20+494-0' */
|
||||
'twm'
|
||||
|
||||
EXIT
|
||||
|
||||
exists:
|
||||
'DIR "'arg(1)'" >nul 2>&1'
|
||||
if rc = 0 THEN RETURN 1
|
||||
RETURN 0
|
||||
Reference in New Issue
Block a user