Commits

Yevgen Muntyan committed 4779e8d

Got rid of intltool.m4

Comments (0)

Files changed (12)

 	$(MAKE) $(AM_MAKEFLAGS) install
 	$(MEDIT_INNO_COMPILER) plat/win32/installer.iss
 endif
+
+@MOO_PO_SUBDIRS_RULE@
 
 # run_cmd libtoolize --copy --force
 
-run_cmd intltoolize --copy --force
-echo "sed -e s/@GETTEXT_PACKAGE@/@GETTEXT_PACKAGE@-gsv/ po/Makefile.in.in > po-gsv/Makefile.in.in"
-sed -e s/@GETTEXT_PACKAGE@/@GETTEXT_PACKAGE@-gsv/ po/Makefile.in.in > po-gsv/Makefile.in.in || exit $!
-
 run_cmd $ACLOCAL --force -I m4 $ACLOCAL_FLAGS
 run_cmd $AUTOCONF --force
 run_cmd $AUTOHEADER --force
 MOO_SESSION_FILE_NAME="medit.session"
 
 AC_SUBST(GETTEXT_PACKAGE,$MOO_PACKAGE_NAME)
+AC_SUBST(GETTEXT_PACKAGE_GSV,"$MOO_PACKAGE_NAME-gsv")
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[GETTEXT_PACKAGE])
-AM_GLIB_GNU_GETTEXT
-IT_PROG_INTLTOOL
-IT_PO_SUBDIR([po-gsv])
+MOO_INTL
 
 AC_PROG_CC
 AC_PROG_CXX
 AC_CONFIG_FILES([
   Makefile
   doc/Makefile
-  po/Makefile.in
-  po-gsv/Makefile.in
   moo/Makefile
+  po/Makefile
+  po-gsv/Makefile
 ])
 AC_OUTPUT
 
   if $GDK_X11; then
     _moo_x_pkgs=
-    PKG_CHECK_EXISTS(x11,[_moo_x_pkgs="$_moo_x_pkgs x11"],[:])
-    PKG_CHECK_EXISTS(xext,[_moo_x_pkgs="$_moo_x_pkgs xext"],[:])
-    PKG_CHECK_EXISTS(xrender,[_moo_x_pkgs="$_moo_x_pkgs xrender"],[:])
-    PKG_CHECK_EXISTS(ice,[_moo_x_pkgs="$_moo_x_pkgs ice"],[:])
+    m4_foreach([_pkg_],[x11, xext, xrender, ice, sm],[
+      PKG_CHECK_EXISTS(_pkg_,[_moo_x_pkgs="$_moo_x_pkgs _pkg_"],[:])
+    ])
     if test -n "$_moo_x_pkgs"; then
       PKG_CHECK_MODULES(X,[$_moo_x_pkgs])
       MOO_CFLAGS="$MOO_CFLAGS $X_CFLAGS"

m4/moo-intltool.m4

+AC_DEFUN([_MOO_INTLTOOL],[
+  AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
+  AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
+  AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
+  if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
+    AC_MSG_ERROR([The intltool scripts were not found. Please install intltool or use --disable-nls to ignore.])
+  fi
+  AC_SUBST(MOO_INTLTOOL_INI_DEPS,'$(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po)')
+  AC_SUBST(MOO_INTLTOOL_INI_CMD,'$(AM''_V_GEN)LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@')
+])
+
+AC_DEFUN([_MOO_INTLTOOL_NO_NLS],[
+  AC_SUBST(MOO_INTLTOOL_INI_DEPS,'')
+  AC_SUBST(MOO_INTLTOOL_INI_CMD,'$(AM''_V_GEN)sed -e "s/^_//g" $< > [$]@.tmp && mv [$]@.tmp [$]@')
+])
+
+AC_DEFUN([MOO_INTL],[
+  AM_GLIB_GNU_GETTEXT
+  AC_REQUIRE([AM_NLS])
+  if test "$USE_NLS" = "yes"; then
+    _MOO_INTLTOOL
+  else
+    _MOO_INTLTOOL_NO_NLS
+  fi
+  AC_SUBST(MOO_PO_SUBDIRS_RULE,'$(top_srcdir)/po-gsv/Makefile.am: $(top_srcdir)/po/Makefile.am ; sed -e "s/GETTEXT_PACKAGE/GETTEXT_PACKAGE_GSV/g" $(top_srcdir)/po/Makefile.am > $(top_srcdir)/po-gsv/Makefile.am.tmp && mv $(top_srcdir)/po-gsv/Makefile.am.tmp $(top_srcdir)/po-gsv/Makefile.am')
+])

moo/medit-app/Makefile.incl

 if MOO_OS_UNIX
 desktopdir = $(datadir)/applications
 desktop_DATA = medit-app/medit.desktop
-medit-app/medit.desktop: medit-app/medit.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po)
+medit-app/medit.desktop: medit-app/medit.desktop.in @MOO_INTLTOOL_INI_DEPS@
 	$(AM_V_at)$(MKDIR_P) medit-app
-	$(AM_V_GEN)LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+	@MOO_INTLTOOL_INI_CMD@
 CLEANFILES += medit-app/medit.desktop
 endif MOO_OS_UNIX
 

po-gsv/Makefile.am

+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE_GSV) --dist
+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE_GSV) --pot
+LINGUAS  = $(shell grep -v "^\#" $(srcdir)/LINGUAS)
+POFILES  = $(shell LINGUAS="$(LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+CATALOGS = $(shell LINGUAS="$(LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+EXTRA_DIST = LINGUAS POTFILES.in POTFILES.skip $(POFILES)
+
+SUFFIXES: .po .gmo .mo
+
+.po.mo:
+	$(AM_V_GEN)$(MSGFMT) -o $@ $<
+
+.po.gmo:
+	$(AM_V_GEN)file=`echo $* | sed 's,.*/,,'`.gmo \
+	  && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+all: all-catalogs-@USE_NLS@
+all-catalogs-yes: $(CATALOGS)
+all-catalogs-no:
+$(CATALOGS): $(srcdir)/Makefile.am
+
+install: install-catalogs
+install-catalogs: install-catalogs-@USE_NLS@
+install-catalogs-no: all
+install-catalogs-yes: all
+	linguas="$(LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE_GSV).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE_GSV).mo"; \
+	  else \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE_GSV).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE_GSV).mo"; \
+	  fi; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE_GSV).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE_GSV).mo.m"; \
+	  else \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE_GSV).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE_GSV).mo.m"; \
+	    else \
+	      true; \
+	    fi; \
+	  fi; \
+	done
+
+uninstall:
+	linguas="$(LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE_GSV).mo; \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE_GSV).mo.m; \
+	done
+
+CLEANFILES = .intltool-merge-cache *.mo *.gmo POTFILES

po-gsv/POTFILES.skip

 build/
+plat/
+tools/
 
 doc/
 moo/medit-app/

po/ChangeLog

Empty file removed.
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+LINGUAS  = $(shell grep -v "^\#" $(srcdir)/LINGUAS)
+POFILES  = $(shell LINGUAS="$(LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+CATALOGS = $(shell LINGUAS="$(LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+EXTRA_DIST = LINGUAS POTFILES.in POTFILES.skip $(POFILES)
+
+SUFFIXES: .po .gmo .mo
+
+.po.mo:
+	$(AM_V_GEN)$(MSGFMT) -o $@ $<
+
+.po.gmo:
+	$(AM_V_GEN)file=`echo $* | sed 's,.*/,,'`.gmo \
+	  && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+all: all-catalogs-@USE_NLS@
+all-catalogs-yes: $(CATALOGS)
+all-catalogs-no:
+$(CATALOGS): $(srcdir)/Makefile.am
+
+install: install-catalogs
+install-catalogs: install-catalogs-@USE_NLS@
+install-catalogs-no: all
+install-catalogs-yes: all
+	linguas="$(LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+	  else \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
+	  fi; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+	  else \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+	    else \
+	      true; \
+	    fi; \
+	  fi; \
+	done
+
+uninstall:
+	linguas="$(LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+	done
+
+CLEANFILES = .intltool-merge-cache *.mo *.gmo POTFILES
 moo/plugins/moofileselector.c
 moo/plugins/moofileselector-prefs.c
 moo/plugins/moofind.c
+moo/plugins/mooluaplugin.cpp
 moo/plugins/moopython.c
 moo/plugins/usertools/exe/moocommand-exe.c
 moo/plugins/usertools/filters.xml
 build/
 junk/
+plat/
+tools/
 moo/mooedit/langs/
 moo/gtksourceview/
 moo/eggsmclient/