Alexandre Julliard : makedep: Generate dependencies for mo files when supported.

Alexandre Julliard julliard at winehq.org
Tue Jan 14 13:44:59 CST 2014


Module: wine
Branch: master
Commit: ab4fc685ba7c035dff91b8c486a95882eaa8dc4e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ab4fc685ba7c035dff91b8c486a95882eaa8dc4e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jan 14 11:49:42 2014 +0100

makedep: Generate dependencies for mo files when supported.

---

 Make.vars.in    |    2 --
 configure       |    7 ++----
 configure.ac    |    5 ++--
 tools/makedep.c |   69 +++++++++++++++++++++++++++++--------------------------
 4 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/Make.vars.in b/Make.vars.in
index 1a1aae9..61c2016 100644
--- a/Make.vars.in
+++ b/Make.vars.in
@@ -49,8 +49,6 @@ ICOTOOL         = @ICOTOOL@
 MSGFMT          = @MSGFMT@
 CROSSTARGET     = @CROSSTARGET@
 LINGUAS         = @LINGUAS@
-ALL_MO_FILES    = $(LINGUAS:%=@top_builddir@/po/%.mo)
-PORCFLAGS       = @PORCFLAGS@
 RUNTESTFLAGS    = -q -P wine
 MAKEDEP         = $(TOOLSDIR)/tools/makedep$(TOOLSEXT)
 SFNT2FNT        = $(TOOLSDIR)/tools/sfnt2fnt$(TOOLSEXT)
diff --git a/configure b/configure
index 7255985..6e6488e 100755
--- a/configure
+++ b/configure
@@ -624,7 +624,6 @@ ac_includes_default="\
 
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
-PORCFLAGS
 LINGUAS
 LDAPLIBS
 LIBRT
@@ -17383,11 +17382,9 @@ fi
 
 if test "$MSGFMT" != false
 then
-    PORCFLAGS="--po-dir=\$(top_builddir)/po"
-
-    wine_fn_append_rule "__builddeps__: \$(ALL_MO_FILES)
+    wine_fn_append_rule "__builddeps__: \$(LINGUAS:%=po/%.mo)
 clean::
-	\$(RM) \$(ALL_MO_FILES)"
+	\$(RM) \$(LINGUAS:%=po/%.mo)"
 
     posrc="po"
     test "$srcdir" = . || posrc="$srcdir/po"
diff --git a/configure.ac b/configure.ac
index dcabb55..c60d870 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3445,11 +3445,10 @@ fi
 
 if test "$MSGFMT" != false
 then
-    AC_SUBST([PORCFLAGS],["--po-dir=\$(top_builddir)/po"])
     WINE_APPEND_RULE(
-[__builddeps__: \$(ALL_MO_FILES)
+[__builddeps__: \$(LINGUAS:%=po/%.mo)
 clean::
-	\$(RM) \$(ALL_MO_FILES)])
+	\$(RM) \$(LINGUAS:%=po/%.mo)])
 
     posrc="po"
     test "$srcdir" = . || posrc="$srcdir/po"
diff --git a/tools/makedep.c b/tools/makedep.c
index c7512a8..108cdb0 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1408,6 +1408,7 @@ static struct strarray output_sources(void)
     struct strarray res_files = empty_strarray;
     struct strarray clean_files = empty_strarray;
     struct strarray po_files = empty_strarray;
+    struct strarray mo_files = empty_strarray;
     struct strarray mc_files = empty_strarray;
     struct strarray test_files = empty_strarray;
     struct strarray dlldata_files = empty_strarray;
@@ -1415,6 +1416,7 @@ static struct strarray output_sources(void)
     struct strarray implib_objs = empty_strarray;
     struct strarray includes = empty_strarray;
     struct strarray phony_targets = empty_strarray;
+    struct strarray linguas = get_expanded_make_var_array( "LINGUAS" );
     struct strarray all_targets = get_expanded_make_var_array( "PROGRAMS" );
     struct strarray targetflags = get_expanded_make_var_array( "TARGETFLAGS" );
     struct strarray delayimports = get_expanded_make_var_array( "DELAYIMPORTS" );
@@ -1429,6 +1431,9 @@ static struct strarray output_sources(void)
     if (module && strendswith( module, ".a" )) staticlib = module;
     for (i = 0; i < extradllflags.count; i++) if (!strcmp( extradllflags.str[i], "-m16" )) is_win16 = 1;
 
+    for (i = 0; i < linguas.count; i++)
+        strarray_add( &mo_files, strmake( "%s/po/%s.mo", top_obj_dir, linguas.str[i] ));
+
     strarray_add( &includes, "-I." );
     if (src_dir) strarray_add( &includes, strmake( "-I%s", src_dir ));
     if (parent_dir) strarray_add( &includes, strmake( "-I%s", src_dir_path( parent_dir )));
@@ -1491,47 +1496,47 @@ static struct strarray output_sources(void)
         }
         else if (!strcmp( ext, "rc" ))  /* resource file */
         {
-            if (source->flags & FLAG_RC_PO)
+            strarray_add( &res_files, strmake( "%s.res", obj ));
+            output( "%s.res: %s %s\n", obj, tools_path( "wrc" ), source->filename );
+            if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
+            output( "\t%s -o $@ %s", tools_path( "wrc" ), source->filename );
+            if (is_win16) output_filename( "-m16" );
+            else output_filenames( targetflags );
+            output_filename( "--nostdinc" );
+            output_filenames( includes );
+            output_filenames( define_args );
+            output_filenames( extradefs );
+            if (mo_files.count && (source->flags & FLAG_RC_PO))
             {
-                output( "%s.res: %s $(ALL_MO_FILES) %s\n", obj, tools_path( "wrc" ), source->filename );
-                if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
-                output( "\t%s -o $@ %s", tools_path( "wrc" ), source->filename );
-                if (is_win16) output_filename( "-m16" );
-                else output_filenames( targetflags );
-                output_filename( "--nostdinc" );
-                output_filenames( includes );
-                output_filenames( define_args );
-                output_filenames( extradefs );
-                output_filename( "$(PORCFLAGS)" );
-                output( "\n" );
-                output( "%s.res rsrc.pot:", obj );
                 strarray_add( &po_files, source->filename );
-            }
-            else
-            {
-                output( "%s.res: %s %s\n", obj, tools_path( "wrc" ), source->filename );
-                if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
-                output( "\t%s -o $@ %s", tools_path( "wrc" ), source->filename );
-                if (is_win16) output_filename( "-m16" );
-                else output_filenames( targetflags );
-                output_filename( "--nostdinc" );
-                output_filenames( includes );
-                output_filenames( define_args );
-                output_filenames( extradefs );
-                output_filename( "$(PORCFLAGS)" );
+                output_filename( strmake( "--po-dir=%s/po", top_obj_dir ));
                 output( "\n" );
                 output( "%s.res:", obj );
+                output_filenames( mo_files );
+                output( "\n" );
+                output( "rsrc.pot " );
             }
-            strarray_add( &res_files, strmake( "%s.res", obj ));
+            else output( "\n" );
+            output( "%s.res:", obj );
         }
         else if (!strcmp( ext, "mc" ))  /* message file */
         {
-            output( "%s.res: %s $(ALL_MO_FILES) %s\n", obj, tools_path( "wmc" ), source->filename );
-            if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
-            output( "\t%s -U -O res $(PORCFLAGS) -o $@ %s\n", tools_path( "wmc" ), source->filename );
             strarray_add( &res_files, strmake( "%s.res", obj ));
-            strarray_add( &mc_files, source->filename );
-            output( "msg.pot %s.res:", obj );
+            output( "%s.res: %s %s\n", obj, tools_path( "wmc" ), source->filename );
+            if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
+            output( "\t%s -U -O res -o $@ %s", tools_path( "wmc" ), source->filename );
+            if (mo_files.count)
+            {
+                strarray_add( &mc_files, source->filename );
+                output_filename( strmake( "--po-dir=%s/po", top_obj_dir ));
+                output( "\n" );
+                output( "%s.res:", obj );
+                output_filenames( mo_files );
+                output( "\n" );
+                output( "msg.pot " );
+            }
+            else output( "\n" );
+            output( "%s.res:", obj );
         }
         else if (!strcmp( ext, "idl" ))  /* IDL file */
         {




More information about the wine-cvs mailing list