configure.ac revision 994689c1
17a84e134Smrgdnl Process this file with autoconf to create configure.
27a84e134Smrg
3994689c1SmrgAC_PREREQ([2.60])
47a84e134Smrg
57a84e134SmrgAC_INIT([libXaw],
6994689c1Smrg	[1.0.8],
77a84e134Smrg	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
87a84e134Smrg	libXaw)
97a84e134Smrg
10994689c1SmrgAM_INIT_AUTOMAKE([foreign dist-bzip2])
11994689c1SmrgAM_MAINTAINER_MODE
127a84e134SmrgAM_CONFIG_HEADER(config.h)
137a84e134Smrg
14994689c1Smrg# Require xorg-macros minimum of 1.10 for HAVE_STYLESHEETS in XORG_CHECK_SGML_DOCTOOLS
15e1e1713cSmrgm4_ifndef([XORG_MACROS_VERSION],
16994689c1Smrg	  [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
17994689c1SmrgXORG_MACROS_VERSION(1.10)
18775e7de9Smrg
197a84e134Smrg# Check for progs
207a84e134SmrgAC_PROG_CC
217a84e134SmrgAC_PROG_LIBTOOL
22e1e1713cSmrgAC_PROG_AWK
23994689c1SmrgAM_PROG_CC_C_O
247a84e134Smrg
257a84e134Smrg# Need to call this explicitly since the first call to PKG_CHECK_MODULES
267a84e134Smrg# is in an if statement, and later calls would break if it's skipped.
277a84e134SmrgPKG_PROG_PKG_CONFIG
287a84e134Smrg
29e1e1713cSmrgXORG_DEFAULT_OPTIONS
30994689c1SmrgXORG_ENABLE_SPECS
31994689c1SmrgXORG_WITH_XMLTO(0.0.20)
32994689c1SmrgXORG_WITH_FOP
33994689c1SmrgXORG_CHECK_SGML_DOCTOOLS(1.5)
34775e7de9Smrg
357a84e134Smrg#
367a84e134Smrg# fix libtool to set SONAME to libXaw.so.$major
377a84e134Smrg#
38ab902922SmrgAC_CONFIG_COMMANDS([libtool_hack], [
39ab902922Smrg	cp -f libtool libtool_
40ab902922Smrg	test -z "$SED" && SED=sed
41ab902922Smrg	$SED '1,/^soname_spec/{
42ab902922Smrg/^soname_spec/i\
43ab902922Smrg# X.Org hack to match monolithic Xaw SONAME\
447a84e134Smrgxorglibxawname="libXaw"
457a84e134Smrg/^soname_spec/s/libname/xorglibxawname/
46ab902922Smrg}' libtool_ > libtool
47ab902922Smrg	rm -f libtool_
48ab902922Smrg])
497a84e134Smrg
50775e7de9Smrg# OSX/Win32 rules are different.
51775e7de9Smrgplatform_win32=no
52775e7de9Smrgplatform_darwin=no
53775e7de9SmrgLIBEXT=so
547a84e134Smrgcase $host_os in
557a84e134Smrg    cygwin*|mingw*)
56994689c1Smrg	LIBEXT=dll.a
577a84e134Smrg	platform_win32=yes
587a84e134Smrg	;;
59775e7de9Smrg    darwin*)
60775e7de9Smrg	LIBEXT=dylib
61775e7de9Smrg	platform_darwin=yes
627a84e134Smrg	;;
637a84e134Smrgesac
64775e7de9SmrgAC_SUBST(LIBEXT)
657a84e134SmrgAM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
66775e7de9SmrgAM_CONDITIONAL(PLATFORM_DARWIN, test "x$platform_darwin" = "xyes")
677a84e134Smrg
687a84e134Smrg# Whether to build Xaw6
697a84e134Smrg
707a84e134SmrgAC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6],
717a84e134Smrg				[Disable building of libXaw.so.6]),
727a84e134Smrg			[build_v6=$enableval], [build_v6=yes])
737a84e134Smrg
747a84e134Smrgif test "x$build_v6" = xyes; then
757a84e134Smrg   PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu)
767a84e134Smrg   AC_SUBST(XAW6_CFLAGS)
777a84e134Smrg   AC_SUBST(XAW6_LIBS)
787a84e134Smrgfi
797a84e134Smrg
807a84e134Smrg
817a84e134Smrg# Whether to build Xaw7
827a84e134Smrg
837a84e134SmrgAC_ARG_ENABLE(xaw7, AC_HELP_STRING([--disable-xaw7],
847a84e134Smrg				[Disable building of libXaw.so.7]),
857a84e134Smrg			[build_v7=$enableval], [build_v7=yes])
867a84e134Smrg
877a84e134Smrgif test "x$build_v7" = xyes; then
887a84e134Smrg   PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm)
897a84e134Smrg   AC_SUBST(XAW7_CFLAGS)
907a84e134Smrg   AC_SUBST(XAW7_LIBS)
917a84e134Smrgfi
927a84e134Smrg
937a84e134Smrg
947a84e134SmrgAM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
957a84e134SmrgAM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
967a84e134Smrg
977a84e134Smrg# Checks for header files.
987a84e134SmrgAC_HEADER_STDC
997a84e134SmrgAC_CHECK_HEADER(wctype.h,
1007a84e134Smrg       	AC_DEFINE([HAS_WCTYPE_H],1,
1017a84e134Smrg			[Define to 1 if you have the <wctype.h> header file.]))
1027a84e134SmrgAC_CHECK_HEADER(wchar.h,
1037a84e134Smrg       	AC_DEFINE([HAS_WCHAR_H],1,
1047a84e134Smrg			[Define to 1 if you have the <wchar.h> header file.]))
1057a84e134SmrgAC_CHECK_HEADER(widec.h, [],
1067a84e134Smrg       	AC_DEFINE([NO_WIDEC_H],1,
1077a84e134Smrg			[Define to 1 if you DO NOT have the <widec.h> header file.]))
1087a84e134Smrg
1097a84e134Smrg# Checks for functions
1107a84e134SmrgAC_CHECK_FUNCS([iswalnum])
1117a84e134Smrg
1127a84e134SmrgAC_OUTPUT([Makefile
1137a84e134Smrg	  include/Makefile
1147a84e134Smrg	  man/Makefile
115994689c1Smrg	  specs/Makefile
1167a84e134Smrg	  src/Makefile])
1177a84e134Smrg
1187a84e134Smrgif test "x$build_v6" = xyes; then
1197a84e134Smrg   AC_OUTPUT(xaw6.pc)
1207a84e134Smrgfi
1217a84e134Smrg
1227a84e134Smrgif test "x$build_v7" = xyes; then
1237a84e134Smrg   AC_OUTPUT(xaw7.pc)
1247a84e134Smrgfi
125