diff --git a/Makefile.in b/Makefile.in index b52495f741f..d9e01a277c0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,6 +32,7 @@ nlsdir = ${datadir}/wine/nls dlldir = ${libdir}/wine srcdir = @srcdir@ SHELL = /bin/sh +ARCH = @ARCH@ CC = @CC@ CXX = @CXX@ CPPBIN = @CPPBIN@ diff --git a/configure b/configure index dba0950b490..d22c0cf89cc 100755 --- a/configure +++ b/configure @@ -775,6 +775,7 @@ AR BISON FLEX TOOLSDIR +ARCH TARGETFLAGS LD CPPBIN @@ -5870,6 +5871,19 @@ then test "x$libdir" != "x\${exec_prefix}/lib" || libdir="\${exec_prefix}/lib64" fi +case $host_cpu in + *i[3456789]86*) ARCH="i386" + ;; + *x86_64*) ARCH="x86_64" + ;; + *aarch64*) ARCH="aarch64" + ;; + *arm*) ARCH="arm" + ;; + *) ARCH="" + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the directory containing the Wine tools" >&5 $as_echo_n "checking for the directory containing the Wine tools... " >&6; } if ${wine_cv_toolsdir+:} false; then : diff --git a/configure.ac b/configure.ac index 68366339ea2..c90e78d8bb7 100644 --- a/configure.ac +++ b/configure.ac @@ -238,6 +238,15 @@ then test "x$libdir" != "x\${exec_prefix}/lib" || libdir="\${exec_prefix}/lib64" fi +dnl Normalize CPU architecture +case $host_cpu in + *i[[3456789]]86*) AC_SUBST(ARCH,"i386") ;; + *x86_64*) AC_SUBST(ARCH,"x86_64") ;; + *aarch64*) AC_SUBST(ARCH,"aarch64") ;; + *arm*) AC_SUBST(ARCH,"arm") ;; + *) AC_SUBST(ARCH,"") ;; +esac + AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir, [wine_cv_toolsdir="$with_wine_tools" if test -z "$with_wine_tools"; then diff --git a/tools/makedep.c b/tools/makedep.c index 0eef646479b..c54eda772db 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -158,6 +158,8 @@ static const char *tools_ext; static const char *exe_ext; static const char *dll_ext; static const char *man_ext; +static const char *arch; +static const char *pe_dir; static const char *crosstarget; static const char *crossdebug; static const char *fontforge; @@ -3321,7 +3323,7 @@ static void output_module( struct makefile *make ) } strarray_add( &make->all_targets, strmake( "%s", make->module )); add_install_rule( make, make->module, strmake( "%s", make->module ), - strmake( "c$(dlldir)/%s", make->module )); + strmake( "c%s/%s", pe_dir, make->module )); debug_file = get_debug_file( make, make->module ); output( "%s:", module_path ); } @@ -4434,6 +4436,7 @@ int main( int argc, char *argv[] ) exe_ext = get_expanded_make_variable( top_makefile, "EXEEXT" ); man_ext = get_expanded_make_variable( top_makefile, "api_manext" ); dll_ext = (exe_ext && !strcmp( exe_ext, ".exe" )) ? "" : ".so"; + arch = get_expanded_make_variable( top_makefile, "ARCH" ); crosstarget = get_expanded_make_variable( top_makefile, "CROSSTARGET" ); crossdebug = get_expanded_make_variable( top_makefile, "CROSSDEBUG" ); fontforge = get_expanded_make_variable( top_makefile, "FONTFORGE" ); @@ -4454,6 +4457,10 @@ int main( int argc, char *argv[] ) if (!exe_ext) exe_ext = ""; if (!tools_ext) tools_ext = ""; if (!man_ext) man_ext = "3w"; + if (arch) + pe_dir = strmake( "$(dlldir)/%s-windows", arch ); + else + pe_dir = "$(dlldir)"; top_makefile->src_dir = root_src_dir; subdirs = get_expanded_make_var_array( top_makefile, "SUBDIRS" );