configure.ac revision 5ec34c4c
1
2# Initialize Autoconf
3AC_PREREQ([2.60])
4AC_INIT([libXaw], [1.0.14],
5        [https://gitlab.freedesktop.org/xorg/lib/libXaw/issues], [libXaw])
6AC_CONFIG_SRCDIR([Makefile.am])
7AC_CONFIG_HEADERS([config.h])
8
9# Initialize Automake
10AM_INIT_AUTOMAKE([foreign dist-bzip2])
11
12# Initialize libtool
13AC_PROG_LIBTOOL
14
15# Require xorg-macros minimum of 1.12 for DocBook external references
16m4_ifndef([XORG_MACROS_VERSION],
17          [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
18XORG_MACROS_VERSION(1.12)
19XORG_DEFAULT_OPTIONS
20XORG_ENABLE_SPECS
21XORG_WITH_XMLTO(0.0.22)
22XORG_WITH_FOP
23XORG_WITH_XSLTPROC
24XORG_CHECK_SGML_DOCTOOLS(1.8)
25
26# Some compilers do not support per target -c and -o flags
27AM_PROG_CC_C_O
28
29# Checks for programs.
30AC_PROG_AWK
31
32# Need to call this explicitly since the first call to PKG_CHECK_MODULES
33# is in an if statement, and later calls would break if it's skipped.
34PKG_PROG_PKG_CONFIG
35
36#
37# fix libtool to set SONAME to libXaw.so.$major
38#
39AC_CONFIG_COMMANDS([libtool_hack], [
40	cp -f libtool libtool_
41	test -z "$SED" && SED=sed
42	$SED '1,/^soname_spec/{
43/^soname_spec/i\
44# X.Org hack to match monolithic Xaw SONAME\
45xorglibxawname="libXaw"
46/^soname_spec/s/libname/xorglibxawname/
47}' libtool_ > libtool
48	rm -f libtool_
49])
50
51# OSX/Win32 rules are different.
52platform_win32=no
53platform_darwin=no
54LIBEXT=so
55case $host_os in
56    cygwin*|mingw*)
57	LIBEXT=dll.a
58	platform_win32=yes
59	;;
60    darwin*)
61	LIBEXT=dylib
62	platform_darwin=yes
63	;;
64esac
65AC_SUBST(LIBEXT)
66AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
67AM_CONDITIONAL(PLATFORM_DARWIN, test "x$platform_darwin" = "xyes")
68
69# Whether to build Xaw6
70
71AC_ARG_ENABLE(xaw6, AS_HELP_STRING([--disable-xaw6],
72				[Disable building of libXaw.so.6]),
73			[build_v6=$enableval], [build_v6=yes])
74
75if test "x$build_v6" = xyes; then
76   PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu)
77fi
78
79
80# Whether to build Xaw7
81
82AC_ARG_ENABLE(xaw7, AS_HELP_STRING([--disable-xaw7],
83				[Disable building of libXaw.so.7]),
84			[build_v7=$enableval], [build_v7=yes])
85
86if test "x$build_v7" = xyes; then
87   PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm)
88fi
89
90
91AM_CONDITIONAL(BUILD_XAW6, [test x$build_v6 = xyes])
92AM_CONDITIONAL(BUILD_XAW7, [test x$build_v7 = xyes])
93
94# Checks for header files.
95AC_CHECK_HEADERS([wctype.h wchar.h widec.h])
96
97# Checks for functions
98AC_CHECK_FUNCS([iswalnum getpagesize])
99
100# Link with winsock if mingw target
101case $host_os in
102	*mingw*)
103		AC_CHECK_LIB([ws2_32],[main])
104	;;
105	*)
106	;;
107esac
108
109AC_MSG_CHECKING(if C const-support is wanted)
110AC_ARG_ENABLE(const, AS_HELP_STRING([--disable-const], [Disable const-support]),
111	USE_CONST="$enableval", USE_CONST="yes")
112AC_MSG_RESULT($USE_CONST)
113if test "x$USE_CONST" = "xyes" ; then
114	AC_DEFINE(_CONST_X_STRING, 1, [Define to 1 to use standard C const feature.])
115fi
116
117AC_CONFIG_FILES([Makefile
118		include/Makefile
119		man/Makefile
120		specs/Makefile
121		specs/libXaw.ent
122		src/Makefile])
123
124if test "x$build_v6" = xyes; then
125   AC_CONFIG_FILES(xaw6.pc)
126fi
127
128if test "x$build_v7" = xyes; then
129   AC_CONFIG_FILES(xaw7.pc)
130fi
131
132AC_OUTPUT
133