diff --git a/mesonbuild/modules/external_project.py b/mesonbuild/modules/external_project.py index 9e283e026b36..18dfcee4b20e 100644 --- a/mesonbuild/modules/external_project.py +++ b/mesonbuild/modules/external_project.py @@ -116,6 +116,17 @@ def _configure(self, state: 'ModuleState') -> None: configure_path = Path(self.src_dir, self.configure_command) configure_prog = state.find_program(configure_path.as_posix()) configure_cmd = configure_prog.get_command() + # On Windows the configure command should be converted to + # unix style path by cygpath command, + # because the colon in the drive letter breaks many configure scripts. + if ( + configure_path.drive + and len(configure_cmd) >= 2 + and configure_cmd[-1] == configure_path.as_posix() + ): + cygpath = state.find_program('cygpath').get_command() + _p, o, _e = Popen_safe(cygpath + [configure_cmd[-1]]) + configure_cmd = configure_cmd[:-1] + [Path(o.strip()).as_posix()] workdir = self.build_dir self.make = state.find_program('make').get_command() diff --git a/test cases/common/230 external project/libfoo/configure b/test cases/common/230 external project/libfoo/configure index 0e4aa72b22b9..bc69a315bbcb 100755 --- a/test cases/common/230 external project/libfoo/configure +++ b/test cases/common/230 external project/libfoo/configure @@ -1,6 +1,15 @@ #! /bin/sh srcdir=$(dirname "$0") +IFS=: +for i in $srcdir +do +if [ "$i" != "$srcdir" ] +then + echo "srcdir $srcdir is not posix path" + exit 1 +fi +done for i in "$@" do diff --git a/test cases/common/230 external project/meson.build b/test cases/common/230 external project/meson.build index d1ed797c4af8..386e52561539 100644 --- a/test cases/common/230 external project/meson.build +++ b/test cases/common/230 external project/meson.build @@ -8,10 +8,6 @@ if not find_program('make', required : false).found() error('MESON_SKIP_TEST: make not found') endif -if host_machine.system() == 'windows' - error('MESON_SKIP_TEST: The fake configure script is too dumb to work on Windows') -endif - if meson.is_cross_build() # CI uses PKG_CONFIG_SYSROOT_DIR which breaks -uninstalled.pc usage. error('MESON_SKIP_TEST: Cross build support is too limited for this test')