Remove DUX/OSF code
[openafs.git] / src / cf / sysname.m4
1 AC_DEFUN([OPENAFS_SYSNAME],[
2 if test "x$with_afs_sysname" != "x"; then
3         AFS_SYSNAME="$with_afs_sysname"
4 else
5         AC_MSG_CHECKING(your AFS sysname)
6         case $host in
7                 i?86-*-openbsd?.?)
8                         v=${host#*openbsd}
9                         vM=${v%.*}
10                         vm=${v#*.}
11                         AFS_SYSNAME="i386_obsd${vM}${vm}"
12                         ;;
13                 sparc64-*-openbsd?.?)
14                         v=${host#*openbsd}
15                         vM=${v%.*}
16                         vm=${v#*.}
17                         AFS_SYSNAME="sparc64_obsd${vM}${vm}"
18                         ;;
19                 x86_64-*-openbsd?.?)
20                         v=${host#*openbsd}
21                         vM=${v%.*}
22                         vm=${v#*.}
23                         AFS_SYSNAME="amd64_obsd${vM}${vm}"
24                         ;;
25                 i?86-*-freebsd*.*)
26                         v=${host#*freebsd}
27                         vM=${v%.*}
28                         vm=${v#*.}
29                         AFS_SYSNAME="i386_fbsd_${vM}${vm}"
30                         ;;
31                 x86_64-*-freebsd*.*)
32                         v=${host#*freebsd}
33                         vM=${v%.*}
34                         vm=${v#*.}
35                         AFS_SYSNAME="amd64_fbsd_${vM}${vm}"
36                         ;;
37                 i386-*-dragonfly?.*)
38                         v=${host#*dragonfly}
39                         vM=${v%.*}
40                         vm=${v#*.}
41                         AFS_SYSNAME="i386_dfbsd_${vM}${vm}"
42                         ;;
43                 i?86-*-netbsd*1.6[[M-Z]]*)
44                         AFS_SYSNAME="i386_nbsd20"
45                         ;;
46                 powerpc-*-netbsd*1.6[[M-Z]]*)
47                         AFS_SYSNAME="ppc_nbsd20"
48                         ;;
49                 *-*-netbsd*)
50                         arch=${host%%-unknown*}
51                         arch=$(echo $arch |sed -e 's/x86_64/amd64/g' \
52                                                -e 's/powerpc/ppc/g')
53                         v=${host#*netbsd}
54                         v=${v#*aout}
55                         v=${v#*ecoff}
56                         v=${v#*elf}
57                         vM=${v%%.*}
58                         vM=${vM%.*}
59                         v=${v#*.}
60                         vm=${v%%.*}
61                         vm=${vm%.*}
62                         vm=${vm%%[[_A-Z]]*}
63                         if test $vm -eq 99 ; then
64                                 vM=$((vM+1))
65                         fi
66                         if test $vM -gt 1 ; then
67                                 vm=0
68                         fi
69                         AFS_SYSNAME="${arch}_nbsd${vM}${vm}"
70                         ;;
71                 hppa*-hp-hpux11.0*)
72                         AFS_SYSNAME="hp_ux110"
73                         ;;
74                 hppa*-hp-hpux11.11)
75                         AFS_SYSNAME="hp_ux11i"
76                         ;;
77                 hppa*-hp-hpux11.23)
78                         AFS_SYSNAME="hp_ux1123"
79                         ;;
80                 ia64-hp-hpux11.22)
81                         AFS_SYSNAME="ia64_hpux1122"
82                         ;;
83                 ia64-hp-hpux*)
84                         AFS_SYSNAME="ia64_hpux1123"
85                         ;;
86                 hppa*-hp-hpux10*)
87                         AFS_SYSNAME="hp_ux102"
88                         ;;
89                 powerpc-apple-darwin7*)
90                         AFS_SYSNAME="ppc_darwin_70"
91                         OSXSDK="macosx10.3"
92                         ;;
93                 powerpc-apple-darwin8.*)
94                         AFS_SYSNAME="ppc_darwin_80"
95                         OSXSDK="macosx10.4"
96                         ;;
97                 i386-apple-darwin8.*)
98                         AFS_SYSNAME="x86_darwin_80"
99                         OSXSDK="macosx10.4"
100                         ;;
101                 powerpc-apple-darwin9.*)
102                         AFS_SYSNAME="ppc_darwin_90"
103                         OSXSDK="macosx10.5"
104                         ;;
105                 i386-apple-darwin9.*)
106                         AFS_SYSNAME="x86_darwin_90"
107                         OSXSDK="macosx10.5"
108                         ;;
109                 i?86-apple-darwin10.*)
110                         AFS_SYSNAME="x86_darwin_100"
111                         OSXSDK="macosx10.6"
112                         ;;
113                 x86_64-apple-darwin10.*)
114                         AFS_SYSNAME="x86_darwin_100"
115                         OSXSDK="macosx10.6"
116                         ;;
117                 arm-apple-darwin10.*)
118                         AFS_SYSNAME="arm_darwin_100"
119                         OSXSDK="iphoneos4.0"
120                         ;;
121                 x86_64-apple-darwin11.*)
122                         AFS_SYSNAME="x86_darwin_110"
123                         OSXSDK="macosx10.7"
124                         ;;
125                 i?86-apple-darwin11.*)
126                         AFS_SYSNAME="x86_darwin_110"
127                         OSXSDK="macosx10.7"
128                         ;;
129                 x86_64-apple-darwin12.*)
130                         AFS_SYSNAME="x86_darwin_120"
131                         OSXSDK="macosx10.8"
132                         ;;
133                 i?86-apple-darwin12.*)
134                         AFS_SYSNAME="x86_darwin_120"
135                         OSXSDK="macosx10.8"
136                         ;;
137                 x86_64-apple-darwin13.*)
138                         AFS_SYSNAME="x86_darwin_130"
139                         OSXSDK="macosx10.9"
140                         ;;
141                 i?86-apple-darwin13.*)
142                         AFS_SYSNAME="x86_darwin_130"
143                         OSXSDK="macosx10.9"
144                         ;;
145                 x86_64-apple-darwin14.*)
146                         AFS_SYSNAME="x86_darwin_140"
147                         OSXSDK="macosx10.10"
148                         ;;
149                 i?86-apple-darwin14.*)
150                         AFS_SYSNAME="x86_darwin_140"
151                         OSXSDK="macosx10.10"
152                         ;;
153                 x86_64-apple-darwin15.*)
154                         AFS_SYSNAME="x86_darwin_150"
155                         OSXSDK="macosx10.11"
156                         ;;
157                 i?86-apple-darwin15.*)
158                         AFS_SYSNAME="x86_darwin_150"
159                         OSXSDK="macosx10.11"
160                         ;;
161                 x86_64-apple-darwin16.*)
162                         AFS_SYSNAME="x86_darwin_160"
163                         OSXSDK="macosx10.12"
164                         ;;
165                 i?86-apple-darwin16.*)
166                         AFS_SYSNAME="x86_darwin_160"
167                         OSXSDK="macosx10.12"
168                         ;;
169                 x86_64-apple-darwin17.*)
170                         AFS_SYSNAME="x86_darwin_170"
171                         OSXSDK="macosx10.13"
172                         ;;
173                 i?86-apple-darwin17.*)
174                         AFS_SYSNAME="x86_darwin_170"
175                         OSXSDK="macosx10.13"
176                         ;;
177                 sparc-sun-solaris2.8)
178                         AFS_SYSNAME="sun4x_58"
179                         ;;
180                 sparc-sun-solaris2.9)
181                         AFS_SYSNAME="sun4x_59"
182                         ;;
183                 sparc-sun-solaris2.10)
184                         AFS_SYSNAME="sun4x_510"
185                         ;;
186                 sparc-sun-solaris2.11)
187                         AFS_SYSNAME="sun4x_511"
188                         ;;
189                 i386-pc-solaris2.8)
190                         AFS_SYSNAME="sunx86_58"
191                         ;;
192                 i386-pc-solaris2.9)
193                         AFS_SYSNAME="sunx86_59"
194                         ;;
195                 i386-pc-solaris2.10)
196                         AFS_SYSNAME="sunx86_510"
197                         ;;
198                 i386-pc-solaris2.11)
199                         AFS_SYSNAME="sunx86_511"
200                         ;;
201                 mips-sgi-irix6.5)
202                         AFS_SYSNAME="sgi_65"
203                         enable_pam="no"
204                         ;;
205                 ia64-*-linux*)
206                         AFS_SYSNAME="ia64_linuxXX"
207                         ;;
208                 powerpc-*-linux*)
209                         AFS_SYSNAME="`/bin/arch`_linuxXX"
210                         ;;
211                 powerpc64-*-linux*)
212                         AFS_SYSNAME="ppc64_linuxXX"
213                         ;;
214                 alpha*-linux*)
215                         AFS_SYSNAME="alpha_linux_XX"
216                         ;;
217                 s390-*-linux*)
218                         AFS_SYSNAME="s390_linuxXX"
219                         ;;
220                 s390x-*-linux*)
221                         AFS_SYSNAME="s390x_linuxXX"
222                         ;;
223                 sparc-*-linux*)
224                         AFS_SYSNAME="`/bin/arch`_linuxXX"
225                         ;;
226                 sparc64-*-linux*)
227                         AFS_SYSNAME="sparc64_linuxXX"
228                         ;;
229                 i?86-*-linux*)
230                         AFS_SYSNAME="i386_linuxXX"
231                         ;;
232                 arm*-linux*)
233                         AFS_SYSNAME="arm_linuxXX"
234                         ;;
235                 aarch64*-linux*)
236                         AFS_SYSNAME="arm64_linuxXX"
237                         ;;
238                 parisc-*-linux-gnu|hppa-*-linux-gnu)
239                         AFS_SYSNAME="parisc_linuxXX"
240                         enable_pam="no"
241                         ;;
242                 power*-ibm-aix4.2*)
243                         AFS_SYSNAME="rs_aix42"
244                         enable_pam="no"
245                         ;;
246                 power*-ibm-aix4.3*)
247                         AFS_SYSNAME="rs_aix42"
248                         enable_pam="no"
249                         ;;
250                 power*-ibm-aix5.1*)
251                         AFS_SYSNAME="rs_aix51"
252                         enable_pam="no"
253                         ;;
254                 power*-ibm-aix5.2*)
255                         AFS_SYSNAME="rs_aix52"
256                         enable_pam="no"
257                         ;;
258                 power*-ibm-aix5.3*)
259                         AFS_SYSNAME="rs_aix53"
260                         enable_pam="no"
261                         ;;
262                 power*-ibm-aix6.1*)
263                         AFS_SYSNAME="rs_aix61"
264                         enable_pam="no"
265                         ;;
266                 x86_64-*-linux-gnu)
267                         AFS_SYSNAME="amd64_linuxXX"
268                         enable_pam="yes"
269                         ;;
270                 *)
271                         AC_MSG_ERROR(An AFS sysname is required)
272                         exit 1
273                         ;;
274         esac
275         case $AFS_SYSNAME in
276                 *_linux* | *_umlinux*)
277                         if test "x${AFS_SYSKVERS}" = "x"; then
278                          AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
279                         fi
280                         if test "x${AFS_SYSKVERS}" = "x24" ||
281                                 test "x${AFS_SYSKVERS}" = "x22"; then
282                             AC_MSG_ERROR([Linux 2.4.x and older are no longer supported by OpenAFS.  Please use an OpenAFS 1.6.x release on those systems.])
283                         fi
284                         _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
285                         AFS_SYSNAME="$_AFS_SYSNAME"
286                         AC_TRY_KBUILD(
287                          [],
288                          [#ifndef CONFIG_USERMODE
289                           #error not UML
290                           #endif],
291                          ac_cv_linux_is_uml=yes,)
292                         if test "${ac_cv_linux_is_uml}" = yes; then
293                          _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/`
294                         fi
295                         AFS_SYSNAME="$_AFS_SYSNAME"
296                         ;;
297         esac
298         AC_MSG_RESULT($AFS_SYSNAME)
299 fi
300
301 case $AFS_SYSNAME in
302         *_darwin*)
303                 AC_CHECK_HEADERS(crt_externs.h)
304                 DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
305                 DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
306                 AC_SUBST(OSXSDK)
307                 ;;
308 esac
309
310 dnl Some hosts have a separate common param file they should include.  Figure
311 dnl out if we're on one of them now that we know the sysname.
312 case $AFS_SYSNAME in
313     *_nbsd15)   AFS_PARAM_COMMON=param.nbsd15.h  ;;
314     *_nbsd16)   AFS_PARAM_COMMON=param.nbsd16.h  ;;
315     *_nbsd20)   AFS_PARAM_COMMON=param.nbsd20.h  ;;
316     *_nbsd21)   AFS_PARAM_COMMON=param.nbsd21.h  ;;
317     *_nbsd30)   AFS_PARAM_COMMON=param.nbsd30.h  ;;
318     *_nbsd40)   AFS_PARAM_COMMON=param.nbsd40.h  ;;
319     *_nbsd50)   AFS_PARAM_COMMON=param.nbsd50.h  ;;
320     *_nbsd60)   AFS_PARAM_COMMON=param.nbsd60.h  ;;
321     *_nbsd70)   AFS_PARAM_COMMON=param.nbsd70.h  ;;
322     *_obsd31)   AFS_PARAM_COMMON=param.obsd31.h  ;;
323     *_obsd32)   AFS_PARAM_COMMON=param.obsd32.h  ;;
324     *_obsd33)   AFS_PARAM_COMMON=param.obsd33.h  ;;
325     *_obsd34)   AFS_PARAM_COMMON=param.obsd34.h  ;;
326     *_obsd35)   AFS_PARAM_COMMON=param.obsd35.h  ;;
327     *_obsd36)   AFS_PARAM_COMMON=param.obsd36.h  ;;
328     *_obsd37)   AFS_PARAM_COMMON=param.obsd37.h  ;;
329     *_obsd38)   AFS_PARAM_COMMON=param.obsd38.h  ;;
330     *_obsd39)   AFS_PARAM_COMMON=param.obsd39.h  ;;
331     *_obsd40)   AFS_PARAM_COMMON=param.obsd40.h  ;;
332     *_obsd41)   AFS_PARAM_COMMON=param.obsd41.h  ;;
333     *_obsd42)   AFS_PARAM_COMMON=param.obsd42.h  ;;
334     *_obsd43)   AFS_PARAM_COMMON=param.obsd43.h  ;;
335     *_obsd44)   AFS_PARAM_COMMON=param.obsd44.h  ;;
336     *_obsd45)   AFS_PARAM_COMMON=param.obsd45.h  ;;
337     *_obsd46)   AFS_PARAM_COMMON=param.obsd46.h  ;;
338     *_obsd47)   AFS_PARAM_COMMON=param.obsd47.h  ;;
339     *_obsd48)   AFS_PARAM_COMMON=param.obsd48.h  ;;
340     *_obsd49)   AFS_PARAM_COMMON=param.obsd49.h  ;;
341     *_obsd50)   AFS_PARAM_COMMON=param.obsd50.h  ;;
342     *_obsd51)   AFS_PARAM_COMMON=param.obsd51.h  ;;
343     *_obsd52)   AFS_PARAM_COMMON=param.obsd52.h  ;;
344     *_obsd53)   AFS_PARAM_COMMON=param.obsd53.h  ;;
345     *_obsd54)   AFS_PARAM_COMMON=param.obsd54.h  ;;
346     *_linux26)  AFS_PARAM_COMMON=param.linux26.h ;;
347 # Linux alpha adds an extra underscore for no good reason.
348     *_linux_26) AFS_PARAM_COMMON=param.linux26.h ;;
349     *_fbsd_*)   AFS_PARAM_COMMON=param.generic_fbsd.h ;;
350 esac
351 ])