leo_sobral@1
|
1 |
# -*- Autoconf -*-
|
leo_sobral@1
|
2 |
# Process this file with autoconf to produce a configure script.
|
leo_sobral@1
|
3 |
|
leo_sobral@1
|
4 |
AC_PREREQ(2.50)
|
leo_sobral@1
|
5 |
|
leo_sobral@1
|
6 |
AC_INIT([gmyth],[0.1])
|
leo_sobral@1
|
7 |
|
leo_sobral@1
|
8 |
dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
|
leo_sobral@1
|
9 |
AC_CONFIG_HEADER(config.h)
|
leo_sobral@1
|
10 |
|
leo_sobral@1
|
11 |
dnl when going to/from release please set the nano (fourth number) right !
|
leo_sobral@1
|
12 |
dnl releases only do Wall, SVN and prerelease does Werror too
|
rosfran@134
|
13 |
AS_VERSION(gmyth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
|
rosfran@134
|
14 |
GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
|
rosfran@134
|
15 |
AC_SUBST(GMYTH_MAJORMINOR)
|
leo_sobral@1
|
16 |
|
leo_sobral@1
|
17 |
dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
|
leo_sobral@1
|
18 |
AM_MAINTAINER_MODE
|
leo_sobral@1
|
19 |
dnl make aclocal work in maintainer mode
|
leo_sobral@1
|
20 |
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
|
leo_sobral@1
|
21 |
|
leo_sobral@1
|
22 |
# Checks for programs.
|
leo_sobral@1
|
23 |
# check for tools
|
leo_sobral@1
|
24 |
# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
|
leo_sobral@1
|
25 |
CFLAGS="$CFLAGS -Wall"
|
leo_sobral@1
|
26 |
AC_PROG_CC
|
leo_sobral@1
|
27 |
AC_PROG_LIBTOOL
|
leo_sobral@1
|
28 |
|
leo_sobral@1
|
29 |
dnl Generate doxygen documentation
|
leo_sobral@1
|
30 |
DX_HTML_FEATURE(ON)
|
leo_sobral@1
|
31 |
DX_CHM_FEATURE(OFF)
|
leo_sobral@1
|
32 |
DX_CHI_FEATURE(OFF)
|
leo_sobral@1
|
33 |
DX_MAN_FEATURE(OFF)
|
leo_sobral@1
|
34 |
DX_RTF_FEATURE(OFF)
|
leo_sobral@1
|
35 |
DX_XML_FEATURE(OFF)
|
leo_sobral@1
|
36 |
DX_PDF_FEATURE(OFF)
|
leo_sobral@1
|
37 |
DX_PS_FEATURE(OFF)
|
leo_sobral@1
|
38 |
DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
|
leo_sobral@1
|
39 |
|
leo_sobral@1
|
40 |
# Checks for libraries.
|
leo_sobral@1
|
41 |
|
leo_sobral@1
|
42 |
# Checks for header files.
|
leo_sobral@1
|
43 |
AC_HEADER_STDC
|
leo_sobral@1
|
44 |
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
|
leo_sobral@1
|
45 |
|
leo_sobral@1
|
46 |
# Checks for typedefs, structures, and compiler characteristics.
|
leo_sobral@1
|
47 |
AC_C_CONST
|
leo_sobral@1
|
48 |
AC_TYPE_PID_T
|
leo_sobral@1
|
49 |
AC_STRUCT_TM
|
rosfran@134
|
50 |
AC_HEADER_TIME
|
rosfran@134
|
51 |
AC_HEADER_STDBOOL
|
rosfran@134
|
52 |
|
leo_sobral@1
|
53 |
# Checks for library functions.
|
leo_sobral@1
|
54 |
AC_FUNC_FORK
|
rosfran@134
|
55 |
AC_FUNC_STRFTIME
|
rosfran@134
|
56 |
AC_FUNC_SELECT_ARGTYPES
|
leo_sobral@1
|
57 |
AC_PROG_GCC_TRADITIONAL
|
leo_sobral@1
|
58 |
AC_FUNC_MALLOC
|
leo_sobral@1
|
59 |
AC_FUNC_MKTIME
|
rosfran@215
|
60 |
AC_FUNC_STRFTIME
|
leo_sobral@1
|
61 |
AC_FUNC_VPRINTF
|
rosfran@215
|
62 |
AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
|
leo_sobral@1
|
63 |
|
leo_sobral@1
|
64 |
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
|
leo_sobral@1
|
65 |
|
rosfran@246
|
66 |
CFLAGS="$CFLAGS -I/usr/include"
|
rosfran@246
|
67 |
LDFLAGS="$LDFLAGS -L/usr/lib"
|
rosfran@246
|
68 |
|
leo_sobral@1
|
69 |
# Checks required packages
|
leo_sobral@1
|
70 |
|
leo_sobral@1
|
71 |
dnl Test if --disable-debug given
|
leo_sobral@1
|
72 |
AC_ARG_ENABLE(debug,
|
renatofilho@131
|
73 |
AC_HELP_STRING([--disable-debug], [enable debugging mode]))
|
renatofilho@131
|
74 |
if test x"$enable_debug" != xno; then
|
renatofilho@131
|
75 |
CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
|
leo_sobral@1
|
76 |
else
|
renatofilho@131
|
77 |
CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
|
leo_sobral@1
|
78 |
fi
|
leo_sobral@1
|
79 |
|
leo_sobral@1
|
80 |
# Check for pkgconfig
|
leo_sobral@1
|
81 |
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
|
leo_sobral@1
|
82 |
# Give error and exit if we don't have pkgconfig
|
leo_sobral@1
|
83 |
if test "x$HAVE_PKGCONFIG" = "xno"; then
|
leo_sobral@1
|
84 |
AC_MSG_ERROR(you need to have pkgconfig installed !)
|
leo_sobral@1
|
85 |
fi
|
leo_sobral@1
|
86 |
|
leo_sobral@1
|
87 |
# Check for Glib2.0
|
leo_sobral@1
|
88 |
PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
|
leo_sobral@1
|
89 |
|
leo_sobral@1
|
90 |
# Give error and exit if we don't have glib
|
leo_sobral@1
|
91 |
if test "x$HAVE_GLIB" = "xno"; then
|
leo_sobral@1
|
92 |
AC_MSG_ERROR(you need glib-2.0 installed)
|
leo_sobral@1
|
93 |
fi
|
leo_sobral@1
|
94 |
|
leo_sobral@1
|
95 |
# make GLIB_CFLAGS and GLIB_LIBS available
|
leo_sobral@1
|
96 |
AC_SUBST(GLIB_CFLAGS)
|
leo_sobral@1
|
97 |
AC_SUBST(GLIB_LIBS)
|
leo_sobral@1
|
98 |
|
leo_sobral@1
|
99 |
# Check for GObject2.0
|
leo_sobral@1
|
100 |
PKG_CHECK_MODULES(GOBJECT,
|
leo_sobral@1
|
101 |
gobject-2.0,
|
leo_sobral@1
|
102 |
HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
|
leo_sobral@1
|
103 |
|
leo_sobral@1
|
104 |
# Give error and exit if we don't have gobject
|
leo_sobral@1
|
105 |
if test "x$HAVE_GOBJECT" = "xno"; then
|
leo_sobral@1
|
106 |
AC_MSG_ERROR(you need gobject-2.0 installed)
|
leo_sobral@1
|
107 |
fi
|
leo_sobral@1
|
108 |
|
leo_sobral@1
|
109 |
# make GOBJECT_CFLAGS and GOBJECT_LIBS available
|
leo_sobral@1
|
110 |
AC_SUBST(GOBJECT_CFLAGS)
|
leo_sobral@1
|
111 |
AC_SUBST(GOBJECT_LIBS)
|
leo_sobral@1
|
112 |
|
leo_sobral@1
|
113 |
# Check for libxml-2.0
|
leo_sobral@1
|
114 |
PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
|
leo_sobral@1
|
115 |
|
renatofilho@18
|
116 |
# Give error and exit if we don't have libxml
|
leo_sobral@1
|
117 |
if test "x$HAVE_LIBXML" = "xno"; then
|
leo_sobral@1
|
118 |
AC_MSG_ERROR(you need libxml-2.0 installed)
|
leo_sobral@1
|
119 |
fi
|
leo_sobral@1
|
120 |
|
leo_sobral@1
|
121 |
# make LIBXML_CFLAGS and LIBXML_LIBS available
|
leo_sobral@1
|
122 |
AC_SUBST(LIBXML_CFLAGS)
|
leo_sobral@1
|
123 |
AC_SUBST(LIBXML_LIBS)
|
leo_sobral@1
|
124 |
|
leo_sobral@1
|
125 |
|
leo_sobral@1
|
126 |
# check for gstreamer development files
|
leo_sobral@1
|
127 |
GST_REQUIRED=0.10
|
leo_sobral@1
|
128 |
GST_MAJORMINOR=0.10
|
leo_sobral@1
|
129 |
PKG_CHECK_MODULES(GST, \
|
leo_sobral@1
|
130 |
gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
|
leo_sobral@1
|
131 |
HAVE_GST=yes, HAVE_GST=no)
|
leo_sobral@1
|
132 |
|
leo_sobral@1
|
133 |
# Give error and exit if we don't have gstreamer
|
leo_sobral@1
|
134 |
if test "x$HAVE_GST" = "xno"; then
|
leo_sobral@1
|
135 |
AC_MSG_ERROR(you need gstreamer development packages installed !)
|
leo_sobral@1
|
136 |
fi
|
leo_sobral@1
|
137 |
|
leo_sobral@1
|
138 |
# make GST_CFLAGS and GST_LIBS available
|
leo_sobral@1
|
139 |
AC_SUBST(GST_CFLAGS)
|
leo_sobral@1
|
140 |
AC_SUBST(GST_LIBS)
|
leo_sobral@1
|
141 |
|
melunko@36
|
142 |
# check for gstreamer-base
|
leo_sobral@1
|
143 |
GSTBASE_REQUIRED=0.10
|
leo_sobral@1
|
144 |
GSTBASE_MAJORMINOR=0.10
|
leo_sobral@1
|
145 |
PKG_CHECK_MODULES(GSTBASE, \
|
leo_sobral@1
|
146 |
gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
|
leo_sobral@1
|
147 |
HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
|
leo_sobral@1
|
148 |
|
leo_sobral@1
|
149 |
# Give error and exit if we don't have gstreamer base libraries
|
leo_sobral@1
|
150 |
if test "x$HAVE_GSTBASE" = "xno"; then
|
leo_sobral@1
|
151 |
AC_MSG_ERROR(you need gstreamer base development packages installed !)
|
leo_sobral@1
|
152 |
fi
|
leo_sobral@1
|
153 |
|
leo_sobral@1
|
154 |
# make GSTBASE_CFLAGS and GSTBASE_LIBS available
|
leo_sobral@1
|
155 |
AC_SUBST(GSTBASE_CFLAGS)
|
leo_sobral@1
|
156 |
AC_SUBST(GSTBASE_LIBS)
|
leo_sobral@1
|
157 |
|
melunko@36
|
158 |
# check for gstreamer-base plugins (xoverlay interface)
|
melunko@36
|
159 |
GSTPLUGINSBASE_REQUIRED=0.10
|
melunko@36
|
160 |
GSTPLUGINSBASE_MAJORMINOR=0.10
|
melunko@36
|
161 |
PKG_CHECK_MODULES(GSTPLUGINSBASE, \
|
melunko@36
|
162 |
gstreamer-plugins-base-$GSTPLUGINSBASE_MAJORMINOR >= $GSTPLUGINSBASE_REQUIRED,
|
melunko@36
|
163 |
HAVE_GSTPLUGINSBASE=yes, HAVE_GSTPLUGINSBASE=no)
|
melunko@36
|
164 |
|
melunko@36
|
165 |
# Give error and exit if we don't have gstreamer base libraries
|
melunko@36
|
166 |
if test "x$HAVE_GSTPLUGINSBASE" = "xno"; then
|
melunko@36
|
167 |
AC_MSG_ERROR(you need gstreamer plugins base development packages installed !)
|
melunko@36
|
168 |
fi
|
melunko@36
|
169 |
|
melunko@36
|
170 |
# make GSTPLUGINSBASE_CFLAGS and GSTPLUGINSBASE_LIBS available
|
melunko@36
|
171 |
AC_SUBST(GSTPLUGINSBASE_CFLAGS)
|
melunko@36
|
172 |
AC_SUBST(GSTPLUGINSBASE_LIBS)
|
melunko@36
|
173 |
|
leo_sobral@1
|
174 |
# make GST_MAJORMINOR available in Makefile.am
|
leo_sobral@1
|
175 |
AC_SUBST(GST_MAJORMINOR)
|
melunko@36
|
176 |
GSTBASE_MAJORMINOR=0.10
|
melunko@36
|
177 |
PKG_CHECK_MODULES(GSTBASE, \
|
melunko@36
|
178 |
gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
|
melunko@36
|
179 |
HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
|
melunko@36
|
180 |
|
melunko@36
|
181 |
# Give error and exit if we don't have gstreamer base libraries
|
melunko@36
|
182 |
if test "x$HAVE_GSTBASE" = "xno"; then
|
melunko@36
|
183 |
AC_MSG_ERROR(you need gstreamer base development packages installed !)
|
melunko@36
|
184 |
fi
|
melunko@36
|
185 |
|
rosfran@104
|
186 |
##############################
|
rosfran@104
|
187 |
# Checks for Network functions
|
rosfran@104
|
188 |
##############################
|
rosfran@104
|
189 |
|
rosfran@104
|
190 |
AC_CHECK_FUNCS([socket])
|
rosfran@104
|
191 |
AC_CHECK_FUNCS([inet_ntoa])
|
rosfran@104
|
192 |
AC_CHECK_HEADERS([ifaddrs.h])
|
rosfran@104
|
193 |
AC_CHECK_FUNCS([getifaddrs])
|
rosfran@135
|
194 |
AC_CHECK_FUNCS([time])
|
leo_sobral@1
|
195 |
|
leo_sobral@1
|
196 |
#
|
leo_sobral@1
|
197 |
# mysql libraries
|
leo_sobral@1
|
198 |
#
|
rosfran@246
|
199 |
MYSQL_CFLAGS="$CFLAGS -DBIG_JOINS=1"
|
rosfran@246
|
200 |
MYSQL_LIBS="$LIBS -L/usr/lib"
|
rosfran@246
|
201 |
|
rosfran@240
|
202 |
AC_CHECK_LIB( mysqlclient, mysql_init,
|
rosfran@240
|
203 |
[
|
rosfran@246
|
204 |
MYSQL_CFLAGS="$MYSQL_CFLAGS -DBIG_JOINS=1"
|
rosfran@246
|
205 |
MYSQL_LIBS="$MYSQL_LIBS -L/usr/lib -lmysqlclient"
|
rosfran@240
|
206 |
], AC_MSG_ERROR([Could not find mysqlclient library. Make sure the mysql client libraries are installed] ) )
|
rosfran@240
|
207 |
|
rosfran@240
|
208 |
AC_CHECK_LIB( z, deflate,
|
rosfran@240
|
209 |
[
|
rosfran@240
|
210 |
MYSQL_LIBS="$MYSQL_LIBS -lz"
|
rosfran@246
|
211 |
], AC_MSG_WARN([Could not find a mysqlclient library dependency - Z. Make sure the mysql client libraries are installed]) )
|
rosfran@240
|
212 |
|
rosfran@240
|
213 |
AC_CHECK_LIB( crypt, encrypt,
|
rosfran@240
|
214 |
[
|
rosfran@240
|
215 |
MYSQL_LIBS="$MYSQL_LIBS -lcrypt"
|
rosfran@246
|
216 |
], AC_MSG_WARN([Could not find a mysqlclient library dependency - Crypt library. Make sure the mysql client libraries are installed]) )
|
rosfran@240
|
217 |
|
rosfran@240
|
218 |
AC_CHECK_LIB( nsl, yp_all,
|
rosfran@240
|
219 |
[
|
rosfran@240
|
220 |
MYSQL_LIBS="$MYSQL_LIBS -lnsl"
|
rosfran@246
|
221 |
], AC_MSG_WARN([Could not find a mysqlclient library dependency - NSL library. Make sure the mysql client libraries are installed]) )
|
rosfran@240
|
222 |
|
rosfran@240
|
223 |
AC_CHECK_LIB( m, ccos,
|
rosfran@240
|
224 |
[
|
rosfran@240
|
225 |
MYSQL_LIBS="$MYSQL_LIBS -lm"
|
rosfran@246
|
226 |
], AC_MSG_WARN([Could not find a mysqlclient library dependency - M library. Make sure the mysql client libraries are installed]) )
|
rosfran@240
|
227 |
|
rosfran@246
|
228 |
AC_CHECK_HEADERS( [mysql/mysql.h mysql/mysql_version.h], [ AC_MSG_NOTICE([Found MySQL headers!]) ],
|
rosfran@246
|
229 |
[ AC_MSG_WARN([Could not find mysqlclient headers, but it will work fine instead of this...]) ],
|
rosfran@246
|
230 |
[
|
rosfran@246
|
231 |
#include <mysql/mysql.h>
|
rosfran@246
|
232 |
])
|
rosfran@240
|
233 |
|
leo_sobral@1
|
234 |
AC_SUBST(MYSQL_CFLAGS)
|
leo_sobral@1
|
235 |
AC_SUBST(MYSQL_LIBS)
|
leo_sobral@1
|
236 |
|
rosfran@241
|
237 |
dnl ========== Check for Cyberlink UPnP Libraries
|
rosfran@241
|
238 |
AC_ARG_ENABLE(upnp,
|
rosfran@246
|
239 |
[AC_HELP_STRING([--enable-upnp], [enable building UPnP related stuff])],
|
rosfran@241
|
240 |
enable_upnp="$enableval",
|
rosfran@246
|
241 |
enable_upnp=no)
|
rosfran@241
|
242 |
|
rosfran@241
|
243 |
if test "x$enable_upnp" = "xyes" ; then
|
rosfran@246
|
244 |
AC_MSG_NOTICE([Checking for the UPnP CyberLink for C library...])
|
rosfran@243
|
245 |
PKG_CHECK_MODULES(CYBERLINK,
|
rosfran@241
|
246 |
clinkc,
|
rosfran@241
|
247 |
HAVE_CYBERLINK=yes, HAVE_CYBERLINK=no)
|
rosfran@241
|
248 |
fi
|
rosfran@241
|
249 |
|
rosfran@241
|
250 |
if test "x$HAVE_CYBERLINK" = "xyes"; then
|
rosfran@241
|
251 |
AC_DEFINE(WITH_UPNP, 1, [build with upnp related stuff])
|
rosfran@241
|
252 |
else
|
rosfran@246
|
253 |
AC_MSG_RESULT([UPnP features (using clinkc library) will not be added.])
|
rosfran@241
|
254 |
fi
|
rosfran@241
|
255 |
|
rosfran@241
|
256 |
AM_CONDITIONAL(WITH_UPNP, test "x$HAVE_CYBERLINK" = "xyes")
|
rosfran@241
|
257 |
|
rosfran@241
|
258 |
dnl make CYBERLINK_CFLAGS and CYBERLINK_LIBS available
|
rosfran@241
|
259 |
AC_SUBST(CYBERLINK_CFLAGS)
|
rosfran@241
|
260 |
AC_SUBST(CYBERLINK_LIBS)
|
rosfran@241
|
261 |
|
leo_sobral@1
|
262 |
#dnl Enable gtk-doc
|
leo_sobral@1
|
263 |
#GTK_DOC_CHECK(1.4)
|
leo_sobral@1
|
264 |
|
rosfran@246
|
265 |
AC_SUBST(CFLAGS)
|
rosfran@246
|
266 |
AC_SUBST(LDFLAGS)
|
rosfran@246
|
267 |
AC_SUBST(LIBS)
|
rosfran@246
|
268 |
|
renatofilho@131
|
269 |
AC_OUTPUT([
|
renatofilho@131
|
270 |
Makefile
|
renatofilho@131
|
271 |
src/Makefile
|
renatofilho@148
|
272 |
tests/Makefile
|
renatofilho@131
|
273 |
gmyth.pc])
|
renatofilho@131
|
274 |
|
renatofilho@131
|
275 |
if test x"$enable_debug" != xno; then
|
renatofilho@131
|
276 |
AC_MSG_NOTICE([Debug: Enabled])
|
renatofilho@131
|
277 |
else
|
renatofilho@131
|
278 |
AC_MSG_NOTICE([Debug: Disabled])
|
renatofilho@131
|
279 |
fi
|
renatofilho@131
|
280 |
|