8779b36cea4339b080ad570c89d673388b1d9d05
[framework/uifw/xorg/lib/libxaw.git] / configure.ac
1 dnl Process this file with autoconf to create configure.
2
3 AC_PREREQ([2.60])
4
5 AC_INIT([libXaw],
6         [1.0.8],
7         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
8         libXaw)
9
10 AM_INIT_AUTOMAKE([foreign dist-bzip2])
11 AM_MAINTAINER_MODE
12 AM_CONFIG_HEADER(config.h)
13
14 # Require xorg-macros minimum of 1.10 for HAVE_STYLESHEETS in XORG_CHECK_SGML_DOCTOOLS
15 m4_ifndef([XORG_MACROS_VERSION],
16           [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
17 XORG_MACROS_VERSION(1.10)
18
19 # Check for progs
20 AC_PROG_CC
21 AC_PROG_LIBTOOL
22 AC_PROG_AWK
23 AM_PROG_CC_C_O
24
25 # Need to call this explicitly since the first call to PKG_CHECK_MODULES
26 # is in an if statement, and later calls would break if it's skipped.
27 PKG_PROG_PKG_CONFIG
28
29 XORG_DEFAULT_OPTIONS
30 XORG_ENABLE_SPECS
31 XORG_WITH_XMLTO(0.0.20)
32 XORG_WITH_FOP
33 XORG_CHECK_SGML_DOCTOOLS(1.5)
34
35 #
36 # fix libtool to set SONAME to libXaw.so.$major
37 #
38 AC_CONFIG_COMMANDS([libtool_hack], [
39         cp -f libtool libtool_
40         test -z "$SED" && SED=sed
41         $SED '1,/^soname_spec/{
42 /^soname_spec/i\
43 # X.Org hack to match monolithic Xaw SONAME\
44 xorglibxawname="libXaw"
45 /^soname_spec/s/libname/xorglibxawname/
46 }' libtool_ > libtool
47         rm -f libtool_
48 ])
49
50 # OSX/Win32 rules are different.
51 platform_win32=no
52 platform_darwin=no
53 LIBEXT=so
54 case $host_os in
55     cygwin*|mingw*)
56         LIBEXT=dll.a
57         platform_win32=yes
58         ;;
59     darwin*)
60         LIBEXT=dylib
61         platform_darwin=yes
62         ;;
63 esac
64 AC_SUBST(LIBEXT)
65 AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
66 AM_CONDITIONAL(PLATFORM_DARWIN, test "x$platform_darwin" = "xyes")
67
68 # Whether to build Xaw6
69
70 AC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6],
71                                 [Disable building of libXaw.so.6]),
72                         [build_v6=$enableval], [build_v6=yes])
73
74 if test "x$build_v6" = xyes; then
75    PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu)
76    AC_SUBST(XAW6_CFLAGS)
77    AC_SUBST(XAW6_LIBS)
78 fi
79
80
81 # Whether to build Xaw7
82
83 AC_ARG_ENABLE(xaw7, AC_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    AC_SUBST(XAW7_CFLAGS)
90    AC_SUBST(XAW7_LIBS)
91 fi
92
93
94 AM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
95 AM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
96
97 # Checks for header files.
98 AC_HEADER_STDC
99 AC_CHECK_HEADER(wctype.h,
100         AC_DEFINE([HAS_WCTYPE_H],1,
101                         [Define to 1 if you have the <wctype.h> header file.]))
102 AC_CHECK_HEADER(wchar.h,
103         AC_DEFINE([HAS_WCHAR_H],1,
104                         [Define to 1 if you have the <wchar.h> header file.]))
105 AC_CHECK_HEADER(widec.h, [],
106         AC_DEFINE([NO_WIDEC_H],1,
107                         [Define to 1 if you DO NOT have the <widec.h> header file.]))
108
109 # Checks for functions
110 AC_CHECK_FUNCS([iswalnum])
111
112 AC_OUTPUT([Makefile
113           include/Makefile
114           man/Makefile
115           specs/Makefile
116           src/Makefile])
117
118 if test "x$build_v6" = xyes; then
119    AC_OUTPUT(xaw6.pc)
120 fi
121
122 if test "x$build_v7" = xyes; then
123    AC_OUTPUT(xaw7.pc)
124 fi