summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2009-09-21 22:51:18 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2009-09-21 22:51:18 +0800
commit094fd5ac0e0135d14e9a2a0d5bb225e64d2e98d9 (patch)
treed8bdbcb0041c7f8ff71172dd630b07879ff70bb8
parent610527290fd6c62fa0bde764cdb353ec60eb44c6 (diff)
build: update to lastest gstreamer plugins build system
-rw-r--r--.gitmodules3
-rw-r--r--Makefile.am2
-rwxr-xr-xautogen.sh60
-rwxr-xr-xautoregen.sh2
m---------common0
-rw-r--r--config.h.in42
-rw-r--r--configure.ac121
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/as-compiler-flag.m425
-rw-r--r--m4/as-version.m466
-rwxr-xr-xmkinstalldirs111
-rw-r--r--src/Makefile.am4
-rw-r--r--src/gettext.h69
-rw-r--r--src/gst-i18n-plugin.h37
14 files changed, 243 insertions, 301 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..a6b1eda
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "common"]
+ path = common
+ url = git://anongit.freedesktop.org/gstreamer/common
diff --git a/Makefile.am b/Makefile.am
index 7203ad8..538a4b1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,3 @@
SUBDIRS = m4 src
-EXTRA_DIST = autogen.sh gst-autogen.sh
+EXTRA_DIST = autogen.sh
diff --git a/autogen.sh b/autogen.sh
index 3056ba6..8c1416c 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,34 +1,47 @@
#!/bin/sh
-# you can either set the environment variables AUTOCONF and AUTOMAKE
-# to the right versions, or leave them unset and get the RedHat 7.3 defaults
+# Run this to generate all the initial makefiles, etc.
DIE=0
package=gst-plugins-sopcast
srcfile=src/gstscsrc.c
-# autogen.sh helper functions (copied from GStreamer's common/ CVS module)
-if test ! -f ./gst-autogen.sh;
+# Make sure we have common
+if test ! -f common/gst-autogen.sh;
+then
+ echo "+ Setting up common submodule"
+ git submodule init
+fi
+git submodule update
+
+# source helper functions
+if test ! -f common/gst-autogen.sh;
then
echo There is something wrong with your source tree.
- echo You are either missing ./gst-autogen.sh or not
- echo running autogen.sh from the top-level source
- echo directory.
+ echo You are missing common/gst-autogen.sh
exit 1
fi
-. ./gst-autogen.sh
+. common/gst-autogen.sh
+
+# install pre-commit hook for doing clean commits
+if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
+then
+ rm -f .git/hooks/pre-commit
+ ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
+fi
+
-CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-debug'
+CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc --enable-plugin-docs'
autogen_options $@
echo -n "+ check for build tools"
if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
-version_check "autoconf" "$AUTOCONF autoconf autoconf259 autoconf257 autoconf-2.54 autoconf-2.53 autoconf-2.52" \
+version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \
"ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
-version_check "automake" "$AUTOMAKE automake automake-1.9 automake19 automake-1.7 automake-1.6 automake-1.5" \
+version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.7 automake-1.6 automake-1.5" \
"ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1
-###version_check "autopoint" "autopoint" \
-### "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 11 5 || DIE=1
+version_check "autopoint" "autopoint" \
+ "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
"ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
version_check "pkg-config" "" \
@@ -51,11 +64,28 @@ if test -z "$*"; then
echo " command line."
fi
-tool_run "$aclocal" "-I m4/ $ACLOCAL_FLAGS"
+toplevel_check $srcfile
+
+# autopoint
+# older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
+if test -x mkinstalldirs; then rm mkinstalldirs; fi
+# first remove patch if necessary, then run autopoint, then reapply
+if test -f po/Makefile.in.in;
+then
+ patch -p0 -R < common/gettext.patch
+fi
+tool_run "$autopoint --force"
+patch -p0 < common/gettext.patch
+
tool_run "$libtoolize" "--copy --force"
+tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
tool_run "$autoheader"
+
+# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
+echo timestamp > stamp-h.in 2> /dev/null
+
tool_run "$autoconf"
-tool_run "$automake" "-a -c"
+tool_run "$automake" "-a -c -Wno-portability"
# if enable exists, add an -enable option for each of the lines in that file
if test -f enable; then
diff --git a/autoregen.sh b/autoregen.sh
deleted file mode 100755
index 00e083f..0000000
--- a/autoregen.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-./autogen.sh --prefix=/usr $@
diff --git a/common b/common
new file mode 160000
+Subproject 709b55890b5fc1354fa867f9280e332a15cc2bf
diff --git a/config.h.in b/config.h.in
index f289af5..c2d0c3d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,17 +1,47 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
+
+/* gettext package name */
+#undef GETTEXT_PACKAGE
+
+/* GStreamer Sopcast license */
+#undef GST_LICENSE
+
+/* package name in plugins */
+#undef GST_PACKAGE_NAME
+
+/* package origin */
+#undef GST_PACKAGE_ORIGIN
+
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYCURRENT
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
-/* Define to 1 if you have the `gst_type_find_helper_for_extension' function.
- */
-#undef HAVE_GST_TYPE_FIND_HELPER_FOR_EXTENSION
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define if you have the iconv() function and it works. */
+#undef HAVE_ICONV
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -77,6 +107,9 @@
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
+/* gettext locale dir */
+#undef LOCALEDIR
+
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
@@ -102,6 +135,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* directory where plugins are located */
+#undef PLUGINDIR
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
diff --git a/configure.ac b/configure.ac
index bdc1be9..d451c54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,24 +1,32 @@
# -*- Autoconf -*-
-m4_define([gst_sopcast_major], 0)
-m4_define([gst_sopcast_minor], 0)
-m4_define([gst_sopcast_micro], 2)
-m4_define([gst_sopcast_nano], 0)
-m4_if(gst_sopcast_nano, 0,
- [m4_define(gst_sopcast_version, gst_sopcast_major.gst_sopcast_minor.gst_sopcast_micro)],
- [m4_define(gst_sopcast_version, gst_sopcast_major.gst_sopcast_minor.gst_sopcast_micro.gst_sopcast_nano)])
-AC_INIT([gst-plugins-sopcast], gst_sopcast_version)
+AC_INIT(GStreamer Sopcast Plug-in, 0.0.3,
+ http://people.freedesktop.org/~jinghua,
+ gst-plugins-sopcast)
+
+AG_GST_INIT
+
+dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
+AM_MAINTAINER_MODE
+AM_INIT_AUTOMAKE
+
+dnl define PACKAGE_VERSION_* variables
+AS_VERSION
+
+dnl check if this is a release version
+AS_NANO(GST_CVS="no", GST_CVS="yes")
dnl AC_INIT([$PACKAGE], [$VERSION])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
-dnl AM_MAINTAINER_MODE
-AM_INIT_AUTOMAKE
+dnl *** autotools stuff ****
+
+dnl allow for different autotools
+AS_AUTOTOOLS_ALTERNATE
dnl make aclocal work in maintainer mode
-AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
+AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
dnl check for tools
AC_PROG_CC
@@ -31,11 +39,12 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
-dnl Add the languages which your application supports to po/LINGUAS
-dnl GETTEXT_PACKAGE=gst-plugins-sopcast
-dnl AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name])
-dnl AC_SUBST(GETTEXT_PACKAGE)
-dnl AM_GLIB_GNU_GETTEXT
+dnl set up gettext
+dnl the version check needs to stay here because autopoint greps for it
+AM_GNU_GETTEXT_VERSION([0.17])
+AM_GNU_GETTEXT([external])
+AG_GST_GETTEXT([gst-plugins-sopcast])
+
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
@@ -55,16 +64,12 @@ AC_FUNC_FORK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset select socket strerror])
-dnl decide on error flags
-AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
-
-if test "x$GST_WALL" = "xyes"; then
- GST_ERROR="$GST_ERROR -Wall"
+dnl *** check for arguments to configure ***
- if test "x$GST_SOPCAST_CVS" = "xyes"; then
- AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
- fi
-fi
+AG_GST_ARG_DEBUG
+AG_GST_ARG_WITH_PKG_CONFIG_PATH
+AG_GST_ARG_WITH_PACKAGE_NAME
+AG_GST_ARG_WITH_PACKAGE_ORIGIN
dnl Check for pkgconfig first
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
@@ -79,66 +84,32 @@ dnl And we can also ask for the right version of gstreamer
dnl versions of gstreamer and plugins-base
GST_MAJORMINOR=0.10
-GST_REQUIRED=0.10.0
+GST_REQ=0.10.0
-PKG_CHECK_MODULES(GST, \
- gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
- HAVE_GST=yes,HAVE_GST=no)
+dnl checks for gstreamer
+dnl uninstalled is selected preferentially -- see pkg-config(1)
+AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], yes)
+AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], yes)
-dnl Give error and exit if we don't have gstreamer
-if test "x$HAVE_GST" = "xno"; then
- AC_MSG_ERROR(you need gstreamer development packages installed !)
-fi
-
-dnl append GST_ERROR cflags to GST_CFLAGS
-GST_CFLAGS="$GST_CFLAGS $GST_ERROR"
-
-dnl make GST_CFLAGS and GST_LIBS available
-AC_SUBST(GST_CFLAGS)
-AC_SUBST(GST_LIBS)
+AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
+AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
-dnl make GST_MAJORMINOR available in Makefile.am
-AC_SUBST(GST_MAJORMINOR)
-
-dnl If we need them, we can also use the base class libraries
-PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED,
- HAVE_GST_BASE=yes, HAVE_GST_BASE=no)
-
-dnl Give a warning if we don't have gstreamer libs
-dnl you can turn this into an error if you need them
-if test "x$HAVE_GST_BASE" = "xno"; then
- AC_MSG_NOTICE(no GStreamer base class libraries found (gstreamer-base-$GST_MAJORMINOR))
-fi
+dnl set license and copyright notice
+GST_LICENSE="LGPL"
+AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer Sopcast license])
+AC_SUBST(GST_LICENSE)
-dnl make _CFLAGS and _LIBS available
-AC_SUBST(GST_BASE_CFLAGS)
-AC_SUBST(GST_BASE_LIBS)
-
-saved_CFLAGS="$CFLAGS"
-saved_LIBS="$LIBS"
-CFLAGS="$CFLAGS $GST_BASE_CFLAGS"
-LIBS="$LIBS $GST_BASE_LIBS"
-
-AC_CHECK_FUNCS([gst_type_find_helper_for_extension])
-
-CFLAGS=$saved_CFLAGS
-LIBS=$saved_LIBS
-
-dnl set the plugindir where plugins should be installed
-if test "x${prefix}" = "x$HOME"; then
- sopcastdir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins"
-else
- sopcastdir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
-fi
-AC_SUBST(sopcastdir)
+dnl set location of plugin directory
+AG_GST_SET_PLUGINDIR
dnl set proper LDFLAGS for plugins
GST_SOPCAST_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
AC_SUBST(GST_SOPCAST_LDFLAGS)
-AC_SUBST(SOPCAST_LIBS)
+AC_LANG(C)
AC_OUTPUT(Makefile
m4/Makefile
+dnl po/Makefile.in
src/Makefile)
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 4a44032..1b336ac 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1 +1 @@
-EXTRA_DIST = as-version.m4 as-compiler-flag.m4
+EXTRA_DIST =
diff --git a/m4/as-compiler-flag.m4 b/m4/as-compiler-flag.m4
deleted file mode 100644
index 2f0ba19..0000000
--- a/m4/as-compiler-flag.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl as-compiler-flag.m4 0.0.1
-dnl autostars m4 macro for detection of compiler flags
-dnl
-dnl ds@schleef.org
-
-AC_DEFUN([AS_COMPILER_FLAG],
-[
- AC_MSG_CHECKING([to see if compiler understands $1])
-
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $1"
-
- AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
- CFLAGS="$save_CFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- $2
- true
- else
- $3
- true
- fi
- AC_MSG_RESULT([$flag_ok])
-])
-
diff --git a/m4/as-version.m4 b/m4/as-version.m4
deleted file mode 100644
index 0bee437..0000000
--- a/m4/as-version.m4
+++ /dev/null
@@ -1,66 +0,0 @@
-dnl as-version.m4 0.1.0
-
-dnl autostars m4 macro for versioning
-
-dnl Thomas Vander Stichele <thomas at apestaart dot org>
-
-dnl $Id: as-version.m4,v 1.2 2004-09-17 22:18:03 leroutier Exp $
-
-dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO,
-dnl ACTION-IF-NO-NANO, [ACTION-IF-NANO])
-
-dnl example
-dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
-dnl for a 0.3.2 release version
-
-dnl this macro
-dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
-dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
-dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
-dnl - executes the relevant action
-dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
-dnl as well as the little ones
-dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
-dnl maintainer mode from running ok
-dnl
-dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
-dnl if you use acconfig.h
-
-AC_DEFUN([AS_VERSION],
-[
- PACKAGE=[$1]
- [$2]_MAJOR=[$3]
- [$2]_MINOR=[$4]
- [$2]_MICRO=[$5]
- NANO=[$6]
- [$2]_NANO=$NANO
- if test "x$NANO" = "x" || test "x$NANO" = "x0";
- then
- AC_MSG_NOTICE(configuring [$1] for release)
- VERSION=[$3].[$4].[$5]
- [$2]_RELEASE=1
- dnl execute action
- ifelse([$7], , :, [$7])
- else
- AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
- VERSION=[$3].[$4].[$5].$NANO
- [$2]_RELEASE=0.`date +%Y%m%d.%H%M%S`
- dnl execute action
- ifelse([$8], , :, [$8])
- fi
-
- [$2]=$VERSION
- AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version])
- AC_SUBST([$2])
- AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version])
- AC_SUBST([$2]_RELEASE)
-
- AC_SUBST([$2]_MAJOR)
- AC_SUBST([$2]_MINOR)
- AC_SUBST([$2]_MICRO)
- AC_SUBST([$2]_NANO)
- AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
- AC_SUBST(PACKAGE)
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
- AC_SUBST(VERSION)
-])
diff --git a/mkinstalldirs b/mkinstalldirs
deleted file mode 100755
index d2d5f21..0000000
--- a/mkinstalldirs
+++ /dev/null
@@ -1,111 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case $1 in
- -h | --help | --h*) # -h for help
- echo "$usage" 1>&2
- exit 0
- ;;
- -m) # -m PERM arg
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- dirmode=$1
- shift
- ;;
- --) # stop option processing
- shift
- break
- ;;
- -*) # unknown option
- echo "$usage" 1>&2
- exit 1
- ;;
- *) # first non-opt arg
- break
- ;;
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
- 0) exit 0 ;;
-esac
-
-case $dirmode in
- '')
- if mkdir -p -- . 2>/dev/null; then
- echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- fi
- ;;
- *)
- if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
- echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- fi
- ;;
-esac
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case $pathcomp in
- -*) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- echo "chmod $dirmode $pathcomp"
- lasterr=""
- chmod "$dirmode" "$pathcomp" || lasterr=$?
-
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# End:
-# mkinstalldirs ends here
diff --git a/src/Makefile.am b/src/Makefile.am
index 47c87e5..b7bc6df 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-sopcast_LTLIBRARIES = libgstsopcastsrc.la
+plugin_LTLIBRARIES = libgstsopcastsrc.la
libgstsopcastsrc_la_SOURCES = gstscsrc.c
@@ -7,4 +7,4 @@ libgstsopcastsrc_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(SOPCAST
libgstsopcastsrc_la_LDFLAGS = $(GST_SOPCAST_LDFLAGS)
libgstsopcastsrc_la_LIBTOOLFLAGS = --tag=disable-static
-noinst_HEADERS = gstscsrc.h
+noinst_HEADERS = gstscsrc.h gst-i18n-plugin.h gettext.h
diff --git a/src/gettext.h b/src/gettext.h
new file mode 100644
index 0000000..8b262f4
--- /dev/null
+++ b/src/gettext.h
@@ -0,0 +1,69 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# define gettext(Msgid) ((const char *) (Msgid))
+# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
+# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define textdomain(Domainname) ((const char *) (Domainname))
+# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
+# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
+
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+#endif /* _LIBGETTEXT_H */
diff --git a/src/gst-i18n-plugin.h b/src/gst-i18n-plugin.h
new file mode 100644
index 0000000..2c37a61
--- /dev/null
+++ b/src/gst-i18n-plugin.h
@@ -0,0 +1,37 @@
+/* GStreamer
+ * Copyright (C) 2004 Thomas Vander Stichele <thomas@apestaart.org>
+ *
+ * gst-i18n-plugins.h: internationalization macros for the GStreamer plugins
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GST_I18N_PLUGIN_H__
+#define __GST_I18N_PLUGIN_H__
+
+#include <locale.h> /* some people need it and some people don't */
+#include "gettext.h" /* included with gettext distribution and copied */
+
+#ifndef GETTEXT_PACKAGE
+#error You must define GETTEXT_PACKAGE before including this header.
+#endif
+
+/* we want to use shorthand _() for translating and N_() for marking */
+#define _(String) dgettext (GETTEXT_PACKAGE, String)
+#define N_(String) gettext_noop (String)
+/* FIXME: if we need it, we can add Q_ as well, like in glib */
+
+#endif /* __GST_I18N_PLUGIN_H__ */