-
-AC_DEFUN([_TUXBOX_APPS_LIB_CONFIG],[
-AC_PATH_PROG($1_CONFIG,$2,no)
-if test "$$1_CONFIG" != "no"; then
- if test "$TARGET" = "cdk" && check_path "$$1_CONFIG"; then
- AC_MSG_$3([could not find a suitable version of $2]);
- else
- $1_CFLAGS=$($$1_CONFIG --cflags)
- $1_LIBS=$($$1_CONFIG --libs)
- fi
-fi
-
-AC_SUBST($1_CFLAGS)
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_CONFIG],[
-_TUXBOX_APPS_LIB_CONFIG($1,$2,ERROR)
-if test "$$1_CONFIG" = "no"; then
- AC_MSG_ERROR([could not find $2]);
-fi
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_CONFIG_CHECK],[
-_TUXBOX_APPS_LIB_CONFIG($1,$2,WARN)
-])
-
-AC_DEFUN([TUXBOX_APPS_PKGCONFIG],[
-AC_PATH_PROG(PKG_CONFIG, pkg-config,no)
-if test "$PKG_CONFIG" = "no" ; then
- AC_MSG_ERROR([could not find pkg-config]);
-fi
-])
-
-AC_DEFUN([_TUXBOX_APPS_LIB_PKGCONFIG],[
-PKG_CHECK_MODULES($1,$2)
-AC_SUBST($1_CFLAGS)
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([_TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL],[
-PKG_CHECK_MODULES($1,$2,$3="yes",$3="no")
-if test "$$3" = "yes"; then
- AC_DEFINE($3, 1, [$2 available])
-else
- $1_CFLAGS=""
- $1_LIBS=""
-fi
-AC_SUBST($1_CFLAGS)
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG],[
-_TUXBOX_APPS_LIB_PKGCONFIG($1,$2)
-if test -z "$$1_CFLAGS" ; then
- AC_MSG_ERROR([could not find package $2]);
-fi
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG_CHECK],[
-_TUXBOX_APPS_LIB_PKGCONFIG($1,$2)
-])
-
-AC_DEFUN([_TUXBOX_APPS_LIB_SYMBOL],[
-AC_CHECK_LIB($2,$3,HAVE_$1="yes",HAVE_$1="no")
-if test "$HAVE_$1" = "yes"; then
- $1_LIBS=-l$2
-fi
-
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_SYMBOL],[
-_TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,ERROR)
-if test "$HAVE_$1" = "no"; then
- AC_MSG_ERROR([could not find $2]);
-fi
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_CONFIG_SYMBOL],[
-_TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,WARN)
-])
-
-AC_DEFUN([TUXBOX_APPS_GETTEXT],[
-AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
- (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
- :)
-AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
-
-AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
- (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)],
- :)
-
-AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1],:)
-
-AC_MSG_CHECKING([whether NLS is requested])
-AC_ARG_ENABLE(nls,
- [ --disable-nls do not use Native Language Support],
- USE_NLS=$enableval, USE_NLS=yes)
-AC_MSG_RESULT($USE_NLS)
-AC_SUBST(USE_NLS)
-
-if test "$USE_NLS" = "yes"; then
- AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,[
- AC_TRY_LINK([
- #include <libintl.h>
- #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
- #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
- #endif
- extern int _nl_msg_cat_cntr;
- extern int *_nl_domain_bindings;
- ],[
- bindtextdomain ("", "");
- return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings;
- ], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no
- )]
- )
-
- if test "$gt_cv_func_gnugettext_libc" = "yes"; then
- AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.])
- gt_use_preinstalled_gnugettext=yes
- else
- USE_NLS=no
- fi
-fi
-
-if test -f "$srcdir/po/LINGUAS"; then
- ALL_LINGUAS=$(sed -e "/^#/d" "$srcdir/po/LINGUAS")
-fi
-
-POFILES=
-GMOFILES=
-UPDATEPOFILES=
-DUMMYPOFILES=
-for lang in $ALL_LINGUAS; do
- POFILES="$POFILES $srcdirpre$lang.po"
- GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
- UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
- DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
-done
-INST_LINGUAS=
-if test -n "$ALL_LINGUAS"; then
- for presentlang in $ALL_LINGUAS; do
- useit=no
- if test -n "$LINGUAS"; then
- desiredlanguages="$LINGUAS"
- else
- desiredlanguages="$ALL_LINGUAS"
- fi
- for desiredlang in $desiredlanguages; do
- case "$desiredlang" in
- "$presentlang"*) useit=yes;;
- esac
- done
- if test $useit = yes; then
- INST_LINGUAS="$INST_LINGUAS $presentlang"
- fi
- done
-fi
-CATALOGS=
-if test -n "$INST_LINGUAS"; then
- for lang in $INST_LINGUAS; do
- CATALOGS="$CATALOGS $lang.gmo"
- done
-fi
-AC_SUBST(POFILES)
-AC_SUBST(GMOFILES)
-AC_SUBST(UPDATEPOFILES)
-AC_SUBST(DUMMYPOFILES)
-AC_SUBST(CATALOGS)
-])
-
-dnl backward compatiblity
-AC_DEFUN([AC_GNU_SOURCE],
-[AH_VERBATIM([_GNU_SOURCE],
-[/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif])dnl
-AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
-AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-AC_DEFINE([_GNU_SOURCE])
-])
-
-AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])