libtoolize.in: Create symlinks with mklink for MSVC

Symlink files are not generated properly with 'ln -s' for MSVC to
process, so mklink is used, which swaps the argument order of target
and link_name. This also requires absolute paths, generated with the
use of cygpath.

* libtoolize.in: Check if linking with mklink and update processing.
This commit is contained in:
Ileana Dumitrescu 2024-12-11 18:43:47 +02:00
parent 4a5acaa7a4
commit 5d79c9525d
No known key found for this signature in database
GPG Key ID: 6570EA01146F7354

View File

@ -437,6 +437,33 @@ func_copy ()
else
my_copycmd=$LN_S
my_copy_type=linking
# The Windows linker, mklink, swaps link_name and target.
case $my_copycmd in
*mklink*)
my_temp=$my_destfile
my_destfile=$my_srcfile
my_srcfile=$my_temp
my_copy_msg="$my_copy_type file '$my_destfile'"
$opt_verbose && my_copy_msg="$my_copycmd $my_srcfile $my_destdir"
my_destfile=`cygpath -aw "$my_destfile"`
my_srcfile=`cygpath -aw "$my_srcfile"`
if test -d "$my_destfile"; then
case $host_os,$build_os in
mingw*,cygwin*)
my_copycmd="$my_copycmd /d" ;;
mingw*,*) # MSYS
my_copycmd="$my_copycmd //d" ;;
*)
my_copycmd="$my_copycmd /d" ;;
esac
fi
;;
*) ;;
esac
fi
my_copy_msg="$my_copy_type file '$my_destfile'"
$opt_verbose && my_copy_msg="$my_copycmd $my_srcfile $my_destdir"