comparison host/infra/acinclude.m4 @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents
children 6ed91473a1cd
comparison
equal deleted inserted replaced
75:41bf073c0c32 76:435cced73e2f
1 dnl Process this file with aclocal to get an aclocal.m4 file. Then
2 dnl process that with autoconf.
3 dnl ====================================================================
4 dnl
5 dnl acinclude.m4
6 dnl
7 dnl Host side implementation of the eCos infrastructure.
8 dnl
9 dnl ====================================================================
10 dnl####COPYRIGHTBEGIN####
11 dnl
12 dnl ----------------------------------------------------------------------------
13 dnl Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
14 dnl
15 dnl This file is part of the eCos host tools.
16 dnl
17 dnl This program is free software; you can redistribute it and/or modify it
18 dnl under the terms of the GNU General Public License as published by the Free
19 dnl Software Foundation; either version 2 of the License, or (at your option)
20 dnl any later version.
21 dnl
22 dnl This program is distributed in the hope that it will be useful, but WITHOUT
23 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
25 dnl more details.
26 dnl
27 dnl You should have received a copy of the GNU General Public License along with
28 dnl this program; if not, write to the Free Software Foundation, Inc.,
29 dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 dnl
31 dnl ----------------------------------------------------------------------------
32 dnl
33 dnl####COPYRIGHTEND####
34 dnl ====================================================================
35 dnl#####DESCRIPTIONBEGIN####
36 dnl
37 dnl Author(s): bartv
38 dnl Contact(s): bartv
39 dnl Date: 1998/07/14
40 dnl Version: 0.01
41 dnl
42 dnl####DESCRIPTIONEND####
43 dnl ====================================================================
44
45 dnl Access shared macros.
46 dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not
47 dnl incorporate the macro into aclocal.m4
48 sinclude(../acinclude.m4)
49
50
51 dnl ====================================================================
52 dnl Look for a 64 bit data type. It is necessary to check both C and C++
53 dnl compilers.
54 dnl
55 dnl A better implementation would check whether or not AC_PROG_CC and
56 dnl AC_PROG_CXX have been invoked and only test the appropriate
57 dnl compiler.
58
59 AC_DEFUN(CYG_AC_TYPE_64bit, [
60 AC_REQUIRE([AC_PROG_CC])
61 AC_REQUIRE([AC_PROG_CXX])
62
63 AC_CACHE_CHECK("for a 64 bit data type",cyg_ac_cv_type_64bit,[
64 for type in "long" "long long" "__int64"; do
65 AC_LANG_SAVE
66 AC_LANG_C
67 AC_TRY_RUN([
68 main() {
69 return 8 != sizeof($type);
70 }
71 ],ctype_64bit=$type,ctype_64bit="unknown",ctype_64bit="unknown")
72 AC_LANG_CPLUSPLUS
73 AC_TRY_RUN([
74 int main(int argc, char ** argv) {
75 return 8 != sizeof($type);
76 }
77 ],cxxtype_64bit=$type,cxxtype_64bit="unknown",cxxtype_64bit="unknown")
78 AC_LANG_RESTORE
79 if test "${ctype_64bit}" = "${type}" -a "${cxxtype_64bit}" = "${type}"; then
80 cyg_ac_cv_type_64bit="${type}"
81 break
82 fi
83 done
84 ])
85 if test "${cyg_ac_cv_type_64bit}" = ""; then
86 AC_MSG_ERROR(Unable to figure out how to do 64 bit arithmetic)
87 else
88 if test "${cyg_ac_cv_type_64bit}" != "long long"; then
89 AC_DEFINE_UNQUOTED(cyg_halint64,${cyg_ac_cv_type_64bit})
90 AC_DEFINE_UNQUOTED(cyg_halcount64,${cyg_ac_cv_type_64bit})
91 fi
92 fi
93 ])
94
95 dnl ====================================================================
96 dnl Check that both the C and C++ compilers support __PRETTY_FUNCTION__
97
98 AC_DEFUN(CYG_AC_C_PRETTY_FUNCTION,[
99 AC_REQUIRE([AC_PROG_CC])
100 AC_REQUIRE([AC_PROG_CXX])
101
102 AC_CACHE_CHECK("for __PRETTY_FUNCTION__ support",cyg_ac_cv_c_pretty_function,[
103 AC_LANG_SAVE
104 AC_LANG_C
105 AC_TRY_LINK(
106 [#include <stdio.h>],
107 [puts(__PRETTY_FUNCTION__);],
108 c_ok="yes",
109 c_ok="no"
110 )
111 AC_LANG_CPLUSPLUS
112 AC_TRY_LINK(
113 [#include <cstdio>],
114 [puts(__PRETTY_FUNCTION__);],
115 cxx_ok="yes",
116 cxx_ok="no"
117 )
118 AC_LANG_RESTORE
119 if test "${c_ok}" = "yes" -a "${cxx_ok}" = "yes"; then
120 cyg_ac_cv_c_pretty_function="yes"
121 fi
122 ])
123 if test "${cyg_ac_cv_c_pretty_function}" = "yes"; then
124 AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO)
125 fi
126 ])
127
128
129
130