Chris@0
|
1 dnl -*- m4 -*-
|
Chris@0
|
2 dnl
|
Chris@0
|
3 dnl libid3tag - ID3 tag manipulation library
|
Chris@0
|
4 dnl Copyright (C) 2000-2004 Underbit Technologies, Inc.
|
Chris@0
|
5 dnl
|
Chris@0
|
6 dnl This program is free software; you can redistribute it and/or modify
|
Chris@0
|
7 dnl it under the terms of the GNU General Public License as published by
|
Chris@0
|
8 dnl the Free Software Foundation; either version 2 of the License, or
|
Chris@0
|
9 dnl (at your option) any later version.
|
Chris@0
|
10 dnl
|
Chris@0
|
11 dnl This program is distributed in the hope that it will be useful,
|
Chris@0
|
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Chris@0
|
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Chris@0
|
14 dnl GNU General Public License for more details.
|
Chris@0
|
15 dnl
|
Chris@0
|
16 dnl You should have received a copy of the GNU General Public License
|
Chris@0
|
17 dnl along with this program; if not, write to the Free Software
|
Chris@0
|
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Chris@0
|
19 dnl
|
Chris@0
|
20 AC_REVISION([$Id: configure.ac,v 1.12 2004/01/23 23:22:46 rob Exp $])dnl
|
Chris@0
|
21
|
Chris@0
|
22 dnl Process this file with autoconf to produce a configure script.
|
Chris@0
|
23
|
Chris@0
|
24 AC_INIT([ID3 Tag], [0.15.1b], [support@underbit.com], [libid3tag])
|
Chris@0
|
25 AC_PREREQ(2.53)
|
Chris@0
|
26
|
Chris@0
|
27 AC_CONFIG_SRCDIR([id3tag.h])
|
Chris@0
|
28
|
Chris@0
|
29 AM_INIT_AUTOMAKE
|
Chris@0
|
30
|
Chris@0
|
31 AM_CONFIG_HEADER([config.h])
|
Chris@0
|
32
|
Chris@0
|
33 dnl System type.
|
Chris@0
|
34
|
Chris@0
|
35 AC_CANONICAL_HOST
|
Chris@0
|
36
|
Chris@0
|
37 dnl Checks for programs.
|
Chris@0
|
38
|
Chris@0
|
39 AC_PROG_CC
|
Chris@0
|
40
|
Chris@0
|
41 if test "$GCC" = yes
|
Chris@0
|
42 then
|
Chris@0
|
43 case "$host" in
|
Chris@0
|
44 *-*-mingw*)
|
Chris@0
|
45 case "$build" in
|
Chris@0
|
46 *-*-cygwin*)
|
Chris@0
|
47 CPPFLAGS="$CPPFLAGS -mno-cygwin"
|
Chris@0
|
48 LDFLAGS="$LDFLAGS -mno-cygwin"
|
Chris@0
|
49 ;;
|
Chris@0
|
50 esac
|
Chris@0
|
51 esac
|
Chris@0
|
52
|
Chris@0
|
53 dnl case "$host" in
|
Chris@0
|
54 dnl *-*-cygwin* | *-*-mingw*)
|
Chris@0
|
55 dnl LDFLAGS="$LDFLAGS -no-undefined -mdll"
|
Chris@0
|
56 dnl ;;
|
Chris@0
|
57 dnl esac
|
Chris@0
|
58 fi
|
Chris@0
|
59
|
Chris@0
|
60 dnl Support for libtool.
|
Chris@0
|
61
|
Chris@0
|
62 dnl AC_DISABLE_SHARED
|
Chris@0
|
63 dnl AC_LIBTOOL_WIN32_DLL
|
Chris@0
|
64 AC_PROG_LIBTOOL
|
Chris@0
|
65
|
Chris@0
|
66 AC_SUBST(LIBTOOL_DEPS)
|
Chris@0
|
67
|
Chris@0
|
68 dnl Compiler options.
|
Chris@0
|
69
|
Chris@0
|
70 arch=""
|
Chris@0
|
71 debug=""
|
Chris@0
|
72 optimize=""
|
Chris@0
|
73 profile=""
|
Chris@0
|
74
|
Chris@0
|
75 set -- $CFLAGS
|
Chris@0
|
76 CFLAGS=""
|
Chris@0
|
77
|
Chris@0
|
78 if test "$GCC" = yes
|
Chris@0
|
79 then
|
Chris@0
|
80 CFLAGS="-Wall"
|
Chris@0
|
81 fi
|
Chris@0
|
82
|
Chris@0
|
83 while test $# -gt 0
|
Chris@0
|
84 do
|
Chris@0
|
85 case "$1" in
|
Chris@0
|
86 -Wall)
|
Chris@0
|
87 if test "$GCC" = yes
|
Chris@0
|
88 then
|
Chris@0
|
89 :
|
Chris@0
|
90 else
|
Chris@0
|
91 CFLAGS="$CFLAGS $1"
|
Chris@0
|
92 fi
|
Chris@0
|
93 shift
|
Chris@0
|
94 ;;
|
Chris@0
|
95 -g)
|
Chris@0
|
96 debug="-g"
|
Chris@0
|
97 shift
|
Chris@0
|
98 ;;
|
Chris@0
|
99 -mno-cygwin)
|
Chris@0
|
100 shift
|
Chris@0
|
101 ;;
|
Chris@0
|
102 -m*)
|
Chris@0
|
103 arch="$arch $1"
|
Chris@0
|
104 shift
|
Chris@0
|
105 ;;
|
Chris@0
|
106 -fomit-frame-pointer)
|
Chris@0
|
107 shift
|
Chris@0
|
108 ;;
|
Chris@0
|
109 -O*|-f*)
|
Chris@0
|
110 optimize="$1"
|
Chris@0
|
111 shift
|
Chris@0
|
112 ;;
|
Chris@0
|
113 *)
|
Chris@0
|
114 CFLAGS="$CFLAGS $1"
|
Chris@0
|
115 shift
|
Chris@0
|
116 ;;
|
Chris@0
|
117 esac
|
Chris@0
|
118 done
|
Chris@0
|
119
|
Chris@0
|
120 dnl Checks for header files.
|
Chris@0
|
121
|
Chris@0
|
122 AC_HEADER_STDC
|
Chris@0
|
123 AC_CHECK_HEADERS(assert.h unistd.h)
|
Chris@0
|
124
|
Chris@0
|
125 AC_CHECK_HEADER(zlib.h, [], [
|
Chris@0
|
126 AC_MSG_ERROR([zlib.h was not found
|
Chris@0
|
127 *** You must first install zlib (libz) before you can build this package.
|
Chris@0
|
128 *** If zlib is already installed, you may need to use the CPPFLAGS
|
Chris@0
|
129 *** environment variable to specify its installed location, e.g. -I<dir>.])
|
Chris@0
|
130 ])
|
Chris@0
|
131
|
Chris@0
|
132 dnl Checks for typedefs, structures, and compiler characteristics.
|
Chris@0
|
133
|
Chris@0
|
134 AC_C_CONST
|
Chris@0
|
135 AC_C_INLINE
|
Chris@0
|
136
|
Chris@0
|
137 dnl Checks for library functions.
|
Chris@0
|
138
|
Chris@0
|
139 AC_CHECK_FUNCS(ftruncate)
|
Chris@0
|
140
|
Chris@0
|
141 AC_CHECK_LIB(z, compress2, [], [
|
Chris@0
|
142 AC_MSG_ERROR([libz was not found
|
Chris@0
|
143 *** You must first install zlib (libz) before you can build this package.
|
Chris@0
|
144 *** If zlib is already installed, you may need to use the LDFLAGS
|
Chris@0
|
145 *** environment variable to specify its installed location, e.g. -L<dir>.])
|
Chris@0
|
146 ])
|
Chris@0
|
147
|
Chris@0
|
148 dnl handle --enable and --disable options
|
Chris@0
|
149
|
Chris@0
|
150 AC_CACHE_SAVE
|
Chris@0
|
151
|
Chris@0
|
152 AC_MSG_CHECKING([whether to enable profiling])
|
Chris@0
|
153 AC_ARG_ENABLE(profiling, AC_HELP_STRING([--enable-profiling],
|
Chris@0
|
154 [generate profiling code]),
|
Chris@0
|
155 [
|
Chris@0
|
156 case "$enableval" in
|
Chris@0
|
157 yes) profile="-pg" ;;
|
Chris@0
|
158 esac
|
Chris@0
|
159 ])
|
Chris@0
|
160 AC_MSG_RESULT(${enable_profiling-no})
|
Chris@0
|
161
|
Chris@0
|
162 AC_MSG_CHECKING([whether to enable debugging])
|
Chris@0
|
163 AC_ARG_ENABLE(debugging, AC_HELP_STRING([--enable-debugging],
|
Chris@0
|
164 [enable diagnostic debugging support])
|
Chris@0
|
165 AC_HELP_STRING([--disable-debugging],
|
Chris@0
|
166 [do not enable debugging and use more optimization]),
|
Chris@0
|
167 [
|
Chris@0
|
168 case "$enableval" in
|
Chris@0
|
169 yes)
|
Chris@0
|
170 AC_DEFINE(DEBUG, 1,
|
Chris@0
|
171 [Define to enable diagnostic debugging support.])
|
Chris@0
|
172 optimize=""
|
Chris@0
|
173 ;;
|
Chris@0
|
174 no)
|
Chris@0
|
175 if test -n "$profile"
|
Chris@0
|
176 then
|
Chris@0
|
177 AC_MSG_ERROR(--enable-profiling and --disable-debugging are incompatible)
|
Chris@0
|
178 fi
|
Chris@0
|
179
|
Chris@0
|
180 AC_DEFINE(NDEBUG, 1,
|
Chris@0
|
181 [Define to disable debugging assertions.])
|
Chris@0
|
182 debug=""
|
Chris@0
|
183 if test "$GCC" = yes
|
Chris@0
|
184 then
|
Chris@0
|
185 optimize="$optimize -fomit-frame-pointer"
|
Chris@0
|
186 fi
|
Chris@0
|
187 ;;
|
Chris@0
|
188 esac
|
Chris@0
|
189 ])
|
Chris@0
|
190 AC_MSG_RESULT(${enable_debugging-default})
|
Chris@0
|
191 AM_CONDITIONAL(DEBUG, test ${enable_debugging-default} = yes)
|
Chris@0
|
192
|
Chris@0
|
193 dnl Create output files.
|
Chris@0
|
194
|
Chris@0
|
195 test -n "$arch" && CFLAGS="$CFLAGS $arch"
|
Chris@0
|
196 test -n "$debug" && CFLAGS="$CFLAGS $debug"
|
Chris@0
|
197 test -n "$optimize" && CFLAGS="$CFLAGS $optimize"
|
Chris@0
|
198 test -n "$profile" && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile"
|
Chris@0
|
199
|
Chris@0
|
200 dnl LTLIBOBJS=`echo "$LIBOBJS" | sed -e 's/\.o/.lo/g'`
|
Chris@0
|
201 dnl AC_SUBST(LTLIBOBJS)
|
Chris@0
|
202
|
Chris@0
|
203 AC_CONFIG_FILES([Makefile msvc++/Makefile \
|
Chris@0
|
204 libid3tag.list])
|
Chris@0
|
205 AC_OUTPUT
|