-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathconfigure.in
188 lines (150 loc) · 4.5 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
dnl Process this file with autoconf to produce a configure script.
AC_INIT([ots],[0.4.2],[[email protected]])
AC_CONFIG_SRCDIR([src/libots.h])
POPT_REQUIRED=1.5
AC_SUBST(POPT_REQUIRED)
dnl This next section is courtesy gtk+
dnl
# Making releases:
# OTS_MICRO_VERSION += 1;
# OTS_INTERFACE_AGE += 1;
# OTS_BINARY_AGE += 1;
# if any functions have been added, set OTS_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set OTS_BINARY_AGE and OTS_INTERFACE_AGE to 0.
#
OTS_MAJOR_VERSION=0
OTS_MINOR_VERSION=5
OTS_MICRO_VERSION=0
OTS_VERSION=$OTS_MAJOR_VERSION.$OTS_MINOR_VERSION.$OTS_MICRO_VERSION
AC_SUBST(OTS_MAJOR_VERSION)
AC_SUBST(OTS_MINOR_VERSION)
AC_SUBST(OTS_MICRO_VERSION)
AC_SUBST(OTS_VERSION)
# libtool versioning
VERSION_INFO=`expr $OTS_MAJOR_VERSION + $OTS_MINOR_VERSION`:$OTS_MICRO_VERSION:$OTS_MINOR_VERSION
AC_SUBST(VERSION_INFO)
# For automake.
PACKAGE=ots
dnl Specify a configuration file
dnl Initialize automake stuff
AM_CONFIG_HEADER(ots-config.h)
AM_INIT_AUTOMAKE($PACKAGE, $OTS_VERSION)
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
if test "x$GCC" = "xyes"; then
ANSI_CFLAGS="-Wall"
else
ANSI_CFLAGS=""
fi
AC_SUBST(ANSI_CFLAGS)
AC_PROG_INSTALL
AC_PROG_MAKE_SET
dnl AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
dnl Checks for headers.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
PKG_CHECK_MODULES(OTS, [glib-2.0 >= 2.0 libxml-2.0 >= 2.4.23])
AC_SUBST(OTS_LIBS)
AC_SUBST(OTS_CFLAGS)
AC_ARG_WITH(popt-prefix, [ --with-popt-prefix=DIR
specify under which prefix popt is installed.], with_popt_prefix="$withval", )
saved_LDFLAGS=$LDFLAGS
if test "x$with_popt_prefix" != "x"; then
LDFLAGS="-L$with_popt_prefix/lib "$LDFLAGS
fi
POPT_LIBS=
AC_CHECK_LIB(popt, poptParseArgvString, [POPT_LIBS="-lpopt"],
AC_MSG_ERROR([popt 1.5 or newer is required to build ots.
You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/]))
if test "x$with_popt_prefix" != "x"; then
POPT_LIBS="-L$with_popt_prefix/lib $POPT_LIBS"
CFLAGS="-I$with_popt_prefix/include $CFLAGS"
fi
AC_SUBST(POPT_LIBS)
LDFLAGS=$saved_LDFLAGS
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
native_win32=yes
;;
*)
native_win32=no
;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
AC_MSG_CHECKING([for Win32 platform in general])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT($platform_win32)
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
if test "x$with_html_dir" = "x" ; then
HTML_DIR='${datadir}/doc/libots/html'
else
HTML_DIR=$with_html_dir
fi
AC_SUBST(HTML_DIR)
AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
gtk_doc_min_version=0.9
if $GTKDOC ; then
gtk_doc_version=`gtkdoc-mkdb --version`
AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
IFS="${IFS= }"; gtk_save_IFS="$IFS"; IFS="."
set $gtk_doc_version
for min in $gtk_doc_min_version ; do
cur=$1; shift
if test -z $min ; then break; fi
if test -z $cur ; then GTKDOC=false; break; fi
if test $cur -gt $min ; then break ; fi
if test $cur -lt $min ; then GTKDOC=false; break ; fi
done
IFS="$gtk_save_IFS"
if $GTKDOC ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
AC_CHECK_PROG(DB2HTML, db2html, true, false)
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
dnl Make people enable the gtk-doc stuff explicitely.
AC_ARG_ENABLE(gtk-doc, [ --disable-gtk-doc use gtk-doc to build documentation [default=yes]], enable_gtk_doc="$enableval", enable_gtk_doc=yes)
if test x$enable_gtk_doc = xyes ; then
if test x$GTKDOC != xtrue ; then
enable_gtk_doc=no
fi
fi
dnl NOTE: We need to use a separate automake conditional for this
dnl to make this work with the tarballs.
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
AC_CONFIG_FILES([
Makefile
libots-1.pc
ots.spec
src/Makefile
dic/Makefile
doc/Makefile
articles/Makefile
])
AC_OUTPUT
dnl =============================================================================================
echo "
ots-$OTS_VERSION
prefix: ${prefix}
compiler: ${CC}
"