1# configure.in - HTML TidyLib GNU autoconf input file
2#
3# Copyright (c) 2003-2004 World Wide Web Consortium
4# (Massachusetts Institute of Technology, European Research
5# Consortium for Informatics and Mathematics, Keio University).
6# All Rights Reserved.
7#
8# CVS Info :
9#
10#   $Author: arnaud02 $
11#   $Date: 2008/03/24 21:08:16 $
12#   $Revision: 1.4 $
13#
14
15AC_INIT([include/tidy.h])
16
17# Making releases:
18#
19#   TIDY_MICRO_VERSION += 1;
20#   TIDY_INTERFACE_AGE += 1;
21#   TIDY_BINARY_AGE += 1;
22#
23# if any functions have been added, set TIDY_INTERFACE_AGE to 0.
24# if backwards compatibility has been broken,
25# set TIDY_BINARY_AGE and TIDY_INTERFACE_AGE to 0.
26#
27TIDY_MAJOR_VERSION=0
28TIDY_MINOR_VERSION=99
29TIDY_MICRO_VERSION=0
30TIDY_INTERFACE_AGE=0
31TIDY_BINARY_AGE=0
32
33LIBTIDY_VERSION=$TIDY_MAJOR_VERSION.$TIDY_MINOR_VERSION.$TIDY_MICRO_VERSION
34
35AC_SUBST(LIBTIDY_VERSION)
36
37# libtool versioning
38#
39LT_RELEASE=$TIDY_MAJOR_VERSION.$TIDY_MINOR_VERSION
40LT_CURRENT=`expr $TIDY_MICRO_VERSION - $TIDY_INTERFACE_AGE`
41LT_REVISION=$TIDY_INTERFACE_AGE
42LT_AGE=`expr $TIDY_BINARY_AGE - $TIDY_INTERFACE_AGE`
43
44AC_SUBST(LT_RELEASE)
45AC_SUBST(LT_CURRENT)
46AC_SUBST(LT_REVISION)
47AC_SUBST(LT_AGE)
48
49AM_INIT_AUTOMAKE(tidy,$LIBTIDY_VERSION)
50
51# Checks for programs.
52
53# =============================================
54# AC_PROG_CC has a habit of adding -g to CFLAGS
55#
56save_cflags="$CFLAGS"
57
58AC_PROG_CC
59if test "x$GCC" = "xyes"; then
60	WARNING_CFLAGS="-Wall"
61else
62	WARNING_CFLAGS=""
63fi
64AC_SUBST(WARNING_CFLAGS)
65
66debug_build=no
67AC_ARG_ENABLE(debug,[  --enable-debug          add -g (instead of -O2) to CFLAGS],[
68	if test "x$enableval" = "xyes"; then
69		debug_build=yes
70	fi
71])
72if test $debug_build = yes; then
73	CFLAGS="$save_cflags -g"
74else
75	CFLAGS="$save_cflags"
76fi
77#
78# =============================================
79
80AC_PROG_CPP
81AC_PROG_CXX
82AC_PROG_INSTALL
83AC_PROG_LN_S
84AC_PROG_LIBTOOL
85AC_PROG_MAKE_SET
86
87support_access=yes
88AC_ARG_ENABLE(access,[  --enable-access         support accessibility checks],[
89	if test "x$enableval" = "xno"; then
90		support_access=no
91	fi
92])
93if test $support_access = yes; then
94	AC_DEFINE(SUPPORT_ACCESSIBILITY_CHECKS,1)
95else
96	AC_DEFINE(SUPPORT_ACCESSIBILITY_CHECKS,0)
97fi
98
99support_utf16=yes
100AC_ARG_ENABLE(utf16,[  --enable-utf16          support UTF-16 encoding],[
101	if test "x$enableval" = "xno"; then
102		support_utf16=no
103	fi
104])
105if test $support_utf16 = yes; then
106	AC_DEFINE(SUPPORT_UTF16_ENCODINGS,1)
107else
108	AC_DEFINE(SUPPORT_UTF16_ENCODINGS,0)
109fi
110
111support_asian=yes
112AC_ARG_ENABLE(asian,[  --enable-asian          support asian encodings],[
113	if test "x$enableval" = "xno"; then
114		support_asian=no
115	fi
116])
117if test $support_asian = yes; then
118	AC_DEFINE(SUPPORT_ASIAN_ENCODINGS,1)
119else
120	AC_DEFINE(SUPPORT_ASIAN_ENCODINGS,0)
121fi
122
123# TODO: this defines "WITH_DMALLOC" but tidy expects "DMALLOC"
124#       need to do: #if defined(DMALLOC) || defined(WITH_DMALLOC)
125#
126AM_WITH_DMALLOC
127
128AC_OUTPUT([
129	Makefile
130	src/Makefile
131	console/Makefile
132	include/Makefile
133])
134