# These dependencies are mandatory
$(SOURCES): include/vlc_symbols.h
-$(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h
+$(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h $(LIB_intl)
###############################################################################
# Optional getopt
SOURCES_libgetopt = extras/GNUgetopt/getopt.c extras/GNUgetopt/getopt1.c
endif
+###############################################################################
+# Optional libintl - FIXME, bad dependencies
+###############################################################################
+
+intl/libintl.a: FORCE
+ cd intl && $(MAKE)
+
+if BUILD_INTL
+LIB_intl = intl/libintl.a
+endif
+
###############################################################################
# MacOS X project
###############################################################################
# @AUTOMAKE_SUCKS@ gets expanded to $(L_builtin) $(LDFLAGS_builtin)
# but we don't write it directly, otherwise automake will go amok and eat all
# the memory because of its 2^N crap algorithm. So we fool him. Nuahaha.
-vlc_LDADD = lib/libvlc.a $(LDFLAGS_vlc) $(DATA_win32_rc) @AUTOMAKE_SUCKS@
+vlc_LDADD = lib/libvlc.a $(LDFLAGS_vlc) \
+ $(DATA_win32_rc) $(LIB_intl) @AUTOMAKE_SUCKS@
vlc_CFLAGS = $(CPPFLAGS_default) $(CFLAGS_default)
# We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
# old automake-1.5 bug (automake/279).
-DEPENDENCIES_vlc = lib/libvlc.a $(L_builtin) $(DATA_win32_rc)
+DEPENDENCIES_vlc = lib/libvlc.a $(L_builtin) $(DATA_win32_rc) $(LIB_intl)
vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc)
@rm -f vlc$(EXEEXT)
include Modules.am
+###############################################################################
+# Force rule
+###############################################################################
+FORCE:
#! /bin/sh
## bootstrap file for vlc, the VideoLAN Client
-## $Id: bootstrap,v 1.18 2002/10/04 13:13:54 sam Exp $
+## $Id: bootstrap,v 1.19 2002/10/16 15:10:38 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
###
set -x
rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
+rm -Rf intl
# Check for gettext
if gettextize --version >/dev/null 2>&1
then
if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
- '>' 0.11.3 >/dev/null 2>&1
+ '>' 0.11.2 >/dev/null 2>&1
then
# We have gettext, and a recent version! Everything is cool.
- autopoint --force || exit 1
+ autopoint || exit 1
GETTEXT=yes
else
- # What?! User is not using a recent version of gettext? We'll have to
- # cheat a bit, then.
- rm -f po/ChangeLog~
- gettextize --copy --force | grep '^from the' | cut -f3 -d' '
- test -f po/ChangeLog~ && mv -f po/ChangeLog~ po/ChangeLog
- # Yuck!
+ # User's gettext is too old. try to continue anyway.
mkdir -p intl
- test -f intl/Makefile.am || echo > intl/Makefile.am
- # Yuck!
+ echo > intl/Makefile.am
echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/oldgettext.m4
GETTEXT=old
fi;else
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
+dnl
dnl Gettext stuff
+dnl
ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
AM_GNU_GETTEXT_VERSION(0.10.40)
AM_GNU_GETTEXT
+if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
+ AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
+ INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
+fi
+AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_SUBST(BCBUILDER)
AC_SUBST(XPIDL)
AC_SUBST(LIBEXT)
+AC_SUBST(INCLUDES)
AC_SUBST(CFLAGS_TUNING)
AC_SUBST(CFLAGS_OPTIM)
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.29 2002/10/11 22:32:55 sam Exp $
+ * $Id: vlc_common.h,v 1.30 2002/10/16 15:10:39 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
/*****************************************************************************
* I18n stuff
*****************************************************************************/
-#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT ) && !defined( __BORLANDC__ ) && !defined( NEED_GNOMESUPPORT_H )
+#if defined( ENABLE_NLS ) \
+ && ( defined(HAVE_GETTEXT) || defined(HAVE_INCLUDED_GETTEXT) )
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.41 2002/10/15 12:30:00 sam Exp $
+ * $Id: libvlc.c,v 1.42 2002/10/16 15:10:39 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*****************************************************************************/
static void SetLanguage ( char const *psz_lang )
{
-#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
-# if defined( HAVE_LOCALE_H ) && defined( HAVE_LC_MESSAGES )
- if( !setlocale( LC_MESSAGES, psz_lang ) )
+#if defined( ENABLE_NLS ) \
+ && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
+
+# if defined( HAVE_INCLUDED_GETTEXT ) && !defined( HAVE_LC_MESSAGES )
+ if( *psz_lang )
{
- fprintf( stderr, "warning: unsupported locale settings\n" );
+ /* We set LC_ALL manually because it is the only way to set
+ * the language at runtime under eg. Windows. Beware that this
+ * makes the environment unconsistent when libvlc is unloaded and
+ * should probably be moved to a safer place like vlc.c. */
+ static char psz_lcall[20];
+ snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
+ psz_lcall[19] = '\0';
+ putenv( psz_lcall );
}
+# endif
- setlocale( LC_CTYPE, psz_lang );
+# if defined( HAVE_LC_MESSAGES )
+ setlocale( LC_MESSAGES, psz_lang );
# endif
+ setlocale( LC_CTYPE, psz_lang );
+ /* Specify where to find the locales for current domain */
if( !bindtextdomain( PACKAGE, LOCALEDIR ) )
{
fprintf( stderr, "warning: no domain %s in directory %s\n",
PACKAGE, LOCALEDIR );
}
+ /* Set the default domain */
textdomain( PACKAGE );
#endif
}