source: trunk/configure.ac

Last change on this file was 627, checked in by dennis, 6 years ago

Trying to use eudev (udev 217)

File size: 1.9 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3# This is adapted from the code I wrote for OpenHPI to do the same - Sean
4#
5
6AC_PREREQ(2.59)
7AC_INIT(SALI, m4_esyscmd([cat VERSION | tr -d '\n']), sali@surfsara.nl)
8
9# Checks for programs.
10AC_PROG_CXX
11AC_PROG_AWK
12AC_PROG_CC
13AC_PROG_CPP
14AC_PROG_LN_S
15AC_PROG_MAKE_SET
16
17AC_PATH_PROG(gcc_exec,gcc)
18AC_PATH_PROG(gxx_exec,g++)
19AC_SUBST(GCC,$gcc_exec)
20AC_SUBST(GXX,$gxx_exec)
21
22# Operatingsystem detection
23AC_MSG_CHECKING([uname -s for detecting host operating system])
24case "$(uname -s)" in
25        Linux*)
26                if [ test -e /etc/debian_version ]; then
27                        OS=debian
28                        OS_RELEASE=$(cat /etc/debian_version|awk -F . '{print $1}')
29                        AC_MSG_RESULT(found ${OS} release ${OS_RELEASE})
30                elif [ test -e /etc/SuSE-release ]; then
31                        OS=suse
32                        OS_RELEASE=$(cat /etc/SuSE-release|awk '/VERSION =/ {print $3}')
33                        AC_MSG_RESULT(found ${OS} release ${OS_RELEASE})
34                elif [ test -e /etc/redhat-release ]; then
35                        OS=rhel
36                        OS_RELEASE=$(cat /etc/redhat-release|awk '{print $3}')
37                        AC_MSG_RESULT(found ${OS} release ${OS_RELEASE})
38                else
39                        AC_MSG_RESULT(no)
40                        AC_MSG_ERROR(Found an unsupported Linux distribution)
41                fi
42        ;;
43        *)
44                AC_MSG_RESULT(no)
45                AC_MSG_ERROR(Found an unsupported operating system)
46        ;;
47esac
48
49# Architecture detection
50AC_MSG_CHECKING([uname -m for detecting host operating architecture])
51case "$(uname -m)" in
52        amd64*|x86_64)
53                ARCH=x86_64
54                ARCH_BIT=64
55                AC_MSG_RESULT(found ${ARCH})
56        ;;
57        i686*|i386*)
58                AC_MSG_RESULT(found ${ARCH})
59                ARCH=i386
60                ARCH_BIT=32
61        ;;
62        *)
63                AC_MSG_RESULT(no)
64                AC_MSG_ERROR(Found an unsupported architecture)
65                exit 1
66        ;;
67esac
68
69AC_SUBST(ARCH,$ARCH)
70AC_SUBST(ARCH_BIT,$ARCH_BIT)
71AC_SUBST(OS,$OS)
72AC_SUBST(OS_RELEASE,$OS_RELEASE)
73AC_SUBST(SALI_VERSION,"$(cat VERSION)")
74
75AC_CONFIG_FILES([
76        Makefile
77        initrd/sali/bin/sali_functions
78        bootdisk/sali_create_bootdisk
79])
80
81AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.