float debugging fix, add myself to copyright
[tunertool] / configure.ac
1 AC_INIT
2
3 dnl versions of gstreamer and plugins-base
4 GST_MAJORMINOR=0.10
5 GST_REQUIRED=0.10.0
6 GSTPB_REQUIRED=0.10.0
7
8 dnl fill in your package name and version here
9 dnl the fourth (nano) number should be 0 for a release, 1 for CVS,
10 dnl and 2... for a prerelease
11
12 dnl when going to/from release please set the nano correctly !
13 dnl releases only do Wall, cvs and prerelease does Werror too
14 AS_VERSION(tuner, GST_PLUGIN_VERSION, 0, 0, 4, 0,
15     GST_PLUGIN_CVS="no", GST_PLUGIN_CVS="yes")
16
17 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
18 AM_MAINTAINER_MODE
19
20 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
21
22 dnl make aclocal work in maintainer mode
23 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
24
25 AM_CONFIG_HEADER(config.h)
26
27 dnl check for tools
28 AC_PROG_CC
29 AC_PROG_LIBTOOL
30
31
32 dnl Enable Hildon GUI
33 AC_ARG_WITH(hildon,
34     AC_HELP_STRING([--with-hildon],
35         [Turn on/off use of Hildon GUI (default=no)]),
36         [if test "x$withval" = "xyes"; then test_hildon=true; fi])
37
38 dnl Enable Maemo specific issues
39 AC_ARG_WITH(maemo,
40     AC_HELP_STRING([--with-maemo],
41         [Turn on/off use of Maemo related code (default=no)]),
42         [if test "x$withval" = "xyes"; then enable_maemo=true; fi])
43
44
45 dnl decide on error flags
46 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
47                                                                                 
48 if test "x$GST_WALL" = "xyes"; then
49    GST_ERROR="$GST_ERROR -Wall"
50                                                                                 
51    if test "x$GST_CVS" = "xyes"; then
52      AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
53    fi
54 fi
55
56 dnl Check for pkgconfig first
57 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
58
59 dnl Give error and exit if we don't have pkgconfig
60 if test "x$HAVE_PKGCONFIG" = "xno"; then
61   AC_MSG_ERROR(you need to have pkgconfig installed !)
62 fi
63
64 dnl Now we're ready to ask for gstreamer libs and cflags
65 dnl And we can also ask for the right version of gstreamer
66
67
68 PKG_CHECK_MODULES(GST, \
69   gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
70   HAVE_GST=yes,HAVE_GST=no)
71
72 dnl Give error and exit if we don't have gstreamer
73 if test "x$HAVE_GST" = "xno"; then
74   AC_MSG_ERROR(you need gstreamer development packages installed !)
75 fi
76
77
78 dnl Check for Maemo required packages
79
80 if test "x$enable_maemo" = "xtrue"; then
81   test_hildon=true
82   AC_DEFINE(MAEMO, 1, [Turn on Maemo dependecies])
83 fi
84
85 if test "x$test_hildon" = "xtrue"; then
86   dnl try if hildon is available in the form previous IT2K8
87   PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.12.0,
88     HAVE_HILDON=yes, HAVE_HILDON=no)
89
90   if test "x$HAVE_HILDON" = "xno"; then
91     dnl if fail try for IT2K8
92     PKG_CHECK_MODULES(HILDON, hildon-1 >= 0.9.9,
93       HAVE_HILDON=yes, HAVE_HILDON=no)
94     AC_DEFINE(HILDON, 1, [Version of hildon libraries])
95   else
96     AC_DEFINE(HILDON, 0, [Version of hildon libraries])
97   fi
98
99   if test "x$HAVE_HILDON" = "xno"; then
100     AC_MSG_ERROR(you need hildon development packages installed !)
101   fi
102
103   PKG_CHECK_MODULES(OSSO, libosso >= 0.9.19)
104
105   MAEMO_CFLAGS="$HILDON_CFLAGS $OSSO_CFLAGS"
106   MAEMO_LIBS="$HILDON_LIBS $OSSO_LIBS"
107 fi
108
109 dnl make MAEMO_CFLAGS and MAEMO_LIBS available
110 AC_SUBST(MAEMO_CFLAGS)
111 AC_SUBST(MAEMO_LIBS)
112
113 dnl append GST_ERROR cflags to GST_CFLAGS
114 GST_CFLAGS="$GST_CFLAGS $GST_ERROR"
115
116 dnl make GST_CFLAGS and GST_LIBS available
117 AC_SUBST(GST_CFLAGS)
118 AC_SUBST(GST_LIBS)
119
120 dnl make GST_MAJORMINOR available in Makefile.am
121 AC_SUBST(GST_MAJORMINOR)
122
123 dnl If we need them, we can also use the base class libraries
124 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED,
125                   HAVE_GST_BASE=yes, HAVE_GST_BASE=no)
126
127 dnl Give a warning if we don't have gstreamer libs
128 dnl you can turn this into an error if you need them
129 if test "x$HAVE_GST_BASE" = "xno"; then
130   AC_MSG_NOTICE(no GStreamer base class libraries found (gstreamer-base-$GST_MAJORMINOR))
131 fi
132
133 dnl make _CFLAGS and _LIBS available
134 AC_SUBST(GST_BASE_CFLAGS)
135 AC_SUBST(GST_BASE_LIBS)
136
137 dnl If we need them, we can also use the gstreamer-plugins-base libraries
138 PKG_CHECK_MODULES(GSTPB_BASE,
139                   gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPB_REQUIRED,
140                   HAVE_GSTPB_BASE=yes, HAVE_GSTPB_BASE=no)
141
142 dnl Give a warning if we don't have gstreamer libs
143 dnl you can turn this into an error if you need them
144 if test "x$HAVE_GSTPB_BASE" = "xno"; then
145   AC_MSG_NOTICE(no GStreamer Plugins Base libraries found (gstreamer-plugins-base-$GST_MAJORMINOR))
146 fi
147
148 dnl make _CFLAGS and _LIBS available
149 AC_SUBST(GSTPB_BASE_CFLAGS)
150 AC_SUBST(GSTPB_BASE_LIBS)
151
152 dnl If we need them, we can also use the gstreamer-controller libraries
153 PKG_CHECK_MODULES(GSTCTRL,
154                   gstreamer-controller-$GST_MAJORMINOR >= $GSTPB_REQUIRED,
155                   HAVE_GSTCTRL=yes, HAVE_GSTCTRL=no)
156
157 dnl Give a warning if we don't have gstreamer-controller
158 dnl you can turn this into an error if you need them
159 if test "x$HAVE_GSTCTRL" = "xno"; then
160   AC_MSG_NOTICE(no GStreamer Controller libraries found (gstreamer-controller-$GST_MAJORMINOR))
161 fi
162
163 dnl make _CFLAGS and _LIBS available
164 AC_SUBST(GSTCTRL_CFLAGS)
165 AC_SUBST(GSTCTRL_LIBS)
166
167 dnl GTK is optional and used in examples
168 HAVE_GTK=NO
169 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, HAVE_GTK_22=yes, HAVE_GTK_22=no)
170 if test "x$HAVE_GTK_22" = "xyes"; then
171   HAVE_GTK=yes
172   GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
173   AC_SUBST(GTK_VERSION)
174   GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
175   AC_SUBST(GTK_BASE_DIR)
176   GDK_PIXBUF_LIBDIR=`$PKG_CONFIG --variable=libdir gdk-pixbuf-2.0`
177   GDK_PIXBUF_PREFIXDIR=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
178   AC_SUBST(GTK_BASE_DIR)
179 else
180   PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK_20=yes, HAVE_GTK_20=no)
181 fi
182 if test "x$HAVE_GTK_20" = "xyes"; then
183   HAVE_GTK=yes
184 fi
185 GTK_CFLAGS=$GTK2_CFLAGS
186 GTK_LIBS=$GTK2_LIBS
187 AC_SUBST(GTK_LIBS)
188 AC_SUBST(GTK_CFLAGS)
189 AC_SUBST(HAVE_GTK)
190 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
191
192 dnl If we need them, we can also use the gstreamer-controller libraries
193 PKG_CHECK_MODULES(GCONF,
194                   gconf-2.0,
195                   HAVE_GCONF=yes, HAVE_GCONF=no)
196
197 dnl Give a warning if we don't have gstreamer-controller
198 dnl you can turn this into an error if you need them
199 if test "x$HAVE_GCONF" = "xno"; then
200   AC_MSG_ERROR(no GConf libraries found)
201 fi
202
203 dnl make _CFLAGS and _LIBS available
204 AC_SUBST(GCONF_CFLAGS)
205 AC_SUBST(GCONFL_LIBS)
206
207 dnl set the plugindir where plugins should be installed
208 if test "x${prefix}" = "x$HOME"; then
209   plugindir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins"
210 else
211   plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
212 fi
213 AC_SUBST(plugindir)
214
215 dnl set proper LDFLAGS for plugins
216 GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
217 AC_SUBST(GST_PLUGIN_LDFLAGS)
218
219 AC_OUTPUT(Makefile m4/Makefile debian/Makefile src/Makefile)
220
221