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