configure.ac revision 7c5adda3
1dnl Copyright 2005 Red Hat, Inc. 2dnl 3dnl Permission to use, copy, modify, distribute, and sell this software and its 4dnl documentation for any purpose is hereby granted without fee, provided that 5dnl the above copyright notice appear in all copies and that both that 6dnl copyright notice and this permission notice appear in supporting 7dnl documentation, and that the name of Red Hat not be used in 8dnl advertising or publicity pertaining to distribution of the software without 9dnl specific, written prior permission. Red Hat makes no 10dnl representations about the suitability of this software for any purpose. It 11dnl is provided "as is" without express or implied warranty. 12dnl 13dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 14dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 15dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR 16dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 17dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 18dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 19dnl PERFORMANCE OF THIS SOFTWARE. 20dnl 21dnl Process this file with autoconf to create configure. 22 23# Initialize Autoconf 24AC_PREREQ([2.60]) 25AC_INIT([xinit], [1.4.2], 26 [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues], [xinit]) 27AC_CONFIG_SRCDIR([Makefile.am]) 28AC_CONFIG_HEADERS([config.h]) 29 30# Initialize Automake 31AM_INIT_AUTOMAKE([foreign dist-xz]) 32 33# Require X.Org macros 1.19 or later for TRADITIONALCPPFLAGS 34m4_ifndef([XORG_MACROS_VERSION], 35 [m4_fatal([must install xorg-macros 1.19 or later before running autoconf/autogen])]) 36XORG_MACROS_VERSION(1.19) 37XORG_DEFAULT_OPTIONS 38 39XORG_PROG_RAWCPP 40AC_CANONICAL_HOST 41 42# Build options 43DEFAULT_XRDB=xrdb 44DEFAULT_XMODMAP=xmodmap 45DEFAULT_TWM=twm 46DEFAULT_XCLOCK=xclock 47DEFAULT_XTERM=xterm 48# You always want to specify the full path to the X server 49DEFAULT_XSERVER=${bindir}/X 50DEFAULT_XAUTH=xauth 51DEFAULT_XINIT=xinit 52DEFAULT_XINITDIR=${sysconfdir}/X11/xinit 53 54AC_ARG_WITH(xrdb, 55 AS_HELP_STRING([--with-xrdb=XRDB], [Path to xrdb]), 56 [XRDB="$withval"], 57 [XRDB="$DEFAULT_XRDB"]) 58 59AC_ARG_WITH(xmodmap, 60 AS_HELP_STRING([--with-xmodmap=XMODMAP], [Path to xmodmap]), 61 [XMODMAP="$withval"], 62 [XMODMAP="$DEFAULT_XMODMAP"]) 63 64AC_ARG_WITH(twm, 65 AS_HELP_STRING([--with-twm=TWM], [Path to twm]), 66 [TWM="$withval"], 67 [TWM="$DEFAULT_TWM"]) 68 69AC_ARG_WITH(xclock, 70 AS_HELP_STRING([--with-xclock=XCLOCK], [Path to xclock]), 71 [XCLOCK="$withval"], 72 [XCLOCK="$DEFAULT_XCLOCK"]) 73 74AC_ARG_WITH(xterm, 75 AS_HELP_STRING([--with-xterm=XTERM], [Path to xterm]), 76 [XTERM="$withval"], 77 [XTERM="$DEFAULT_XTERM"]) 78 79AC_ARG_WITH(xserver, 80 AS_HELP_STRING([--with-xserver=XSERVER], [Path to default X server]), 81 [XSERVER="$withval"], 82 [XSERVER="$DEFAULT_XSERVER"]) 83 84AC_ARG_WITH(xauth, 85 AS_HELP_STRING([--with-xauth=XAUTH], [Path to xauth]), 86 [XAUTH="$withval"], 87 [XAUTH="$DEFAULT_XAUTH"]) 88 89AC_ARG_WITH(xinit, 90 AS_HELP_STRING([--with-xinit=XINIT], [Path to xinit]), 91 [XINIT="$withval"], 92 [XINIT="$DEFAULT_XINIT"]) 93 94AC_ARG_WITH(xinitdir, 95 AS_HELP_STRING([--with-xinitdir=XINITDIR], [Path to xinitdir]), 96 [XINITDIR="$withval"], 97 [XINITDIR="$DEFAULT_XINITDIR"]) 98 99AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto]) 100AC_ARG_WITH(launchagents-dir, AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]), 101 [ launchagentsdir="${withval}" ], 102 [ launchagentsdir="/Library/LaunchAgents" ]) 103AC_ARG_WITH(launchagent-xserver, AS_HELP_STRING([--with-launchagent-xserver=PATH], [Path to the X server which the LaunchAgent should start (if not provided, let startx decide)"]), 104 [ launchagentxserver="${withval}" ], 105 [ launchagentxserver="no" ]) 106AC_ARG_WITH(launchdaemons-dir, AS_HELP_STRING([--with-launchdaemons-dir=PATH], [Path to launchd's LaunchDaemonss directory (default: /Library/LaunchDaemons)]), 107 [ launchdaemonsdir="${withval}" ], 108 [ launchdaemonsdir="/Library/LaunchDaemons" ]) 109AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]), 110 [ bundleidprefix="${withval}" ], 111 [ bundleidprefix="org.x" ]) 112AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]), 113 [ bundleidprefix="${withval}" ]) 114 115if test "x$LAUNCHD" = "xauto"; then 116 unset LAUNCHD 117 AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin]) 118fi 119 120AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$bundleidprefix", [Prefix to use for launchd identifiers]) 121AC_SUBST([launchagentsdir]) 122AC_SUBST([launchdaemonsdir]) 123AC_SUBST([bundleidprefix]) 124AC_SUBST([launchagentxserver]) 125AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"]) 126AM_CONDITIONAL(LAUNCHAGENT_XSERVER, [test "x$launchagentxserver" != "xno"]) 127 128# Checks for pkg-config packages 129PKG_CHECK_MODULES(XINIT, x11 xproto >= 7.0.17) 130 131case $host_os in 132 *bsd*) 133 XINIT_CFLAGS="$XINIT_CFLAGS -DCSRG_BASED" 134 ;; 135esac 136 137 138AC_PATH_PROGS(MCOOKIE, [mcookie], [$MCOOKIE], 139 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/local/bin]) 140 141# If mcookie not found, try openssl, else per-system fallbacks 142if test "x$MCOOKIE" = x ; then 143 AC_PATH_PROGS(OPENSSL, [openssl], [$OPENSSL], 144 [$PATH:/bin:/usr/bin:/usr/sbin:/usr/lib:/usr/libexec:/usr/local/bin]) 145 if test "x$OPENSSL" != x ; then 146 MCOOKIE="$OPENSSL rand -hex 16" 147 else 148 case $host_os in 149 *solaris*) 150 MCOOKIE="/usr/bin/od -X -A n -N 16 /dev/urandom | /usr/bin/tr -d ' '" 151 ;; 152 esac 153 fi 154fi 155if test "x$MCOOKIE" != x ; then 156 STARTX_COOKIE_FLAGS='-DHAS_COOKIE_MAKER -DMK_COOKIE="$(MCOOKIE)"' 157 AC_MSG_NOTICE([startx will depend on "$MCOOKIE" to generate xauth cookies]) 158fi 159AC_SUBST(STARTX_COOKIE_FLAGS) 160 161# Additional substitutions in startx, xinitrc & man pages 162SHELL_CMD="/bin/sh" 163XSERVERNAME="Xorg" 164XCONFIGFILE="xorg.conf" 165XCONFIGFILEMAN='${XCONFIGFILE} (${FILE_MAN_SUFFIX})' 166case $host_os in 167 cygwin*) 168 XSERVERNAME="XWin" 169 XCONFIGFILE="XWinrc" 170 ;; 171 darwin*) 172 XSERVERNAME="Xquartz" 173 XCONFIGFILE="defaults" 174 XCONFIGFILEMAN='defaults (1)' 175 ;; 176 *solaris*) 177 SHELL_CMD="/bin/ksh" 178 ;; 179esac 180AC_SUBST(SHELL_CMD) 181AC_SUBST(XSERVERNAME) 182AC_SUBST(XCONFIGFILE) 183AC_SUBST(XCONFIGFILEMAN) 184 185AC_SUBST(XRDB) 186AC_SUBST(XMODMAP) 187AC_SUBST(TWM) 188AC_SUBST(XCLOCK) 189AC_SUBST(XTERM) 190AC_SUBST(XSERVER) 191AC_SUBST(XAUTH) 192AC_SUBST(XINIT) 193AC_SUBST(XINITDIR) 194 195AC_CONFIG_FILES([Makefile 196 man/Makefile 197 launchd/Makefile 198 launchd/privileged_startx/Makefile 199 launchd/user_startx/Makefile]) 200AC_OUTPUT 201