configure.ac revision 29004570
1a73027baSmrgdnl Copyright 2005 Red Hat, Inc. 2a73027baSmrgdnl 3a73027baSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 4a73027baSmrgdnl documentation for any purpose is hereby granted without fee, provided that 5a73027baSmrgdnl the above copyright notice appear in all copies and that both that 6a73027baSmrgdnl copyright notice and this permission notice appear in supporting 7a73027baSmrgdnl documentation, and that the name of Red Hat not be used in 8a73027baSmrgdnl advertising or publicity pertaining to distribution of the software without 9a73027baSmrgdnl specific, written prior permission. Red Hat makes no 10a73027baSmrgdnl representations about the suitability of this software for any purpose. It 11a73027baSmrgdnl is provided "as is" without express or implied warranty. 12a73027baSmrgdnl 13a73027baSmrgdnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 14a73027baSmrgdnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 15a73027baSmrgdnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR 16a73027baSmrgdnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 17a73027baSmrgdnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 18a73027baSmrgdnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 19a73027baSmrgdnl PERFORMANCE OF THIS SOFTWARE. 20a73027baSmrgdnl 21a73027baSmrgdnl Process this file with autoconf to create configure. 22a73027baSmrg 2329004570SmrgAC_PREREQ([2.60]) 2429004570SmrgAC_INIT([xinit], [1.3.0], 2529004570Smrg [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xinit]) 26bf4a254eSmrgAM_INIT_AUTOMAKE([foreign dist-bzip2]) 27a73027baSmrgAM_MAINTAINER_MODE 28a73027baSmrg 2929004570Smrg# Require X.Org macros 1.8 or later for AC_PROG_SED in XORG_DEFAULT_OPTIONS 30bf4a254eSmrgm4_ifndef([XORG_MACROS_VERSION], 3129004570Smrg [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) 3229004570SmrgXORG_MACROS_VERSION(1.8) 33bf4a254eSmrgXORG_DEFAULT_OPTIONS 34bf4a254eSmrg 35a73027baSmrgAM_CONFIG_HEADER(config.h) 36a73027baSmrg 37a73027baSmrgXORG_PROG_RAWCPP 38a73027baSmrgAC_CANONICAL_HOST 39a73027baSmrg 40a73027baSmrgm4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))]) 41a73027baSmrg 42bf4a254eSmrg 43a73027baSmrg# Build options 44a73027baSmrgDEFAULT_XRDB=xrdb 45a73027baSmrgDEFAULT_XMODMAP=xmodmap 46a73027baSmrgDEFAULT_TWM=twm 47a73027baSmrgDEFAULT_XCLOCK=xclock 48a73027baSmrgDEFAULT_XTERM=xterm 49a73027baSmrg# You always want to specify the full path to the X server 50a73027baSmrgDEFAULT_XSERVER=${bindir}/X 51a73027baSmrgDEFAULT_XAUTH=xauth 52a73027baSmrgDEFAULT_XINIT=xinit 53bf4a254eSmrgDEFAULT_XINITDIR=${libdir}/X11/xinit 54a73027baSmrg 55a73027baSmrgAC_ARG_WITH(xrdb, 56a73027baSmrg AS_HELP_STRING([--with-xrdb=XRDB], [Path to xrdb]), 57a73027baSmrg [XRDB="$withval"], 58a73027baSmrg [XRDB="$DEFAULT_XRDB"]) 59a73027baSmrg 60a73027baSmrgAC_ARG_WITH(xmodmap, 61a73027baSmrg AS_HELP_STRING([--with-xmodmap=XMODMAP], [Path to xmodmap]), 62a73027baSmrg [XMODMAP="$withval"], 63a73027baSmrg [XMODMAP="$DEFAULT_XMODMAP"]) 64a73027baSmrg 65a73027baSmrgAC_ARG_WITH(twm, 66a73027baSmrg AS_HELP_STRING([--with-twm=TWM], [Path to twm]), 67a73027baSmrg [TWM="$withval"], 68a73027baSmrg [TWM="$DEFAULT_TWM"]) 69a73027baSmrg 70a73027baSmrgAC_ARG_WITH(xclock, 71a73027baSmrg AS_HELP_STRING([--with-xclock=XCLOCK], [Path to xclock]), 72a73027baSmrg [XCLOCK="$withval"], 73a73027baSmrg [XCLOCK="$DEFAULT_XCLOCK"]) 74a73027baSmrg 75a73027baSmrgAC_ARG_WITH(xterm, 76a73027baSmrg AS_HELP_STRING([--with-xterm=XTERM], [Path to xterm]), 77a73027baSmrg [XTERM="$withval"], 78a73027baSmrg [XTERM="$DEFAULT_XTERM"]) 79a73027baSmrg 80a73027baSmrgAC_ARG_WITH(xserver, 81a73027baSmrg AS_HELP_STRING([--with-xserver=XSERVER], [Path to default X server]), 82a73027baSmrg [XSERVER="$withval"], 83a73027baSmrg [XSERVER="$DEFAULT_XSERVER"]) 84a73027baSmrg 85a73027baSmrgAC_ARG_WITH(xauth, 86a73027baSmrg AS_HELP_STRING([--with-xauth=XAUTH], [Path to xauth]), 87a73027baSmrg [XAUTH="$withval"], 88a73027baSmrg [XAUTH="$DEFAULT_XAUTH"]) 89a73027baSmrg 90a73027baSmrgAC_ARG_WITH(xinit, 91a73027baSmrg AS_HELP_STRING([--with-xinit=XINIT], [Path to xinit]), 92a73027baSmrg [XINIT="$withval"], 93a73027baSmrg [XINIT="$DEFAULT_XINIT"]) 94a73027baSmrg 95bf4a254eSmrgAC_ARG_WITH(xinitdir, 96bf4a254eSmrg AS_HELP_STRING([--with-xinitdir=XINITDIR], [Path to xinitdir]), 97bf4a254eSmrg [XINITDIR="$withval"], 98bf4a254eSmrg [XINITDIR="$DEFAULT_XINITDIR"]) 99bf4a254eSmrg 100a73027baSmrgAC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto]) 101a73027baSmrgAC_ARG_WITH(launchagents-dir, AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]), 102a73027baSmrg [ launchagentsdir="${withval}" ], 103a73027baSmrg [ launchagentsdir="/Library/LaunchAgents" ]) 104a73027baSmrgAC_ARG_WITH(launchdaemons-dir, AS_HELP_STRING([--with-launchdaemons-dir=PATH], [Path to launchd's LaunchDaemonss directory (default: /Library/LaunchDaemons)]), 105a73027baSmrg [ launchdaemonsdir="${withval}" ], 106a73027baSmrg [ launchdaemonsdir="/Library/LaunchDaemons" ]) 107bf4a254eSmrgAC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]), 108bf4a254eSmrg [ launchdidprefix="${withval}" ], 109bf4a254eSmrg [ launchdidprefix="org.x" ]) 110a73027baSmrg 111a73027baSmrgif test "x$LAUNCHD" = "xauto"; then 112a73027baSmrg unset LAUNCHD 11329004570Smrg AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin]) 114a73027baSmrgfi 115a73027baSmrg 11672e81212SmrgTIGER_LAUNCHD=no 117a73027baSmrgif test "x$LAUNCHD" = "xyes" ; then 118a73027baSmrg AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available]) 11972e81212Smrg case $host_os in 12072e81212Smrg darwin8*) 12172e81212Smrg TIGER_LAUNCHD=yes 12272e81212Smrg ;; 12372e81212Smrg esac 124a73027baSmrgelse 125a73027baSmrg launchagentsdir="" 126a73027baSmrg launchdaemonsdir="" 127a73027baSmrgfi 128bf4a254eSmrg 129bf4a254eSmrgAC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$launchdidprefix", [Prefix to use for launchd identifiers]) 130a73027baSmrgAC_SUBST([launchagentsdir]) 131a73027baSmrgAC_SUBST([launchdaemonsdir]) 132bf4a254eSmrgAC_SUBST([launchdidprefix]) 133a73027baSmrgAM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"]) 13472e81212SmrgAM_CONDITIONAL(TIGER_LAUNCHD, [test "x$TIGER_LAUNCHD" = "xyes"]) 135a73027baSmrg 136a73027baSmrg# Checks for pkg-config packages 137a73027baSmrgPKG_CHECK_MODULES(XINIT, x11) 138a73027baSmrg 139a73027baSmrgcase $host_os in 140a73027baSmrg *bsd*) 141a73027baSmrg XINIT_CFLAGS="$XINIT_CFLAGS -DCSRG_BASED" 142a73027baSmrg ;; 143a73027baSmrgesac 144a73027baSmrg 145a73027baSmrgAC_SUBST(XINIT_CFLAGS) 146a73027baSmrgAC_SUBST(XINIT_LIBS) 147a73027baSmrg 148a73027baSmrgAC_PATH_PROGS(MCOOKIE, [mcookie], [$MCOOKIE], 149a73027baSmrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/local/bin]) 150a73027baSmrg 151a73027baSmrgcase $host_os in 152a73027baSmrg *openbsd*) 153a73027baSmrg MCOOKIE='/usr/sbin/openssl rand -hex 16' 154a73027baSmrg ;; 155a73027baSmrg *solaris*) 156a73027baSmrg MCOOKIE="/usr/bin/od -X -A n -N 16 /dev/urandom | /usr/bin/tr -d ' '" 157a73027baSmrg ;; 158a73027baSmrgesac 159a73027baSmrg 160a73027baSmrgif test "x$MCOOKIE" != x ; then 161a73027baSmrg STARTX_COOKIE_FLAGS='-DHAS_COOKIE_MAKER -DMK_COOKIE="$(MCOOKIE)"' 162a73027baSmrgfi 163a73027baSmrgAC_SUBST(STARTX_COOKIE_FLAGS) 164a73027baSmrg 165a73027baSmrg# Additional substitutions in startx, xinitrc & man pages 166bf4a254eSmrgARCHMANDEFS="" 167bf4a254eSmrgSHELL_CMD="/bin/sh" 168bf4a254eSmrgXSERVERNAME="Xorg" 169bf4a254eSmrgXCONFIGFILE="xorg.conf" 170bf4a254eSmrgXCONFIGFILEMAN='${XCONFIGFILE} (__filemansuffix__)' 171a73027baSmrgcase $host_os in 172bf4a254eSmrg cygwin*) 173bf4a254eSmrg XSERVERNAME="XWin" 174bf4a254eSmrg XCONFIGFILE="XWinrc" 175bf4a254eSmrg ;; 176bf4a254eSmrg darwin*) 177bf4a254eSmrg XSERVERNAME="Xquartz" 178bf4a254eSmrg XCONFIGFILE="defaults" 179bf4a254eSmrg XCONFIGFILEMAN='defaults (1)' 180bf4a254eSmrg ;; 181a73027baSmrg *solaris*) 182a73027baSmrg SHELL_CMD="/bin/ksh" 183a73027baSmrg ;; 184a73027baSmrg *sco*) 185a73027baSmrg SHELL_CMD="/bin/ksh" 186a73027baSmrg ARCHMANDEFS="-D__SCOMAN__" 187a73027baSmrg ;; 188a73027baSmrgesac 189a73027baSmrgAC_SUBST(SHELL_CMD) 190a73027baSmrgAC_SUBST(ARCHMANDEFS) 191bf4a254eSmrgAC_SUBST(XSERVERNAME) 192bf4a254eSmrgAC_SUBST(XCONFIGFILE) 193bf4a254eSmrgAC_SUBST(XCONFIGFILEMAN) 194a73027baSmrg 195a73027baSmrgAC_SUBST(XRDB) 196a73027baSmrgAC_SUBST(XMODMAP) 197a73027baSmrgAC_SUBST(TWM) 198a73027baSmrgAC_SUBST(XCLOCK) 199a73027baSmrgAC_SUBST(XTERM) 200a73027baSmrgAC_SUBST(XSERVER) 201a73027baSmrgAC_SUBST(XAUTH) 202a73027baSmrgAC_SUBST(XINIT) 203bf4a254eSmrgAC_SUBST(XINITDIR) 204a73027baSmrg 205a73027baSmrgAC_OUTPUT([Makefile]) 206a73027baSmrgAC_OUTPUT([privileged_startx/Makefile]) 207