makefiles: Add a makefile for the po directory.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-03-01 14:21:01 +09:00
parent 9dc8956102
commit 0bb029f929
6 changed files with 71 additions and 118 deletions

View File

@ -70,7 +70,6 @@ CONVERT = @CONVERT@
ICOTOOL = @ICOTOOL@ ICOTOOL = @ICOTOOL@
MSGFMT = @MSGFMT@ MSGFMT = @MSGFMT@
CROSSTARGET = @CROSSTARGET@ CROSSTARGET = @CROSSTARGET@
LINGUAS = @LINGUAS@
SUBDIRS = @SUBDIRS@ SUBDIRS = @SUBDIRS@
RUNTESTFLAGS = -q -P wine RUNTESTFLAGS = -q -P wine
MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT) MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT)
@ -139,7 +138,7 @@ install-manpages:: manpages
# dependencies needed to build any dll or program # dependencies needed to build any dll or program
__tooldeps__: libs/port libs/wpp __tooldeps__: libs/port libs/wpp
__builddeps__: __tooldeps__ libs/wine include __builddeps__: __tooldeps__ libs/wine include po
.PHONY: depend dummy check test testclean crosstest __tooldeps__ __builddeps__ .PHONY: depend dummy check test testclean crosstest __tooldeps__ __builddeps__
dummy: dummy:

55
configure vendored
View File

@ -625,7 +625,6 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
WINELOADER_INSTALL WINELOADER_INSTALL
LINGUAS
ALL_VARS_RULES ALL_VARS_RULES
LDAP_LIBS LDAP_LIBS
RT_LIBS RT_LIBS
@ -1439,6 +1438,7 @@ enable_libs_port
enable_libs_wine enable_libs_wine
enable_libs_wpp enable_libs_wpp
enable_loader enable_loader
enable_po
enable_arp enable_arp
enable_aspnet_regiis enable_aspnet_regiis
enable_attrib enable_attrib
@ -6116,6 +6116,7 @@ if test "$MSGFMT" = false; then :
This is an error since --with-gettext was requested." "$LINENO" 5 ;; This is an error since --with-gettext was requested." "$LINENO" 5 ;;
esac esac
fi fi
test "$MSGFMT" = false && enable_po=${enable_po:-no}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for i386_set_ldt in -li386" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for i386_set_ldt in -li386" >&5
@ -18070,6 +18071,7 @@ wine_fn_config_makefile libs/port enable_libs_port
wine_fn_config_makefile libs/wine enable_libs_wine clean,implib,install-dev,install-lib wine_fn_config_makefile libs/wine enable_libs_wine clean,implib,install-dev,install-lib
wine_fn_config_makefile libs/wpp enable_libs_wpp wine_fn_config_makefile libs/wpp enable_libs_wpp
wine_fn_config_makefile loader enable_loader clean,install-lib wine_fn_config_makefile loader enable_loader clean,install-lib
wine_fn_config_makefile po enable_po clean
wine_fn_config_program arp enable_arp install wine_fn_config_program arp enable_arp install
wine_fn_config_program aspnet_regiis enable_aspnet_regiis install wine_fn_config_program aspnet_regiis enable_aspnet_regiis install
wine_fn_config_program attrib enable_attrib clean,install wine_fn_config_program attrib enable_attrib clean,install
@ -18174,55 +18176,6 @@ wine_fn_config_tool tools/winemaker clean,install-dev
wine_fn_config_tool tools/wmc clean,install-dev wine_fn_config_tool tools/wmc clean,install-dev
wine_fn_config_tool tools/wrc clean,install-dev wine_fn_config_tool tools/wrc clean,install-dev
LINGUAS="\
ar \
bg \
ca \
cs \
da \
de \
el \
en \
en_US \
eo \
es \
fa \
fi \
fr \
he \
hi \
hr \
hu \
it \
ja \
ko \
lt \
ml \
nb_NO \
nl \
or \
pa \
pl \
pt_BR \
pt_PT \
rm \
ro \
ru \
sk \
sl \
sr_RS@cyrillic \
sr_RS@latin \
sv \
te \
th \
tr \
uk \
wa \
zh_CN \
zh_TW"
wine_fn_append_file CONFIGURE_TARGETS "TAGS" wine_fn_append_file CONFIGURE_TARGETS "TAGS"
wine_fn_append_file CONFIGURE_TARGETS "tags" wine_fn_append_file CONFIGURE_TARGETS "tags"
@ -18257,8 +18210,6 @@ include/stamp-h.in: configure.ac aclocal.m4
@echo timestamp > \$@" @echo timestamp > \$@"
fi fi
test "$MSGFMT" != false || LINGUAS=
if test "x$enable_tools" != xno if test "x$enable_tools" != xno
then then
wine_fn_append_rule "tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status wine_fn_append_rule "tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status

View File

@ -362,6 +362,7 @@ EOF
fi fi
WINE_WARNING_WITH(gettext,[test "$MSGFMT" = false], WINE_WARNING_WITH(gettext,[test "$MSGFMT" = false],
[gettext tools not found (or too old), translations won't be built.]) [gettext tools not found (or too old), translations won't be built.])
test "$MSGFMT" = false && enable_po=${enable_po:-no}
dnl **** Check for some libraries **** dnl **** Check for some libraries ****
@ -3430,6 +3431,7 @@ WINE_CONFIG_MAKEFILE([libs/port])
WINE_CONFIG_MAKEFILE([libs/wine],,[clean,implib,install-dev,install-lib]) WINE_CONFIG_MAKEFILE([libs/wine],,[clean,implib,install-dev,install-lib])
WINE_CONFIG_MAKEFILE([libs/wpp]) WINE_CONFIG_MAKEFILE([libs/wpp])
WINE_CONFIG_MAKEFILE([loader],,[clean,install-lib]) WINE_CONFIG_MAKEFILE([loader],,[clean,install-lib])
WINE_CONFIG_MAKEFILE([po],,[clean])
WINE_CONFIG_PROGRAM(arp,,[install]) WINE_CONFIG_PROGRAM(arp,,[install])
WINE_CONFIG_PROGRAM(aspnet_regiis,,[install]) WINE_CONFIG_PROGRAM(aspnet_regiis,,[install])
WINE_CONFIG_PROGRAM(attrib,,[clean,install]) WINE_CONFIG_PROGRAM(attrib,,[clean,install])
@ -3533,54 +3535,6 @@ WINE_CONFIG_TOOL(tools/winegcc,[clean,install-dev])
WINE_CONFIG_TOOL(tools/winemaker,[clean,install-dev]) WINE_CONFIG_TOOL(tools/winemaker,[clean,install-dev])
WINE_CONFIG_TOOL(tools/wmc,[clean,install-dev]) WINE_CONFIG_TOOL(tools/wmc,[clean,install-dev])
WINE_CONFIG_TOOL(tools/wrc,[clean,install-dev]) WINE_CONFIG_TOOL(tools/wrc,[clean,install-dev])
AC_SUBST([LINGUAS],["\
ar \
bg \
ca \
cs \
da \
de \
el \
en \
en_US \
eo \
es \
fa \
fi \
fr \
he \
hi \
hr \
hu \
it \
ja \
ko \
lt \
ml \
nb_NO \
nl \
or \
pa \
pl \
pt_BR \
pt_PT \
rm \
ro \
ru \
sk \
sl \
sr_RS@cyrillic \
sr_RS@latin \
sv \
te \
th \
tr \
uk \
wa \
zh_CN \
zh_TW"])
dnl End of auto-generated output commands dnl End of auto-generated output commands
dnl Main ignore file dnl Main ignore file
@ -3629,8 +3583,6 @@ include/stamp-h.in: configure.ac aclocal.m4
@echo timestamp > \$[@]]) @echo timestamp > \$[@]])
fi fi
test "$MSGFMT" != false || LINGUAS=
if test "x$enable_tools" != xno if test "x$enable_tools" != xno
then then
WINE_APPEND_RULE( WINE_APPEND_RULE(

46
po/Makefile.in Normal file
View File

@ -0,0 +1,46 @@
PO_SRCS = \
ar.po \
bg.po \
ca.po \
cs.po \
da.po \
de.po \
el.po \
en.po \
en_US.po \
eo.po \
es.po \
fa.po \
fi.po \
fr.po \
he.po \
hi.po \
hr.po \
hu.po \
it.po \
ja.po \
ko.po \
lt.po \
ml.po \
nb_NO.po \
nl.po \
or.po \
pa.po \
pl.po \
pt_BR.po \
pt_PT.po \
rm.po \
ro.po \
ru.po \
sk.po \
sl.po \
sr_RS@cyrillic.po \
sr_RS@latin.po \
sv.po \
te.po \
th.po \
tr.po \
uk.po \
wa.po \
zh_CN.po \
zh_TW.po

View File

@ -211,7 +211,7 @@ sub parse_makefile($)
${$make{"=flags"}}{"implib"} = 1 if $var eq "IMPORTLIB"; ${$make{"=flags"}}{"implib"} = 1 if $var eq "IMPORTLIB";
next; next;
} }
if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES|EXTRA_OBJS|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/) if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PO_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES|EXTRA_OBJS|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/)
{ {
my $var = $1; my $var = $1;
my @list = split(/\s+/, $2); my @list = split(/\s+/, $2);
@ -388,6 +388,11 @@ sub assign_sources_to_makefiles(@)
push @{${$make}{"=MC_SRCS"}}, $name; push @{${$make}{"=MC_SRCS"}}, $name;
${${$make}{"=flags"}}{"clean"} = 1; ${${$make}{"=flags"}}{"clean"} = 1;
} }
elsif ($name =~ /\.po$/)
{
push @{${$make}{"=PO_SRCS"}}, $name;
${${$make}{"=flags"}}{"clean"} = 1;
}
elsif ($name =~ /\.idl$/) elsif ($name =~ /\.idl$/)
{ {
die "no makedep flags specified in $file" unless %flags || $dir eq "include"; die "no makedep flags specified in $file" unless %flags || $dir eq "include";
@ -502,8 +507,6 @@ sub update_makefiles(@)
} }
} }
push @lines, "\nAC_SUBST([LINGUAS],[\"\\\n", join( " \\\n", sort @linguas ), "\"])\n\n";
# update the source variables in all the makefiles # update the source variables in all the makefiles
foreach my $file (sort @_) foreach my $file (sort @_)
@ -519,6 +522,7 @@ sub update_makefiles(@)
replace_makefile_variable( $file, "IDL_SRCS" ); replace_makefile_variable( $file, "IDL_SRCS" );
replace_makefile_variable( $file, "HEADER_SRCS" ); replace_makefile_variable( $file, "HEADER_SRCS" );
replace_makefile_variable( $file, "XTEMPLATE_SRCS" ); replace_makefile_variable( $file, "XTEMPLATE_SRCS" );
replace_makefile_variable( $file, "PO_SRCS" );
replace_makefile_variable( $file, "IN_SRCS" ); replace_makefile_variable( $file, "IN_SRCS" );
replace_makefile_variable( $file, "MANPAGES" ); replace_makefile_variable( $file, "MANPAGES" );
} }

View File

@ -1811,6 +1811,11 @@ static void add_generated_sources( struct makefile *make )
if (!make->staticimplib && make->importlib && *dll_ext) if (!make->staticimplib && make->importlib && *dll_ext)
make->staticimplib = strmake( "lib%s.def.a", make->importlib ); make->staticimplib = strmake( "lib%s.def.a", make->importlib );
} }
if (strendswith( source->name, ".po" ))
{
if (!make->disabled)
strarray_add_uniq( &linguas, replace_extension( source->name, ".po", "" ));
}
} }
if (make->testdll) if (make->testdll)
{ {
@ -2536,6 +2541,12 @@ static struct strarray output_sources( const struct makefile *make )
top_dir_path( make, "tools/buildimage" ), source->filename ); top_dir_path( make, "tools/buildimage" ), source->filename );
} }
} }
else if (!strcmp( ext, "po" )) /* po file */
{
output( "%s.mo: %s\n", obj_dir_path( make, obj ), source->filename );
output( "\t%s -o $@ %s\n", msgfmt, source->filename );
strarray_add( &all_targets, strmake( "%s.mo", obj ));
}
else if (!strcmp( ext, "res" )) else if (!strcmp( ext, "res" ))
{ {
strarray_add( &res_files, source->name ); strarray_add( &res_files, source->name );
@ -3080,16 +3091,6 @@ static struct strarray output_sources( const struct makefile *make )
output( "\n" ); output( "\n" );
strarray_add( &phony_targets, "distclean" ); strarray_add( &phony_targets, "distclean" );
if (msgfmt && strcmp( msgfmt, "false" ))
{
strarray_addall( &build_deps, mo_files );
for (i = 0; i < linguas.count; i++)
{
output( "%s/%s.mo:", obj_dir_path( make, "po" ), linguas.str[i] );
output( " %s/%s.po\n", src_dir_path( make, "po" ), linguas.str[i] );
output( "\t%s -o $@ %s/%s.po\n", msgfmt, src_dir_path( make, "po" ), linguas.str[i] );
}
}
if (build_deps.count) if (build_deps.count)
{ {
output( "__builddeps__:" ); output( "__builddeps__:" );
@ -3360,6 +3361,7 @@ static void load_sources( struct makefile *make )
"SVG_SRCS", "SVG_SRCS",
"FONT_SRCS", "FONT_SRCS",
"IN_SRCS", "IN_SRCS",
"PO_SRCS",
"MANPAGES", "MANPAGES",
NULL NULL
}; };
@ -3537,7 +3539,6 @@ int main( int argc, char *argv[] )
top_makefile = parse_makefile( NULL ); top_makefile = parse_makefile( NULL );
linguas = get_expanded_make_var_array( top_makefile, "LINGUAS" );
target_flags = get_expanded_make_var_array( top_makefile, "TARGETFLAGS" ); target_flags = get_expanded_make_var_array( top_makefile, "TARGETFLAGS" );
msvcrt_flags = get_expanded_make_var_array( top_makefile, "MSVCRTFLAGS" ); msvcrt_flags = get_expanded_make_var_array( top_makefile, "MSVCRTFLAGS" );
dll_flags = get_expanded_make_var_array( top_makefile, "DLLFLAGS" ); dll_flags = get_expanded_make_var_array( top_makefile, "DLLFLAGS" );