1 dnl Copyright 2005 Red Hat, Inc.
3 dnl Permission to use, copy, modify, distribute, and sell this software and its
4 dnl documentation for any purpose is hereby granted without fee, provided that
5 dnl the above copyright notice appear in all copies and that both that
6 dnl copyright notice and this permission notice appear in supporting
7 dnl documentation, and that the name of Red Hat not be used in
8 dnl advertising or publicity pertaining to distribution of the software without
9 dnl specific, written prior permission. Red Hat makes no
10 dnl representations about the suitability of this software for any purpose. It
11 dnl is provided "as is" without express or implied warranty.
13 dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15 dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16 dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 dnl PERFORMANCE OF THIS SOFTWARE.
21 dnl Process this file with autoconf to create configure.
24 AC_INIT(xinit,[1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xinit)
25 AM_INIT_AUTOMAKE([dist-bzip2])
28 AM_CONFIG_HEADER(config.h)
40 AC_CHECK_FUNCS([killpg])
42 m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
46 DEFAULT_XMODMAP=xmodmap
50 # You always want to specify the full path to the X server
51 DEFAULT_XSERVER=${bindir}/X
56 AS_HELP_STRING([--with-xrdb=XRDB], [Path to xrdb]),
58 [XRDB="$DEFAULT_XRDB"])
61 AS_HELP_STRING([--with-xmodmap=XMODMAP], [Path to xmodmap]),
63 [XMODMAP="$DEFAULT_XMODMAP"])
66 AS_HELP_STRING([--with-twm=TWM], [Path to twm]),
71 AS_HELP_STRING([--with-xclock=XCLOCK], [Path to xclock]),
73 [XCLOCK="$DEFAULT_XCLOCK"])
76 AS_HELP_STRING([--with-xterm=XTERM], [Path to xterm]),
78 [XTERM="$DEFAULT_XTERM"])
81 AS_HELP_STRING([--with-xserver=XSERVER], [Path to default X server]),
83 [XSERVER="$DEFAULT_XSERVER"])
86 AS_HELP_STRING([--with-xauth=XAUTH], [Path to xauth]),
88 [XAUTH="$DEFAULT_XAUTH"])
91 AS_HELP_STRING([--with-xinit=XINIT], [Path to xinit]),
93 [XINIT="$DEFAULT_XINIT"])
95 AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
96 AC_ARG_WITH(launchagents-dir, AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]),
97 [ launchagentsdir="${withval}" ],
98 [ launchagentsdir="/Library/LaunchAgents" ])
99 AC_ARG_WITH(launchdaemons-dir, AS_HELP_STRING([--with-launchdaemons-dir=PATH], [Path to launchd's LaunchDaemonss directory (default: /Library/LaunchDaemons)]),
100 [ launchdaemonsdir="${withval}" ],
101 [ launchdaemonsdir="/Library/LaunchDaemons" ])
103 if test "x$LAUNCHD" = "xauto"; then
110 AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
115 if test "x$LAUNCHD" = "xyes" ; then
116 AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
121 AC_SUBST([launchagentsdir])
122 AC_SUBST([launchdaemonsdir])
123 AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"])
125 # Checks for pkg-config packages
126 PKG_CHECK_MODULES(XINIT, x11)
130 XINIT_CFLAGS="$XINIT_CFLAGS -DCSRG_BASED"
134 AC_SUBST(XINIT_CFLAGS)
137 AC_PATH_PROGS(MCOOKIE, [mcookie], [$MCOOKIE],
138 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/local/bin])
142 MCOOKIE='/usr/sbin/openssl rand -hex 16'
145 MCOOKIE="/usr/bin/od -X -A n -N 16 /dev/urandom | /usr/bin/tr -d ' '"
149 if test "x$MCOOKIE" != x ; then
150 STARTX_COOKIE_FLAGS='-DHAS_COOKIE_MAKER -DMK_COOKIE="$(MCOOKIE)"'
152 AC_SUBST(STARTX_COOKIE_FLAGS)
154 # Additional substitutions in startx, xinitrc & man pages
162 ARCHMANDEFS="-D__SCOMAN__"
170 AC_SUBST(ARCHMANDEFS)
181 # Defines which X servers are listed in help output in xinit.c
182 # Cheat, lie, and assume all the world is Xorg for now
183 AC_DEFINE(XORG, 1, [Define if you have Xorg X server])
185 XORG_MANPAGE_SECTIONS
188 AC_OUTPUT([Makefile])
189 AC_OUTPUT([privileged_startx/Makefile])