configure.ac revision 7a84e134
17a84e134Smrgdnl Process this file with autoconf to create configure.
27a84e134Smrg
37a84e134SmrgAC_PREREQ([2.57])
47a84e134Smrg
57a84e134SmrgAC_INIT([libXaw],
67a84e134Smrg	1.0.4,
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
147a84e134Smrg# Check for progs
157a84e134SmrgAC_PROG_CC
167a84e134SmrgAC_PROG_LIBTOOL
177a84e134Smrg
187a84e134Smrg# Need to call this explicitly since the first call to PKG_CHECK_MODULES
197a84e134Smrg# is in an if statement, and later calls would break if it's skipped.
207a84e134SmrgPKG_PROG_PKG_CONFIG
217a84e134Smrg
227a84e134Smrg#
237a84e134Smrg# fix libtool to set SONAME to libXaw.so.$major
247a84e134Smrg#
257a84e134SmrgAC_MSG_CHECKING([hacks in libtool for libXaw SONAME])
267a84e134Smrgif grep "xorglibxawname" libtool > /dev/null ; then
277a84e134Smrg	AC_MSG_RESULT([already done])
287a84e134Smrgelse
297a84e134Smrg	ed libtool << \EOF
307a84e134Smrg/^soname_spec/i
317a84e134Smrg# X.Org hack to match monolithic Xaw SONAME
327a84e134Smrgxorglibxawname="libXaw"
337a84e134Smrg.
347a84e134Smrg/^soname_spec/s/libname/xorglibxawname/
357a84e134Smrgw
367a84e134Smrgq
377a84e134SmrgEOF
387a84e134Smrg	AC_MSG_RESULT([fixed])
397a84e134Smrgfi
407a84e134Smrg
417a84e134Smrg# Win32 DLL rules are different.
427a84e134Smrgcase $host_os in
437a84e134Smrg    cygwin*|mingw*)
447a84e134Smrg	platform_win32=yes
457a84e134Smrg	;;
467a84e134Smrg    *)
477a84e134Smrg	platform_win32=no
487a84e134Smrg	;;
497a84e134Smrgesac
507a84e134SmrgAM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
517a84e134Smrg
527a84e134Smrg# Whether to build Xaw6
537a84e134Smrg
547a84e134SmrgAC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6],
557a84e134Smrg				[Disable building of libXaw.so.6]),
567a84e134Smrg			[build_v6=$enableval], [build_v6=yes])
577a84e134Smrg
587a84e134Smrgif test "x$build_v6" = xyes; then
597a84e134Smrg   PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu)
607a84e134Smrg
617a84e134Smrg   AC_SUBST(XAW6_CFLAGS)
627a84e134Smrg   AC_SUBST(XAW6_LIBS)
637a84e134Smrgfi
647a84e134Smrg
657a84e134Smrg
667a84e134Smrg# Whether to build Xaw7
677a84e134Smrg
687a84e134SmrgAC_ARG_ENABLE(xaw7, AC_HELP_STRING([--disable-xaw7],
697a84e134Smrg				[Disable building of libXaw.so.7]),
707a84e134Smrg			[build_v7=$enableval], [build_v7=yes])
717a84e134Smrg
727a84e134Smrgif test "x$build_v7" = xyes; then
737a84e134Smrg   PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm)
747a84e134Smrg
757a84e134Smrg   AC_SUBST(XAW7_CFLAGS)
767a84e134Smrg   AC_SUBST(XAW7_LIBS)
777a84e134Smrgfi
787a84e134Smrg
797a84e134Smrg
807a84e134Smrg# Whether to build Xaw8
817a84e134Smrg
827a84e134SmrgAC_ARG_ENABLE(xaw8, AC_HELP_STRING([--disable-xaw8],
837a84e134Smrg				[Disable building of libXaw.so.8]),
847a84e134Smrg			[build_v8=$enableval], [build_v8=auto])
857a84e134Smrg
867a84e134Smrgif test "x$build_v8" = xyes || test "x$build_v8" = xauto; then
877a84e134Smrg   PKG_CHECK_MODULES(XPRINT, xp, xprint_found=yes, xprint_found=no)
887a84e134Smrg
897a84e134Smrg   if test "x$xprint_found" = xno; then
907a84e134Smrg      if test "x$build_v8" = xyes; then
917a84e134Smrg          AC_ERROR([
927a84e134Smrg	    Xprint is required to build libXaw.so.8. You can disable
937a84e134Smrg	    building of libXaw.so.8 by passing --disable-xaw8 to
947a84e134Smrg	    configure])
957a84e134Smrg      fi
967a84e134Smrg      build_v8=no
977a84e134Smrg   else
987a84e134Smrg       PKG_CHECK_MODULES(XAW8, xproto x11 xext xextproto xt xmu xpm xp printproto xau)
997a84e134Smrg       AC_SUBST(XAW8_CFLAGS)
1007a84e134Smrg       AC_SUBST(XAW8_LIBS)
1017a84e134Smrg       build_v8=yes
1027a84e134Smrg   fi
1037a84e134Smrgfi
1047a84e134Smrg
1057a84e134SmrgAM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
1067a84e134SmrgAM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
1077a84e134SmrgAM_CONDITIONAL(BUILD_XAW8, [test x$build_v8 = xyes])
1087a84e134Smrg
1097a84e134Smrg# Checks for header files.
1107a84e134SmrgAC_HEADER_STDC
1117a84e134SmrgAC_CHECK_HEADER(wctype.h,
1127a84e134Smrg       	AC_DEFINE([HAS_WCTYPE_H],1,
1137a84e134Smrg			[Define to 1 if you have the <wctype.h> header file.]))
1147a84e134SmrgAC_CHECK_HEADER(wchar.h,
1157a84e134Smrg       	AC_DEFINE([HAS_WCHAR_H],1,
1167a84e134Smrg			[Define to 1 if you have the <wchar.h> header file.]))
1177a84e134SmrgAC_CHECK_HEADER(widec.h, [],
1187a84e134Smrg       	AC_DEFINE([NO_WIDEC_H],1,
1197a84e134Smrg			[Define to 1 if you DO NOT have the <widec.h> header file.]))
1207a84e134Smrg
1217a84e134Smrg# Checks for functions
1227a84e134SmrgAC_CHECK_FUNCS([iswalnum])
1237a84e134Smrg
1247a84e134SmrgXORG_MANPAGE_SECTIONS
1257a84e134SmrgXORG_RELEASE_VERSION
1267a84e134Smrg
1277a84e134SmrgAC_OUTPUT([Makefile
1287a84e134Smrg	  include/Makefile
1297a84e134Smrg	  man/Makefile
1307a84e134Smrg	  src/Makefile])
1317a84e134Smrg
1327a84e134Smrgif test "x$build_v6" = xyes; then
1337a84e134Smrg   AC_OUTPUT(xaw6.pc)
1347a84e134Smrgfi
1357a84e134Smrg
1367a84e134Smrgif test "x$build_v7" = xyes; then
1377a84e134Smrg   AC_OUTPUT(xaw7.pc)
1387a84e134Smrgfi
1397a84e134Smrg
1407a84e134Smrgif test "x$build_v8" = xyes; then
1417a84e134Smrg   AC_OUTPUT(xaw8.pc)
1427a84e134Smrgfi
143