configure.ac revision 775e7de9
17a84e134Smrgdnl Process this file with autoconf to create configure.
27a84e134Smrg
37a84e134SmrgAC_PREREQ([2.57])
47a84e134Smrg
57a84e134SmrgAC_INIT([libXaw],
6775e7de9Smrg	1.0.6,
77a84e134Smrg	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
87a84e134Smrg	libXaw)
97a84e134Smrg
107a84e134SmrgAM_INIT_AUTOMAKE([dist-bzip2])
117a84e134Smrg
127a84e134SmrgAM_CONFIG_HEADER(config.h)
137a84e134Smrg
14775e7de9Smrg# Require xorg-macros: XORG_WITH_LINT, XORG_CWARNFLAGS, XORG_CHANGELOG
15775e7de9Smrgm4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2.1 or later before running autoconf/autogen])])
16775e7de9SmrgXORG_MACROS_VERSION(1.2.1)
17775e7de9Smrg
187a84e134Smrg# Check for progs
197a84e134SmrgAC_PROG_CC
207a84e134SmrgAC_PROG_LIBTOOL
217a84e134Smrg
227a84e134Smrg# Need to call this explicitly since the first call to PKG_CHECK_MODULES
237a84e134Smrg# is in an if statement, and later calls would break if it's skipped.
247a84e134SmrgPKG_PROG_PKG_CONFIG
257a84e134Smrg
26775e7de9SmrgXORG_CWARNFLAGS
27775e7de9Smrg
287a84e134Smrg#
297a84e134Smrg# fix libtool to set SONAME to libXaw.so.$major
307a84e134Smrg#
31ab902922SmrgAC_PROG_SED
32ab902922SmrgAC_CONFIG_COMMANDS([libtool_hack], [
33ab902922Smrg	cp -f libtool libtool_
34ab902922Smrg	test -z "$SED" && SED=sed
35ab902922Smrg	$SED '1,/^soname_spec/{
36ab902922Smrg/^soname_spec/i\
37ab902922Smrg# X.Org hack to match monolithic Xaw SONAME\
387a84e134Smrgxorglibxawname="libXaw"
397a84e134Smrg/^soname_spec/s/libname/xorglibxawname/
40ab902922Smrg}' libtool_ > libtool
41ab902922Smrg	rm -f libtool_
42ab902922Smrg])
437a84e134Smrg
44775e7de9Smrg# OSX/Win32 rules are different.
45775e7de9Smrgplatform_win32=no
46775e7de9Smrgplatform_darwin=no
47775e7de9SmrgLIBEXT=so
487a84e134Smrgcase $host_os in
497a84e134Smrg    cygwin*|mingw*)
507a84e134Smrg	platform_win32=yes
517a84e134Smrg	;;
52775e7de9Smrg    darwin*)
53775e7de9Smrg	LIBEXT=dylib
54775e7de9Smrg	platform_darwin=yes
557a84e134Smrg	;;
567a84e134Smrgesac
57775e7de9SmrgAC_SUBST(LIBEXT)
587a84e134SmrgAM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
59775e7de9SmrgAM_CONDITIONAL(PLATFORM_DARWIN, test "x$platform_darwin" = "xyes")
607a84e134Smrg
617a84e134Smrg# Whether to build Xaw6
627a84e134Smrg
637a84e134SmrgAC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6],
647a84e134Smrg				[Disable building of libXaw.so.6]),
657a84e134Smrg			[build_v6=$enableval], [build_v6=yes])
667a84e134Smrg
677a84e134Smrgif test "x$build_v6" = xyes; then
687a84e134Smrg   PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu)
69775e7de9Smrg   XAW6_CFLAGS="$CWARNFLAGS $XAW6_CFLAGS"
707a84e134Smrg   AC_SUBST(XAW6_CFLAGS)
717a84e134Smrg   AC_SUBST(XAW6_LIBS)
727a84e134Smrgfi
737a84e134Smrg
747a84e134Smrg
757a84e134Smrg# Whether to build Xaw7
767a84e134Smrg
777a84e134SmrgAC_ARG_ENABLE(xaw7, AC_HELP_STRING([--disable-xaw7],
787a84e134Smrg				[Disable building of libXaw.so.7]),
797a84e134Smrg			[build_v7=$enableval], [build_v7=yes])
807a84e134Smrg
817a84e134Smrgif test "x$build_v7" = xyes; then
827a84e134Smrg   PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm)
83775e7de9Smrg   XAW7_CFLAGS="$CWARNFLAGS $XAW7_CFLAGS"
847a84e134Smrg   AC_SUBST(XAW7_CFLAGS)
857a84e134Smrg   AC_SUBST(XAW7_LIBS)
867a84e134Smrgfi
877a84e134Smrg
887a84e134Smrg
897a84e134SmrgAM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
907a84e134SmrgAM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
917a84e134Smrg
927a84e134Smrg# Checks for header files.
937a84e134SmrgAC_HEADER_STDC
947a84e134SmrgAC_CHECK_HEADER(wctype.h,
957a84e134Smrg       	AC_DEFINE([HAS_WCTYPE_H],1,
967a84e134Smrg			[Define to 1 if you have the <wctype.h> header file.]))
977a84e134SmrgAC_CHECK_HEADER(wchar.h,
987a84e134Smrg       	AC_DEFINE([HAS_WCHAR_H],1,
997a84e134Smrg			[Define to 1 if you have the <wchar.h> header file.]))
1007a84e134SmrgAC_CHECK_HEADER(widec.h, [],
1017a84e134Smrg       	AC_DEFINE([NO_WIDEC_H],1,
1027a84e134Smrg			[Define to 1 if you DO NOT have the <widec.h> header file.]))
1037a84e134Smrg
1047a84e134Smrg# Checks for functions
1057a84e134SmrgAC_CHECK_FUNCS([iswalnum])
1067a84e134Smrg
1077a84e134SmrgXORG_MANPAGE_SECTIONS
1087a84e134SmrgXORG_RELEASE_VERSION
109775e7de9SmrgXORG_CHANGELOG
1107a84e134Smrg
1117a84e134SmrgAC_OUTPUT([Makefile
1127a84e134Smrg	  include/Makefile
1137a84e134Smrg	  man/Makefile
1147a84e134Smrg	  src/Makefile])
1157a84e134Smrg
1167a84e134Smrgif test "x$build_v6" = xyes; then
1177a84e134Smrg   AC_OUTPUT(xaw6.pc)
1187a84e134Smrgfi
1197a84e134Smrg
1207a84e134Smrgif test "x$build_v7" = xyes; then
1217a84e134Smrg   AC_OUTPUT(xaw7.pc)
1227a84e134Smrgfi
123