source: trunk/configure.ac @ 524

Last change on this file since 524 was 524, checked in by dennis, 8 years ago

Owke, lssci has changed its behaviour to install in /usr/local, this must me /usr

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@sara.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        ppc64*)
58                ARCH=ppc64
59                ARCH_BIT=64
60                AC_MSG_RESULT(found ${ARCH})
61        ;;
62        i686*|i386*)
63                AC_MSG_RESULT(found ${ARCH})
64                ARCH=i386
65                ARCH_BIT=32
66        ;;
67        *)
68                AC_MSG_RESULT(no)
69                AC_MSG_ERROR(Found an unsupported architecture)
70                exit 1
71        ;;
72esac
73
74AC_SUBST(ARCH,$ARCH)
75AC_SUBST(ARCH_BIT,$ARCH_BIT)
76AC_SUBST(OS,$OS)
77AC_SUBST(OS_RELEASE,$OS_RELEASE)
78AC_SUBST(SALI_VERSION,"$(cat VERSION)")
79
80AC_CONFIG_FILES([
81        Makefile
82        initrd/sali/bin/sali_functions
83])
84
85AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.