]> git.ozlabs.org Git - ppp.git/blob - configure
8f5e36ee80dcf1628d225b967abdc3c884e7c20f
[ppp.git] / configure
1 #!/bin/sh
2 # $Id: configure,v 1.22 1999/09/22 18:40:53 masputra Exp $
3
4 if [ -d /NextApps ]; then
5   system="NeXTStep"
6 else
7   system=`uname -s`
8   release=`uname -r`
9   machine=`uname -p`
10   arch=`uname -m`
11 fi
12 state="unknown"
13
14 case $system in
15   NetBSD)
16     makext="bsd";
17     case $release in
18       0.*)      state="ancient";;
19       1.0*)     state="ancient";;
20       1.1*)     state="known"; ksrc="netbsd-1.1";;
21       1.2*)     state="known"; ksrc="netbsd-1.2"; makext="netbsd-1.2";;
22       1.[3-9]*|[2-9]*)
23                 state="late"; ksrc="netbsd-1.2";;
24     esac;;
25   SunOS)
26     case $release in
27       [0-3]*)   state="ancient";;
28       4*)       state="known"; ksrc="sunos4"; makext="sunos4";;
29       5.[1-6]*) state="known"; ksrc="svr4"; makext="sol2";;
30       5.[789]*) state="known"; ksrc="svr4"; makext="sol2";
31               case $arch in
32                 sun4u)  lp64='y';;
33                 *)      ;;
34               esac;;
35     esac;;
36   ULTRIX)
37     makext="ultrix";
38     case $release in
39       [0-3]*)   state="ancient";;
40       4.[01]*)  state="early"; ksrc="ultrix";;
41       4.[234])  state="known"; ksrc="ultrix";;
42     esac;;
43   OSF1)
44     makext="osf";
45     case $release in
46       V1.*)   state="neolithic"; ksrc="osf1";;
47       V[23].*)  state="neolithic"; ksrc="osf1";;
48       V4.*)     state="known"; ksrc="osf1";;
49       V[5-9]*) state="late"; ksrc="osf1";;
50     esac;;
51   Linux)
52     makext="linux";
53     ksrc="linux";
54     state="known";;
55   FreeBSD)
56     makext="bsd";
57     case $release in
58       1.*)      state="known"; ksrc="freebsd-old";;
59       2.[01]*)  state="known"; ksrc="freebsd-2.0";;
60       2.2.[2-7]*) state="late"; ksrc="freebsd-2.0";;
61       2.2.8*)   state="known"; ksrc="freebsd-2.2.8";;
62       3.[0-1]*) state="known"; ksrc="freebsd-3.0";;
63     esac;;
64   NeXTStep)
65     makext="NeXT";
66     ksrc="NeXT";
67     state="known";;
68   SINIX-?)
69     case $release in
70       5.4[01]) state=known; ksrc=svr4; makext=svr4;;
71       5.4[2-9]) state=late; ksrc=svr4; makext=svr4;;
72     esac;;
73   # Intel SVR4 systems come with a bug in the uname program.  Unless
74   # your provider fixed the bug, or you get a fix for it, uname -S will
75   # overwrite the system name with the node name!
76   UNIX_SV|UNIX_System_V|`uname -n`)
77     case $release in
78       4.0) state=known; ksrc=svr4; makext=svr4;;
79       4.2) state=late; ksrc=svr4; makext=svr4;;
80     esac;;
81 esac
82
83 if [ -d "$ksrc" ]; then :; else
84   state="notincluded"
85   unset ksrc
86 fi
87
88 case $state in
89   neolithic) 
90     echo "This is a newer release on an outdated OS ($system)."
91     echo " This software may  or may not work on this OS."
92     echo " You may want to download an older version of PPP for this OS.";;
93   ancient)
94     echo "This is an old release of a supported OS ($system)."
95     echo "This software cannot be used as-is on this system,"
96     echo "but you may be able to port it.  Good luck!"
97     exit;;
98   early)
99     echo "This is an old release of a supported OS ($system)."
100     echo "This software should install and run on this system,"
101     echo "but it hasn't been tested.";;
102   late)
103     echo "This is a newer release of $system than is supported by"
104     echo "this software.  It may or may not work.";;
105   unknown)
106     echo "This software has not been ported to this system.  Sorry.";;
107   notincluded)
108     echo "Support for this system has not been included"
109     echo "in this distribution.  Sorry.";;
110 esac
111
112 orig_makext=$makext
113
114 if [ -d "$ksrc" ]; then
115   echo "Creating links to Makefiles."
116   rm -f Makefile
117   ln -s $ksrc/Makefile.top Makefile
118   echo "  Makefile -> $ksrc/Makefile.top"
119   if [ "$ksrc" = svr4 ]; then
120     # Point to 64-bit Makefile extension
121     if [ "$lp64" = y ]; then 
122       makext=$makext-64 
123     fi
124     rm -f $ksrc/Makefile
125     ln -s Makefile.$makext $ksrc/Makefile
126     echo "  $ksrc/Makefile -> Makefile.$makext"
127     # Restore extension
128     if [ "$lp64" = y ]; then 
129       makext=$orig_makext 
130     fi
131   fi
132   for dir in pppd pppstats chat pppdump; do
133     rm -f $dir/Makefile
134     if [ -f $dir/Makefile.$makext ]; then
135       ln -s Makefile.$makext $dir/Makefile
136       echo "  $dir/Makefile -> Makefile.$makext"
137     fi
138   done
139 fi