This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 28ab05da84 configure: create native symlinks on Windows and test them 
with the compiler
28ab05da84 is described below

commit 28ab05da84b3194d49eabeead9291af97ba251d4
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Mon Sep 21 20:09:56 2026 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Fri Sep 25 10:56:47 2026 +0000

    configure: create native symlinks on Windows and test them with the compiler
    
    MSYS2 emulates ln -s by copying the target unless native links are
    requested, so the src link test never passed there and out of tree
    builds on Windows got the absolute source path in every -I flag and
    dependency file. Native links need Developer Mode or the symlink
    privilege. When that is missing, both MSYS2 and Cygwin fall back to link
    types only their own tools can read, which the shell test accepts while
    the compiler cannot open a header through them.
    
    Request native links, create the src link itself instead of probing a
    temporary one, and keep it only if it is a symbolic link and the
    compiler can preprocess a header through the src path. A copying link
    tool would otherwise pass the compiler test with a stale snapshot of
    the tree, so anything else the tool created is removed. That also drops
    the temporary files and their cleanup.
    
    Signed-off-by: Kacper Michajłow <[email protected]>
---
 configure | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index c588508f8a..715dfeeb80 100755
--- a/configure
+++ b/configure
@@ -6306,25 +6306,21 @@ case $target_os in
         ;;
 esac
 
-# test if creating links works
-link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
-link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
-mkdir "$link_dest"
-$ln_s "$link_dest" "$link_name"
-touch "$link_dest/test_file"
-if [ "$source_path" != "." ] && [ "$source_path" != "./src" ] && ([ ! -d src ] 
|| [ -L src ]) && [ -e "$link_name/test_file" ]; then
-    # create link to source path
+# Ask for native links and keep the link only if the compiler works with them.
+link_dir(){
+    MSYS="$MSYS winsymlinks:native" CYGWIN="$CYGWIN winsymlinks:native" $ln_s 
"$@"
+}
+
+# Link the source tree into the build directory and use it the way the build
+# does, with the full source path as the fallback.
+source_link="$source_path"
+if [ "$source_path" != "." ] && [ "$source_path" != "./src" ] && ([ ! -d src ] 
|| [ -L src ]); then
     [ -e src ] && rm src
-    $ln_s "$source_path" src
-    source_link=src
-else
-    # creating directory links doesn't work
-    # fall back to using the full source path
-    source_link="$source_path"
+    link_dir "$source_path" src && [ -L src ] && test_cpp -I. <<EOF && 
source_link=src
+#include "src/libavutil/version_major.h"
+EOF
+    [ "$source_link" = src ] || rm -rf src
 fi
-# cleanup
-rm -r "$link_dest"
-rm -r "$link_name"
 
 # determine libc flavour
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to