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