File: configure.in

package info (click to toggle)
gwc 0.22.05-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 3,516 kB
  • sloc: ansic: 40,154; sh: 797; makefile: 660; perl: 49
file content (208 lines) | stat: -rw-r--r-- 6,199 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 Process this file with autoconf to produce a configure script.
AC_INIT([Gtk Wave Cleaner], [0.22-05], [http://gwc.sourceforge.net])
AM_INIT_AUTOMAKE([1.12 foreign no-define tar-ustar])

PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
                   HAVE_LIBSNDFILE1="yes", HAVE_LIBSNDFILE1="no")

if test "x$HAVE_LIBSNDFILE1" = xno ; then
    AC_MSG_ERROR([
Libsndfile 1.0.2 or greater needed, find it at http://www.zip.com.au/~erikd/libsndfile/
OR perhaps configure can not file libsndfile, in which you can try 1 of 3 things:
1) set the environment variable PKG_CONFIG_PATH
   to find the package file for libsndfile for example:
   export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
2) re-install libsndfile in /usr instead of /usr/local, where it installs by default.
3) There are some packages for libsndfile now, be sure to install libsndfile-devel
])
fi

AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
               [enable debugging, default: no]),
[case "${enable_debug}" in
             yes) debug=true ;;
             no)  debug=false ;;
             *)   AC_MSG_ERROR([bad value ${enable_debug} for --enable-debug]) ;;
esac],
[debug=false])

AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")

PKG_CHECK_MODULES(PULSEAUDIO, libpulse-simple >= 0.9.0,
                   HAVE_PULSE_AUDIO="yes", HAVE_PULSE_AUDIO="no")

dnl Checks for programs.
AC_PROG_CC
AC_LANG(C)

dnl Checks for libraries.

dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, cos)

dnl setup macros variables to be replaced in Makefile.in
AC_SUBST(FFTWLIB)
AC_SUBST(FFTWHDR)
AC_SUBST(FFTWPREC)
AC_SUBST(OSXDEF)
AC_SUBST(PALIB)
AC_SUBST(PAHDR)
AC_SUBST(ALSALIB)
AC_SUBST(ALSADEF)
AC_SUBST(ALSACFLAGS)
AC_SUBST(OGGLIB)
AC_SUBST(OGGHDR)
AC_SUBST(MP3LIB)
AC_SUBST(MP3HDR)
AC_SUBST(OSXLIBS)

dnl enable ogg/vorbis libs on user request and check installation
OGGLIB=""
OGGHDR=""

AC_ARG_ENABLE(ogg, [  --enable-ogg           compile experimental Ogg file reading support (default disabled)])

AC_MSG_CHECKING([for ogg])
if test "$enable_ogg" = "yes"
then
    ogg="yes";OGGLIB="-lvorbis -logg -lvorbisfile";OGGHDR="-DHAVE_OGG"
else
    ogg="disabled"
fi
AC_MSG_RESULT($ogg)

dnl enable mp3 libs on user request and check installation
MP3LIB=""
MP3HDR=""

AC_ARG_ENABLE(mp3, [  --enable-mp3           compile experimental mp3 file reading support (default disabled)])

AC_MSG_CHECKING([for mp3])
if test "$enable_mp3" = "yes"
then
    mp3="yes";MP3LIB="-lmpg123";MP3HDR="-DHAVE_MP3"
else
    mp3="disabled"
fi
AC_MSG_RESULT($mp3)

dnl enable alsa on user request and check installation
ALSALIB=""
ALSADEF=""
alsa="enabled"

AC_ARG_ENABLE(alsa, [  --disable-alsa           disable ALSA support (default enabled)])

if test "$enable_alsa" != "no"
then
    PKG_CHECK_MODULES(ALSA, alsa >= 0.9.0, alsa="yes";ALSALIB=$ALSA_LIBS;ALSADEF="-DHAVE_ALSA";ALSACFLAGS=$ALSA_CFLAGS, alsa="disabled")
else
    alsa="disabled"
    AC_MSG_CHECKING([for ALSA])
    AC_MSG_RESULT($alsa)
fi

dnl enable pulseaudio on user request and check installation
PALIB=""
PAHDR=""

AC_ARG_ENABLE(pa, [  --enable-pa           compile Pulse Audio support (default disabled)],enablepa="yes",enablepa="no")


AC_MSG_CHECKING([Pulse Audio enabled])
if test "$enablepa" == "yes"
then
    if test "x$HAVE_PULSE_AUDIO" = xyes ; then
        pa="yes";
	PALIB=$PULSEAUDIO_LIBS
	PAHDR="-DHAVE_PULSE_AUDIO" ;
	alsa="disabled";
	ALSALIB="";
	ALSADEF="";
	AC_MSG_NOTICE([
***********************!!!!!!! Notice !!!!!!!**********************
The Pulseaudio libraries were found and you have chosen to use the
Pulseaudio driver.  Note that ALSA is recommended as a better sound
driver to use, but on some systems (e.g. Ubuntu), getting ALSA to
work may be complicated.
*******************************************************************
])
    fi
else
    AC_MSG_RESULT($enablepa)
    pa="disabled"
fi


dnl enable single precision FFTW3 if installed
AC_ARG_ENABLE(single-fftw3,
            [  --enable-single-fftw3    compile single precision FFTW3 support (default double precision)],
            FFTWLIB="-lfftw3f";FFTWHDR="-DHAVE_FFTW3";FFTWPREC="-DFFTWPREC=1")

if test "$FFTWLIB" = ""
then
dnl Detect which version of fftw libs exist, if any
FFTWPREC=""
AC_CHECK_LIB(fftw3, fftw_plan_r2r_1d,FFTWLIB="-lfftw3";FFTWHDR="-DHAVE_FFTW3";FFTWPREC="-DFFTWPREC=2",
    AC_CHECK_LIB(fftw3f, fftwf_plan_r2r_1d,FFTWLIB="-lfftw3f";FFTWHDR="-DHAVE_FFTW3";FFTWPREC="-DFFTWPREC=1",
        AC_CHECK_LIB(fftw, fftw_create_plan, ,
	    AC_CHECK_LIB(dfftw, fftw_create_plan))))

if test "$FFTWLIB" = ""
then
AC_CHECK_LIB(rfftw, rfftw_one, FFTWLIB="-lrfftw -lfftw";FFTWHDR="-DHAVE_FFTW",
    AC_CHECK_LIB(drfftw, rfftw_one, FFTWLIB="-ldrfftw -ldfftw";FFTWHDR="-DHAVE_DFFTW",
	AC_MSG_ERROR("You need to install the fftw 3.x libraries from www.fftw.org")))
fi
fi


dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h sys/time.h unistd.h sndfile.h)
AC_HEADER_TIME

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

dnl refer to comments in gwc.c where these versions are required:
PKG_CHECK_MODULES(GTK, [ gtk+-2.0 >= 2.16 glib-2.0 >= 2.30 ])

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday)

dnl check for osx platform
AC_MSG_CHECKING([for Mac OS X platform])
case `uname -s` in
  Darwin)
    platform_osx=yes
    ;;
  *)
    platform_osx=no
    ;;
esac
AC_MSG_RESULT([$platform_osx])
if [test x$platform_osx = xyes]; then
  OSXDEF="-DMAC_OS_X"
  if test "$enablepa" == "yes"; then
    # pulseaudio is enabled (recommended until issues are fixed with coreaudio backend)
    OSXLIBS="$LIBS -lgtkmacintegration-gtk2"
  else
    # pulseaudio is not enabled so we need to build CoreAudio backend instead
    AC_MSG_NOTICE([
**********************!!!!!!! Warning !!!!!!!**********************
You are building on Apple OSX with the CoreAudio backend.
This currently does not seem to work.
Use --enable-pa to build with the pulseaudio backend instead.
*******************************************************************
])
    OSXLIBS="$LIBS -framework CoreAudio -lgtkmacintegration-gtk2" 
  fi
fi

AC_OUTPUT(Makefile)