File gcc44-textdomain.patch of Package cross-armv7hl-gcc48-icecream-backend

#! /bin/sh -e

# DP: Set gettext's domain and textdomain to the versioned package name.

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0


Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in.orig	2012-12-11 12:53:28.687076548 +0100
+++ gcc/Makefile.in	2012-12-11 12:53:28.872076540 +0100
@@ -5283,8 +5283,8 @@ install-po:
 	  dir=$(localedir)/$$lang/LC_MESSAGES; \
 	  echo $(mkinstalldirs) $(DESTDIR)$$dir; \
 	  $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
-	  echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
-	  $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
+	  echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-4.8.mo; \
+	  $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-4.8.mo; \
 	done
 
 # Rule for regenerating the message template (gcc.pot).
Index: gcc/intl.c
===================================================================
--- gcc/intl.c.orig	2012-08-20 15:49:12.000000000 +0200
+++ gcc/intl.c	2012-12-11 12:53:28.873076541 +0100
@@ -56,8 +56,8 @@ gcc_init_libintl (void)
   setlocale (LC_ALL, "");
 #endif
 
-  (void) bindtextdomain ("gcc", LOCALEDIR);
-  (void) textdomain ("gcc");
+  (void) bindtextdomain ("gcc-4.8", LOCALEDIR);
+  (void) textdomain ("gcc-4.8");
 
   /* Opening quotation mark.  */
   open_quote = _("`");
Index: libcpp/Makefile.in
===================================================================
--- libcpp/Makefile.in.orig	2012-12-11 12:19:46.000000000 +0100
+++ libcpp/Makefile.in	2012-12-11 12:53:28.873076541 +0100
@@ -49,6 +49,7 @@ LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 PACKAGE = @PACKAGE@
+PACKAGE_SUFFIX = -4.8
 RANLIB = @RANLIB@
 SHELL = @SHELL@
 USED_CATALOGS = @USED_CATALOGS@
@@ -73,8 +74,10 @@ INCLUDES = -I$(srcdir) -I. -I$(srcdir)/.
 	-I$(srcdir)/include
 
 ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
+ALL_CFLAGS += -DPACKAGE_SUFFIX=\"$(strip $(PACKAGE_SUFFIX))\"
 ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \
 	$(CPPFLAGS)
+ALL_CXXFLAGS += -DPACKAGE_SUFFIX=\"$(strip $(PACKAGE_SUFFIX))\"
 
 # The name of the compiler to use.
 COMPILER = $(CXX)
@@ -163,8 +166,8 @@ install-strip install: all installdirs
 	  else continue; \
 	  fi; \
 	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
-	  $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+	  echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; \
+	  $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; \
 	done
 
 mostlyclean:
Index: libcpp/system.h
===================================================================
--- libcpp/system.h.orig	2012-01-04 13:11:36.000000000 +0100
+++ libcpp/system.h	2012-12-11 12:53:28.873076541 +0100
@@ -281,7 +281,7 @@ extern int errno;
 #endif
 
 #ifndef _
-# define _(msgid) dgettext (PACKAGE, msgid)
+# define _(msgid) dgettext (PACKAGE PACKAGE_SUFFIX, msgid)
 #endif
 
 #ifndef N_
Index: libcpp/init.c
===================================================================
--- libcpp/init.c.orig	2012-11-28 10:37:05.000000000 +0100
+++ libcpp/init.c	2012-12-11 12:53:28.873076541 +0100
@@ -146,7 +146,7 @@ init_library (void)
       init_trigraph_map ();
 
 #ifdef ENABLE_NLS
-       (void) bindtextdomain (PACKAGE, LOCALEDIR);
+       (void) bindtextdomain (PACKAGE PACKAGE_SUFFIX, LOCALEDIR);
 #endif
     }
 }
openSUSE Build Service is sponsored by