configure.ac revision ab902922
1dnl Process this file with autoconf to create configure.
2
3AC_PREREQ([2.57])
4
5AC_INIT([libXaw],
6	1.0.5,
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_PROG_SED
26AC_CONFIG_COMMANDS([libtool_hack], [
27	cp -f libtool libtool_
28	test -z "$SED" && SED=sed
29	$SED '1,/^soname_spec/{
30/^soname_spec/i\
31# X.Org hack to match monolithic Xaw SONAME\
32xorglibxawname="libXaw"
33/^soname_spec/s/libname/xorglibxawname/
34}' libtool_ > libtool
35	rm -f libtool_
36])
37
38# Win32 DLL rules are different.
39case $host_os in
40    cygwin*|mingw*)
41	platform_win32=yes
42	;;
43    *)
44	platform_win32=no
45	;;
46esac
47AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
48
49# Whether to build Xaw6
50
51AC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6],
52				[Disable building of libXaw.so.6]),
53			[build_v6=$enableval], [build_v6=yes])
54
55if test "x$build_v6" = xyes; then
56   PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu)
57
58   AC_SUBST(XAW6_CFLAGS)
59   AC_SUBST(XAW6_LIBS)
60fi
61
62
63# Whether to build Xaw7
64
65AC_ARG_ENABLE(xaw7, AC_HELP_STRING([--disable-xaw7],
66				[Disable building of libXaw.so.7]),
67			[build_v7=$enableval], [build_v7=yes])
68
69if test "x$build_v7" = xyes; then
70   PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm)
71
72   AC_SUBST(XAW7_CFLAGS)
73   AC_SUBST(XAW7_LIBS)
74fi
75
76
77AM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
78AM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
79
80# Checks for header files.
81AC_HEADER_STDC
82AC_CHECK_HEADER(wctype.h,
83       	AC_DEFINE([HAS_WCTYPE_H],1,
84			[Define to 1 if you have the <wctype.h> header file.]))
85AC_CHECK_HEADER(wchar.h,
86       	AC_DEFINE([HAS_WCHAR_H],1,
87			[Define to 1 if you have the <wchar.h> header file.]))
88AC_CHECK_HEADER(widec.h, [],
89       	AC_DEFINE([NO_WIDEC_H],1,
90			[Define to 1 if you DO NOT have the <widec.h> header file.]))
91
92# Checks for functions
93AC_CHECK_FUNCS([iswalnum])
94
95XORG_MANPAGE_SECTIONS
96XORG_RELEASE_VERSION
97
98AC_OUTPUT([Makefile
99	  include/Makefile
100	  man/Makefile
101	  src/Makefile])
102
103if test "x$build_v6" = xyes; then
104   AC_OUTPUT(xaw6.pc)
105fi
106
107if test "x$build_v7" = xyes; then
108   AC_OUTPUT(xaw7.pc)
109fi
110