comparison configure.ac @ 636:1a4c76e0f7c5

* Experimental autoconf procedure to produce qmake include file
author Chris Cannam
date Tue, 14 Sep 2010 09:45:30 +0100
parents
children 465f769ccad0
comparison
equal deleted inserted replaced
635:3864886c807c 636:1a4c76e0f7c5
1
2 AC_INIT(SVcore, 1.8, cannam@all-day-breakfast.com)
3
4 AC_CONFIG_SRCDIR(base/AudioLevel.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_PATH_X
22 AC_HEADER_STDC
23
24 # These are the flags Autoconf guesses for us; we use them later if
25 # the user has set none and we are not using GCC (so lack our own
26 # preferred flags)
27 AUTOCONF_CXXFLAGS="$CXXFLAGS"
28
29 PKG_PROG_PKG_CONFIG
30
31 SV_CHECK_QT
32
33 AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],[LIBS="$LIBS -lbz2"],[AC_MSG_ERROR(Failed to find required bzip2 library)])
34
35 PKG_CHECK_MODULES([JACK],[jack >= 0.100],[HAVES="$HAVES HAVE_LIBJACK"],[
36 AC_MSG_WARN(No JACK library found)])
37
38 PKG_CHECK_MODULES([libpulse],[libpulse >= 0.9],[HAVES="$HAVES HAVE_LIBPULSE"],[
39 AC_MSG_WARN(No PulseAudio library found)])
40
41 # bit messy this
42 PKG_CHECK_MODULES([fftw3],[fftw3 >= 3.0.0],[HAVES="$HAVES HAVE_FFTW3"],[])
43 PKG_CHECK_MODULES([fftw3f],[fftw3f >= 3.0.0],[HAVES="$HAVES HAVE_FFTW3F"],[])
44 PKG_CHECK_MODULES([sndfile],[sndfile >= 1.0.16],[HAVES="$HAVES HAVE_SNDFILE"],[])
45 PKG_CHECK_MODULES([liblo],[liblo >= 0.7],[HAVES="$HAVES HAVE_LIBLO"],[])
46 PKG_CHECK_MODULES([lrdf],[lrdf >= 0.2],[HAVES="$HAVES HAVE_LRDF"],[])
47 PKG_CHECK_MODULES([samplerate],[samplerate >= 0.1.2],[HAVES="$HAVES HAVE_SAMPLERATE"],[])
48 PKG_CHECK_MODULES([vamp],[vamp >= 2.1],[HAVES="$HAVES HAVE_VAMP"],[])
49 PKG_CHECK_MODULES([vamphostsdk],[vamp-hostsdk >= 2.1],[HAVES="$HAVES HAVE_VAMP_HOSTSDK"],[])
50 PKG_CHECK_MODULES([oggz],[oggz >= 1.0.0],[HAVES="$HAVES HAVE_OGGZ"],[])
51 PKG_CHECK_MODULES([fishsound],[fishsound >= 1.0.0],[HAVES="$HAVES HAVE_FISHSOUND"],[])
52 PKG_CHECK_MODULES([mad],[fishsound >= 0.15.0],[HAVES="$HAVES HAVE_MAD"],[])
53 PKG_CHECK_MODULES([id3tag],[id3tag >= 0.15.0],[HAVES="$HAVES HAVE_ID3TAG"],[])
54 PKG_CHECK_MODULES([raptor],[raptor >= 1.4.20],[HAVES="$HAVES HAVE_RAPTOR"],[])
55 PKG_CHECK_MODULES([rasqal],[rasqal >= 0.9.19],[HAVES="$HAVES HAVE_RASQAL"],[])
56 PKG_CHECK_MODULES([redland],[redland >= 1.0.10],[HAVES="$HAVES HAVE_REDLAND"],[])
57
58 AC_PATH_PROG([PERL],[perl])
59 if test x$PERL = x ; then
60 AC_MSG_ERROR([Failed to find required perl program.])
61 fi
62
63 AC_PATH_PROG([XARGS],[xargs])
64 if test x$XARGS = x ; then
65 AC_MSG_ERROR([Failed to find required xargs program.])
66 fi
67
68 AC_PATH_PROG([MAKEDEPEND],[makedepend])
69 if test x$MAKEDEPEND = x ; then
70 AC_MSG_ERROR([Failed to find required makedepend program.])
71 fi
72
73 AC_PATH_PROG([SHA1SUM],[sha1sum])
74 AC_PATH_PROG([SHA1SUM],[sha1 -q])
75 if test x$SHA1SUM = x ; then
76 AC_MSG_ERROR([Failed to find required sha1sum or sha1 program.])
77 fi
78
79 AC_PATH_PROG([CUT],[cut])
80 if test x$CUT = x ; then
81 AC_MSG_ERROR([Failed to find required cut program.])
82 fi
83
84 SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING"
85 SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING"
86 SV_DEFINES_MINIMAL="$SV_DEFINES_RELEASE"
87
88 # Now we have: USER_CXXFLAGS contains any flags the user set
89 # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought
90 # we should use. If we have GCC, we override the latter but then
91 # allow ourselves to be overridden (later) by the former
92
93 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
94 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
95 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
96
97 if test "x$GCC" = "xyes"; then
98 CXXFLAGS_DEBUG="-Wall -Woverloaded-virtual -Wextra -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe"
99 CXXFLAGS_RELEASE="-g0 -O2 -Wall -pipe"
100 CXXFLAGS_MINIMAL="-g0 -O0"
101 fi
102
103 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
104 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
105
106 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build])
107 CXXFLAGS_BUILD="$CXXFLAGS_DEBUG"
108 SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"])
109
110 if test x"$USER_CXXFLAGS" != x; then
111 AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".])
112 AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.)
113 CXXFLAGS_BUILD="$USER_CXXFLAGS"
114 CXXFLAGS_MINIMAL="$USER_CXXFLAGS"
115 fi
116
117 CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD"
118
119 #if test -z "$JACK_CFLAGS" ; then
120 # AC_MSG_WARN([Required JACK library not found, building with no audio!])
121 #fi
122 #if test -z "$ALSA_CFLAGS" ; then
123 # AC_MSG_WARN([Required ALSA library not found, building with no MIDI!])
124 #fi
125
126 AC_SUBST(PERL)
127 AC_SUBST(XARGS)
128 AC_SUBST(MAKEDEPEND)
129 AC_SUBST(SHA1SUM)
130 AC_SUBST(CUT)
131
132 AC_SUBST(CFLAGS)
133 AC_SUBST(CXXFLAGS)
134 AC_SUBST(CXXFLAGS_MINIMAL)
135 AC_SUBST(HAVES)
136 #AC_SUBST(DSSI_LOCALFLAGS)
137
138 AC_SUBST(CC)
139 AC_SUBST(CXX)
140
141 AC_SUBST(CODENAME)
142
143 AC_OUTPUT([config.pri])
144
145 # qmake builds our static libraries, which is fine -- what we'd really
146 # like to do afterwards is bundle them into a single .so with e.g.
147
148 # gcc -Wl,--whole-archive */*.a -Wl,--no-whole-archive -o libsvcore.so
149
150 # but how best to arrange this? if it's not possible, we'll presumably
151 # just have to use a single (q)make(project)file instead.
152