-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
319 lines (270 loc) · 9.29 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# $Id: configure.in,v 1.67 2002/09/13 16:33:36 t1mpy Exp $
# Copyright 1999, 2000 Scott Thomas Haug <[email protected]>
# Copyright (C) 2002 Thijmen Klok <[email protected]>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# require autoconf 2.13
AC_PREREQ(2.13)
# init autoconf (and check for presence fo reconf)
AC_INIT(reconf)
ID3LIB_NAME=id3lib
dnl The following has been adapted from glib (http://www.gtk.org)
dnl
dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
dnl are available for $ac_help expansion (don't we all *love* autoconf?)
#AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
[AC_DIVERT_PUSH(NOTICE)])
# Making releases:
# ID3LIB_PATCH_VERSION += 1;
# ID3LIB_INTERFACE_AGE += 1;
# ID3LIB_BINARY_AGE += 1;
# if any functions have been added, set ID3LIB_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set ID3LIB_BINARY_AGE _and_ ID3LIB_INTERFACE_AGE to 0.
#
ID3LIB_MAJOR_VERSION=3
ID3LIB_MINOR_VERSION=9
ID3LIB_PATCH_VERSION=0
ID3LIB_ADDED_VERSION=
ID3LIB_VERSION=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION.$ID3LIB_PATCH_VERSION$ID3LIB_ADDED_VERSION
ID3LIB_INTERFACE_AGE=0
ID3LIB_BINARY_AGE=0
AC_DIVERT_POP()dnl
AC_SUBST(ID3LIB_NAME)
AC_SUBST(ID3LIB_MAJOR_VERSION)
AC_SUBST(ID3LIB_MINOR_VERSION)
AC_SUBST(ID3LIB_PATCH_VERSION)
AC_SUBST(ID3LIB_VERSION)
AC_SUBST(ID3LIB_INTERFACE_AGE)
AC_SUBST(ID3LIB_BINARY_AGE)
# for documentation purposes
DOX_DIR_HTML=api
DOX_DIR_LATEX=latex
DOX_DIR_MAN=man
DOX_DIR_RTF=rtf
AC_SUBST(DOX_DIR_HTML)
AC_SUBST(DOX_DIR_LATEX)
AC_SUBST(DOX_DIR_MAN)
AC_SUBST(DOX_DIR_RTF)
# libtool versioning
LT_RELEASE=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION
LT_CURRENT=`expr $ID3LIB_PATCH_VERSION - $ID3LIB_INTERFACE_AGE`
LT_REVISION=$ID3LIB_INTERFACE_AGE
LT_AGE=`expr $ID3LIB_BINARY_AGE - $ID3LIB_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
VERSION=$ID3LIB_VERSION
PACKAGE=$ID3LIB_NAME
dnl This is a hack to get the release date using cvs checkin macros
ID3LIB_FULLNAME=$ID3LIB_NAME-$ID3LIB_VERSION
AC_SUBST(ID3LIB_FULLNAME)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
AC_ISC_POSIX
dnl Initialize libtool
AM_PROG_LIBTOOL
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
#AC_CANONICAL_HOST
dnl figure debugging default, prior to $ac_help setup
dnl
ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
[AC_DIVERT_PUSH(NOTICE)])
if test `expr $ID3LIB_MINOR_VERSION \% 2` = 1 ; then
debug_default=yes
else
debug_default=minimum
fi
AC_DIVERT_POP()dnl
dnl declare --enable-* args and collect ac_help strings
AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]], , enable_ansi=no)
dnl
AC_SUBST(ID3LIB_DEBUG_FLAGS)
dnl Checks for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_INSTALL
dnl for executable extensions
AC_EXEEXT
dnl Checks for libraries.
AC_CHECK_LIB(z,uncompress,AC_DEFINE_UNQUOTED(HAVE_ZLIB))#,,
# AC_MSG_ERROR([id3lib requires zlib to process compressed frames]))
AM_CONDITIONAL(ID3_NEEDZLIB, test x$ac_cv_lib_z_uncompress = xno)
AM_CONDITIONAL(ID3_NEEDDEBUG, test x$enable_debug = xyes)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(zlib.h wchar.h sys/param.h unistd.h )
dnl check wheter iconv is the part of libc.
AC_CHECK_HEADERS( iconv.h, has_iconv=1, has_iconv=0)
dnl if we have iconv library, we have to decide if it
dnl is present in libc
ICONV_LIB=
if test $has_iconv = 1; then
AC_MSG_CHECKING(where to find iconv_open)
exec 6>/dev/null
AC_CHECK_FUNCS(iconv_open, iconv_in_libc=1, iconv_in_libc=0)
AC_CHECK_LIB(iconv, iconv_open, iconv_in_iconv=1, iconv_in_iconv=0)
AC_CHECK_LIB(iconv, libiconv_open, libiconv_in_iconv=1, libiconv_in_iconv=0)
if test ! x$silent = xyes; then
exec 6>&1
fi
#standalone library rules over libc
if test $iconv_in_iconv = 1 -o $libiconv_in_iconv = 1; then
AC_MSG_RESULT(libiconv)
ICONV_LIB=-liconv
elif test $iconv_in_libc = 1; then
AC_MSG_RESULT(libc)
else
AC_MSG_RESULT(not found (panic))
AC_MSG_ERROR([iconv.h found, while iconv library not found])
fi
#we have iconv at this moment, better check which call to use
AC_MSG_CHECKING(whether iconv takes const char ** or char **)
AC_TRY_COMPILE([#include <iconv.h>],[
{
size_t iconv (iconv_t a, const char ** b, size_t *c, char **d, size_t *e);
}],
iconv_oldstyle=1, iconv_oldstyle=0)
if test $iconv_oldstyle = 1; then
AC_MSG_RESULT(const char **)
AC_DEFINE(ID3LIB_ICONV_OLDSTYLE)
#we'll check out the need of
#typecast in the call of iconv_open
AC_MSG_CHECKING(whether to typecast in iconv)
AC_TRY_COMPILE([#include <iconv.h>],[
{
const char *src = "nothing";
char *outbuf;
size_t insize = 0;
size_t outsize = 0;
iconv_t cd;
iconv(cd, &src, &insize, &outbuf, &outsize);
}],
iconv_cast=0, iconv_cast=1)
if test $iconv_cast = 1; then
AC_MSG_RESULT(yes)
AC_DEFINE(ID3LIB_ICONV_CAST_OK)
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(char **)
#we'll check out the need of
#typecast in the call of iconv_open
AC_MSG_CHECKING(whether to typecast in iconv)
AC_TRY_COMPILE([#include <iconv.h>],[
{
char *src = "nothing";
char *outbuf;
size_t insize = 0;
size_t outsize = 0;
iconv_t cd;
iconv(cd, &src, &insize, &outbuf, &outsize);
}],
iconv_cast=0, iconv_cast=1)
if test $iconv_cast = 1; then
AC_MSG_RESULT(yes)
AC_DEFINE(ID3LIB_ICONV_CAST_OK)
else
AC_MSG_RESULT(no)
fi
fi
fi
if test "x$ICONV_LIB" != "x"; then
LIBS="$LIBS $ICONV_LIB"
fi
dnl Check for c++ features
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(libcw/sys.h)
AC_CHECK_HEADERS(cctype climits cstdio cstdlib bitset cstring)
AC_CHECK_HEADERS(fstream iostream iomanip vector \
,,AC_MSG_ERROR([Missing a vital header file for id3lib - download them here: http://gcc.gnu.org/libstdc++/ or better - compile a newer compiler like gcc3.x])
)
AC_CHECK_HEADERS( \
string \
iomanip.h \
,,AC_MSG_ERROR([Missing a vital header file for id3lib])
)
dnl Checks for the portability of certain c++ features: the bool type and
dnl for-loop scoping
ID3_CXX_PORTABILITY
ID3_CXX_WARNINGS
AC_LANG_RESTORE
ID3_DEBUG
ID3_UNICODE
dnl Check for functions.
# AC_FUNC_MEMCMP
AC_CHECK_FUNCS(getopt_long)
AM_CONDITIONAL(ID3_NEEDGETOPT_LONG, test x$ac_cv_func_getopt_long = xno)
AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(
truncate \
,,AC_MSG_ERROR([Missing a vital function for id3lib])
)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
dnl
dnl Checks with local macros
dnl
dnl Provides a --honor-std option to the configure script that honors the
dnl std namespace. Must be used AFTER configuring ALL compilers.
dnl LF_HONOR_STD
dnl ACCONFIG TEMPLATE
dnl
dnl /* config.h defines these preprocesser symbols to be used by id3lib for
dnl * determining internal versioning information. The intent is that these
dnl * macros will be made available in the library via constants, functions,
dnl * or static methods.
dnl */
dnl #undef HAVE_ZLIB
dnl #undef HAVE_GETOPT_LONG
dnl #undef _ID3LIB_NAME
dnl #undef _ID3LIB_VERSION
dnl #undef _ID3LIB_FULLNAME
dnl #undef _ID3LIB_MAJOR_VERSION
dnl #undef _ID3LIB_MINOR_VERSION
dnl #undef _ID3LIB_PATCH_VERSION
dnl #undef _ID3LIB_INTERFACE_AGE
dnl #undef _ID3LIB_BINARY_AGE
dnl #undef _ID3_COMPILED_WITH_DEBUGGING
dnl /* */
dnl END ACCONFIG
AC_DEFINE_UNQUOTED(_ID3LIB_NAME, "$ID3LIB_NAME")
AC_DEFINE_UNQUOTED(_ID3LIB_VERSION, "$ID3LIB_VERSION")
AC_DEFINE_UNQUOTED(_ID3LIB_FULLNAME, "$ID3LIB_FULLNAME")
AC_DEFINE_UNQUOTED(_ID3LIB_MAJOR_VERSION, $ID3LIB_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(_ID3LIB_MINOR_VERSION, $ID3LIB_MINOR_VERSION)
AC_DEFINE_UNQUOTED(_ID3LIB_PATCH_VERSION, $ID3LIB_PATCH_VERSION)
AC_DEFINE_UNQUOTED(_ID3LIB_INTERFACE_AGE, $ID3LIB_INTERFACE_AGE)
AC_DEFINE_UNQUOTED(_ID3LIB_BINARY_AGE, $ID3LIB_BINARY_AGE)
AC_DEFINE_UNQUOTED(_ID3_COMPILED_WITH_DEBUGGING, "${enable_debug}")
CONDITIONAL_SUBDIRS=
if test "x$ac_cv_lib_z_uncompress" = "xno"; then
CONDITIONAL_SUBDIRS="$CONDITIONAL_SUBDIRS zlib"
fi
AC_CONFIG_SUBDIRS(zlib)
CFLAGS="$CFLAGS -Wall"
AC_OUTPUT( \
Makefile \
doc/Makefile \
m4/Makefile \
include/Makefile \
include/id3/Makefile \
id3com/Makefile \
id3com/Sample/Makefile \
src/Makefile \
examples/Makefile \
prj/Makefile \
libprj/Makefile
)