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