configure.ac revision c889a3bf
17a84e134Smrg 2f353fbadSmrg# Initialize Autoconf 3994689c1SmrgAC_PREREQ([2.60]) 4c889a3bfSmrgAC_INIT([libXaw], [1.0.12], 5f353fbadSmrg [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXaw]) 6f353fbadSmrgAC_CONFIG_SRCDIR([Makefile.am]) 7f353fbadSmrgAC_CONFIG_HEADERS([config.h]) 87a84e134Smrg 9f353fbadSmrg# Initialize Automake 10994689c1SmrgAM_INIT_AUTOMAKE([foreign dist-bzip2]) 11994689c1SmrgAM_MAINTAINER_MODE 127a84e134Smrg 13421c997bSmrg# Initialize libtool 14421c997bSmrgAC_PROG_LIBTOOL 15421c997bSmrg 16421c997bSmrg# Require xorg-macros minimum of 1.12 for DocBook external references 17e1e1713cSmrgm4_ifndef([XORG_MACROS_VERSION], 18421c997bSmrg [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])]) 19421c997bSmrgXORG_MACROS_VERSION(1.12) 20f353fbadSmrgXORG_DEFAULT_OPTIONS 21f353fbadSmrgXORG_ENABLE_SPECS 22421c997bSmrgXORG_WITH_XMLTO(0.0.22) 23f353fbadSmrgXORG_WITH_FOP 24421c997bSmrgXORG_WITH_XSLTPROC 25421c997bSmrgXORG_CHECK_SGML_DOCTOOLS(1.8) 26775e7de9Smrg 27421c997bSmrg# Some compilers do not support per target -c and -o flags 28994689c1SmrgAM_PROG_CC_C_O 297a84e134Smrg 30421c997bSmrg# Checks for programs. 31421c997bSmrgAC_PROG_AWK 32421c997bSmrg 337a84e134Smrg# Need to call this explicitly since the first call to PKG_CHECK_MODULES 347a84e134Smrg# is in an if statement, and later calls would break if it's skipped. 357a84e134SmrgPKG_PROG_PKG_CONFIG 367a84e134Smrg 377a84e134Smrg# 387a84e134Smrg# fix libtool to set SONAME to libXaw.so.$major 397a84e134Smrg# 40ab902922SmrgAC_CONFIG_COMMANDS([libtool_hack], [ 41ab902922Smrg cp -f libtool libtool_ 42ab902922Smrg test -z "$SED" && SED=sed 43ab902922Smrg $SED '1,/^soname_spec/{ 44ab902922Smrg/^soname_spec/i\ 45ab902922Smrg# X.Org hack to match monolithic Xaw SONAME\ 467a84e134Smrgxorglibxawname="libXaw" 477a84e134Smrg/^soname_spec/s/libname/xorglibxawname/ 48ab902922Smrg}' libtool_ > libtool 49ab902922Smrg rm -f libtool_ 50ab902922Smrg]) 517a84e134Smrg 52775e7de9Smrg# OSX/Win32 rules are different. 53775e7de9Smrgplatform_win32=no 54775e7de9Smrgplatform_darwin=no 55775e7de9SmrgLIBEXT=so 567a84e134Smrgcase $host_os in 577a84e134Smrg cygwin*|mingw*) 58994689c1Smrg LIBEXT=dll.a 597a84e134Smrg platform_win32=yes 607a84e134Smrg ;; 61775e7de9Smrg darwin*) 62775e7de9Smrg LIBEXT=dylib 63775e7de9Smrg platform_darwin=yes 647a84e134Smrg ;; 657a84e134Smrgesac 66775e7de9SmrgAC_SUBST(LIBEXT) 677a84e134SmrgAM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes") 68775e7de9SmrgAM_CONDITIONAL(PLATFORM_DARWIN, test "x$platform_darwin" = "xyes") 697a84e134Smrg 707a84e134Smrg# Whether to build Xaw6 717a84e134Smrg 72421c997bSmrgAC_ARG_ENABLE(xaw6, AS_HELP_STRING([--disable-xaw6], 737a84e134Smrg [Disable building of libXaw.so.6]), 747a84e134Smrg [build_v6=$enableval], [build_v6=yes]) 757a84e134Smrg 767a84e134Smrgif test "x$build_v6" = xyes; then 777a84e134Smrg PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu) 787a84e134Smrgfi 797a84e134Smrg 807a84e134Smrg 817a84e134Smrg# Whether to build Xaw7 827a84e134Smrg 83421c997bSmrgAC_ARG_ENABLE(xaw7, AS_HELP_STRING([--disable-xaw7], 847a84e134Smrg [Disable building of libXaw.so.7]), 857a84e134Smrg [build_v7=$enableval], [build_v7=yes]) 867a84e134Smrg 877a84e134Smrgif test "x$build_v7" = xyes; then 887a84e134Smrg PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm) 897a84e134Smrgfi 907a84e134Smrg 917a84e134Smrg 927a84e134SmrgAM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes]) 937a84e134SmrgAM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes]) 947a84e134Smrg 957a84e134Smrg# Checks for header files. 96f353fbadSmrgAC_CHECK_HEADERS([wctype.h wchar.h widec.h]) 977a84e134Smrg 987a84e134Smrg# Checks for functions 99f353fbadSmrgAC_CHECK_FUNCS([iswalnum getpagesize]) 1007a84e134Smrg 101c889a3bfSmrg# Link with winsock if mingw target 102c889a3bfSmrgcase $host_os in 103c889a3bfSmrg *mingw*) 104c889a3bfSmrg AC_CHECK_LIB([ws2_32],[main]) 105c889a3bfSmrg ;; 106c889a3bfSmrg *) 107c889a3bfSmrg ;; 108c889a3bfSmrgesac 109c889a3bfSmrg 110f353fbadSmrgAC_CONFIG_FILES([Makefile 111f353fbadSmrg include/Makefile 112f353fbadSmrg man/Makefile 113f353fbadSmrg specs/Makefile 114f353fbadSmrg src/Makefile]) 1157a84e134Smrg 1167a84e134Smrgif test "x$build_v6" = xyes; then 117f353fbadSmrg AC_CONFIG_FILES(xaw6.pc) 1187a84e134Smrgfi 1197a84e134Smrg 1207a84e134Smrgif test "x$build_v7" = xyes; then 121f353fbadSmrg AC_CONFIG_FILES(xaw7.pc) 1227a84e134Smrgfi 123f353fbadSmrg 124f353fbadSmrgAC_OUTPUT 125