mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									34680930d5
								
							
						
					
					
						commit
						6fef1a26cc
					
				
							
								
								
									
										670
									
								
								src/configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										670
									
								
								src/configure
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -78,11 +78,7 @@ else | ||||
| 	ECHO_C='\c' | ||||
| fi | ||||
| 
 | ||||
| dnl this part selects the template from the one in the | ||||
| dnl template directory. | ||||
| 
 | ||||
| dnl LOOK FOR EXACT MATCH FIRST, | ||||
| dnl then try an OS without a version | ||||
| dnl this part selects the template from the ones in the template directory. | ||||
| 
 | ||||
| AC_MSG_CHECKING(setting template to) | ||||
| AC_ARG_WITH(template, | ||||
| @ -90,18 +86,37 @@ AC_ARG_WITH(template, | ||||
|                           use operating system template file  | ||||
|                               see template directory], | ||||
|     [  TEMPLATE=$withval ], | ||||
|     [   | ||||
|        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<template/.similar | ||||
| 	while read LINE <&4 | ||||
| 	do | ||||
| 	    SIMHOST=`expr "$LINE" : '\(.*\)='` | ||||
| 	    MATCH=`expr "$host" : "$SIMHOST"` | ||||
| 	    if test "$MATCH" != 0 | ||||
| 	    then GUESS=`echo "$LINE" | sed 's/^.*=//'` | ||||
| 	    fi | ||||
| 	done | ||||
| 	exec 4<&- | ||||
| 	if test "$GUESS" | ||||
| 	then TEMPLATE="$GUESS" | ||||
| 	else | ||||
| 	    # Last chance ... maybe uname -s will match an entry. | ||||
| 	    TEMPLATE=`uname -s | tr A-Z a-z`  | ||||
| 	fi | ||||
|     fi | ||||
| fi | ||||
|     ]) | ||||
| AC_MSG_RESULT($TEMPLATE) | ||||
| 
 | ||||
|  | ||||
| @ -1,15 +1,14 @@ | ||||
| alpha-dec-osf=alpha | ||||
| alpha-unknown-linux-gnu=linux_alpha | ||||
| hppa1.1-hp-hpux10.20=hpux_cc | ||||
| hppa1.1-hp-hpux=hpux_cc | ||||
| hppa1.1-stratus-sysv4=svr4 | ||||
| i386-next-nextstep3=nextstep | ||||
| i386-pc-bsdi2.0=bsdi_2.0 | ||||
| i386-pc-bsdi2.1=bsdi_2.1 | ||||
| i386-pc-bsdi3.0=bsdi_2.1 | ||||
| i386-pc-bsdi3.1=bsdi_2.1 | ||||
| i386-pc-bsdi4.0=bsdi_4.0 | ||||
| i386-pc-bsdi3=bsdi_2.1 | ||||
| i386-pc-bsdi4=bsdi_4.0 | ||||
| i386-pc-linux-gnu=linux_i386 | ||||
| i386-pc-solaris2.6=solaris_i386_gcc | ||||
| i386-pc-solaris=solaris_i386_gcc | ||||
| i386-pc-sunos5=solaris_i386_gcc | ||||
| i386-unknown-freebsd=freebsd | ||||
| i386-unknown-netbsd=netbsd | ||||
| @ -19,10 +18,9 @@ i586-pc-sco3.2v=sco | ||||
| i686-pc-linux-gnu=linux_i386 | ||||
| mips-sgi-irix=irix5 | ||||
| powerpc-ibm-aix3.2.5=aix_325 | ||||
| powerpc-ibm-aix4.1.4.0=aix_41 | ||||
| powerpc-ibm-aix4.1.5.0=aix_41 | ||||
| powerpc-ibm-aix4.2.1.0=aix_42 | ||||
| powerpc-ibm-aix4.3.1.0=aix_42 | ||||
| powerpc-ibm-aix4.1=aix_41 | ||||
| powerpc-ibm-aix4.2=aix_42 | ||||
| powerpc-ibm-aix4.3=aix_42 | ||||
| powerpc-unknown-linux-gnu=linux_ppc | ||||
| sparc-sun-solaris=solaris_sparc_gcc | ||||
| sparc-sun-sunos4=sunos4_gcc | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user