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