Commit 3aecaf1d authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: Treat all directories the same way in configure.

parent 51b57133
...@@ -229,65 +229,10 @@ wine_fn_append_rule () ...@@ -229,65 +229,10 @@ wine_fn_append_rule ()
AS_ECHO("$[1]") >>$wine_rules_file AS_ECHO("$[1]") >>$wine_rules_file
} }
wine_fn_all_rules ()
{
wine_fn_append_file SUBDIRS $ac_dir
}
wine_fn_disabled_rules ()
{
wine_fn_append_file SUBDIRS $ac_dir
wine_fn_append_file DISABLED_SUBDIRS $ac_dir
}
wine_fn_config_makefile () wine_fn_config_makefile ()
{ {
ac_dir=$[1] wine_fn_append_file SUBDIRS $[1]
ac_enable=$[2] AS_VAR_IF([$[2]],[no],[wine_fn_append_file DISABLED_SUBDIRS $[1]])
case $ac_dir in
dnl These are created as symlinks for wow64 builds
fonts|server) test -z "$with_wine64" || return ;;
esac
AS_VAR_IF([$ac_enable],[no],[wine_fn_disabled_rules],[wine_fn_all_rules])
}
wine_fn_config_lib ()
{
ac_name=$[1]
ac_dir=dlls/$ac_name
wine_fn_all_rules
}
wine_fn_config_dll ()
{
ac_name=$[1]
ac_dir=dlls/$ac_name
ac_enable=$[2]
AS_VAR_IF([$ac_enable],[no],[wine_fn_disabled_rules],[wine_fn_all_rules])
}
wine_fn_config_program ()
{
ac_name=$[1]
ac_dir=programs/$ac_name
ac_enable=$[2]
AS_VAR_IF([$ac_enable],[no],[wine_fn_disabled_rules],[wine_fn_all_rules])
}
wine_fn_config_test ()
{
ac_dir=$[1]
ac_name=$[2]
AS_VAR_IF([enable_tests],[no],[wine_fn_disabled_rules],[wine_fn_all_rules])
}
wine_fn_config_tool ()
{
ac_dir=$[1]
AS_VAR_IF([enable_tools],[no],[return])
wine_fn_all_rules
} }
wine_fn_config_symlink () wine_fn_config_symlink ()
...@@ -299,12 +244,6 @@ wine_fn_config_symlink () ...@@ -299,12 +244,6 @@ wine_fn_config_symlink ()
for f in $ac_links; do wine_fn_append_file CONFIGURE_TARGETS $f; done for f in $ac_links; do wine_fn_append_file CONFIGURE_TARGETS $f; done
}]) }])
dnl **** Define helper function to append a file to a makefile file list ****
dnl
dnl Usage: WINE_APPEND_FILE(var,file)
dnl
AC_DEFUN([WINE_APPEND_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_file $1 "$2"])
dnl **** Define helper function to append a rule to a makefile command list **** dnl **** Define helper function to append a rule to a makefile command list ****
dnl dnl
dnl Usage: WINE_APPEND_RULE(rule) dnl Usage: WINE_APPEND_RULE(rule)
...@@ -326,60 +265,15 @@ fi])[]dnl ...@@ -326,60 +265,15 @@ fi])[]dnl
dnl **** Create a makefile from config.status **** dnl **** Create a makefile from config.status ****
dnl dnl
dnl Usage: WINE_CONFIG_MAKEFILE(file,enable) dnl Usage: WINE_CONFIG_MAKEFILE(file,enable,condition)
dnl dnl
AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]m4_bpatsubst([$1],[.*/\([^/]*\)$],[\1])))dnl
m4_append_uniq([_AC_USER_OPTS],ac_enable,[
])dnl
wine_fn_config_makefile [$1] ac_enable[]dnl
AS_VAR_POPDEF([ac_enable])])
dnl **** Create a dll makefile from config.status ****
dnl
dnl Usage: WINE_CONFIG_DLL(name,enable)
dnl
AC_DEFUN([WINE_CONFIG_DLL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
m4_append_uniq([_AC_USER_OPTS],ac_enable,[
])dnl
wine_fn_config_dll [$1] ac_enable[]dnl
AS_VAR_POPDEF([ac_enable])])
dnl **** Create a program makefile from config.status ****
dnl
dnl Usage: WINE_CONFIG_PROGRAM(name,enable)
dnl
AC_DEFUN([WINE_CONFIG_PROGRAM],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
m4_append_uniq([_AC_USER_OPTS],ac_enable,[ m4_append_uniq([_AC_USER_OPTS],ac_enable,[
])dnl ])dnl
wine_fn_config_program [$1] ac_enable[]dnl m4_ifval([$3],[$3 || ])wine_fn_config_makefile [$1] ac_enable[]dnl
AS_VAR_POPDEF([ac_enable])]) AS_VAR_POPDEF([ac_enable])])
dnl **** Create a test makefile from config.status ****
dnl
dnl Usage: WINE_CONFIG_TEST(dir)
dnl
AC_DEFUN([WINE_CONFIG_TEST],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
wine_fn_config_test [$1]])
dnl **** Create a static lib makefile from config.status ****
dnl
dnl Usage: WINE_CONFIG_LIB(name)
dnl
AC_DEFUN([WINE_CONFIG_LIB],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
wine_fn_config_lib [$1]])
dnl **** Create a tool makefile from config.status ****
dnl
dnl Usage: WINE_CONFIG_TOOL(name)
dnl
AC_DEFUN([WINE_CONFIG_TOOL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
m4_append_uniq([_AC_USER_OPTS],[enable_tools],[
])dnl
wine_fn_config_tool [$1]])
dnl **** Append a file to the .gitignore list **** dnl **** Append a file to the .gitignore list ****
dnl dnl
dnl Usage: WINE_IGNORE_FILE(file,enable) dnl Usage: WINE_IGNORE_FILE(file,enable)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -342,9 +342,8 @@ sub assign_sources_to_makefiles(@) ...@@ -342,9 +342,8 @@ sub assign_sources_to_makefiles(@)
my $make = $makefiles{"$dir/Makefile"}; my $make = $makefiles{"$dir/Makefile"};
my $name = substr( $file, length($dir) + 1 ); my $name = substr( $file, length($dir) + 1 );
my %flags = get_makedep_flags( $file );
next if $file =~ /^include\/wine\// && !%flags && !$exported_wine_headers{$name}; next if $file =~ /^include\/wine\// && !get_makedep_flags($file) && !$exported_wine_headers{$name};
if ($name =~ /\.m$/) { push @{${$make}{"=OBJC_SRCS"}}, $name; } if ($name =~ /\.m$/) { push @{${$make}{"=OBJC_SRCS"}}, $name; }
elsif ($name =~ /\.l$/) { push @{${$make}{"=LEX_SRCS"}}, $name; } elsif ($name =~ /\.l$/) { push @{${$make}{"=LEX_SRCS"}}, $name; }
...@@ -376,7 +375,7 @@ sub assign_sources_to_makefiles(@) ...@@ -376,7 +375,7 @@ sub assign_sources_to_makefiles(@)
} }
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 $dir eq "include" || get_makedep_flags($file);
push @{${$make}{"=IDL_SRCS"}}, $name; push @{${$make}{"=IDL_SRCS"}}, $name;
} }
elsif ($name =~ /\.man\.in$/) elsif ($name =~ /\.man\.in$/)
...@@ -420,72 +419,57 @@ sub update_makefiles(@) ...@@ -420,72 +419,57 @@ sub update_makefiles(@)
foreach my $file (sort @_) foreach my $file (sort @_)
{ {
next if $file eq "Makefile";
my %make = %{$makefiles{$file}}; my %make = %{$makefiles{$file}};
(my $dir = $file) =~ s/^(.*)\/Makefile/$1/;
my $args = ""; my $args = "";
my $is_win16 = $make{"MODULE"} && ($make{"MODULE"} =~ /16$/ || $modules16{$make{"MODULE"}});
if (defined($make{"TESTDLL"})) # test if (defined($make{"TESTDLL"})) # test
{ {
die "TESTDLL should not be defined in $file" unless $file =~ /\/tests\/Makefile$/; die "TESTDLL should not be defined in $file" unless $file =~ /\/tests\/Makefile$/;
die "MODULE should not be defined in $file" if defined $make{"MODULE"}; die "MODULE should not be defined in $file" if defined $make{"MODULE"};
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"}; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
(my $dir = $file) =~ s/^(.*)\/Makefile/$1/;
push @lines, "WINE_CONFIG_TEST($dir)\n";
} }
elsif (defined($make{"MODULE"}) && $make{"MODULE"} =~ /\.a$/) # import lib elsif (defined($make{"MODULE"}) && $make{"MODULE"} =~ /\.a$/) # import lib
{ {
die "MODULE should not be defined as static lib in $file" unless $file =~ /^dlls\//; die "MODULE should not be defined as static lib in $file" unless $file =~ /^dlls\//;
die "APPMODE should not be defined in $file" if defined $make{"APPMODE"}; die "APPMODE should not be defined in $file" if defined $make{"APPMODE"};
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"}; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
(my $name = $file) =~ s/^dlls\/(.*)\/Makefile/$1/;
push @lines, "WINE_CONFIG_LIB($name)\n";
} }
elsif (defined($make{"MODULE"}) && defined($make{"APPMODE"})) # program elsif (defined($make{"MODULE"})) # dll or program
{ {
die "APPMODE should not be defined in $file" unless $file =~ /^programs\//; (my $name = $file) =~ s/^(dlls|programs)\/(.*)\/Makefile/$2/;
die "MODULE should not be defined in $file" unless $file =~ /^(dlls|programs)\//;
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"}; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
(my $name = $file) =~ s/^programs\/(.*)\/Makefile/$1/; die "Invalid MODULE in $file" if $name =~ /\./ && $make{"MODULE"} ne $name;
if ($name =~ /\./) if ($file =~ /^programs\//)
{ {
die "Invalid MODULE in $file" unless $make{"MODULE"} eq $name; die "APPMODE should be defined in $file" unless defined $make{"APPMODE"} ;
die "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.exe";
} }
else else
{ {
die "Invalid MODULE in $file" unless $make{"MODULE"} eq "$name.exe"; die "APPMODE should not be defined in $file" if defined $make{"APPMODE"} ;
die "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.dll";
} }
$args .= ",enable_win16" if $is_win16; if (defined $make{"IMPORTLIB"})
push @lines, "WINE_CONFIG_PROGRAM($name$args)\n";
}
elsif (defined($make{"MODULE"})) # dll
{
die "APPMODE should be defined in $file" if $file =~ /^programs\//;
die "MODULE should not be defined in $file" unless $file =~ /^dlls\//;
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
(my $name = $file) =~ s/^dlls\/(.*)\/Makefile/$1/;
if ($name =~ /\./)
{
die "Invalid MODULE in $file" unless $make{"MODULE"} eq $name;
}
else
{ {
die "Invalid MODULE in $file" unless $make{"MODULE"} eq "$name.dll"; die "IMPORTLIB not allowed in programs\n" if $file =~ /^programs\//;
die "Invalid IMPORTLIB name in $file" if $make{"IMPORTLIB"} =~ /\./;
} }
my $implib = $make{"IMPORTLIB"} || ""; $args = ",enable_win16" if $make{"MODULE"} =~ /16$/ || $modules16{$make{"MODULE"}};
die "Invalid IMPORTLIB name in $file" if $implib =~ /\./;
$args .= ",enable_win16" if $is_win16;
push @lines, "WINE_CONFIG_DLL($name$args)\n";
} }
elsif ($file =~ /^tools.*\/Makefile$/) elsif ($file =~ /^tools.*\/Makefile$/)
{ {
die "APPMODE should not be defined in $file" if defined $make{"APPMODE"}; die "APPMODE should not be defined in $file" if defined $make{"APPMODE"};
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"}; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
(my $name = $file) =~ s/^(.*)\/Makefile/$1/; $args = ",,[test \"x\$enable_tools\" = xno]";
push @lines, "WINE_CONFIG_TOOL($name)\n";
} }
elsif ($file =~ /\/Makefile$/) elsif (($dir eq "fonts") || ($dir eq "server"))
{ {
(my $name = $file) =~ s/^(.*)\/Makefile/$1/; # these are created as symlinks for wow64 builds
push @lines, "WINE_CONFIG_MAKEFILE($name)\n"; $args = ",,[test -n \"\$with_wine64\"]";
} }
push @lines, "WINE_CONFIG_MAKEFILE($dir$args)\n";
} }
# update the source variables in all the makefiles # update the source variables in all the makefiles
...@@ -493,7 +477,7 @@ sub update_makefiles(@) ...@@ -493,7 +477,7 @@ sub update_makefiles(@)
foreach my $file (sort @_) { replace_makefile_variables( $file ); } foreach my $file (sort @_) { replace_makefile_variables( $file ); }
push @lines, "dnl End of auto-generated output commands\n"; push @lines, "dnl End of auto-generated output commands\n";
replace_in_file( "configure.ac", '^WINE_CONFIG_DLL', '^dnl End of auto-generated output commands\n$', @lines); replace_in_file( "configure.ac", '^WINE_CONFIG_MAKEFILE', '^dnl End of auto-generated output commands\n$', @lines);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment