configure: fall back to using full path if src is a directory
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 26 Jan 2016 21:54:01 +0000 (22:54 +0100)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sat, 6 Feb 2016 14:30:25 +0000 (15:30 +0100)
Or when building in-tree.
Also don't try to remove src on distclean in these cases.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Makefile
configure

index e484249..7d8ae4b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -181,7 +181,10 @@ clean::
 
 distclean::
        $(RM) $(DISTCLEANSUFFIXES)
-       $(RM) config.* .config libavutil/avconfig.h .version avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h src
+       $(RM) config.* .config libavutil/avconfig.h .version avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h
+ifeq ($(SRC_LINK),src)
+       $(RM) src
+endif
        $(RM) -rf doc/examples/pc-uninstalled
 
 config:
index c415d5a..1000cb1 100755 (executable)
--- a/configure
+++ b/configure
@@ -4710,7 +4710,7 @@ 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
+if [ "$source_path" != "." ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
     # create link to source path
     [ -e src ] && rm src
     $ln_s "$source_path" src