configure.ac revision 1477040f
1444c061aSmrgdnl 2444c061aSmrgdnl Copyright © 2003 Keith Packard, Noah Levitt 3444c061aSmrgdnl 4444c061aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 5444c061aSmrgdnl documentation for any purpose is hereby granted without fee, provided that 6444c061aSmrgdnl the above copyright notice appear in all copies and that both that 7444c061aSmrgdnl copyright notice and this permission notice appear in supporting 8444c061aSmrgdnl documentation, and that the name of Keith Packard not be used in 9444c061aSmrgdnl advertising or publicity pertaining to distribution of the software without 10444c061aSmrgdnl specific, written prior permission. Keith Packard makes no 11444c061aSmrgdnl representations about the suitability of this software for any purpose. It 12444c061aSmrgdnl is provided "as is" without express or implied warranty. 13444c061aSmrgdnl 14444c061aSmrgdnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 15444c061aSmrgdnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 16444c061aSmrgdnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR 17444c061aSmrgdnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 18444c061aSmrgdnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19444c061aSmrgdnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 20444c061aSmrgdnl PERFORMANCE OF THIS SOFTWARE. 21444c061aSmrgdnl 22444c061aSmrgdnl Process this file with autoconf to create configure. 23444c061aSmrg 24444c061aSmrgAC_PREREQ([2.57]) 25444c061aSmrg 26444c061aSmrgdnl 27444c061aSmrgdnl 281477040fSmrgAC_INIT(libXt, 1.0.8, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXt) 291477040fSmrgAM_INIT_AUTOMAKE([foreign dist-bzip2]) 30444c061aSmrgAM_MAINTAINER_MODE 31444c061aSmrg 322ae83157Smrg# Require xorg-macros: XORG_DEFAULT_OPTIONS 331477040fSmrgm4_ifndef([XORG_MACROS_VERSION], 341477040fSmrg [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])]) 352ae83157SmrgXORG_MACROS_VERSION(1.3) 361477040fSmrgXORG_DEFAULT_OPTIONS 37444c061aSmrgAM_CONFIG_HEADER(config.h) 38444c061aSmrg 39444c061aSmrg# Check for progs 40444c061aSmrgAC_PROG_CC 41444c061aSmrgAC_PROG_LIBTOOL 422265a131SmrgAM_PROG_CC_C_O 432265a131Smrg 442265a131Smrgif test x"$CC_FOR_BUILD" = x; then 452265a131Smrg if test x"$cross_compiling" = xyes; then 462265a131Smrg AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) 472265a131Smrg else 482265a131Smrg CC_FOR_BUILD="$CC" 492265a131Smrg fi 502265a131Smrgfi 512265a131SmrgAC_SUBST([CC_FOR_BUILD]) 522ae83157SmrgCFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} 532ae83157SmrgAC_SUBST(CFLAGS_FOR_BUILD) 542ae83157SmrgLDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} 552ae83157SmrgAC_SUBST(LDFLAGS_FOR_BUILD) 56444c061aSmrg 572ae83157SmrgPKG_CHECK_MODULES(XT, sm ice x11 xproto kbproto) 58444c061aSmrg 59444c061aSmrg# Needed for including Xalloca.h 60444c061aSmrgAC_CHECK_HEADER([alloca.h], AC_DEFINE(INCLUDE_ALLOCA_H, 1, [Define to 1 if Xalloca.h should include <alloca.h>])) 61444c061aSmrg 62444c061aSmrg# Map function checks to old Imake #defines 632265a131Smrgcase $host_os in 641477040fSmrg # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard) 651477040fSmrg darwin*) ;; 662265a131Smrg *) 672265a131Smrg AC_CHECK_FUNC(poll, AC_DEFINE(USE_POLL,1, 682265a131Smrg [Define to 1 if you have the "poll" function.])) 692265a131Smrg ;; 702265a131Smrgesac 71444c061aSmrgAC_CHECK_FUNC(snprintf, AC_DEFINE(USE_SNPRINTF,1, 722265a131Smrg [Define to 1 if you have the "snprintf" function.])) 732265a131Smrg 742265a131SmrgAC_HAVE_LIBRARY(ws2_32) 75444c061aSmrg 76444c061aSmrg# Options 77444c061aSmrgAC_ARG_ENABLE(xkb, AC_HELP_STRING([--disable-xkb], [Disable XKB support]), 78444c061aSmrg XKB="$enableval", XKB="yes") 79444c061aSmrgif test "x$XKB" = "xyes" ; then 80444c061aSmrg AC_DEFINE(XKB, 1, [Define to 1 to use XKB for keysym resolution.]) 81444c061aSmrgfi 82444c061aSmrg 83444c061aSmrg# Replaces XFileSearchPathDefault from Imake configs 84444c061aSmrgXFILESEARCHPATHDEFAULT='$(sysconfdir)/X11/%L/%T/%N%C%S:$(sysconfdir)/X11/%l/%T/%N%C%S:$(sysconfdir)/X11/%T/%N%C%S:$(sysconfdir)/X11/%L/%T/%N%S:$(sysconfdir)/X11/%l/%T/%N%S:$(sysconfdir)/X11/%T/%N%S:$(datadir)/X11/%L/%T/%N%C%S:$(datadir)/X11/%l/%T/%N%C%S:$(datadir)/X11/%T/%N%C%S:$(datadir)/X11/%L/%T/%N%S:$(datadir)/X11/%l/%T/%N%S:$(datadir)/X11/%T/%N%S:$(libdir)/X11/%L/%T/%N%C%S:$(libdir)/X11/%l/%T/%N%C%S:$(libdir)/X11/%T/%N%C%S:$(libdir)/X11/%L/%T/%N%S:$(libdir)/X11/%l/%T/%N%S:$(libdir)/X11/%T/%N%S' 85444c061aSmrg 86444c061aSmrgAC_ARG_WITH(xfile-search-path, 87444c061aSmrg AC_HELP_STRING([--with-xfile-search-path=<path>], 88444c061aSmrg [Set path to search for app-defaults and other files]), 89444c061aSmrg [XFILESEARCHPATHDEFAULT="$withval"], []) 90444c061aSmrgAC_SUBST([XFILESEARCHPATHDEFAULT]) 91444c061aSmrg 92444c061aSmrgAC_ARG_WITH(appdefaultdir, 93444c061aSmrg AC_HELP_STRING([--with-appdefaultdir=<path>], 94444c061aSmrg [Set app-default directory (default: ${datadir}/X11/app-defaults)]), 95444c061aSmrg [appdefaultdir="$withval"], 96444c061aSmrg [appdefaultdir=${datadir}/X11/app-defaults]) 972ae83157SmrgAX_DEFINE_DIR([appdefaultdir], [appdefaultdir], [app default data directory]) 98444c061aSmrg 99444c061aSmrg# Replacement for Imake ToolkitStringsABIOptions, controls string tables 100444c061aSmrg# generated by util/string.list in StringDefs.h & Shell.h 101444c061aSmrgcase $host_os in 102444c061aSmrg solaris*) 1032265a131Smrg # Solaris uses -intelabi even on SPARC 1042265a131Smrg STRINGSABIOPTIONS="-intelabi -solarisabinames" 105444c061aSmrg ;; 106444c061aSmrg sco* | svr4*) 107444c061aSmrg case $host_cpu in 108444c061aSmrg i*86) STRINGSABIOPTIONS="-intelabi" ;; 109444c061aSmrg *) STRINGSABIOPTIONS="" ;; 110444c061aSmrg esac 111444c061aSmrg ;; 112444c061aSmrgesac 113444c061aSmrgAC_SUBST(STRINGSABIOPTIONS) 114444c061aSmrg 1152265a131Smrgcase $host_os in 1162265a131Smrg darwin*) 1172265a131Smrg OS_CFLAGS="-Wl,-flat_namespace" 1182265a131Smrg ;; 1192265a131Smrg *) 1202265a131Smrg OS_CFLAGS= 1212265a131Smrg ;; 1222265a131Smrgesac 1232265a131Smrg 1242ae83157SmrgXT_CFLAGS="$XT_CFLAGS $OS_CFLAGS" 1252265a131Smrg 126444c061aSmrg# Man page processing requirements 127444c061aSmrgXORG_PROG_RAWCPP 128444c061aSmrg 129444c061aSmrgXORG_CHECK_MALLOC_ZERO 130444c061aSmrg 131444c061aSmrgAC_OUTPUT([Makefile 132444c061aSmrg src/Makefile 133444c061aSmrg util/Makefile 134444c061aSmrg include/Makefile 135444c061aSmrg man/Makefile 136444c061aSmrg xt.pc]) 137