File: configure.in

package info (click to toggle)
audacity 0.98-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,896 kB
  • ctags: 4,089
  • sloc: cpp: 26,099; ansic: 4,961; sh: 2,465; makefile: 156; perl: 23
file content (208 lines) | stat: -rw-r--r-- 5,496 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
dnl
dnl audacity configure.in script
dnl
dnl Joshua Haberman
dnl Dominic Mazzoni
dnl

dnl Process this file with autoconf to produce a configure script.

dnl Require autoconf >= 2.50 (unfortunately 2.13 is standard)
AC_PREREQ(2.50)

dnl Init autoconf
AC_INIT

dnl Check for existence of AudacityApp.h
AC_CONFIG_SRCDIR([AudacityApp.h])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_LANG([C++])
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_INSTALL

dnl extra variables
AC_SUBST(EXTRAOBJS)
AC_SUBST(MAKEALL)

dnl options
AC_ARG_WITH(oss,
	[AC_HELP_STRING([--with-oss],
      [use Open Sound System (OSS) for Audio I/O [default=yes]])],
	use_oss=$withval,
	use_oss="default")
AC_ARG_WITH(arts-soundserver,
	[AC_HELP_STRING([--with-arts-soundserver],
      [use the KDE/aRts soundserver instead of OSS [default=no]])],
	use_arts=$withval,
	use_arts="no")
AC_ARG_WITH(libmad,
	[AC_HELP_STRING([--with-libmad],
      [use libmad for mp3 support (libraries must be installed) [default=no]])],
	use_libmad=$withval,
	use_libmad="no")
AC_ARG_WITH(vorbis,
	[AC_HELP_STRING([--with-vorbis],
		[enable ogg vorbis support (libraries must be installed) [default=no]])],
	use_vorbis=$withval,
	use_vorbis="no")
AC_ARG_WITH(id3,
	[AC_HELP_STRING([--with-id3],
		[compile with id3lib (libraries must be installed) [default=no]])],
	use_id3lib=$withval,
	use_id3lib="no")


if [[ "$use_oss" = "default" ] && [ "$use_arts" = "yes" ]] ; then
	use_oss="no";
fi

if [[ "$use_oss" = "default" ] && [ "$use_arts" = "no" ]] ; then
	use_oss="yes";
fi

dnl if user has explicitly enabled both oss and arts,
dnl warn that they are incompatible
if [[ "$use_oss" = "yes" ] && [ "$use_arts" = "yes" ]] ; then
	AC_MSG_ERROR([*** --with-oss and --with-arts-soundserver are mutually exclusive])
fi

if [[ "$use_libmad" = "yes" ]] ; then

   dnl check for headers and libraries

   AC_CHECK_LIB(mad, mad_decoder_init, true, dnl here true is just a nop
	   AC_MSG_ERROR([*** libmad not found. Either compile and install it or use xaudio]) )

   AC_CHECK_HEADER(mad.h, ,
		AC_MSG_ERROR([*** libmad headers not found. Either compile and install it or use xaudio]))

	AC_DEFINE(USE_LIBMAD, 1,
		[Define if mp3 support is implemented with the libmad library])

	LIBS="$LIBS -lmad"
   mp3support="true"
fi

if [[ "$mp3support" = "true" ]] ; then

	AC_DEFINE(MP3SUPPORT, 1,
      [Define if at least one supported library for mp3 functions is present])

fi


if [[ $use_vorbis = "yes" ]] ; then

   dnl check for both headers and libraries
   
   AC_CHECK_LIB(vorbisfile, ov_open, true, dnl here true is just a nop
	   AC_MSG_ERROR([*** Ogg Vorbis libraries not found. libvorbis must be installed for Ogg Vorbis support]),
	   -lvorbis -logg) dnl auxiliary library that -lvorbisfile needs

   AC_CHECK_HEADER(vorbis/vorbisfile.h, ,
		AC_MSG_ERROR([*** Ogg Vorbis headers not found. libvorbis must be installed for Ogg Vorbis support]))

	LIBS="$LIBS -lvorbisfile -lvorbis -logg"
	AC_DEFINE(USE_LIBVORBIS, 1,
		[Define if the ogg vorbis decoding library is present])
fi

if [[ $use_id3lib = "yes" ]] ; then
   dnl check for both headers and libraries
   
   AC_CHECK_LIB(id3, ID3Tag_New, true, dnl here true is just a nop
	   AC_MSG_ERROR([*** ID3lib libraries not found. ID3lib must be installed for ID3 tag support]))

   AC_CHECK_HEADER(id3.h, ,
		AC_MSG_ERROR([*** ID3lib headers not found. ID3lib must be installed for ID3 tag support]))

	LIBS="$LIBS -lid3"

	AC_DEFINE(USE_ID3LIB, 1,
      [Define if id3lib is present])
fi

if [[ $use_oss = "yes" ]] ; then
	EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/snd/audiooss.c.o"

	AC_DEFINE(USE_OSS, 1,
		[Define if audio I/O happens with OSS])

elif [[ "$use_arts" = "yes" ]]; then
	EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/snd/audioarts.c.o"
	LIBS="$LIBS -lartsc"	

	AC_DEFINE(USE_ARTS, 1,
		[Define if audio I/O happens with KDE/aRts soundserver])

else
	EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/snd/audionone.c.o"

	AC_DEFINE(USE_AUDIO_NONE, 1,
		[Define if audio I/O was not compiled in])
fi


dnl --- check for required libraries ---

dnl wxWindows -- we assume that if wx-config is found, wxWindows is successfully installed.
AC_PATH_PROG(WX_CONFIG, wx-config, no)
if [[ "$WX_CONFIG" = "no" ]] ; then
	AC_MSG_ERROR("Could not find wx-config: is wxWindows installed? is wx-config in your path?")
fi
LIBS="$LIBS `$WX_CONFIG --libs`"
CFLAGS="$CFLAGS `$WX_CONFIG --cflags`"


dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_SIZE_T

dnl Checks for library functions.

AC_CONFIG_HEADER(configunix.h:configtemplate.h)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

echo ""
echo "Finished configure:"

if [[ "$use_id3lib" = "yes" ]] ; then
	echo "  with    id3lib";
else
	echo "  without id3lib";
fi

if [[ "$use_libmad" = "yes" ]] ; then
	echo "  with    libmad";
else
	echo "  without libmad";
fi

if [[ "$use_vorbis" = "yes" ]] ; then
	echo "  with    vorbis";
else
	echo "  without vorbis";
fi

if [[ $use_oss = "yes" ]] ; then
	echo "  with    OSS for audio I/O";
elif [[ "$use_arts" = "yes" ]]; then
	echo "  with    KDE/aRts soundserver for audio I/O";
else
	echo "  without any audio I/O support  <-- WARNING!!!!!!!!!!";
	echo "     (you should probably configure using either --with-oss or";
	echo "     --with-arts-soundserver, unless you are sure that neither";
	echo "     are supported on your system.)";
fi

echo "prefix=$prefix";

echo ""
echo "Run configure --help for an explanation of these options,"
echo "otherwise type 'make' to build Audacity."