1 AC_DEFUN([TUXBOX_APPS],[
9 [ --with-target=TARGET target for compilation [[native,cdk]]],
10 [TARGET="$withval"],[TARGET="native"])
12 AC_ARG_WITH(targetprefix,
13 [ --with-targetprefix=PATH prefix relative to target root (only applicable in cdk mode)],
14 [targetprefix="$withval"],[targetprefix="NONE"])
17 [ --without-debug disable debugging code],
18 [DEBUG="$withval"],[DEBUG="yes"])
20 if test "$DEBUG" = "yes"; then
21 DEBUG_CFLAGS="-g3 -ggdb"
22 AC_DEFINE(DEBUG,1,[Enable debug messages])
25 AC_MSG_CHECKING(target)
27 if test "$TARGET" = "native"; then
30 if test "$CFLAGS" = "" -a "$CXXFLAGS" = ""; then
31 CFLAGS="-Wall -O2 -pipe $DEBUG_CFLAGS"
32 CXXFLAGS="-Wall -O2 -pipe $DEBUG_CFLAGS"
34 if test "$prefix" = "NONE"; then
38 elif test "$TARGET" = "cdk"; then
41 if test "$CC" = "" -a "$CXX" = ""; then
42 CC=powerpc-tuxbox-linux-gnu-gcc CXX=powerpc-tuxbox-linux-gnu-g++
44 if test "$CFLAGS" = "" -a "$CXXFLAGS" = ""; then
45 CFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS"
46 CXXFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS"
48 if test "$prefix" = "NONE"; then
49 AC_MSG_ERROR(invalid prefix, you need to specify one in cdk mode)
51 if test "$targetprefix" = "NONE"; then
54 if test "$host_alias" = ""; then
56 host_alias=powerpc-tuxbox-linux-gnu
60 AC_MSG_ERROR([invalid target $TARGET, choose on from native,cdk]);
67 return $(perl -e "if(\"$1\"=~m#^/usr/(local/)?bin#){print \"0\"}else{print \"1\";}")
72 AC_DEFUN([TUXBOX_APPS_DIRECTORY_ONE],[
73 AC_ARG_WITH($1,[ $6$7 [[PREFIX$4$5]]],[
75 if test "$TARGET" = "cdk"; then
76 $2=`eval echo "${targetprefix}$withval"`
82 if test "$TARGET" = "cdk"; then
83 _$2=`eval echo "${target$3}$5"`
85 _$2=`eval echo "${$3}$5"`
89 dnl automake <= 1.6 don't support this
91 AC_DEFINE_UNQUOTED($2,"$_$2",$7)
94 AC_DEFUN([TUXBOX_APPS_DIRECTORY],[
95 AC_REQUIRE([TUXBOX_APPS])
97 if test "$TARGET" = "cdk"; then
98 datadir="\${prefix}/share"
99 tuxboxdatadir="\${prefix}/share/tuxbox"
100 zoneinfodir="\${datadir}/zoneinfo"
101 sysconfdir="\${prefix}/etc"
102 localstatedir="\${prefix}/var"
103 localedir="\${prefix}/var"
104 libdir="\${prefix}/lib"
105 targetdatadir="\${targetprefix}/share"
106 targetsysconfdir="\${targetprefix}/etc"
107 targetlocalstatedir="\${targetprefix}/var"
108 targetlibdir="\${targetprefix}/lib"
111 TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,sysconfdir,/etc,,
112 [--with-configdir=PATH ],[where to find the config files])
114 TUXBOX_APPS_DIRECTORY_ONE(datadir,DATADIR,datadir,/share,,
115 [--with-datadir=PATH ],[where to find data])
117 TUXBOX_APPS_DIRECTORY_ONE(fontdir,FONTDIR,datadir,/share,/fonts,
118 [--with-fontdir=PATH ],[where to find the fonts])
120 TUXBOX_APPS_DIRECTORY_ONE(libdir,LIBDIR,libdir,/lib,,
121 [--with-libdir=PATH ],[where to find the internal libs])
124 dnl automake <= 1.6 needs this specifications
131 AC_DEFUN([TUXBOX_APPS_DVB],[
132 AC_ARG_WITH(dvbincludes,
133 [ --with-dvbincludes=PATH path for dvb includes [[NONE]]],
134 [DVBINCLUDES="$withval"],[DVBINCLUDES=""])
136 if test "$DVBINCLUDES"; then
137 CPPFLAGS="$CPPFLAGS -I$DVBINCLUDES"
140 AC_CHECK_HEADERS(ost/dmx.h,[
142 AC_MSG_NOTICE([found dvb version 1])
145 if test -z "$DVB_API_VERSION"; then
146 AC_CHECK_HEADERS(linux/dvb/version.h,[
147 AC_LANG_PREPROC_REQUIRE()
148 AC_REQUIRE([AC_PROG_EGREP])
149 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
150 #include <linux/dvb/version.h>
151 version DVB_API_VERSION
153 DVB_API_VERSION=`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP "^version" | sed "s,version\ ,,"`
156 AC_MSG_NOTICE([found dvb version $DVB_API_VERSION])
160 if test "$DVB_API_VERSION"; then
161 AC_DEFINE(HAVE_DVB,1,[Define to 1 if you have the dvb includes])
162 AC_DEFINE_UNQUOTED(HAVE_DVB_API_VERSION,$DVB_API_VERSION,[Define to the version of the dvb api])
164 AC_MSG_ERROR([can't find dvb headers])
168 AC_DEFUN([_TUXBOX_APPS_LIB_CONFIG],[
169 AC_PATH_PROG($1_CONFIG,$2,no)
170 if test "$$1_CONFIG" != "no"; then
171 if test "$TARGET" = "cdk" && check_path "$$1_CONFIG"; then
172 AC_MSG_$3([could not find a suitable version of $2]);
174 $1_CFLAGS=$($$1_CONFIG --cflags)
175 $1_LIBS=$($$1_CONFIG --libs)
183 AC_DEFUN([TUXBOX_APPS_LIB_CONFIG],[
184 _TUXBOX_APPS_LIB_CONFIG($1,$2,ERROR)
185 if test "$$1_CONFIG" = "no"; then
186 AC_MSG_ERROR([could not find $2]);
190 AC_DEFUN([TUXBOX_APPS_LIB_CONFIG_CHECK],[
191 _TUXBOX_APPS_LIB_CONFIG($1,$2,WARN)
194 AC_DEFUN([TUXBOX_APPS_PKGCONFIG],[
195 AC_PATH_PROG(PKG_CONFIG, pkg-config,no)
196 if test "$PKG_CONFIG" = "no" ; then
197 AC_MSG_ERROR([could not find pkg-config]);
201 AC_DEFUN([_TUXBOX_APPS_LIB_PKGCONFIG],[
202 PKG_CHECK_MODULES($1,$2)
207 AC_DEFUN([_TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL],[
208 PKG_CHECK_MODULES($1,$2,$3="yes",$3="no")
209 if test "$$3" = "yes"; then
210 AC_DEFINE($3, 1, [$2 available])
219 AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG],[
220 _TUXBOX_APPS_LIB_PKGCONFIG($1,$2)
221 if test -z "$$1_CFLAGS" ; then
222 AC_MSG_ERROR([could not find package $2]);
226 AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG_CHECK],[
227 _TUXBOX_APPS_LIB_PKGCONFIG($1,$2)
230 AC_DEFUN([_TUXBOX_APPS_LIB_SYMBOL],[
231 AC_CHECK_LIB($2,$3,HAVE_$1="yes",HAVE_$1="no")
232 if test "$HAVE_$1" = "yes"; then
239 AC_DEFUN([TUXBOX_APPS_LIB_SYMBOL],[
240 _TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,ERROR)
241 if test "$HAVE_$1" = "no"; then
242 AC_MSG_ERROR([could not find $2]);
246 AC_DEFUN([TUXBOX_APPS_LIB_CONFIG_SYMBOL],[
247 _TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,WARN)
250 AC_DEFUN([TUXBOX_APPS_GETTEXT],[
251 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
252 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
253 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
255 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
257 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
258 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
259 (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
262 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1],:)
264 AC_MSG_CHECKING([whether NLS is requested])
266 [ --disable-nls do not use Native Language Support],
267 USE_NLS=$enableval, USE_NLS=yes)
268 AC_MSG_RESULT($USE_NLS)
271 if test "$USE_NLS" = "yes"; then
272 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,[
275 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
276 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
278 extern int _nl_msg_cat_cntr;
279 extern int *_nl_domain_bindings;
281 bindtextdomain ("", "");
282 return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings;
283 ], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no
287 if test "$gt_cv_func_gnugettext_libc" = "yes"; then
288 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.])
289 gt_use_preinstalled_gnugettext=yes
295 if test -f "$srcdir/po/LINGUAS"; then
296 ALL_LINGUAS=$(sed -e "/^#/d" "$srcdir/po/LINGUAS")
303 for lang in $ALL_LINGUAS; do
304 POFILES="$POFILES $srcdirpre$lang.po"
305 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
306 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
307 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
310 if test -n "$ALL_LINGUAS"; then
311 for presentlang in $ALL_LINGUAS; do
313 if test -n "$LINGUAS"; then
314 desiredlanguages="$LINGUAS"
316 desiredlanguages="$ALL_LINGUAS"
318 for desiredlang in $desiredlanguages; do
319 case "$desiredlang" in
320 "$presentlang"*) useit=yes;;
323 if test $useit = yes; then
324 INST_LINGUAS="$INST_LINGUAS $presentlang"
329 if test -n "$INST_LINGUAS"; then
330 for lang in $INST_LINGUAS; do
331 CATALOGS="$CATALOGS $lang.gmo"
336 AC_SUBST(UPDATEPOFILES)
337 AC_SUBST(DUMMYPOFILES)
341 dnl backward compatiblity
342 AC_DEFUN([AC_GNU_SOURCE],
343 [AH_VERBATIM([_GNU_SOURCE],
344 [/* Enable GNU extensions on systems that have them. */
348 AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
349 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
350 AC_DEFINE([_GNU_SOURCE])
353 AC_DEFUN([AC_PROG_EGREP],
354 [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
355 [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
356 then ac_cv_prog_egrep='grep -E'
357 else ac_cv_prog_egrep='egrep'
359 EGREP=$ac_cv_prog_egrep