File: configure.ac

package info (click to toggle)
libsamplerate 0.1.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,724 kB
  • ctags: 484
  • sloc: ansic: 28,793; sh: 8,427; makefile: 124
file content (334 lines) | stat: -rw-r--r-- 9,890 bytes parent folder | download
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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# Copyright (C) 2002-2004 Erik de Castro Lopo (erikd AT mega-nerd DOT com).

dnl Require autoconf version >= 2.54)
AC_PREREQ(2.54)

AC_INIT
AC_CONFIG_SRCDIR([src/samplerate.c])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE(libsamplerate,0.1.2)
AM_CONFIG_HEADER(src/config.h)

#------------------------------------------------------------------------------------
# Rules for library version information:
#
#  1. Start with version information of `0:0:0' for each libtool library.
#  2. Update the version information only immediately before a public release of
#     your software. More frequent updates are unnecessary, and only guarantee
#     that the current interface number gets larger faster.
#  3. If the library source code has changed at all since the last update, then
#     increment revision (`c:r:a' becomes `c:r+1:a').
#  4. If any interfaces have been added, removed, or changed since the last update,
#     increment current, and set revision to 0.
#  5. If any interfaces have been added since the last public release, then increment
#     age.
#  6. If any interfaces have been removed since the last public release, then set age
#     to 0.

SHARED_VERSION_INFO="1:1:1"

AC_PROG_CC
AC_PROG_INSTALL

AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL

if test "x-$build_os-$host_os-$target_os" = x-mingw32-mingw32-mingw32 ; then
	AC_CHECK_PROG(DLLTOOL, dlltool, dlltool)
	AC_CHECK_PROG(DLLWRAP, dllwrap, dllwrap)
	AC_CHECK_PROG(PEXPORTS, pexports, pexports)
	fi

AC_HEADER_STDC

AC_CHECK_HEADERS(stdint.h sys/times.h)

#====================================================================================
# Couple of initializations here. Fill in real values later.

SHLIB_VERSION_ARG=""

#====================================================================================
# Finished checking, handle options.

AC_ARG_ENABLE(gcc-werror,
	AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]),
	ac_arg_gcc_werror=yes, ac_arg_gcc_werror=no)

AC_ARG_ENABLE(gcc-pipe,
		AC_HELP_STRING([--disable-gcc-pipe], [disable gcc -pipe option ]),
		ac_arg_gcc_pipe="N", ac_arg_gcc_pipe="Y")

AC_ARG_ENABLE(gcc-opt,
		AC_HELP_STRING([--disable-gcc-opt], [disable gcc optimisations ]),
		ac_arg_gcc_opt="N", ac_arg_gcc_opt="Y")

AC_ARG_ENABLE(fftw,
		AC_HELP_STRING([--disable-fftw], [disable usage of FFTW ]),
		ac_arg_fftw="N", ac_arg_fftw="Y")

AC_ARG_ENABLE(debug,
		AC_HELP_STRING([--enable-debug], [enable debugging ]),
		ac_arg_debug=yes, ac_arg_debug=no)

AC_ARG_ENABLE(cpu-clip,
		AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]),
		ac_arg_cpu_clip="N", ac_arg_cpu_clip="Y")

if test x$ac_arg_debug = xyes ; then
	AC_DEFINE([ENABLE_DEBUG],1,[Set to 1 to enable debugging.])
else
	AC_DEFINE([ENABLE_DEBUG],0,[Set to 1 to enable debugging.])
	fi

if test $ac_cv_c_compiler_gnu = yes ; then
	CFLAGS="$CFLAGS -W -Wstrict-prototypes -Wmissing-prototypes -Wall -pedantic -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow"
	# -Wpointer-arith -Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion -Winline"
	if test "$ac_arg_gcc_opt" = "N" ; then
		temp_CFLAGS=`echo $CFLAGS | sed "s/O2/O0/"`
		CFLAGS=$temp_CFLAGS
		AC_MSG_WARN([[*** Compiler optimisations switched off. ***]])
		fi

	# Disable -Wall and -pedantic for Apple Darwin/Rhapsody.
	# System headers on these systems are broken.
	case "$target_os" in
		darwin* | rhapsody*)
			temp_CFLAGS=`echo $CFLAGS | sed "s/-Wall -pedantic//"`
			CFLAGS=$temp_CFLAGS
			;;
		linux*)
			SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
			;;
		*)
			;;
		esac
	if test x$ac_arg_gcc_pipe != "xN" ; then
	 	CFLAGS="$CFLAGS -pipe"
	 	fi

	if test x$ac_arg_gcc_werror = "xyes" ; then
		CFLAGS="-Werror $CFLAGS"
		fi

	AC_DEFINE([COMPILER_IS_GCC],1, [Set to 1 if the compile is GNU GCC.])
	GCC_MAJOR_VERSION=`$CC -dumpversion | sed "s/\..*//"`
	AC_DEFINE_UNQUOTED([GCC_MAJOR_VERSION],${GCC_MAJOR_VERSION}, [Major version of GCC or 3 otherwise.])
	fi

#====================================================================================
# Check types and their sizes.

AC_CHECK_SIZEOF(int,0)
AC_CHECK_SIZEOF(long,0)
AC_CHECK_SIZEOF(float,4)
AC_CHECK_SIZEOF(double,8)

#====================================================================================
# Want to find libefence if it exists, but only want to link it to the test
# programs. Therefore, save $LIBS, check for libefence and then reset $LIBS
# to the previously saved value.

ac_cv_lib_efence_memalign=no
EFENCE_LIB=""

if test x$ac_arg_debug = xyes ; then
	saved_LIBS=$LIBS
	AC_CHECK_LIB([efence],memalign)
	LIBS=$saved_LIBS

	if test x$ac_cv_lib_efence_memalign = xyes ; then
		EFENCE_LIB="-lefence"
		fi
	fi

#====================================================================================
# Check for functions.

AC_CHECK_FUNCS(malloc calloc free memcpy memmove)

AC_CHECK_LIB([m],floor)
AC_CHECK_FUNCS(floor ceil fmod)

AC_C99_FUNC_LRINT
AC_C99_FUNC_LRINTF
# AC_C99_FUNC_LLRINT  Don't need this (yet?).

case "x$ac_cv_c99_lrint$ac_cv_c99_lrintf" in
	xyesyes)
		;;
	*)
		AC_MSG_WARN([[*** Missing C99 standard functions lrint() and lrintf().]])
		AC_MSG_WARN([[*** This may cause benign compiler warnings on some systems (ie Solaris).]])
		;;
	esac

#====================================================================================
# Determine if the processor can do clipping on float to int conversions.

if test x$ac_arg_cpu_clip = "xY" ; then
	AC_C_CLIP_MODE
else
	echo "checking processor clipping capabilities... disabled"
	ac_cv_c_clip_positive=0
	ac_cv_c_clip_negative=0
	fi

AC_DEFINE_UNQUOTED(CPU_CLIPS_POSITIVE, ${ac_cv_c_clip_positive},
	[Target processor clips on positive float to int conversion.])
AC_DEFINE_UNQUOTED(CPU_CLIPS_NEGATIVE, ${ac_cv_c_clip_negative},
	[Target processor clips on negative float to int conversion.])

#====================================================================================
# Check for libsndfile which is required for the test and example programs.

PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.6, ac_cv_sndfile=1, ac_cv_sndfile=0)

AC_DEFINE_UNQUOTED([HAVE_SNDFILE],$ac_cv_sndfile,[Set to 1 if you have libsndfile.])

if test x$ac_cv_sndfile = x1 ; then
	ac_cv_sndfile=yes
	HAVE_SNDFILE=1
else
	ac_cv_sndfile=no
	HAVE_SNDFILE=0
	fi

#====================================================================================
# Check for libfftw3 which is required for the test and example programs.

if test $ac_arg_fftw = "Y" ; then
	PKG_CHECK_MODULES(FFTW3, fftw3 >= 0.15.0, ac_cv_fftw3=1, ac_cv_fftw3=0)
	AC_DEFINE_UNQUOTED([HAVE_FFTW3],$ac_cv_fftw3,[Set to 1 if you have libfftw3.])

	if test x$ac_cv_fftw3 = x1 ; then
		ac_cv_fftw3=yes
		HAVE_FFTW3=1
		fi
	fi

if test x$ac_cv_fftw3 != xyes ; then
	ac_cv_fftw3=no
	HAVE_FFTW3=0
	fi

#====================================================================================
# Find known target OS.

OS_SPECIFIC_INCLUDES=""

case "$target_os" in
	darwin* | rhapsody*)
		OS_SPECIFIC_INCLUDES="-fpascal-strings -I/Developer/Headers/FlatCarbon"
		OS_SPECIFIC_LINKS="-framework CoreAudio"
		;;
	mingw32*)
		OS_SPECIFIC_LINKS="-lwinmm"
		;;
	*)
		OS_SPECIFIC_INCLUDES=""
		OS_SPECIFIC_LINKS=""
		;;
	esac

#====================================================================================
# Now use the information from the checking stage.

# Need to make examples directory before tests directory.
subdirs="src doc examples tests"

AC_DEFINE([OS_IS_WIN32],0, [Set to 1 if compiling for Win32])

AC_SUBST(subdirs)
AC_SUBST(SHLIB_VERSION_ARG)
AC_SUBST(SHARED_VERSION_INFO)
AC_SUBST(OS_SPECIFIC_INCLUDES)
AC_SUBST(OS_SPECIFIC_LINKS)

AC_SUBST(COMPILER_IS_GCC)
AC_SUBST(GCC_MAJOR_VERSION)
AC_SUBST(ENABLE_DEBUG)

AC_SUBST(HAVE_FFTW3)
AC_SUBST(FFTW3_CFLAGS)
AC_SUBST(FFTW3_LIBS)

AC_SUBST(EFENCE_LIB)

AC_SUBST(HAVE_SNDFILE)
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)

AC_CONFIG_FILES([Makefile src/Version_script Win32/Makefile Win32/Makefile.mingw \
			src/Makefile examples/Makefile tests/Makefile doc/Makefile \
			libsamplerate.spec samplerate.pc])
AC_OUTPUT

#====================================================================================
# Special case for MinGW32.

if test "x-$build_os-$host_os-$target_os" = x-mingw32-mingw32-mingw32 ; then
	cp -f Win32/Makefile.mingw Makefile
	echo
	echo "Now run \"make\" and \"make check\"."
	echo
	echo "There is no automatic install script on this platform."
	echo
	
	exit 0
	fi

#====================================================================================

AC_MSG_RESULT([
-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-=-

  Configuration summary :

    Version : ..................... ${VERSION}])
AC_MSG_RESULT([    Enable debugging : ............ ${ac_arg_debug}
])


if test x$ac_cv_c_compiler_gnu = xyes ; then
	echo -e "  Tools :\n"
	echo "    Compiler is GCC : ............. ${ac_cv_c_compiler_gnu}"
	echo "    GCC major version : ........... ${GCC_MAJOR_VERSION}"
	fi

AC_MSG_RESULT([
  Extra tools required for testing and examples :

    Use FFTW : .................... ${ac_cv_fftw3}])

AC_MSG_RESULT([    Have libsndfile : ............. ${ac_cv_sndfile}])
AC_MSG_RESULT([    Have libefence : .............. ${ac_cv_lib_efence_memalign}
])

AC_MSG_RESULT([  Installation directories :

    Library directory : ........... ${prefix}/lib
    Program directory : ........... ${prefix}/bin
    Pkgconfig directory : ......... ${prefix}/lib/pkgconfig
])

if test x$prefix != "x/usr" ; then
	echo "Compiling some other packages against ${PACKAGE} may require "
	echo -e "the addition of \"${prefix}/lib/pkgconfig\" to the "
	echo -e "PKG_CONFIG_PATH environment variable.\n"
	fi



ifelse(dnl	

 Do not edit or modify anything in this comment block.
 The arch-tag line is a file identity tag for the GNU Arch 
 revision control system.

 arch-tag: ea0a8fed-620b-4dff-917a-7a32a2368908

)dnl