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