configure.ac revision 2ae83157
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 282ae83157SmrgAC_INIT(libXt, 1.0.7, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXt) 29444c061aSmrgAM_INIT_AUTOMAKE([dist-bzip2]) 30444c061aSmrgAM_MAINTAINER_MODE 31444c061aSmrg 322ae83157Smrg# Require xorg-macros: XORG_DEFAULT_OPTIONS 332ae83157Smrgm4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])]) 342ae83157SmrgXORG_MACROS_VERSION(1.3) 35444c061aSmrgAM_CONFIG_HEADER(config.h) 36444c061aSmrg 37444c061aSmrg# Check for progs 38444c061aSmrgAC_PROG_CC 39444c061aSmrgAC_PROG_LIBTOOL 402265a131SmrgAM_PROG_CC_C_O 412ae83157SmrgXORG_DEFAULT_OPTIONS 422265a131Smrg 432265a131Smrgif test x"$CC_FOR_BUILD" = x; then 442265a131Smrg if test x"$cross_compiling" = xyes; then 452265a131Smrg AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) 462265a131Smrg else 472265a131Smrg CC_FOR_BUILD="$CC" 482265a131Smrg fi 492265a131Smrgfi 502265a131SmrgAC_SUBST([CC_FOR_BUILD]) 512ae83157SmrgCFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} 522ae83157SmrgAC_SUBST(CFLAGS_FOR_BUILD) 532ae83157SmrgLDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} 542ae83157SmrgAC_SUBST(LDFLAGS_FOR_BUILD) 55444c061aSmrg 562ae83157SmrgPKG_CHECK_MODULES(XT, sm ice x11 xproto kbproto) 57444c061aSmrg 58444c061aSmrg# Needed for including Xalloca.h 59444c061aSmrgAC_CHECK_HEADER([alloca.h], AC_DEFINE(INCLUDE_ALLOCA_H, 1, [Define to 1 if Xalloca.h should include <alloca.h>])) 60444c061aSmrg 61444c061aSmrg# Map function checks to old Imake #defines 622265a131Smrgcase $host_os in 632265a131Smrg # darwin has poll() but can't be used to poll character devices 642265a131Smrg # darwin10 (SnowLeopard) should be tested as well once released 652265a131Smrg darwin7*) ;; darwin8*) ;; darwin9*) ;; 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 83444c061aSmrgAC_ARG_ENABLE(install-makestrs, 84444c061aSmrg AC_HELP_STRING([--disable-install-makestrs], [Disable installing makestrs]), 85444c061aSmrg INSTALL_MAKESTRS="$enableval", 86444c061aSmrg INSTALL_MAKESTRS="yes") 87444c061aSmrgAM_CONDITIONAL([INSTALL_MAKESTRS], [test "x$INSTALL_MAKESTRS" = xyes]) 88444c061aSmrg 89444c061aSmrg# Replaces XFileSearchPathDefault from Imake configs 90444c061aSmrgXFILESEARCHPATHDEFAULT='$(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' 91444c061aSmrg 92444c061aSmrgAC_ARG_WITH(xfile-search-path, 93444c061aSmrg AC_HELP_STRING([--with-xfile-search-path=<path>], 94444c061aSmrg [Set path to search for app-defaults and other files]), 95444c061aSmrg [XFILESEARCHPATHDEFAULT="$withval"], []) 96444c061aSmrgAC_SUBST([XFILESEARCHPATHDEFAULT]) 97444c061aSmrg 98444c061aSmrgAC_ARG_WITH(appdefaultdir, 99444c061aSmrg AC_HELP_STRING([--with-appdefaultdir=<path>], 100444c061aSmrg [Set app-default directory (default: ${datadir}/X11/app-defaults)]), 101444c061aSmrg [appdefaultdir="$withval"], 102444c061aSmrg [appdefaultdir=${datadir}/X11/app-defaults]) 1032ae83157SmrgAX_DEFINE_DIR([appdefaultdir], [appdefaultdir], [app default data directory]) 104444c061aSmrg 105444c061aSmrg# Replacement for Imake ToolkitStringsABIOptions, controls string tables 106444c061aSmrg# generated by util/string.list in StringDefs.h & Shell.h 107444c061aSmrgcase $host_os in 108444c061aSmrg solaris*) 1092265a131Smrg # Solaris uses -intelabi even on SPARC 1102265a131Smrg STRINGSABIOPTIONS="-intelabi -solarisabinames" 111444c061aSmrg ;; 112444c061aSmrg sco* | svr4*) 113444c061aSmrg case $host_cpu in 114444c061aSmrg i*86) STRINGSABIOPTIONS="-intelabi" ;; 115444c061aSmrg *) STRINGSABIOPTIONS="" ;; 116444c061aSmrg esac 117444c061aSmrg ;; 118444c061aSmrgesac 119444c061aSmrgAC_SUBST(STRINGSABIOPTIONS) 120444c061aSmrg 1212265a131Smrgcase $host_os in 1222265a131Smrg darwin*) 1232265a131Smrg OS_CFLAGS="-Wl,-flat_namespace" 1242265a131Smrg ;; 1252265a131Smrg *) 1262265a131Smrg OS_CFLAGS= 1272265a131Smrg ;; 1282265a131Smrgesac 1292265a131Smrg 1302ae83157SmrgXT_CFLAGS="$XT_CFLAGS $OS_CFLAGS" 1312265a131Smrg 132444c061aSmrg# Man page processing requirements 133444c061aSmrgXORG_PROG_RAWCPP 134444c061aSmrg 135444c061aSmrgXORG_CHECK_MALLOC_ZERO 136444c061aSmrg 137444c061aSmrgAC_OUTPUT([Makefile 138444c061aSmrg src/Makefile 139444c061aSmrg util/Makefile 140444c061aSmrg include/Makefile 141444c061aSmrg man/Makefile 142444c061aSmrg xt.pc]) 143