configure.ac revision 994689c1
1dnl Process this file with autoconf to create configure.
2
3AC_PREREQ([2.60])
4
5AC_INIT([libXaw],
6	[1.0.8],
7	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
8	libXaw)
9
10AM_INIT_AUTOMAKE([foreign dist-bzip2])
11AM_MAINTAINER_MODE
12AM_CONFIG_HEADER(config.h)
13
14# Require xorg-macros minimum of 1.10 for HAVE_STYLESHEETS in XORG_CHECK_SGML_DOCTOOLS
15m4_ifndef([XORG_MACROS_VERSION],
16	  [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
17XORG_MACROS_VERSION(1.10)
18
19# Check for progs
20AC_PROG_CC
21AC_PROG_LIBTOOL
22AC_PROG_AWK
23AM_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.
27PKG_PROG_PKG_CONFIG
28
29XORG_DEFAULT_OPTIONS
30XORG_ENABLE_SPECS
31XORG_WITH_XMLTO(0.0.20)
32XORG_WITH_FOP
33XORG_CHECK_SGML_DOCTOOLS(1.5)
34
35#
36# fix libtool to set SONAME to libXaw.so.$major
37#
38AC_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\
44xorglibxawname="libXaw"
45/^soname_spec/s/libname/xorglibxawname/
46}' libtool_ > libtool
47	rm -f libtool_
48])
49
50# OSX/Win32 rules are different.
51platform_win32=no
52platform_darwin=no
53LIBEXT=so
54case $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	;;
63esac
64AC_SUBST(LIBEXT)
65AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
66AM_CONDITIONAL(PLATFORM_DARWIN, test "x$platform_darwin" = "xyes")
67
68# Whether to build Xaw6
69
70AC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6],
71				[Disable building of libXaw.so.6]),
72			[build_v6=$enableval], [build_v6=yes])
73
74if 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)
78fi
79
80
81# Whether to build Xaw7
82
83AC_ARG_ENABLE(xaw7, AC_HELP_STRING([--disable-xaw7],
84				[Disable building of libXaw.so.7]),
85			[build_v7=$enableval], [build_v7=yes])
86
87if 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)
91fi
92
93
94AM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
95AM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
96
97# Checks for header files.
98AC_HEADER_STDC
99AC_CHECK_HEADER(wctype.h,
100       	AC_DEFINE([HAS_WCTYPE_H],1,
101			[Define to 1 if you have the <wctype.h> header file.]))
102AC_CHECK_HEADER(wchar.h,
103       	AC_DEFINE([HAS_WCHAR_H],1,
104			[Define to 1 if you have the <wchar.h> header file.]))
105AC_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
110AC_CHECK_FUNCS([iswalnum])
111
112AC_OUTPUT([Makefile
113	  include/Makefile
114	  man/Makefile
115	  specs/Makefile
116	  src/Makefile])
117
118if test "x$build_v6" = xyes; then
119   AC_OUTPUT(xaw6.pc)
120fi
121
122if test "x$build_v7" = xyes; then
123   AC_OUTPUT(xaw7.pc)
124fi
125