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