~mterry/ubuntu/natty/libofx/libofx.new-upstream-benoit-sru

« back to all changes in this revision

Viewing changes to m4/os.m4

  • Committer: Bazaar Package Importer
  • Author(s): Saïvann Carignan
  • Date: 2008-02-06 17:25:16 UTC
  • mto: (3.1.2 lenny)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20080206172516-bnzxb29igye8um9h
Tags: upstream-0.9.0
Import upstream version 0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: os.m4,v 1.1 2007/10/27 11:28:08 aquamaniac Exp $
 
2
# (c) 2002 Martin Preuss<martin@libchipcard.de>
 
3
# These functions guess your operation system
 
4
 
 
5
AC_DEFUN([AQ_CHECK_OS],[
 
6
dnl IN: 
 
7
dnl   - AC_CANONICAL_SYSTEM muste be called before
 
8
dnl OUT:
 
9
dnl   Variables:
 
10
dnl     OSYSTEM: Short name of your system (subst)
 
11
dnl     OS_TYPE: either "posix" or "windows" (subst)
 
12
dnl     MAKE_DLL_TARGET: under windows this is set to "dll" (subst)
 
13
dnl     INSTALL_DLL_TARGET: under Windows this is set to "dll-install" (subst)
 
14
dnl   Defines:
 
15
dnl     OS_NAME: full name of your system
 
16
dnl     OS_SHORTNAME: short name of your system
 
17
dnl     Depending on your system one of the following is defined in addition:
 
18
dnl      OS_LINUX, OS_OPENBSD, OS_FREEBSD, OS_BEOS, OS_WIN32
 
19
 
 
20
# check for OS
 
21
AC_MSG_CHECKING([host system type])
 
22
OSYSTEM=""
 
23
OS_TYPE=""
 
24
MAKE_DLL_TARGET=""
 
25
INSTALL_DLL_TARGET=""
 
26
AC_DEFINE_UNQUOTED(OS_NAME,"$host", [host system])
 
27
case "$host" in
 
28
    *-linux*)
 
29
        OSYSTEM="linux"
 
30
        AC_DEFINE(OS_LINUX,1,[if linux is used])
 
31
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
32
        OS_TYPE="posix"
 
33
        ;;
 
34
    *-solaris*)
 
35
        OSYSTEM="solaris"
 
36
        AC_DEFINE(OS_SOLARIS,1,[if Solaris is used])
 
37
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
38
        OS_TYPE="posix"
 
39
        ;;
 
40
    *-darwin*)
 
41
        OSYSTEM="osx"
 
42
        AC_DEFINE(OS_DARWIN,1,[if Apple Darwin is used])
 
43
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
44
        OS_TYPE="posix"
 
45
        ;;
 
46
    *-openbsd*)
 
47
        OSYSTEM="openbsd"
 
48
        AC_DEFINE(OS_OPENBSD,1,[if OpenBSD is used])
 
49
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
50
        OS_TYPE="posix"
 
51
        ;;
 
52
    *-freebsd*)
 
53
        OSYSTEM="freebsd"
 
54
        AC_DEFINE(OS_FREEBSD,1,[if FreeBSD is used])
 
55
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
56
        OS_TYPE="posix"
 
57
        ;;
 
58
    *-netbsd*)
 
59
        OSYSTEM="netbsd"
 
60
        AC_DEFINE(OS_NETBSD,1,[if NetBSD is used])
 
61
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
62
        OS_TYPE="posix"
 
63
        ;;
 
64
    *-beos*)
 
65
        OSYSTEM="beos"
 
66
        AC_DEFINE(OS_BEOS,1,[if BeOS is used])
 
67
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
68
        OS_TYPE="posix"
 
69
        ;;
 
70
    *-win32*)
 
71
        OSYSTEM="windows"
 
72
        AC_DEFINE(OS_WIN32,1,[if WIN32 is used])
 
73
        OS_TYPE="windows"
 
74
        AC_DEFINE_UNQUOTED(BUILDING_DLL,1,[if DLL is to be built])
 
75
        MAKE_DLL_TARGET="dll"
 
76
        INSTALL_DLL_TARGET="dll-install"
 
77
        ;;
 
78
    *-mingw32*)
 
79
        OSYSTEM="windows"
 
80
        AC_DEFINE(OS_WIN32,1,[if WIN32 is used])
 
81
        OS_TYPE="windows"
 
82
        AC_DEFINE_UNQUOTED(BUILDING_DLL,1,[if DLL is to be built])
 
83
        MAKE_DLL_TARGET="dll"
 
84
        INSTALL_DLL_TARGET="dll-install"
 
85
        ;;
 
86
    *-palmos*)
 
87
        OSYSTEM="palmos"
 
88
        AC_DEFINE(OS_PALMOS,1,[if PalmOS is used])
 
89
        OS_TYPE="palmos"
 
90
        ;;
 
91
    *)
 
92
        AC_MSG_WARN([Sorry, but host $host is not supported.
 
93
        Please report if it works anyway. We will assume that your system
 
94
        is a posix system and continue.])
 
95
        OSYSTEM="unknown"
 
96
        OS_TYPE="posix"
 
97
        AC_DEFINE(OS_POSIX,1,[if this is a POSIX system])
 
98
        ;;
 
99
esac
 
100
 
 
101
AC_SUBST(OSYSTEM)
 
102
AC_DEFINE_UNQUOTED(OS_SHORTNAME,"$OSYSTEM",[host system])
 
103
AC_SUBST(OS_TYPE)
 
104
AC_DEFINE_UNQUOTED(OS_TYPE,"$OS_TYPE",[system type])
 
105
AC_SUBST(MAKE_DLL_TARGET)
 
106
AC_SUBST(INSTALL_DLL_TARGET)
 
107
 
 
108
AC_MSG_RESULT($OS_TYPE)
 
109
])
 
110
 
 
111