Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ef5602d

Browse files
committed
When testing for source and build tree equality, and test -ef doesn't work,
fall back to `cd $srcdir && /bin/pwd` = `/bin/pwd`. One of these ought to work, and if not, prep_buildtree is harmless.
1 parent 7505e5d commit ef5602d

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

configure

+6-10
Original file line numberDiff line numberDiff line change
@@ -8581,25 +8581,21 @@ done
85818581

85828582
fi
85838583

8584-
# check whether 'test -ef' works
8585-
if (test "$srcdir" -ef "$srcdir") >/dev/null 2>&1 ; then
8586-
test_ef_works=yes
8587-
else
8588-
test_ef_works=no
8589-
fi
8590-
85918584
abs_top_srcdir=
85928585

85938586

8594-
if test "$test_ef_works" = yes ; then
85958587
# prepare build tree if outside source tree
8596-
if test "$srcdir" -ef . ; then : ; else
8588+
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
8589+
# Note 2: /bin/pwd might be better than shell's built-in at getting
8590+
# a symlink-free name.
8591+
if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
8592+
:
8593+
else
85978594
abs_top_srcdir=`cd $srcdir && pwd`
85988595
echo $ac_n "preparing build tree... $ac_c" 1>&6
85998596
/bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "." \
86008597
|| { echo "configure: error: failed" 1>&2; exit 1; }
86018598
echo "$ac_t""done" 1>&6
8602-
fi
86038599
fi
86048600

86058601
trap '' 1 2 15

configure.in

+6-10
Original file line numberDiff line numberDiff line change
@@ -1219,25 +1219,21 @@ if test -n "$NSGMLS"; then
12191219
AC_CHECK_PROGS(SGMLSPL, sgmlspl)
12201220
fi
12211221

1222-
# check whether 'test -ef' works
1223-
if (test "$srcdir" -ef "$srcdir") >/dev/null 2>&1 ; then
1224-
test_ef_works=yes
1225-
else
1226-
test_ef_works=no
1227-
fi
1228-
12291222
abs_top_srcdir=
12301223
AC_SUBST(abs_top_srcdir)
12311224

1232-
if test "$test_ef_works" = yes ; then
12331225
# prepare build tree if outside source tree
1234-
if test "$srcdir" -ef . ; then : ; else
1226+
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
1227+
# Note 2: /bin/pwd might be better than shell's built-in at getting
1228+
# a symlink-free name.
1229+
if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
1230+
:
1231+
else
12351232
abs_top_srcdir=`cd $srcdir && pwd`
12361233
echo $ac_n "preparing build tree... $ac_c" 1>&6
12371234
/bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "." \
12381235
|| AC_MSG_ERROR(failed)
12391236
AC_MSG_RESULT(done)
1240-
fi
12411237
fi
12421238

12431239
AC_OUTPUT(

0 commit comments

Comments
 (0)