From 7e784e08bb0b42c8f3a7f64f331afd14b9b17da3 Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Thu, 31 Jan 2008 10:03:37 +0000 Subject: --- Makefile.am | 28 +++++++++++++++++++++++ autogen.sh | 49 +++++++++++++++++++++++++++++++++++++++++ configure.ac | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ libintl.c | 37 +++++++++++++++++++++++++++++++ libintl.h | 14 ++++++++++++ 5 files changed, 200 insertions(+) create mode 100644 Makefile.am create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 libintl.c create mode 100644 libintl.h diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..6a31590 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,28 @@ +include_HEADERS = libintl.h +lib_LTLIBRARIES = libintl.la + +libintl_la_SOURCES = \ + libintl.h \ + libintl.c + +EXTRA_DIST = \ + autogen.sh + +MAINTAINERCLEANFILES = \ + configure \ + Makefile.in \ + aclocal.m4 \ + config.guess \ + config.sub \ + config.h.in \ + ltmain.sh \ + missing \ + depcomp \ + install-sh \ + *~ \ + $(DIST_ARCHIVES) + +maintainer-clean-local: + -chmod -R a+rw $(distdir) + -rm -fr $(distdir) + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..49376b4 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# +# usage: +# +# banner +# +banner() { + echo + TG=`echo $1 | sed -e "s,/.*/,,g"` + LINE=`echo $TG |sed -e "s/./-/g"` + echo $LINE + echo $TG + echo $LINE + echo +} + + +ACLOCAL=${ACLOCAL:=aclocal} +AUTOHEADER=${AUTOHEADER:=autoheader} +AUTOMAKE=${AUTOMAKE:=automake} +AUTOCONF=${AUTOCONF:=autoconf} + +#$ACLOCAL --version | \ +# awk -vPROG="aclocal" -vVERS=1.7\ +# '{if ($1 == PROG) {gsub ("-.*","",$4); if ($4 < VERS) print PROG" < version "VERS"\nThis may result in errors\n"}}' + +#$AUTOMAKE --version | \ +# awk -vPROG="automake" -vVERS=1.7\ +# '{if ($1 == PROG) {gsub ("-.*","",$4); if ($4 < VERS) print PROG" < version "VERS"\nThis may result in errors\n"}}' + + +banner "running libtoolize" +libtoolize --force --copy || exit + +banner "running aclocal" +$ACLOCAL --warnings=syntax || exit + +banner "running autoheader" +$AUTOHEADER || exit + +banner "running automake" +$AUTOMAKE --gnu --add-missing -c --warnings=portability,syntax || exit + +banner "running autoconf" +$AUTOCONF --warnings=cross,syntax || exit + +banner "Finished" + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..6aa96f2 --- /dev/null +++ b/configure.ac @@ -0,0 +1,72 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.61) +AC_INIT([gettext-dummy], [0.0.0], [bugs@pengutronix.de]) +AC_CONFIG_SRCDIR([libintl.h]) +AC_CONFIG_HEADER([config.h]) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +AM_MAINTAINER_MODE + +CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wfloat-equal -Wformat-security" + +# +# libtool library versioning stuff +# +# Library code modified: REVISION++ +# Interfaces changed/added/removed: CURRENT++ REVISION=0 +# Interfaces added: AGE++ +# Interfaces removed: AGE=0 +LT_CURRENT=1 +LT_REVISION=0 +LT_AGE=0 +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) + +# +# Checks for programs. +# +AC_PROG_CC +AC_PROG_LIBTOOL + +AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2]) + +# +# Checks for libraries. +# + +# +# Checks for header files. +# + +# +# Checks for typedefs, structures, and compiler characteristics. +# +AC_C_CONST + +# +# Debugging +# +AC_MSG_CHECKING([whether to enable debugging]) +AC_ARG_ENABLE(debug, + AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=yes@:>@]), + [case "$enableval" in + y | yes) CONFIG_DEBUG=yes ;; + *) CONFIG_DEBUG=no ;; + esac], + [CONFIG_DEBUG=yes]) +AC_MSG_RESULT([${CONFIG_DEBUG}]) +if test "${CONFIG_DEBUG}" = "yes"; then + CFLAGS="${CFLAGS} -g -O1" + AC_DEFINE(DEBUG, 1, [debugging]) +else + CFLAGS="${CFLAGS} -Werror -O2" +fi + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + diff --git a/libintl.c b/libintl.c new file mode 100644 index 0000000..f8c90b2 --- /dev/null +++ b/libintl.c @@ -0,0 +1,37 @@ +/* Dummy gettext library */ + +char * +gettext(char *msg) +{ + return msg; +} + +char * +dgettext(const char *domain, char *msg) +{ + return msg; +} + +char * +dcgettext(const char *domain, char *msg, int category) +{ + return msg; +} + +char * +ngettext(char *msg, char *msg_plural, unsigned long int n) +{ + return n == 1 ? msg : msg_plural; +} + +char * +dngettext(const char *domain, char *msg, char *msg_plural, unsigned long int n) +{ + return n == 1 ? msg : msg_plural; +} + +char * +dcngettext(const char *domain, char *msg, char *msg_plural, unsigned long int n, int category) +{ + return n == 1 ? msg : msg_plural; +} diff --git a/libintl.h b/libintl.h new file mode 100644 index 0000000..e3de736 --- /dev/null +++ b/libintl.h @@ -0,0 +1,14 @@ +/* Dummy gettext library */ + +#ifndef _LIBINTL_H +#define _LIBINTL_H + +#define gettext(msg) (msg) +#define dgettext(domain,msg) (msg) +#define dcgettext(domain,msg,category) (msg) + +#define ngettext(msg,pmsg,n) ((n == 1) ? (msg) : (pmsg)) +#define dngettext(domain,msg,pmsg,n) ((n == 1) ? (msg) : (pmsg)) +#define dcngettext(domain,msg,pmsg,n,category) ((n == 1) ? (msg) : (pmsg)) + +#endif -- cgit v1.2.3