comparison configure.ac @ 42:94d988cef54e

* Update to new autoconf build system
author Chris Cannam
date Mon, 18 Oct 2010 14:10:00 +0100
parents
children 4d07f61dba3f
comparison
equal deleted inserted replaced
41:f0346cc8ff21 42:94d988cef54e
1
2 AC_INIT([Sonic Annotator], 0.5, cannam@all-day-breakfast.com)
3
4 AC_CONFIG_SRCDIR(runner/main.cpp)
5
6 # Autoconf will set CXXFLAGS; we don't usually want it to, because we
7 # either define our own flags (at least if GCC is in use) or else use
8 # the user's preferences. We need to ensure CXXFLAGS is only set if
9 # the user has expressly set it. So, save the user's (or empty)
10 # setting now and restore it after Autoconf has done its bit of
11 # piddling about.
12 USER_CXXFLAGS="$CXXFLAGS"
13
14 AC_LANG_CPLUSPLUS
15
16 AC_PROG_CC
17 AC_PROG_CXX
18 AC_PROG_INSTALL
19 AC_PROG_MKDIR_P
20
21 AC_HEADER_STDC
22
23 # These are the flags Autoconf guesses for us; we use them later if
24 # the user has set none and we are not using GCC (so lack our own
25 # preferred flags)
26 AUTOCONF_CXXFLAGS="$CXXFLAGS"
27
28 PKG_PROG_PKG_CONFIG
29
30 SV_CHECK_QT
31
32 SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING"
33 SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING"
34 SV_DEFINES_MINIMAL="$SV_DEFINES_RELEASE"
35
36 # Now we have: USER_CXXFLAGS contains any flags the user set
37 # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought
38 # we should use. If we have GCC, we override the latter but then
39 # allow ourselves to be overridden (later) by the former
40
41 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
42 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
43 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
44
45 if test "x$GCC" = "xyes"; then
46 CXXFLAGS_DEBUG="-Wall -Woverloaded-virtual -Wextra -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe"
47 CXXFLAGS_RELEASE="-g0 -O2 -Wall -pipe"
48 CXXFLAGS_MINIMAL="-g0 -O0"
49 fi
50
51 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
52 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
53
54 QMAKE_CONFIG="release"
55
56 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build])
57 QMAKE_CONFIG="debug"
58 CXXFLAGS_BUILD="$CXXFLAGS_DEBUG"
59 SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"])
60
61 if test x"$USER_CXXFLAGS" != x; then
62 AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".])
63 AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.)
64 CXXFLAGS_BUILD="$USER_CXXFLAGS"
65 CXXFLAGS_MINIMAL="$USER_CXXFLAGS"
66 fi
67
68 CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD"
69
70 SV_MODULE_REQUIRED([bz2],[],[bzlib.h],[bz2],[BZ2_bzReadOpen])
71 SV_MODULE_REQUIRED([fftw3],[fftw3 >= 3.0.0],[fftw3.h],[fftw3],[fftw_execute])
72 SV_MODULE_REQUIRED([fftw3f],[fftw3f >= 3.0.0],[fftw3.h],[fftw3f],[fftwf_execute])
73 SV_MODULE_REQUIRED([sndfile],[sndfile >= 1.0.16],[sndfile.h],[sndfile],[sf_open])
74 SV_MODULE_REQUIRED([samplerate],[samplerate >= 0.1.2],[samplerate.h],[samplerate],[src_new])
75 SV_MODULE_REQUIRED([vamp],[vamp >= 2.1],[vamp/vamp.h],[],[])
76 SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.0],[vamp-hostsdk/PluginLoader.h],[],[])
77 SV_MODULE_REQUIRED([rubberband],[rubberband],[rubberband/RubberBandStretcher.h],[rubberband],[rubberband_new])
78 SV_MODULE_REQUIRED([raptor],[raptor >= 1.4.20],[raptor.h],[raptor],[raptor_start_parse])
79 SV_MODULE_REQUIRED([rasqal],[rasqal >= 0.9.19],[rasqal/rasqal.h],[rasqal],[rasqal_new_world])
80 SV_MODULE_REQUIRED([redland],[redland >= 1.0.10],[librdf.h],[rdf],[librdf_new_world])
81
82 SV_MODULE_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new])
83 SV_MODULE_OPTIONAL([portaudio_2_0],[portaudio-2.0 >= 19],[portaudio.h],[portaudio],[Pa_IsFormatSupported])
84 SV_MODULE_OPTIONAL([JACK],[jack >= 0.100],[jack/jack.h],[jack],[jack_client_open])
85 SV_MODULE_OPTIONAL([libpulse],[libpulse >= 0.9],[pulse/pulseaudio.h],[pulse],[pa_stream_new])
86 SV_MODULE_OPTIONAL([lrdf],[lrdf >= 0.2],[lrdf.h],[lrdf],[lrdf_init])
87 SV_MODULE_OPTIONAL([oggz],[oggz >= 1.0.0],[oggz/oggz.h],[oggz],[oggz_run])
88 SV_MODULE_OPTIONAL([fishsound],[fishsound >= 1.0.0],[fishsound/fishsound.h],[fishsound],[fish_sound_new])
89 SV_MODULE_OPTIONAL([mad],[mad >= 0.15.0],[mad.h],[mad],[mad_decoder_init])
90 SV_MODULE_OPTIONAL([id3tag],[id3tag >= 0.15.0],[id3tag.h],[id3tag],[id3_tag_new])
91
92 AC_SUBST(PERL)
93 AC_SUBST(XARGS)
94 AC_SUBST(MAKEDEPEND)
95 AC_SUBST(SHA1SUM)
96 AC_SUBST(CUT)
97
98 AC_SUBST(CFLAGS)
99 AC_SUBST(CXXFLAGS)
100 AC_SUBST(CXXFLAGS_MINIMAL)
101 AC_SUBST(HAVES)
102 AC_SUBST(LIBS)
103
104 AC_SUBST(CC)
105 AC_SUBST(CXX)
106
107 AC_SUBST(QMAKE_CONFIG)
108
109 AC_SUBST(CODENAME)
110
111 AC_OUTPUT([config.pri])
112 AC_OUTPUT([version.h])
113
114 if ! $QMAKE -r; then
115 AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"])
116 fi
117
118 AC_MSG_NOTICE([
119
120 Configuration complete.
121 Please check the above messages for any warnings that you
122 might care about, and then run "make".
123
124 The file config.pri contains the configuration settings for
125 qmake. If you want to adjust these by hand, edit config.pri
126 and run "qmake -r" again to regenerate the Makefile.
127 ])