File: configure.in

package info (click to toggle)
kwave 0.7.2-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,048 kB
  • ctags: 4,906
  • sloc: cpp: 31,275; ansic: 13,111; sh: 9,511; perl: 2,724; makefile: 786; asm: 145
file content (591 lines) | stat: -rw-r--r-- 17,676 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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
dnl without this order in this file, autoconf will not work!
dnl the argument is a source file out of your sources. But
dnl acinclude.m4 makes the job for all programs ;-)

AC_INIT([kwave],[0.7.2])
AC_CONFIG_SRCDIR([admin/acinclude.m4.in])
AC_CONFIG_AUX_DIR(admin)
unset CDPATH            dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
AC_CANONICAL_TARGET([]) dnl Checking host/target/build systems, for make, install etc.
AC_ARG_PROGRAM          dnl Perform program name transformation
AM_INIT_AUTOMAKE([kwave],[0.7.2])
AC_PREREQ(2.50)         dnl Require Autoconf 2.50 or higher

KDE_SET_PREFIX

dnl generate the config header
AM_CONFIG_HEADER(config.h)

AC_LANG([C])
AC_LANG([C++])
AC_CHECK_COMPILERS
AM_PROG_AS
AM_ENABLE_SHARED(yes)
AM_ENABLE_STATIC(no)

AC_LIBTOOL_DLOPEN
KDE_PROG_LIBTOOL

dnl does not work yet, at least not for me
dnl AM_KDE_WITH_NLS

dnl Checks for some programs/tools
AC_PROG_INSTALL
AC_PROG_LN_S

dnl look if we have a rpm based system
AC_PATH_PROG(RPM, rpm)

dnl some systems have rpmbuild some not
dnl if not, let the default be "rpm", this works at least for SuSE
AC_PATH_PROG(RPMBUILD, rpmbuild, ${RPM})
AC_SUBST(RPMBUILD)

AC_DEFUN([KWAVE_NEEDS_PROGRAM],
[
    KDE_FIND_PATH([$2], [$1], , [AC_MSG_ERROR([$2 is not installed])])
])

KWAVE_NEEDS_PROGRAM(CONVERT, convert)
AC_SUBST(CONVERT)

KWAVE_NEEDS_PROGRAM(MSGMERGE, msgmerge)
AC_SUBST(MSGMERGE)

KWAVE_NEEDS_PROGRAM(MSGFMT, msgfmt)
AC_SUBST(MSGFMT)

KWAVE_NEEDS_PROGRAM(XGETTEXT, xgettext)
AC_SUBST(XGETTEXT)

KWAVE_NEEDS_PROGRAM(RECODE, recode)
AC_SUBST(RECODE)

KWAVE_NEEDS_PROGRAM(SED, sed)
AC_SUBST(SED)

KWAVE_NEEDS_PROGRAM(GREP, grep)
AC_SUBST(GREP)

KWAVE_NEEDS_PROGRAM(EXPAND, expand)
AC_SUBST(EXPAND)

KWAVE_NEEDS_PROGRAM(CAT, cat)
AC_SUBST(CAT)

KWAVE_NEEDS_PROGRAM(SORT, sort)
AC_SUBST(SORT)

KWAVE_NEEDS_PROGRAM(UNIQ, uniq)
AC_SUBST(UNIQ)

KWAVE_NEEDS_PROGRAM(FIND, find)
AC_SUBST(FIND)

KWAVE_NEEDS_PROGRAM(AWK,awk)
AC_SUBST(AWK)

AC_DEFUN([AC_CHECK_WITH_INSURE],
[
    ac_use_insure=no
    AC_MSG_CHECKING(whether to use insure++);
    AC_ARG_ENABLE(insure,
[  --enable-insure         enable support for insure++ debugging [default=no]],
   [
    if test $enableval = "no"; then
         ac_use_insure="no"
       else
         ac_use_insure="yes"
    fi
   ], [ac_use_insure="no"])

  if test "$ac_use_insure" = "yes"; then
   CC=insure
   CPP=insure
   CXX=insure
   AC_SUBST(CC)
   AC_SUBST(CPP)
   AC_SUBST(CXX)
  fi

 AC_MSG_RESULT($ac_use_insure);
])

KDEMAJOR=`$CAT ./KDE-VERSION`
AC_MSG_CHECKING(KDE/Qt version)
if test "$KDEMAJOR" = "2"; then {
    AC_MSG_ERROR([KDE 2.x / Qt 2.1 - this does no longer work since v0.6.5])
    KDE_USE_QT(2.1)
    KDE_VERSION_SPECIFIC_LIBS="-lartsc -lartsflow -lartsflow_idl -lmcop \
                               -lkfile -lkdeui -lkdecore -lqt"
} else {
    if test "$KDEMAJOR" = "3"; then {
        AC_MSG_RESULT([OK, (KDE 3.x / Qt 3.x)])
        KDE_USE_QT(3.0.1)
        KDE_VERSION_SPECIFIC_LIBS="-lartsc -lartsflow_idl -lartsflow -lmcop \
                                   -lkio -lkdeui -lkdecore -lqt-mt"
    } else {
        AC_MSG_RESULT(unknown ?)
        AC_MSG_ERROR([ unable to determine KDE/Qt versions ])
    } fi
} fi
AC_SUBST(KDE_VERSION_SPECIFIC_LIBS)

AC_PATH_KDE

KDE_FIND_PATH(xml2pot, XML2POT, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(xml2pot)])
AC_SUBST(XML2POT)

KDE_FIND_PATH(checkXML, CHECKXML, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(checkXML)])
AC_SUBST(CHECKXML)

KDE_FIND_PATH(po2xml, PO2XML, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(po2xml)])
AC_SUBST(PO2XML)

KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(meinproc)])
AC_SUBST(MEINPROC)

dnl check for the file with KDE's built-in translations
AC_MSG_CHECKING(for kde.pot)
eval "KDE_POT_FILE=\"`echo ${includedir}/kde.pot`\""
AC_SUBST(KDE_POT_FILE)
AC_MSG_RESULT(${KDE_POT_FILE})

dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME

dnl check if the compiler has bool
AC_CHECK_BOOL
dnl check if the system needs some #defines
AC_CHECK_GNU_EXTENSIONS

dnl check if the c++ compiler is new enough to support references to functions
AC_MSG_CHECKING(whether $CXX supports references to functions)
AC_TRY_CPP([#include <sys/resource.h>
,
    typedef int(function_t)(int);
    class dummy {
    public:
        function_t &function(int index);
    };]
,
AC_MSG_RESULT(yes)
,AC_MSG_ERROR(FAILED! please get a newer C++ compiler))

AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(char,1)
AC_CHECK_SIZEOF(short,2)
AC_CHECK_SIZEOF(int,4)

dnl check for the host byte order
AC_C_BIGENDIAN(
    AC_DEFINE(ENDIANESS_BIG,    1, [byte-order of the host machine]),
    AC_DEFINE(ENDIANESS_LITTLE, 1, [byte-order of the host machine]),
    AC_MSG_ERROR([couldn't determine host endianess/byte-order])
)

dnl check for dirent.h
AC_HEADER_DIRENT

dnl check for other stdc headers. More traditional ;)
AC_HEADER_STDC

AC_CHECK_HEADER(sys/times.h, AC_DEFINE(HAVE_SYS_TIMES_H,1,
    [we can include <sys/times.h>]))

KDE_CHECK_HEADER(kdeversion.h, AC_DEFINE(HAVE_KDEVERSION_H,1,
    [we should have a file from which we can guess the KDE version]))

AC_CHECK_HEADER(sys/soundcard.h, AC_DEFINE(HAVE_SYS_SOUNDCARD_H,1,
    [needed for OSS playback and recording]))

dnl rtti/type info would be fine for debugging
AC_CHECK_HEADERS(typeinfo)

dnl check for multithreading support
AC_CHECK_HEADER(pthread.h,,[AC_MSG_ERROR([

    your system lacks support for posix threads.
    please install a current version of gnu libc!

    ])])

dnl check if the host system's libaudiofile is usable
AC_CHECK_LIB(audiofile, afOpenVirtualFile,
     USE_BUILTIN_LIBAUDIOFILE=0,
     USE_BUILTIN_LIBAUDIOFILE=1,
     )
dnl if the system libaudiofile is usable, check if the
dnl corresponding header files are installed too
if test "${USE_BUILTIN_LIBAUDIOFILE}" = "0"; then
    AC_CHECK_HEADER(audiofile.h,,[AC_MSG_ERROR([

    the header files of libaudiofile are missing.
    please install the audiofile-devel package!

    ])])
fi

if test "${USE_BUILTIN_LIBAUDIOFILE}" = "1"; then
    AC_DEFINE(USE_BUILTIN_LIBAUDIOFILE,1,[use own copy of libaudiofile])
    LIBAUDIOFILE_LDFLAGS="-L../libaudiofile"
    LIBAUDIOFILE_LIBADD="../libaudiofile/libaudiofile.la"
    LIBAUDIOFILE_SUBDIR="libaudiofile"
else
    LIBAUDIOFILE_REQUIRE="Requires:	audiofile > 0.2.3"
    LIBAUDIOFILE_LDFLAGS="-laudiofile"
    LIBAUDIOFILE_LIBADD=""
    LIBAUDIOFILE_SUBDIR=""
fi

AC_SUBST(LIBAUDIOFILE_REQUIRE)
AC_SUBST(LIBAUDIOFILE_LDFLAGS)
AC_SUBST(LIBAUDIOFILE_LIBADD)
AC_SUBST(LIBAUDIOFILE_SUBDIR)
AC_SUBST(USE_BUILTIN_LIBAUDIOFILE)

dnl check if the host system's libmad is usable
AC_CHECK_LIB(mad, mad_decoder_init,,[AC_MSG_ERROR([

        the mad package is missing.
        please install the mad and the mad-devel package!

])]
)
dnl if the system libmad is usable, check if the
dnl corresponding header files are installed too
AC_CHECK_HEADER(mad.h,,[AC_MSG_ERROR([

    the header files of the mad package are missing.
    please install the mad-devel package!

])])

dnl check for the GSL library
AM_PATH_GSL([1.4],,[AC_MSG_ERROR([

    could not find required version of GSL (GNU Scientific Library)
    please install the GSL and it's -devel package!
    see http://www.gnu.org/software/gsl

])])

dnl determine the name of the package that contains libmad
dnl on RPM based systems
if ! test -z ${RPM}; then {
    AC_MSG_CHECKING([which RPM package provides libmad.so.0])
    RPM_REQUIRE_LIBMAD=`${RPM} -q --whatprovides libmad.so.0 2>/dev/null | cut -d \- -f 1`
    AC_MSG_RESULT([${RPM_REQUIRE_LIBMAD}])
} fi
if test -z ${RPM_REQUIRE_LIBMAD}; then {
    RPM_REQUIRE_LIBMAD="libmad.so.0"
} fi

dnl ************************************************
dnl *** check for id3lib in a new enough version ***

AC_LANG_PUSH(C++)
saved_libs="$LDFLAGS"
LDFLAGS="$LDFLAGS -lid3 -lstdc++ -lz"
ac_found_id3lib="yes"
AC_MSG_CHECKING(for id3lib)
AC_TRY_LINK([
	#include <id3/globals.h>
	#include <id3/readers.h>
	#include <id3/tag.h>
], [ID3_Tag tag;],
[
    AC_TRY_LINK(
	[
		#include <id3/globals.h>
		#include <id3/readers.h>
		#include <id3/tag.h>
	],[
		ID3_Tag tag;
		ID3_MemoryReader reader;
		tag.Link(reader);
	],
		[AC_MSG_RESULT([yes, version is new enough])],
	{
		[AC_MSG_RESULT([yes, but version is too old])] ;
		ac_found_id3lib="no" ;
	}
    )
],
 [ac_found_id3lib="no"]
)
if test $ac_found_id3lib = "no"; then
AC_MSG_ERROR([

    id3lib seems not to be installed or too old !

    You can download id3lib from http://id3lib.sourceforge.net/
    and fetch the latest version from there. If you download the
    rpm package, please don't forget to fetch id3tag-devel too,
    it is needed for compiling Kwave!

    Note: at least version 3.8.1 is needed.

    ])
fi
AC_LANG_POP(C++)
LDFLAGS="$saved_libs"
dnl ***                                          ***
dnl ************************************************

dnl determine the name of the package that contains id3lib
dnl on RPM based systems, especially under Mandrake which
dnl gives it's best to get away from any standards...
if ! test -z ${RPM}; then {
    AC_MSG_CHECKING([which RPM package provides id3lib])
    RPM_REQUIRE_ID3LIB=`\
	(( ${RPM} --quiet -q --whatprovides id3lib 2>/dev/null && \
	   ${RPM} -q --whatprovides id3lib 2>/dev/null ) || \
	 ( ${RPM} --quiet -q --whatprovides libid3-3.8.so.2 2>/dev/null && \
	   ${RPM} -q --whatprovides libid3-3.8.so.2 2>/dev/null ) \
	) | cut -d \- -f 1`
    AC_MSG_RESULT([${RPM_REQUIRE_ID3LIB}])
} fi
if test -z ${RPM_REQUIRE_ID3LIB}; then {
    RPM_REQUIRE_ID3LIB="id3lib"
} fi

dnl check for libogg-devel support
AC_CHECK_HEADER(ogg/ogg.h,,[AC_MSG_ERROR([libogg-devel is missing.])])

dnl check for libogg support (needed by libvorbis)
AC_CHECK_LIB(ogg, ogg_stream_init,,[AC_MSG_ERROR([libogg is missing.])])

dnl check for libvorbis support
AC_CHECK_HEADER(vorbis/codec.h,,[AC_MSG_ERROR([

    your system lacks support for at least libvorbis-devel!
    please visit "http://vorbis.com" for obtainig a current version
    of libogg and libvorbis plus the -devel packages if your
    distribution does not include them.

    ])])

AC_CHECK_LIB(vorbis, vorbis_bitrate_addblock,,[AC_MSG_ERROR([

    your version of libvorbis seems to be too old, it does not
    contain the "vorbis_bitrate_addblock" function.

    Please update your libvorbis and libvorbis-devel package to
    at least "libvorbis-1.0rc3-75" or higher and try again.

])])

dnl check for libFLAC and libFLAC++
dnl needed for the FLAC codec
AM_PATH_LIBFLAC(, [AC_MSG_ERROR([

    libFLAC not found, please install libflac and the
    corresponding -devel package!

])])
AM_PATH_LIBFLACPP(, [AC_MSG_ERROR([

    libFLAC++ not found, please install libflac and the
    corresponding -devel package!

])])

dnl AC_CHECK_HEADERS(utility string,,AC_MSG_ERROR(""
dnl "    "
dnl "    your system seems to lack support for one or more STL classes."
dnl "    please install a current version of the libgpp package"
dnl "    that contains the necessary C++ header files!"
dnl "    "))

AC_CHECK_HEADERS( assert.h byteswap.h ctype.h dlfcn.h endian.h errno.h \
	fcntl.h features.h float.h limits.h sched.h stdarg.h stddef.h \
	stdio.h stdlib.h string.h sys/ioctl.h sys/param.h limits.h \
	sys/time.h sys/types.h time.h unistd.h,,AC_MSG_ERROR(""
"    "
"    your system seems to lack one or more needed header files."
"    please make sure you have all necessary developer packages"
"    installed or that the header files are present on your system!"
"    "))

dnl Check for memory info and see if we can determine
dnl the total amount of installed memory
AC_MSG_CHECKING(for memory info)
AC_TRY_CPP([
#include <sys/sysinfo.h>
#include <linux/kernel.h>
,
    struct sysinfo info;
    unsigned int total;
    sysinfo(&info);
    total = info.totalram;
],
AC_DEFINE(HAVE_MEMINFO,1,[meminfo is needed for the memory manager])
AC_MSG_RESULT(present)
,AC_MSG_WARN(FAILED!

!!! You might get inaccurate behaviour of the memory management !!!

))

dnl check for resource query functions
AC_MSG_CHECKING(for resource usage)
AC_TRY_CPP([
#include <sys/resource.h>
,
    struct rlimit limit;
    getrlimit(RLIMIT_DATA, &limit);
    unsigned int ulimit = limit.rlim_cur >> 20;
    getrlimit(RLIMIT_AS, &limit);
],
AC_DEFINE(HAVE_GETRLIMIT, 1, [resource limits for the memory manager])
AC_MSG_RESULT(present)
,AC_MSG_WARN(MISSING!))

dnl AC_CHECK_FUNC(geteuid, AC_DEFINE(HAVE_GETEUID, 1, [geteuid]))
AC_CHECK_FUNC(mkstemp, AC_DEFINE(HAVE_MKSTEMP, 1, [used for creating swap files]))
AC_CHECK_FUNC(unlink,  AC_DEFINE(HAVE_UNLINK, 1, [used for unlinking swap files]))

dnl get the correct aRts and mcopidl include directories...
AC_MSG_CHECKING(for mcopidl includes)
ac_arts_inc1="`$ARTSCCONFIG --arts-prefix | $SED s./\$..g`/include"
ac_arts_inc2="`$ARTSCCONFIG --arts-prefix | $SED s./\$..g`/include/arts"
ac_arts_inc3="`$ARTSCCONFIG --arts-prefix | $SED s./\$..g`/include/kde/arts"

dnl ...concatenate and eliminate duplicate entries...
eval "ac_arts_includes=\"`echo -en ${ac_arts_inc1}\\\n${ac_arts_inc2}\\\n${ac_arts_inc3} | $SED s.//./.g | $SORT | $UNIQ`\""
eval "MCOPIDL_INCLUDES=\"`for dir in \`echo $ac_arts_includes\`; do { test -e $dir && echo -n -I$dir " "; }; done `\""
AC_MSG_RESULT(${MCOPIDL_INCLUDES})
AC_SUBST(MCOPIDL_INCLUDES)

AC_MSG_CHECKING(for aRts includes)
ac_arts_inc4="`${ARTSCCONFIG} --cflags      | $SED s./\$..g`"
ac_arts_inc5="`${ARTSCCONFIG} --cflags      | $SED s./\$..g | $SED s/artsc/arts/g `"
eval "ac_arts_includes=\"`echo -en -I${ac_arts_inc1}\\\n\-I${ac_arts_inc2}\\\n\-I${ac_arts_inc3}\\\n\${ac_arts_inc4}\\\n\${ac_arts_inc5} | $SED s.//./.g | $SED s/\ /\\\n/g | $SED s/^-I//g | $SORT | $UNIQ`\""
eval "ARTS_INCLUDES=\"`for dir in \`echo $ac_arts_includes\`; do {(test -e $dir && echo -n -I$dir " ") || ((test "${dir:0:1}" = "-") && echo -n $dir " "); };
done `\""
AC_MSG_RESULT(${ARTS_INCLUDES})
AC_SUBST(ARTS_INCLUDES)

dnl ...and check that the aRts headers are found from them
AC_LANG_PUSH(C++)
arts_check_saved_cppflags="$CPPFLAGS"
CPPFLAGS="$ARTS_INCLUDES $CPPFLAGS"
KDE_CHECK_HEADERS( artsc.h, [arts_headers_found=1], [
  AC_MSG_ERROR( ARTS headers not found - can't compile. )
])

KDE_CHECK_HEADERS( artsmodules.h stdsynthmodule.h, [kdemultimedia_headers_found=1], [
  AC_MSG_ERROR( kdemultimedia-devel package is missing? )
])

AC_LANG_POP(C++)
CPPFLAGS="$arts_check_saved_cppflags";

AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
AC_SUBST(LIBCOMPAT)

AC_MSG_CHECKING([whether a target optimized memcpy() for $target_cpu is available])
case $target_cpu in
  i?86 | athlon | athlon-* | pentium | pentium-* )
    AC_MSG_RESULT([yes])
    AC_DEFINE(ARCH_X86,1,[use ix86 target optimizations (from xine)]) ;;
  x86_64 )
    AC_MSG_RESULT([yes])
    AC_DEFINE(ARCH_X86_64,1,[use X86_64 target optimizations (from xine)]) ;;
  ppc )
    AC_MSG_RESULT([yes])
    AC_DEFINE(ARCH_PPC,1,[use ppc target optimizations (from xine)]) ;;
  *)
    AC_MSG_RESULT([no, sorry :-(]) ;;
esac
dnl we need this only for ix86 optimized memcpy for now,
dnl possible others would be:
dnl ARCH_ARMV4L, ARCH_SPARC, ARCH_ALPHA, ARCH_POWERPC, ARCH_SH4, ARCH_X86_64

dnl output files
topdir=`pwd`
AC_SUBST(topdir)

dnl get the fields of the spec file from the lsm file

define(getlsm, $1=`bin/get_lsm_entry.sh kwave.lsm $2`)

getlsm(RPM_DESCRIPTION, Description)
getlsm(RPM_SUMMARY, Keywords)
getlsm(RPM_NAME, Title)
getlsm(RPM_COPYRIGHT, Copying-policy)
getlsm(RPM_URL, Homepage)
dnl getlsm(RPM_VENDOR, Author)
RPM_VENDOR="Thomas Eschenbacher <Thomas.Eschenbacher@gmx.de>"

changequote(<<, >>)
RPM_SHORT_VERSION=`cat ./VERSION | awk '{ split($0, a, "-") } END { print a[1] }'`
RPM_FULL_VERSION=`cat ./VERSION`
RPM_RELEASE=`cat ./VERSION | awk '{ split($0, a, "-") } END { print a[2]+0 ? a[2] : 1}'`
RPM_GROUP=<<X11/Applications/Sound>>
RPM_BUILDROOT=<</tmp/kwave-%{version}.root>>
LD_VERSION_INFO=<<`cat ./VERSION | awk '{split($0, a, ".")} \
	{relpos=index(a[3],"-")} \
	{rel=relpos==0 ? a[3] : substr(a[3], 1, relpos-1)} \
END	{printf("%d:%d:%d", a[1]+a[2], rel, a[2]) }'`>>
changequote([, ])

dnl enter the variables for the spec file
AC_SUBST(RPM_DESCRIPTION)
AC_SUBST(RPM_SUMMARY)
AC_SUBST(RPM_NAME)
AC_SUBST(RPM_SHORT_VERSION)
AC_SUBST(RPM_FULL_VERSION)
AC_SUBST(RPM_RELEASE)
AC_SUBST(RPM_GROUP)
AC_SUBST(RPM_COPYRIGHT)
AC_SUBST(RPM_URL)
AC_SUBST(RPM_VENDOR)
AC_SUBST(RPM_BUILDROOT)
AC_SUBST(RPM_REQUIRE_LIBMAD)
AC_SUBST(RPM_REQUIRE_ID3LIB)
AC_SUBST(LD_VERSION_INFO)

AC_ARG_ENABLE(debug,
[  --enable-debug    Turn on debugging],
[case "${enableval}" in
  yes) debug=true ;;
  no)  debug=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[debug=false])
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)

dnl test for usage of insure++
AC_CHECK_WITH_INSURE

dnl
dnl Instead of one single line with all files, I had to split this up
dnl into several lines with only one argument per call. Otherwise there
dnl would be a strange problem with Debian-3.01 (woody). Like this:
dnl
dnl configure.in:428: error: m4_popdef: undefined macro: AC_Dest
dnl autoconf/status.m4:844: AC_CONFIG_FILES is expanded from...
dnl configure.in:74: the top level
dnl autom4te: /usr/bin/m4 failed with exit status: 1
dnl

AC_CONFIG_FILES(Makefile)
if test "${USE_BUILTIN_LIBAUDIOFILE}" = "1"; then
    AC_CONFIG_FILES(libaudiofile/Makefile)
    AC_CONFIG_FILES(libaudiofile/modules/Makefile)
fi

AC_CONFIG_FILES(mt/Makefile)
AC_CONFIG_FILES(libkwave/Makefile)
AC_CONFIG_FILES(libgui/Makefile)
AC_CONFIG_FILES(kwave/Makefile)
AC_CONFIG_FILES(plugins/Makefile)
AC_CONFIG_FILES(plugins/common/Makefile)
AC_CONFIG_FILES(po/Makefile)
AC_CONFIG_FILES(doxy.cfg)
AC_CONFIG_FILES(doc/Makefile)
AC_CONFIG_FILES(kwave.spec)

AC_OUTPUT