summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:59:33 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:59:33 +0000
commit809484570008da67b0dcd291af7673481fff52f6 (patch)
tree31609d2257d09f9fc20bdc550982f700223bf781
parent89409d33dc8d3156d089f4f90a02b39a04a9d952 (diff)
gettext stuff
Author: jgg Date: 2002-10-16 05:24:02 GMT gettext stuff
-rw-r--r--Makefile1
-rw-r--r--buildlib/apti18n.h.in9
-rw-r--r--buildlib/defaults.mak6
-rw-r--r--buildlib/environment.mak.in12
-rw-r--r--buildlib/library.mak8
-rw-r--r--buildlib/program.mak3
-rw-r--r--configure.in15
-rw-r--r--methods/makefile4
8 files changed, 50 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 2a88c1bb1..72cac61b5 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@ all headers library clean veryclean binary program doc dirs:
$(MAKE) -C ftparchive $@
$(MAKE) -C dselect $@
$(MAKE) -C doc $@
+ $(MAKE) -C po $@
# Some very common aliases
.PHONY: maintainer-clean dist-clean distclean pristine sanity
diff --git a/buildlib/apti18n.h.in b/buildlib/apti18n.h.in
index 49c5b0cd4..9bdd6bbca 100644
--- a/buildlib/apti18n.h.in
+++ b/buildlib/apti18n.h.in
@@ -1,5 +1,5 @@
// -*- mode: cpp; mode: fold -*-
-// $Id: apti18n.h.in,v 1.3 2002/01/09 04:16:33 jgg Exp $
+// $Id: apti18n.h.in,v 1.4 2002/10/16 05:24:02 jgg Exp $
/* Internationalization macros for apt. This header should be included last
in each C file. */
@@ -10,10 +10,13 @@
#if USE_NLS==yes && USE_INCLUDED_LIBINTL==no
// apt will use the gettext implementation of the C library
# include <libintl.h>
-# define _(x) gettext(x)
+# ifdef DOMAIN
+# define _(x) dgettext(DOMAIN,x)
+# else
+# define _(x) gettext(x)
+# endif
#else
// apt will not use any gettext
# define setlocale(a, b)
-# define textdomain(a)
# define _(x) x
#endif
diff --git a/buildlib/defaults.mak b/buildlib/defaults.mak
index 3ecf4ba27..4d05e5eaf 100644
--- a/buildlib/defaults.mak
+++ b/buildlib/defaults.mak
@@ -70,6 +70,9 @@ LIB := $(BIN)
OBJ := $(BUILD)/obj/$(SUBDIR)
DEP := $(OBJ)
DOC := $(BUILD)/docs
+PO := $(BUILD)/po
+LOCALE := $(BUILD)/locale
+PO_DOMAINS := $(BUILD)/po/domains
# Module types
LIBRARY_H = $(BASE)/buildlib/library.mak
@@ -81,6 +84,7 @@ COPY_H = $(BASE)/buildlib/copy.mak
YODL_MANPAGE_H = $(BASE)/buildlib/yodl_manpage.mak
SGML_MANPAGE_H = $(BASE)/buildlib/sgml_manpage.mak
FAIL_H = $(BASE)/buildlib/fail.mak
+PODOMAIN_H = $(BASE)/buildlib/podomain.mak
include $(BUILD)/environment.mak
@@ -109,7 +113,7 @@ CPPFLAGS+= -I$(INCLUDE)
LDFLAGS+= -L$(LIB)
# Directors to create
-MKDIRS := $(BIN)
+MKDIRS := $(BIN)
# Phony rules. Other things hook these by appending to the dependency
# list
diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
index eab60c1bc..bf676e643 100644
--- a/buildlib/environment.mak.in
+++ b/buildlib/environment.mak.in
@@ -1,6 +1,8 @@
# This file contains everything that autoconf guessed for your system.
# if you want you can edit it, just don't re-run configure.
+PACKAGE = @PACKAGE@
+
# C++ compiler options
CC = @CC@
CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT
@@ -31,6 +33,16 @@ NSGMLS = @NSGMLS@
SGMLSPL = @SGMLSPL@
DOCBOOK2MAN := $(wildcard /usr/lib/perl5/sgmlspl-specs/docbook2man-spec.pl)
+# Gettext settings
+GMSGFMT = @GMSGFMT@
+XGETTEXT = @XGETTEXT@
+MSGCOMM:=$(dir $(XGETTEXT))/msgcomm
+MSGMERGE:=$(dir $(XGETTEXT))/msgmerge
+CATALOGS = @CATALOGS@
+USE_NLS = @USE_NLS@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+BASH = @BASH@
+
# Various library checks
PTHREADLIB = @PTHREADLIB@
PYTHONLIB = @PYTHONLIB@
diff --git a/buildlib/library.mak b/buildlib/library.mak
index fb944cfbc..9f8b78541 100644
--- a/buildlib/library.mak
+++ b/buildlib/library.mak
@@ -8,6 +8,7 @@
# $(LIBRARY) - The name of the library without lib or .so
# $(MAJOR) - The major version number of this library
# $(MINOR) - The minor version number of this library
+# $(DOMAIN) - The text domain for this library
# All output is writtin to .opic files in the build directory to
# signify the PIC output.
@@ -23,6 +24,9 @@ $(LOCAL)-SONAME := lib$(LIBRARY)$(LIBEXT).so.$(MAJOR)
$(LOCAL)-SLIBS := $(SLIBS)
$(LOCAL)-LIBRARY := $(LIBRARY)
+TYPE = src
+include $(PODOMAIN_H)
+
# Install the command hooks
headers: $($(LOCAL)-HEADERS)
library: $(LIB)/lib$(LIBRARY).so $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR)
@@ -45,7 +49,7 @@ $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR): $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MA
ln -sf $(<F) $@
$(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR)
ln -sf $(<F) $@
-
+
# The binary build rule
$(LIB)/lib$(LIBRARY)$(LIBEXT).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
-rm -f $(LIB)/lib$($(@F)-LIBRARY)*.so* 2> /dev/null
@@ -66,4 +70,4 @@ $(OBJ)/%.opic: %.cc
The_DFiles = $(wildcard $($(LOCAL)-DEP))
ifneq ($(words $(The_DFiles)),0)
include $(The_DFiles)
-endif
+endif
diff --git a/buildlib/program.mak b/buildlib/program.mak
index a89dc5ea1..e0e76316c 100644
--- a/buildlib/program.mak
+++ b/buildlib/program.mak
@@ -24,6 +24,9 @@ program: $(BIN)/$(PROGRAM)
clean: clean/$(LOCAL)
veryclean: veryclean/$(LOCAL)
+TYPE = src
+include $(PODOMAIN_H)
+
# Make Directories
MKDIRS += $(OBJ) $(DEP) $(BIN)
diff --git a/configure.in b/configure.in
index ca79cb8b8..541232587 100644
--- a/configure.in
+++ b/configure.in
@@ -17,8 +17,10 @@ AC_CONFIG_AUX_DIR(buildlib)
AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.5.4")
-AC_DEFINE_UNQUOTED(PACKAGE,"apt")
+AC_DEFINE_UNQUOTED(VERSION,"")
+PACKAGE="apt"
+AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
+AC_SUBST(PACKAGE)
dnl Check the archs, we want the target type.
AC_CANONICAL_SYSTEM
@@ -163,4 +165,13 @@ rc_GLIBC_VER
rc_LIBSTDCPP_VER
ah_GCC3DEP
+dnl FIXME: There is no reason for this bit to do all the configure tests it
+dnl ends up doing. Maybe replace it with a simple AC_CHECK_HEADER and
+dnl AC_PATH_PROG.
+ALL_LINGUAS="da de en_GB es fr hu it nl no_NO pl pt_BR ru sv zh_TW"
+AM_GNU_GETTEXT
+AC_DEFINE_UNQUOTED(USE_NLS, $USE_NLS)
+AC_DEFINE_UNQUOTED(USE_INCLUDED_LIBINTL, $USE_INCLUDED_LIBINTL)
+AC_PATH_PROG(BASH, bash)
+
AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make -s dirs)
diff --git a/methods/makefile b/methods/makefile
index 80f749255..dcdb0dc46 100644
--- a/methods/makefile
+++ b/methods/makefile
@@ -6,6 +6,10 @@ SUBDIR=methods
include ../buildlib/defaults.mak
BIN := $(BIN)/methods
+# FIXME..
+LIB_APT_PKG_MAJOR = 3.3
+DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR)
+
# The file method
PROGRAM=file
SLIBS = -lapt-pkg