source: trunk/athena/bin/machtype/configure.in @ 14823

Revision 14823, 1.2 KB checked in by ghudson, 25 years ago (diff)
Do appropriate substitutions in Linux machtype script.
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(machtype.c)
3
4test -z "$lbindir" && lbindir='${bindir}'
5AC_SUBST(lbindir)
6
7AC_PROG_CC
8AC_PROG_INSTALL
9
10AC_CANONICAL_HOST
11case $host_os in
12solaris*)
13        OS=solaris
14        AC_CHECK_FUNC(kvm_read, :, AC_CHECK_LIB(kvm, kvm_read))
15        AC_CHECK_FUNC(read_vtoc, :, AC_CHECK_LIB(adm, read_vtoc))
16        ;;
17irix*)
18        OS=irix
19        ;;
20linux*)
21        OS=linux
22        ;;
23netbsd*)
24        OS=netbsd
25        ;;
26esac
27
28AC_MSG_CHECKING(if machtype is a script)
29if test -r ${srcdir}/machtype_$OS.sh; then
30        AC_MSG_RESULT(yes)
31        TARGET=${srcdir}/machtype.sh
32        INSTALLFLAGS="-m 555"
33        script=true
34else
35        AC_MSG_RESULT(no)
36        TARGET=machtype
37        OS_OBJS=machtype_$OS.o
38        INSTALLFLAGS="-m 2555 -o root -g sys"
39fi
40AC_SUBST(TARGET)
41AC_SUBST(OS_OBJS)
42AC_SUBST(INSTALLFLAGS)
43
44if test true = "$script"; then
45        AC_SUBST(ATHENA_MAJOR_VERSION)
46        AC_SUBST(ATHENA_MINOR_VERSION)
47        AC_SUBST(ATHENA_SYS)
48        AC_SUBST(ATHENA_SYS_COMPAT)
49        AC_OUTPUT(Makefile machtype.sh:machtype_$OS.sh)
50else
51        AC_DEFINE_UNQUOTED(ATHMAJV, "$ATHENA_MAJOR_VERSION")
52        AC_DEFINE_UNQUOTED(ATHMINV, "$ATHENA_MINOR_VERSION")
53        AC_DEFINE_UNQUOTED(OSVERS, "`uname -r`")
54        AC_DEFINE_UNQUOTED(OSNAME, "`uname -s`")
55        AC_DEFINE_UNQUOTED(ATHSYS, "$ATHENA_SYS")
56        AC_DEFINE_UNQUOTED(ATHSYSCOMPAT, "$ATHENA_SYS_COMPAT")
57        AC_OUTPUT(Makefile)
58fi
Note: See TracBrowser for help on using the repository browser.