diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-01-25 01:42:23 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-01-25 20:43:34 +0100 |
commit | b46aae093634271931395d65f422f4b2a23112d3 (patch) | |
tree | 1f7118bfbb0fb1ba4fcbf7caba4caaf9988630b1 /configure | |
parent | 8b02af1e6fbb0d782f3561afd82f66edc7fa8ae0 (diff) | |
download | ffmpeg-b46aae093634271931395d65f422f4b2a23112d3.tar.gz |
build: use a link instead of changing current directory when compiling
If links don't work, fall back to using the full source path as was
previously done.
This should fix build failures with MSVC.
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 28 |
1 files changed, 21 insertions, 7 deletions
@@ -4696,6 +4696,26 @@ 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 [ -e "$link_name/test_file" ]; then + # create link to source path + [ -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" +fi +# cleanup +rm -r "$link_dest" +rm -r "$link_name" + # determine libc flavour probe_libc(){ @@ -6229,12 +6249,6 @@ enabled stripping || strip="echo skipping strip" config_files="$TMPH config.mak doc/config.texi" -if enabled msvc; then - dst_path=$(pwd -W) -else - dst_path=$(pwd) -fi - cat > config.mak <<EOF # Automatically generated by configure - do not modify! ifndef FFMPEG_CONFIG_MAK @@ -6250,10 +6264,10 @@ DOCDIR=\$(DESTDIR)$docdir MANDIR=\$(DESTDIR)$mandir PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir SRC_PATH=$source_path +SRC_LINK=$source_link ifndef MAIN_MAKEFILE SRC_PATH:=\$(SRC_PATH:.%=..%) endif -DST_PATH=$dst_path CC_IDENT=$cc_ident ARCH=$arch INTRINSICS=$intrinsics |