File: configure.ac

package info (click to toggle)
libccaudio2 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,204 kB
  • ctags: 948
  • sloc: sh: 9,715; cpp: 9,065; makefile: 105
file content (227 lines) | stat: -rw-r--r-- 5,329 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
# Copyright (C) 2000-2005 Open Source Telecom Corporation.
# Copyright (C) 2006-2008 David Sugar, Tycho Softworks.
#
# 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.

AC_INIT(autogen.sh)

AUDIO_LIBS=""

VERSION="1.0.0"
LT_RELEASE="1.0"
LT_VERSION="0:0"
AC_CONFIG_AUX_DIR(autoconf)
AC_CANONICAL_SYSTEM
AC_PROG_CPP
AC_PROG_CXXCPP
AC_PROG_CXX
AM_PROG_LIBTOOL
AM_INIT_AUTOMAKE(ccaudio2,[$VERSION])
AM_CONFIG_HEADER(private.h)
AC_CHECK_HEADERS(stdint.h sys/soundcard.h)
AC_CHECK_LIB(ossaudio, _oss_ioctl, 
	[AUDIO_LIBS="$AUDIO_LIBS -lossaudio"])

AC_C_RESTRICT
AC_C_VOLATILE
AC_C_INLINE
		
ac_gsm_codec=false
ac_spx_codec=false

AC_CHECK_HEADER(gsm/gsm.h,
	[ac_gsm_codec=true
	AC_DEFINE(HAVE_GSM_GSM_H, [1], [gsm header found])
	],[
	AC_CHECK_HEADER(gsm.h,
		[ac_gsm_codec=true
		AC_DEFINE(HAVE_GSM_H, [1], [gsm default header])
		])
	])

AC_ARG_ENABLE(speex, [  --enable-speex          enable speex support])
if test "$enable_speex" = "yes" ; then
	AC_CHECK_HEADER(speex/speex.h,
		AC_CHECK_LIB(speex, speex_encode_int, [
			[ac_spx_codec=true])
		])
fi

WINVERSION="`echo $VERSION | sed 's/\./,/g'`,0"
AC_SUBST(WINVERSION)

OST_DEBUG

case "$prefix" in
/opt/*)
        if test "$localstatedir" == '${prefix}/var' ; then
                localstatedir=/var${prefix} ; fi

        if test "$datadir" == '${prefix}/share' ; then
                if test "$mandir" == '${datadir}/man' ; then
                        mandir='${prefix}/man' ; fi
                if test "$infodir" == '${datadir}/info' ; then
                        infodir='${prefix}/info' ; fi
                datadir='${prefix}'
        fi
        AC_SUBST(mandir)
        AC_SUBST(infodir)
        AC_SUBST(datadir)
	AC_SUBST(localstatedir)
	;;
esac

if test "$localstatedir" == '${prefix}/var' ; then
	localstatedir="/var" ; fi
AC_SUBST(localstatedir)

codec_libdir='${libdir}/ccaudio2-'${LT_RELEASE}
eprefix=${exec_prefix}
if test "$eprefix" == "NONE" ; then
        eprefix=${prefix} ; fi

case "$eprefix" in
/opt/*)
        if test "$libdir" == '${exec_prefix}/lib' ; then
                codec_libdir='${exec_prefix}/lib/ccaudio2'
	fi
        ;;
esac

AC_SUBST(STAGE2)
AC_SUBST(codec_libdir)
AC_SUBST_DIR(codec_libpath, codec_libdir)

AC_DEFINE_UNQUOTED(CODEC_LIBPATH, "$codec_libpath", [define codec path])

AH_TOP(

#ifndef W32
#if defined(_WIN32) && defined(_MSC_VER)
#define W32
#endif
#if defined(__BORLANDC__) && defined(__Windows)
#define W32
#endif
#endif

#if !defined(__EXPORT) && defined(W32)
#define __EXPORT __declspec(dllexport)
#endif

#ifdef	W32
#include "w32/private.h"
#else	// w32 uses hardcoded config

)

AH_BOTTOM(

#ifndef	NO_CPP

// hidden mutex class

#ifdef	HAVE_PTHREAD_H
#include <pthread.h>
#endif

class ccAudio_Mutex_
{
private:
#ifdef	HAVE_PTHREAD_H
        pthread_mutex_t mutex;
#endif

public:
        ccAudio_Mutex_();
        ~ccAudio_Mutex_();
        void enter(void);
        void leave(void);
}; 

#endif
#endif // end of internal configures

)

OST_PROG_LIBVER
OST_PROG_LIBRARY(CCXX,[$LT_VERSION])
OST_CC_ENDIAN
OST_CC_STRING
OST_CC_DYNAMIC
OST_CC_THREADING
OST_AUTOMAKE_MODE
OST_MAINTAINER_MODE
AM_CONDITIONAL(MODULES, test $ost_cv_dynloader = yes)
KDOC_DIR="\$(top_srcdir)/doc"
AC_SUBST(LT_VERSION)
AC_SUBST(LT_RELEASE)
AC_SUBST(KDOC_DIR)

AC_CHECK_HEADERS(CoreAudio/CoreAudio.h, [
	 AC_DEFINE(OSX_AUDIO, [1], [OSX Core Audio])
	 AUDIO_LIBS="-framework CoreAudio"
])

SHARED_FLAGS=""
MODULE_FLAGS="-module -shared -avoid-version"
STAGE2=""      
case "$target_os" in
cygwin*)
        SHARED_FLAGS="-no-undefined"
        MODULE_FLAGS="-module -shared -no-undefined -avoid-version"
	AUDIO_LIBS="-lwinmm"
	;;
darwin6*)
	MODULE_FLAGS="-dynamic -bundle -undefined suppress -flat_namespace -read_only_relocs suppress"
        STAGE2="macosx"
        ;;
darwin*)
	MODULE_FLAGS="-dynamic -bundle -undefined suppress -flat_namespace -read_only_relocs suppress"
        ;;
esac

audio_library="-lccaudio2 $DYN_LOADER $AUDIO_LIBS -lm"
AC_DEFINE_UNQUOTED(CODEC_MODFLAGS, "$MODULE_FLAGS", [module flags])
AC_DEFINE_UNQUOTED(AUDIO_LIBRARY, "$audio_library", [linking flags])

AC_SUBST(AUDIO_LIBS)
AC_SUBST(MODULE_FLAGS)
AC_SUBST(SHARED_FLAGS)
AC_SUBST(STAGE2)

gsm_format="false"
if test "$ac_gsm_codec" == true; then
	gsm_format="true" ; fi

speex_format="false"
if test "$ac_spx_codec" == true; then
	speex_format="true" ; fi

AC_SUBST(gsm_format)
AC_SUBST(speex_format)

AC_PATH_PROG(DOXYGEN, doxygen, no)
AC_SUBST(DOXYGEN)
AM_CONDITIONAL(DOXY, test "$DOXYGEN" != "no")
AM_CONDITIONAL(MODULES, test "$ost_cv_dynloader" = yes)
AM_CONDITIONAL(GSM_CODEC, test "$ac_gsm_codec" = true)
AM_CONDITIONAL(SPEEX_CODEC, test "$ac_spx_codec" = true)

LIB_VERSION=`echo $LT_RELEASE | sed -e 's/[\.]/_/'` 
LIB_MAJOR=`echo $LT_VERSION | sed -e 's/[:].*$//'`

AC_SUBST(LIB_VERSION)
AC_SUBST(LIB_MAJOR)

AC_OUTPUT(src/Makefile m4/Makefile doc/Makefile w32/Makefile codecs/Makefile 
utils/Makefile Makefile libccaudio2.pc ccaudio2.spec ccaudio2.list 
w32/ccaudio2.rc doc/Doxyfile)