~ubuntu-branches/ubuntu/wily/me-tv/wily

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.53)
AC_INIT([Me TV], [1.2.6], [http://launchpad.net/me-tv], me-tv)
AC_COPYRIGHT([Michael Lamothe <michael.lamothe@gmail.com>])
AC_CONFIG_SRCDIR([src/main.cc])
AM_INIT_AUTOMAKE([1.9 foreign])
AC_GNU_SOURCE
AM_MAINTAINER_MODE

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_ISC_POSIX
AM_PROG_CC_STDC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

# GNOME aclocal, debug and maintainer flags
GNOME_COMMON_INIT
# debug, warnings, deprecated
if test x"$enable_more_warnings" = xyes ; then
	enable_cxx_warnings=yes
fi
if test x"$USE_MAINTAINER_MODE" != xno; then
	enable_debug=yes
	CFLAGS=""
fi
if test x"$enable_debug" = xyes ; then
#	enable_cxx_warnings=yes
	enable_more_warnings=yes
	CFLAGS="$CFLAGS -O0 -g"
fi
GNOME_DEBUG_CHECK
GNOME_MAINTAINER_MODE_DEFINES
GNOME_CXX_WARNINGS
AC_ARG_ENABLE(more-warnings,
   AC_HELP_STRING([--enable-more-warnings],
                  [enable more compiler warnings (default=no)]),
                  [enable_more_warnings="$enableval"], [enable_more_warnings=no])
AC_MSG_CHECKING([what more warning flags to pass to the C compiler])
if test x"$enable_more_warnings" != xno ; then
	more_options=" \
-Wextra \
-Wcast-align \
-Wcast-qual \
-Wcomment \
-Wformat \
-Wimplicit \
-Wmissing-braces \
-Wpacked \
-Wparentheses \
-Wpointer-arith \
-Wreturn-type \
-Wsequence-point \
-Wstrict-aliasing \
-Wstrict-aliasing=2 \
-Wswitch-default \
-Wundef \
"
	previous_CXXFLAGS="$CXXFLAGS"
	CXXFLAGS="${WARN_CXXFLAGS}"
	for option in ${more_options} ; do
		SAVE_CXXFLAGS="$CXXFLAGS"
		CXXFLAGS="$CXXFLAGS $option"
		AC_TRY_COMPILE([], [],
			has_option=yes,
			has_option=no,)
		if test $has_option = no; then
			CXXFLAGS="$SAVE_CXXFLAGS"
		fi
		unset has_option
		unset SAVE_CXXFLAGS
	done
	unset option more_options
	WARN_CXXFLAGS="$CXXFLAGS"
	CXXFLAGS="${previous_CXXFLAGS}"
	unset previous_CXXFLAGS
	AC_MSG_RESULT([$WARN_CXXFLAGS])
else
	AC_MSG_RESULT(none)
fi

# Checks for header files.
AC_PATH_X
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T

# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([localtime_r mempcpy memset mkfifo select strerror tzset])

# Checks for libraries.

# gettext support
GETTEXT_PACKAGE=${PACKAGE}
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext domain string])
AM_GLIB_GNU_GETTEXT
AM_GLIB_DEFINE_LOCALEDIR(PACKAGE_LOCALE_DIR)
IT_PROG_INTLTOOL([0.35.0])

# required versions
SQLITE_REQUIRED=3.0
GTKMM_REQUIRED=2.12.0
GIOMM_REQUIRED=2.10.0
GCONF_REQUIRED=2.0
GTHREAD_REQUIRED=2.10.0
GNET_REQUIRED=2.0.0
LIBXINE_REQUIRED=1.1.7
AC_SUBST(SQLITE_REQUIRED)
AC_SUBST(LIBGTKMM_REQUIRED)
AC_SUBST(GIOMM_REQUIRED)
AC_SUBST(GCONF_REQUIRED)
AC_SUBST(GTHREAD_REQUIRED)
AC_SUBST(GNET_REQUIRED)
AC_SUBST(LIBXINE_REQUIRED)

# check for sqlite
PKG_CHECK_MODULES(SQLITE, [sqlite3 >= $SQLITE_REQUIRED])

PKG_CHECK_MODULES(ME_TV, [
	gtkmm-2.4 >= $GTKMM_REQUIRED
	giomm-2.4 >= $GIOMM_REQUIRED
	gthread-2.0 >= $GTHREAD_REQUIRED
	gconfmm-2.6 >= $GCONF_REQUIRED
	unique-1.0
	x11
	dbus-1 dbus-glib-1])
AC_SUBST(ME_TV_CFLAGS)
AC_SUBST(ME_TV_LIBS)

# GConf
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)

if test x"$GCONFTOOL" = xno; then
  AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
fi

AM_GCONF_SOURCE_2

##################################################
# Check for gtk-doc.
##################################################
AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
if test "x$with_html_dir" = "x" ; then
  HTML_DIR='${datadir}/gtk-doc/html'
else
  HTML_DIR=$with_html_dir
fi
AC_SUBST(HTML_DIR)

gtk_doc_min_version=1.0
AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
if pkg-config --atleast-version=$gtk_doc_min_version gtk-doc; then
  AC_MSG_RESULT(yes)
  GTKDOC=true
else
  AC_MSG_RESULT(no)
  GTKDOC=false
fi
dnl Let people disable the gtk-doc stuff.
AC_ARG_ENABLE(gtk-doc,
              [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]],
	      enable_gtk_doc="$enableval", enable_gtk_doc=auto)
if test x$enable_gtk_doc = xauto ; then
  if test x$GTKDOC = xtrue ; then
    enable_gtk_doc=yes
  else
    enable_gtk_doc=no
  fi
fi
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)

AC_CONFIG_FILES([
Makefile
src/Makefile
po/Makefile.in
])
AC_CONFIG_HEADERS([config.h:config.h.in])
PKG_CHECK_MODULES(ME_TV_PLAYER, libxine >= $LIBXINE_REQUIRED)
AC_OUTPUT


dnl Print a little note
echo "

Configure summary:

	Source code location .......: ${srcdir}
	Compiler ...................: ${CC}
	Compiler flags .............: ${CFLAGS}
	Enable compile warnings ....: ${enable_cxx_warnings}
	Enable more warnings .......: ${enable_more_warnings}
	Extra Compiler Warnings ....: ${WARN_CXXFLAGS}
	Debug support ..............: ${enable_debug}
	Installing into prefix .....: ${prefix}

Type make to build ${PACKAGE_STRING}

"