configure.ac revision 7a84e134
1dnl Process this file with autoconf to create configure. 2 3AC_PREREQ([2.57]) 4 5AC_INIT([libXaw], 6 1.0.4, 7 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], 8 libXaw) 9 10AM_INIT_AUTOMAKE([dist-bzip2]) 11 12AM_CONFIG_HEADER(config.h) 13 14# Check for progs 15AC_PROG_CC 16AC_PROG_LIBTOOL 17 18# Need to call this explicitly since the first call to PKG_CHECK_MODULES 19# is in an if statement, and later calls would break if it's skipped. 20PKG_PROG_PKG_CONFIG 21 22# 23# fix libtool to set SONAME to libXaw.so.$major 24# 25AC_MSG_CHECKING([hacks in libtool for libXaw SONAME]) 26if grep "xorglibxawname" libtool > /dev/null ; then 27 AC_MSG_RESULT([already done]) 28else 29 ed libtool << \EOF 30/^soname_spec/i 31# X.Org hack to match monolithic Xaw SONAME 32xorglibxawname="libXaw" 33. 34/^soname_spec/s/libname/xorglibxawname/ 35w 36q 37EOF 38 AC_MSG_RESULT([fixed]) 39fi 40 41# Win32 DLL rules are different. 42case $host_os in 43 cygwin*|mingw*) 44 platform_win32=yes 45 ;; 46 *) 47 platform_win32=no 48 ;; 49esac 50AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes") 51 52# Whether to build Xaw6 53 54AC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6], 55 [Disable building of libXaw.so.6]), 56 [build_v6=$enableval], [build_v6=yes]) 57 58if test "x$build_v6" = xyes; then 59 PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu) 60 61 AC_SUBST(XAW6_CFLAGS) 62 AC_SUBST(XAW6_LIBS) 63fi 64 65 66# Whether to build Xaw7 67 68AC_ARG_ENABLE(xaw7, AC_HELP_STRING([--disable-xaw7], 69 [Disable building of libXaw.so.7]), 70 [build_v7=$enableval], [build_v7=yes]) 71 72if test "x$build_v7" = xyes; then 73 PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm) 74 75 AC_SUBST(XAW7_CFLAGS) 76 AC_SUBST(XAW7_LIBS) 77fi 78 79 80# Whether to build Xaw8 81 82AC_ARG_ENABLE(xaw8, AC_HELP_STRING([--disable-xaw8], 83 [Disable building of libXaw.so.8]), 84 [build_v8=$enableval], [build_v8=auto]) 85 86if test "x$build_v8" = xyes || test "x$build_v8" = xauto; then 87 PKG_CHECK_MODULES(XPRINT, xp, xprint_found=yes, xprint_found=no) 88 89 if test "x$xprint_found" = xno; then 90 if test "x$build_v8" = xyes; then 91 AC_ERROR([ 92 Xprint is required to build libXaw.so.8. You can disable 93 building of libXaw.so.8 by passing --disable-xaw8 to 94 configure]) 95 fi 96 build_v8=no 97 else 98 PKG_CHECK_MODULES(XAW8, xproto x11 xext xextproto xt xmu xpm xp printproto xau) 99 AC_SUBST(XAW8_CFLAGS) 100 AC_SUBST(XAW8_LIBS) 101 build_v8=yes 102 fi 103fi 104 105AM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes]) 106AM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes]) 107AM_CONDITIONAL(BUILD_XAW8, [test x$build_v8 = xyes]) 108 109# Checks for header files. 110AC_HEADER_STDC 111AC_CHECK_HEADER(wctype.h, 112 AC_DEFINE([HAS_WCTYPE_H],1, 113 [Define to 1 if you have the <wctype.h> header file.])) 114AC_CHECK_HEADER(wchar.h, 115 AC_DEFINE([HAS_WCHAR_H],1, 116 [Define to 1 if you have the <wchar.h> header file.])) 117AC_CHECK_HEADER(widec.h, [], 118 AC_DEFINE([NO_WIDEC_H],1, 119 [Define to 1 if you DO NOT have the <widec.h> header file.])) 120 121# Checks for functions 122AC_CHECK_FUNCS([iswalnum]) 123 124XORG_MANPAGE_SECTIONS 125XORG_RELEASE_VERSION 126 127AC_OUTPUT([Makefile 128 include/Makefile 129 man/Makefile 130 src/Makefile]) 131 132if test "x$build_v6" = xyes; then 133 AC_OUTPUT(xaw6.pc) 134fi 135 136if test "x$build_v7" = xyes; then 137 AC_OUTPUT(xaw7.pc) 138fi 139 140if test "x$build_v8" = xyes; then 141 AC_OUTPUT(xaw8.pc) 142fi 143