From: Alexandre Julliard <julliard@winehq.org> With help from Jacek Caban. --- configure | 366 ++++++++++++++++++++++++------------------- configure.ac | 15 +- tools/make_makefiles | 8 +- tools/makedep.c | 76 +++++++-- 4 files changed, 288 insertions(+), 177 deletions(-) diff --git a/configure b/configure index 6ffc2a8e580..02649853799 100755 --- a/configure +++ b/configure @@ -807,8 +807,11 @@ x86_64_STRIP x86_64_TARGET x86_64_DEBUG x86_64_LDFLAGS +x86_64_EXTRACXXFLAGS x86_64_EXTRACFLAGS +x86_64_CXXFLAGS x86_64_CFLAGS +x86_64_CXX x86_64_CC i386_DISABLED_SUBDIRS i386_DELAYLOADFLAG @@ -816,8 +819,11 @@ i386_STRIP i386_TARGET i386_DEBUG i386_LDFLAGS +i386_EXTRACXXFLAGS i386_EXTRACFLAGS +i386_CXXFLAGS i386_CFLAGS +i386_CXX i386_CC arm64ec_DISABLED_SUBDIRS arm64ec_DELAYLOADFLAG @@ -825,8 +831,11 @@ arm64ec_STRIP arm64ec_TARGET arm64ec_DEBUG arm64ec_LDFLAGS +arm64ec_EXTRACXXFLAGS arm64ec_EXTRACFLAGS +arm64ec_CXXFLAGS arm64ec_CFLAGS +arm64ec_CXX arm64ec_CC arm_DISABLED_SUBDIRS arm_DELAYLOADFLAG @@ -834,8 +843,11 @@ arm_STRIP arm_TARGET arm_DEBUG arm_LDFLAGS +arm_EXTRACXXFLAGS arm_EXTRACFLAGS +arm_CXXFLAGS arm_CFLAGS +arm_CXX arm_CC aarch64_DISABLED_SUBDIRS aarch64_DELAYLOADFLAG @@ -843,8 +855,11 @@ aarch64_STRIP aarch64_TARGET aarch64_DEBUG aarch64_LDFLAGS +aarch64_EXTRACXXFLAGS aarch64_EXTRACFLAGS +aarch64_CXXFLAGS aarch64_CFLAGS +aarch64_CXX aarch64_CC HOST_ARCH toolsext @@ -7680,6 +7695,20 @@ then : else case e in #( e) eval "${wine_arch}_LDFLAGS=\$CROSSLDFLAGS" ;; esac +fi + if eval test \${${wine_arch}_CXX+y} +then : + +else case e in #( + e) eval ${wine_arch}_CXX=\$${wine_arch}_CC ;; +esac +fi + if eval test \${${wine_arch}_CXXFLAGS+y} +then : + +else case e in #( + e) eval ${wine_arch}_CXXFLAGS=\$${wine_arch}_CFLAGS ;; +esac fi eval CC=\$${wine_arch}_CC eval CFLAGS=\$${wine_arch}_CFLAGS @@ -8175,46 +8204,6 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes" then : CFLAGS="$CFLAGS -Werror=unsupported-floating-point-opt" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wdeclaration-after-statement" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5 -printf %s "checking whether $CC supports -Wdeclaration-after-statement... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wdeclaration-after-statement" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wdeclaration-after-statement" fi } { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wempty-body" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wempty-body" >&5 @@ -8455,46 +8444,6 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes" then : as_fn_append ${wine_arch}_EXTRACFLAGS " -Wshift-overflow=2" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wstrict-prototypes" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstrict-prototypes" >&5 -printf %s "checking whether $CC supports -Wstrict-prototypes... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wstrict-prototypes" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wstrict-prototypes" fi } { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wtype-limits" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wtype-limits" >&5 @@ -8735,46 +8684,6 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes" then : as_fn_append ${wine_arch}_EXTRACFLAGS " -Wlogical-op" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wabsolute-value" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wabsolute-value" >&5 -printf %s "checking whether $CC supports -Wabsolute-value... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wabsolute-value" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -Wabsolute-value" fi } { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wenum-enum-conversion" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-enum-conversion" >&5 @@ -8897,46 +8806,6 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes" then : as_fn_append ${wine_arch}_EXTRACFLAGS " -ffunction-sections" -fi } - { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fasync-exceptions -DMIN_CLANG_VERSION=19" | sed "$as_sed_sh"` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fasync-exceptions -DMIN_CLANG_VERSION=19" >&5 -printf %s "checking whether $CC supports -fasync-exceptions -DMIN_CLANG_VERSION=19... " >&6; } -if eval test \${$as_ac_var+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_wine_try_cflags_saved=$CFLAGS -ac_wine_try_cflags_saved_exeext=$ac_exeext -CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -fasync-exceptions -DMIN_CLANG_VERSION=19" -ac_exeext=".exe" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -void *__os_arm64x_dispatch_ret = 0; -const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; -#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION -#error Too old clang version -#endif -int __cdecl mainCRTStartup(void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_ac_var=yes" -else case e in #( - e) eval "$as_ac_var=no" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -ac_exeext=$ac_wine_try_cflags_saved_exeext ;; -esac -fi -eval ac_res=\$$as_ac_var - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_var"\" = x"yes" -then : - as_fn_append ${wine_arch}_EXTRACFLAGS " -fasync-exceptions" fi } { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-ffp-exception-behavior=maytrap" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ffp-exception-behavior=maytrap" >&5 @@ -9621,6 +9490,168 @@ then : fi } test "x$enable_build_id" != xyes || as_fn_append ${wine_arch}_LDFLAGS " -Wl,--build-id" + eval ${wine_arch}_EXTRACXXFLAGS=\$${wine_arch}_EXTRACFLAGS + { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wdeclaration-after-statement" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5 +printf %s "checking whether $CC supports -Wdeclaration-after-statement... " >&6; } +if eval test \${$as_ac_var+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wdeclaration-after-statement" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +void *__os_arm64x_dispatch_ret = 0; +const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; +#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION +#error Too old clang version +#endif +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_var=yes" +else case e in #( + e) eval "$as_ac_var=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +ac_exeext=$ac_wine_try_cflags_saved_exeext ;; +esac +fi +eval ac_res=\$$as_ac_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + as_fn_append ${wine_arch}_EXTRACFLAGS " -Wdeclaration-after-statement" +fi } + { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wstrict-prototypes" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstrict-prototypes" >&5 +printf %s "checking whether $CC supports -Wstrict-prototypes... " >&6; } +if eval test \${$as_ac_var+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wstrict-prototypes" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +void *__os_arm64x_dispatch_ret = 0; +const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; +#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION +#error Too old clang version +#endif +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_var=yes" +else case e in #( + e) eval "$as_ac_var=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +ac_exeext=$ac_wine_try_cflags_saved_exeext ;; +esac +fi +eval ac_res=\$$as_ac_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + as_fn_append ${wine_arch}_EXTRACFLAGS " -Wstrict-prototypes" +fi } + { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wabsolute-value" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wabsolute-value" >&5 +printf %s "checking whether $CC supports -Wabsolute-value... " >&6; } +if eval test \${$as_ac_var+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wabsolute-value" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +void *__os_arm64x_dispatch_ret = 0; +const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; +#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION +#error Too old clang version +#endif +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_var=yes" +else case e in #( + e) eval "$as_ac_var=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +ac_exeext=$ac_wine_try_cflags_saved_exeext ;; +esac +fi +eval ac_res=\$$as_ac_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + as_fn_append ${wine_arch}_EXTRACFLAGS " -Wabsolute-value" +fi } + { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fasync-exceptions -DMIN_CLANG_VERSION=19" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fasync-exceptions -DMIN_CLANG_VERSION=19" >&5 +printf %s "checking whether $CC supports -fasync-exceptions -DMIN_CLANG_VERSION=19... " >&6; } +if eval test \${$as_ac_var+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -fasync-exceptions -DMIN_CLANG_VERSION=19" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +void *__os_arm64x_dispatch_ret = 0; +const unsigned int _load_config_used[0x50] = { sizeof(_load_config_used) }; +#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION +#error Too old clang version +#endif +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_var=yes" +else case e in #( + e) eval "$as_ac_var=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +ac_exeext=$ac_wine_try_cflags_saved_exeext ;; +esac +fi +eval ac_res=\$$as_ac_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + as_fn_append ${wine_arch}_EXTRACFLAGS " -fasync-exceptions" +fi } + done CC=$saved_CC @@ -24455,8 +24486,11 @@ TARGETFLAGS = $TARGETFLAGS toolsext = $toolsext HOST_ARCH = $HOST_ARCH aarch64_CC = $aarch64_CC +aarch64_CXX = $aarch64_CXX aarch64_CFLAGS = $aarch64_CFLAGS +aarch64_CXXFLAGS = $aarch64_CXXFLAGS aarch64_EXTRACFLAGS = $aarch64_EXTRACFLAGS +aarch64_EXTRACXXFLAGS = $aarch64_EXTRACXXFLAGS aarch64_LDFLAGS = $aarch64_LDFLAGS aarch64_DEBUG = $aarch64_DEBUG aarch64_TARGET = $aarch64_TARGET @@ -24464,8 +24498,11 @@ aarch64_STRIP = $aarch64_STRIP aarch64_DELAYLOADFLAG = $aarch64_DELAYLOADFLAG aarch64_DISABLED_SUBDIRS = $aarch64_DISABLED_SUBDIRS arm_CC = $arm_CC +arm_CXX = $arm_CXX arm_CFLAGS = $arm_CFLAGS +arm_CXXFLAGS = $arm_CXXFLAGS arm_EXTRACFLAGS = $arm_EXTRACFLAGS +arm_EXTRACXXFLAGS = $arm_EXTRACXXFLAGS arm_LDFLAGS = $arm_LDFLAGS arm_DEBUG = $arm_DEBUG arm_TARGET = $arm_TARGET @@ -24473,8 +24510,11 @@ arm_STRIP = $arm_STRIP arm_DELAYLOADFLAG = $arm_DELAYLOADFLAG arm_DISABLED_SUBDIRS = $arm_DISABLED_SUBDIRS arm64ec_CC = $arm64ec_CC +arm64ec_CXX = $arm64ec_CXX arm64ec_CFLAGS = $arm64ec_CFLAGS +arm64ec_CXXFLAGS = $arm64ec_CXXFLAGS arm64ec_EXTRACFLAGS = $arm64ec_EXTRACFLAGS +arm64ec_EXTRACXXFLAGS = $arm64ec_EXTRACXXFLAGS arm64ec_LDFLAGS = $arm64ec_LDFLAGS arm64ec_DEBUG = $arm64ec_DEBUG arm64ec_TARGET = $arm64ec_TARGET @@ -24482,8 +24522,11 @@ arm64ec_STRIP = $arm64ec_STRIP arm64ec_DELAYLOADFLAG = $arm64ec_DELAYLOADFLAG arm64ec_DISABLED_SUBDIRS = $arm64ec_DISABLED_SUBDIRS i386_CC = $i386_CC +i386_CXX = $i386_CXX i386_CFLAGS = $i386_CFLAGS +i386_CXXFLAGS = $i386_CXXFLAGS i386_EXTRACFLAGS = $i386_EXTRACFLAGS +i386_EXTRACXXFLAGS = $i386_EXTRACXXFLAGS i386_LDFLAGS = $i386_LDFLAGS i386_DEBUG = $i386_DEBUG i386_TARGET = $i386_TARGET @@ -24491,8 +24534,11 @@ i386_STRIP = $i386_STRIP i386_DELAYLOADFLAG = $i386_DELAYLOADFLAG i386_DISABLED_SUBDIRS = $i386_DISABLED_SUBDIRS x86_64_CC = $x86_64_CC +x86_64_CXX = $x86_64_CXX x86_64_CFLAGS = $x86_64_CFLAGS +x86_64_CXXFLAGS = $x86_64_CXXFLAGS x86_64_EXTRACFLAGS = $x86_64_EXTRACFLAGS +x86_64_EXTRACXXFLAGS = $x86_64_EXTRACXXFLAGS x86_64_LDFLAGS = $x86_64_LDFLAGS x86_64_DEBUG = $x86_64_DEBUG x86_64_TARGET = $x86_64_TARGET diff --git a/configure.ac b/configure.ac index 78364d27346..a05f3e31e12 100644 --- a/configure.ac +++ b/configure.ac @@ -174,7 +174,7 @@ case "$host_cpu" in x86_64) HOST_ARCH=x86_64 ;; esac m4_set_add_all([_AC_SUBST_VARS],[HOST_ARCH]m4_foreach([cpu],[aarch64,arm,arm64ec,i386,x86_64], - [m4_foreach([var],[CC,CFLAGS,EXTRACFLAGS,LDFLAGS,DEBUG,TARGET,STRIP,DELAYLOADFLAG,DISABLED_SUBDIRS],[,cpu[_]var])])) + [m4_foreach([var],[CC,CXX,CFLAGS,CXXFLAGS,EXTRACFLAGS,EXTRACXXFLAGS,LDFLAGS,DEBUG,TARGET,STRIP,DELAYLOADFLAG,DISABLED_SUBDIRS],[,cpu[_]var])])) case $host_os in darwin*) @@ -446,6 +446,8 @@ do CPPFLAGS="" AS_VAR_SET_IF([${wine_arch}_CFLAGS],[],[AS_VAR_SET([${wine_arch}_CFLAGS],[${CROSSCFLAGS:-"-g -O2"}])]) AS_VAR_SET_IF([${wine_arch}_LDFLAGS],[],[AS_VAR_SET([${wine_arch}_LDFLAGS],[$CROSSLDFLAGS])]) + AS_VAR_SET_IF([${wine_arch}_CXX],[],[AS_VAR_COPY([${wine_arch}_CXX],[${wine_arch}_CC])]) + AS_VAR_SET_IF([${wine_arch}_CXXFLAGS],[],[AS_VAR_COPY([${wine_arch}_CXXFLAGS],[${wine_arch}_CFLAGS])]) AS_VAR_COPY([CC],[${wine_arch}_CC]) AS_VAR_COPY([CFLAGS],[${wine_arch}_CFLAGS]) AS_VAR_COPY([LDFLAGS],[${wine_arch}_LDFLAGS]) @@ -559,24 +561,20 @@ This is an error since --enable-archs=$wine_arch was requested.])]) WINE_TRY_PE_CFLAGS([-Werror=unused-command-line-argument],[CFLAGS="$CFLAGS -Werror=unused-command-line-argument"]) WINE_TRY_PE_CFLAGS([-Werror=ignored-optimization-argument],[CFLAGS="$CFLAGS -Werror=ignored-optimization-argument"]) WINE_TRY_PE_CFLAGS([-Werror=unsupported-floating-point-opt],[CFLAGS="$CFLAGS -Werror=unsupported-floating-point-opt"]) - WINE_TRY_PE_CFLAGS([-Wdeclaration-after-statement]) WINE_TRY_PE_CFLAGS([-Wempty-body]) WINE_TRY_PE_CFLAGS([-Wignored-qualifiers]) WINE_TRY_PE_CFLAGS([-Winit-self]) WINE_TRY_PE_CFLAGS([-Wpacked-not-aligned],[AS_VAR_APPEND(${wine_arch}_EXTRACFLAGS,[" -Wno-packed-not-aligned"])]) WINE_TRY_PE_CFLAGS([-Wmicrosoft-enum-forward-reference],[AS_VAR_APPEND(${wine_arch}_EXTRACFLAGS,[" -Wno-microsoft-enum-forward-reference"])]) WINE_TRY_PE_CFLAGS([-Wshift-overflow=2]) - WINE_TRY_PE_CFLAGS([-Wstrict-prototypes]) WINE_TRY_PE_CFLAGS([-Wtype-limits]) WINE_TRY_PE_CFLAGS([-Wunused-but-set-parameter]) WINE_TRY_PE_CFLAGS([-Wvla]) WINE_TRY_PE_CFLAGS([-Wwrite-strings]) WINE_TRY_PE_CFLAGS([-Wpointer-arith]) WINE_TRY_PE_CFLAGS([-Wlogical-op]) - WINE_TRY_PE_CFLAGS([-Wabsolute-value]) WINE_TRY_PE_CFLAGS([-Wenum-enum-conversion],[:],WINE_TRY_PE_CFLAGS([-Wenum-conversion])) WINE_TRY_PE_CFLAGS([-ffunction-sections]) - WINE_TRY_PE_CFLAGS([-fasync-exceptions -DMIN_CLANG_VERSION=19], AS_VAR_APPEND([${wine_arch}_EXTRACFLAGS],[" -fasync-exceptions"])) WINE_TRY_PE_CFLAGS([-ffp-exception-behavior=maytrap]) dnl clang had broken -fms-hotpatch support before version 18 (https://github.com/llvm/llvm-project/pull/77245) @@ -644,6 +642,13 @@ This is an error since --enable-archs=$wine_arch was requested.])]) dnl don't bother testing flags, compilation will fail afterwards test "x$enable_build_id" != xyes || AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -Wl,--build-id"]) + dnl Options that differ between C and C++ + AS_VAR_COPY([${wine_arch}_EXTRACXXFLAGS],[${wine_arch}_EXTRACFLAGS]) + WINE_TRY_PE_CFLAGS([-Wdeclaration-after-statement]) + WINE_TRY_PE_CFLAGS([-Wstrict-prototypes]) + WINE_TRY_PE_CFLAGS([-Wabsolute-value]) + WINE_TRY_PE_CFLAGS([-fasync-exceptions -DMIN_CLANG_VERSION=19], AS_VAR_APPEND([${wine_arch}_EXTRACFLAGS],[" -fasync-exceptions"])) + done CC=$saved_CC diff --git a/tools/make_makefiles b/tools/make_makefiles index 5e925855d55..48c390fca1d 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -252,7 +252,7 @@ sub assign_sources_to_makefiles(@) my $subdir = $dir; while ($dir && !defined $makefiles{"$dir/Makefile.in"}) { $dir = dirname( $dir ); } - $subdir =~ s/^$dir\/?//; + $subdir =~ s/^\Q$dir\E\/?//; next unless $dir; die "no makefile found for $file\n" unless defined $makefiles{"$dir/Makefile.in"}; @@ -291,7 +291,11 @@ sub assign_sources_to_makefiles(@) { next unless $dir eq "dlls/winewayland.drv"; } - elsif ($name !~ /\.(S|c|desktop|in|inl|l|m|mc|po|rc|rh|sfd|svg|ver|x|y)$/) + elsif ($name =~ /^msvcrt\/[^.]+$/) # C++ header without extension + { + next unless $dir eq "include"; + } + elsif ($name !~ /\.(S|c|cpp|desktop|in|inl|l|m|mc|po|rc|rh|sfd|svg|ver|x|y)$/) { next; } diff --git a/tools/makedep.c b/tools/makedep.c index 8c6d8d58b58..bc099c6f6cb 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -97,7 +97,8 @@ struct incl_file #define FLAG_SFD_FONTS 0x00400000 /* sfd file generated bitmap fonts */ #define FLAG_C_IMPLIB 0x01000000 /* file is part of an import library */ #define FLAG_C_UNIX 0x02000000 /* file is part of a Unix library */ -#define FLAG_ARM64EC_X64 0x04000000 /* use x86_64 object on ARM64EC */ +#define FLAG_C_CXX 0x04000000 /* file uses C++ */ +#define FLAG_ARM64EC_X64 0x08000000 /* use x86_64 object on ARM64EC */ static const struct { @@ -181,7 +182,7 @@ static const char *delay_load_flags[MAX_ARCHS]; static struct strarray debug_flags[MAX_ARCHS]; static struct strarray target_flags[MAX_ARCHS]; static struct strarray extra_cflags[MAX_ARCHS]; -static struct strarray extra_cflags_extlib[MAX_ARCHS]; +static struct strarray extra_cxxflags[MAX_ARCHS]; static struct strarray disabled_dirs[MAX_ARCHS]; static unsigned int native_archs[MAX_ARCHS]; static unsigned int hybrid_archs[MAX_ARCHS]; @@ -1140,6 +1141,16 @@ static void parse_c_file( struct file *source, FILE *file ) } +/******************************************************************* + * parse_cxx_file + */ +static void parse_cxx_file( struct file *source, FILE *file ) +{ + source->flags |= FLAG_C_CXX; + parse_c_file( source, file ); +} + + /******************************************************************* * parse_rc_file */ @@ -1256,6 +1267,9 @@ static const struct { ".x", parse_c_file }, { ".y", parse_c_file }, { ".idl", parse_idl_file }, + { ".cpp", parse_cxx_file }, + { ".hpp", parse_cxx_file }, + { ".ipp", parse_cxx_file }, { ".rc", parse_rc_file }, { ".ver", parse_rc_file }, { ".in", parse_in_file }, @@ -1287,6 +1301,12 @@ static struct file *load_file( const char *name ) parse_functions[i].parse( file, f ); break; } + if (i == ARRAY_SIZE(parse_functions)) + { + /* check for C++ header with no extension */ + char *dir = strstr( name, "/msvcrt/" ); + if (dir && !strchr( dir, '.' )) parse_cxx_file( file, f ); + } fclose( f ); input_file_name = NULL; @@ -1658,7 +1678,7 @@ static void parse_file( struct makefile *make, struct incl_file *source, bool sr if (strendswith( file->name, ".m" )) file->flags |= FLAG_C_UNIX; if (file->flags & FLAG_C_UNIX) source->use_msvcrt = false; - else if (file->flags & FLAG_C_IMPLIB) source->use_msvcrt = true; + else if (file->flags & (FLAG_C_IMPLIB | FLAG_C_CXX)) source->use_msvcrt = true; if (source->sourcename) { @@ -2128,6 +2148,10 @@ static void get_dependencies( struct incl_file *file, struct incl_file *source ) if (file != source) { if (file->owner == source) return; /* already processed */ + if (!(source->file->flags & FLAG_C_CXX)) /* ignore C++ dependencies for non-C++ sources */ + { + if (file->file && (file->file->flags & FLAG_C_CXX)) return; + } if (file->type == INCL_IMPORTLIB) { if (!(source->file->flags & (FLAG_IDL_TYPELIB | FLAG_IDL_REGTYPELIB))) @@ -3489,6 +3513,10 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou { if (!unix_lib_supported) return; } + else if (source->file->flags & FLAG_C_CXX) + { + return; + } else if (archs.count > 1 && is_using_msvcrt( make )) { if (!so_dll_supported) return; @@ -3517,11 +3545,23 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou strarray_add( &cflags, "-D__arm64ec_x64__" ); strarray_addall( &cflags, get_expanded_make_var_array( top_makefile, "x86_64_EXTRACFLAGS" )); } + else if (source->file->flags & FLAG_C_CXX) + { + var_cc = arch_make_variable( "CXX", arch ); + var_cflags = arch_make_variable( "CXXFLAGS", arch ); + if (make->external) + strarray_addall( &cflags, remove_warning_flags( extra_cxxflags[arch] )); + else + strarray_addall( &cflags, extra_cxxflags[arch] ); + } else { var_cc = arch_make_variable( "CC", arch ); var_cflags = arch_make_variable( "CFLAGS", arch ); - strarray_addall( &cflags, make->external ? extra_cflags_extlib[arch] : extra_cflags[arch] ); + if (make->external) + strarray_addall( &cflags, remove_warning_flags( extra_cflags[arch] )); + else + strarray_addall( &cflags, extra_cflags[arch] ); } if (!arch) @@ -3604,6 +3644,12 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou cmd->cmd = get_expanded_make_variable( make, "x86_64_CC" ); if (cflags) strarray_add( &cmd->args, cflags ); } + else if (source->file->flags & FLAG_C_CXX) + { + char *cflags = get_expanded_arch_var( make, "CXXFLAGS", arch ); + cmd->cmd = get_expanded_arch_var( make, "CXX", arch ); + if (cflags) strarray_add( &cmd->args, cflags ); + } else { char *cflags = get_expanded_arch_var( make, "CFLAGS", arch ); @@ -4168,13 +4214,23 @@ static void output_sources( struct makefile *make ) char *obj = xstrdup( source->name ); char *ext = get_extension( obj ); - if (!ext) fatal_error( "unsupported file type %s\n", source->name ); - *ext++ = 0; + if (ext) + { + *ext++ = 0; - for (j = 0; output_source_funcs[j].ext; j++) - if (!strcmp( ext, output_source_funcs[j].ext )) break; + for (j = 0; output_source_funcs[j].ext; j++) + if (!strcmp( ext, output_source_funcs[j].ext )) break; + + output_source_funcs[j].fn( make, source, obj ); + } + else + { + if (source->file->flags & FLAG_C_CXX) + output_source_h( make, source, obj ); + else + fatal_error( "unsupported file type %s\n", source->name ); + } - output_source_funcs[j].fn( make, source, obj ); strarray_addall_uniq( &make->dependencies, source->dependencies ); } @@ -4950,7 +5006,7 @@ int main( int argc, char *argv[] ) { arch_pe_dirs[arch] = strmake( "%s-windows", archs.str[arch] ); extra_cflags[arch] = get_expanded_arch_var_array( top_makefile, "EXTRACFLAGS", arch ); - extra_cflags_extlib[arch] = remove_warning_flags( extra_cflags[arch] ); + extra_cxxflags[arch] = get_expanded_arch_var_array( top_makefile, "EXTRACXXFLAGS", arch ); disabled_dirs[arch] = get_expanded_arch_var_array( top_makefile, "DISABLED_SUBDIRS", arch ); if (!is_multiarch( arch )) continue; delay_load_flags[arch] = get_expanded_arch_var( top_makefile, "DELAYLOADFLAG", arch ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10273