From: Tom Lane Date: Mon, 23 Nov 1998 04:40:58 +0000 (+0000) Subject: modify configure so that template/.similar entries can be X-Git-Tag: REL6_5~955 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6fef1a26ccda3856c9fe453e660ebdc15d0697aa;p=postgresql modify configure so that template/.similar entries can be selected when they match a prefix of the value. The previous method, which stripped all version data from and then tried to match that against .similar entries, was entirely useless when .similar contained several entries for different version numbers of a single OS name. --- diff --git a/src/configure b/src/configure index 44dc1e3bc2..e8d8157142 100755 --- a/src/configure +++ b/src/configure @@ -680,26 +680,44 @@ else fi - echo $ac_n "checking setting template to""... $ac_c" 1>&6 -echo "configure:686: checking setting template to" >&5 +echo "configure:685: checking setting template to" >&5 # Check whether --with-template or --without-template was given. if test "${with_template+set}" = set; then withval="$with_template" TEMPLATE=$withval else - - GUESS=`grep "^$host=" template/.similar | sed 's/.*=//' | tail -1` - if test "$GUESS" - then TEMPLATE="$GUESS" - else - host_no_ver=`echo "$host" | sed 's/[0-9.]*$//'` - GUESS=`grep "^$host_no_ver" template/.similar | sed 's/.*=//' | tail -1` - if test "$GUESS" - then TEMPLATE="$GUESS" - else TEMPLATE=`uname -s | tr A-Z a-z` - fi - fi + +# First, try for a template exactly matching $host +if test -f "template/$host" +then TEMPLATE="$host" +else + # Next try for an exact match to a .similar entry. + # There shouldn't be multiple matches, but take the last if there are. + GUESS=`grep "^$host=" template/.similar | sed 's/^.*=//' | tail -1` + if test "$GUESS" + then TEMPLATE="$GUESS" + else + # Next look for a .similar entry that is a prefix of $host. + # If there are multiple matches, take the last one. + exec 4