libXaw should not try to build into a pure wayland platform.
[platform/upstream/libXaw.git] / configure.ac
1
2 # Initialize Autoconf
3 AC_PREREQ([2.60])
4 AC_INIT([libXaw], [1.0.11],
5         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXaw])
6 AC_CONFIG_SRCDIR([Makefile.am])
7 AC_CONFIG_HEADERS([config.h])
8
9 # Initialize Automake
10 AM_INIT_AUTOMAKE([foreign dist-bzip2])
11 AM_MAINTAINER_MODE
12
13 # Initialize libtool
14 AC_PROG_LIBTOOL
15
16 # Require xorg-macros minimum of 1.12 for DocBook external references
17 m4_ifndef([XORG_MACROS_VERSION],
18           [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
19 XORG_MACROS_VERSION(1.12)
20 XORG_DEFAULT_OPTIONS
21 XORG_ENABLE_SPECS
22 XORG_WITH_XMLTO(0.0.22)
23 XORG_WITH_FOP
24 XORG_WITH_XSLTPROC
25 XORG_CHECK_SGML_DOCTOOLS(1.8)
26
27 # Some compilers do not support per target -c and -o flags
28 AM_PROG_CC_C_O
29
30 # Checks for programs.
31 AC_PROG_AWK
32
33 # Need to call this explicitly since the first call to PKG_CHECK_MODULES
34 # is in an if statement, and later calls would break if it's skipped.
35 PKG_PROG_PKG_CONFIG
36
37 #
38 # fix libtool to set SONAME to libXaw.so.$major
39 #
40 AC_CONFIG_COMMANDS([libtool_hack], [
41         cp -f libtool libtool_
42         test -z "$SED" && SED=sed
43         $SED '1,/^soname_spec/{
44 /^soname_spec/i\
45 # X.Org hack to match monolithic Xaw SONAME\
46 xorglibxawname="libXaw"
47 /^soname_spec/s/libname/xorglibxawname/
48 }' libtool_ > libtool
49         rm -f libtool_
50 ])
51
52 # OSX/Win32 rules are different.
53 platform_win32=no
54 platform_darwin=no
55 LIBEXT=so
56 case $host_os in
57     cygwin*|mingw*)
58         LIBEXT=dll.a
59         platform_win32=yes
60         ;;
61     darwin*)
62         LIBEXT=dylib
63         platform_darwin=yes
64         ;;
65 esac
66 AC_SUBST(LIBEXT)
67 AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
68 AM_CONDITIONAL(PLATFORM_DARWIN, test "x$platform_darwin" = "xyes")
69
70 # Whether to build Xaw6
71
72 AC_ARG_ENABLE(xaw6, AS_HELP_STRING([--disable-xaw6],
73                                 [Disable building of libXaw.so.6]),
74                         [build_v6=$enableval], [build_v6=yes])
75
76 if test "x$build_v6" = xyes; then
77    PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu)
78 fi
79
80
81 # Whether to build Xaw7
82
83 AC_ARG_ENABLE(xaw7, AS_HELP_STRING([--disable-xaw7],
84                                 [Disable building of libXaw.so.7]),
85                         [build_v7=$enableval], [build_v7=yes])
86
87 if test "x$build_v7" = xyes; then
88    PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm)
89 fi
90
91
92 AM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
93 AM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
94
95 # Checks for header files.
96 AC_CHECK_HEADERS([wctype.h wchar.h widec.h])
97
98 # Checks for functions
99 AC_CHECK_FUNCS([iswalnum getpagesize])
100
101 AC_CONFIG_FILES([Makefile
102                 include/Makefile
103                 man/Makefile
104                 specs/Makefile
105                 src/Makefile])
106
107 if test "x$build_v6" = xyes; then
108    AC_CONFIG_FILES(xaw6.pc)
109 fi
110
111 if test "x$build_v7" = xyes; then
112    AC_CONFIG_FILES(xaw7.pc)
113 fi
114
115 AC_OUTPUT