annotate acsupport/acinclude.m4 @ 290:3ecf91f6663a

Update instructions for building the host-side software
author bartv
date Tue, 13 Aug 2002 20:10:16 +0000
parents f58bc1b2c2bc
children c0ffaecb376e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
1 dnl Process this file with aclocal to get an aclocal.m4 file. Then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
2 dnl process that with autoconf.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
3 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
4 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
5 dnl acinclude.m4
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
6 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
7 dnl Various autoconf macros that are shared between different
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
8 dnl eCos packages.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
9 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
10 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
11 dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN####
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
12 dnl ----------------------------------------------------------------------------
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
13 dnl Copyright (C) 2002 Bart Veer
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
14 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
15 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
16 dnl This file is part of the eCos host tools.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
17 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
18 dnl This program is free software; you can redistribute it and/or modify it
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
19 dnl under the terms of the GNU General Public License as published by the Free
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
20 dnl Software Foundation; either version 2 of the License, or (at your option)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
21 dnl any later version.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
22 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
23 dnl This program is distributed in the hope that it will be useful, but WITHOUT
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
24 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
25 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
26 dnl more details.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
27 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
28 dnl You should have received a copy of the GNU General Public License along with
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
29 dnl this program; if not, write to the Free Software Foundation, Inc.,
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
30 dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
31 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
32 dnl ----------------------------------------------------------------------------
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
33 dnl ####ECOSHOSTGPLCOPYRIGHTEND####
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
34 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
35 dnl#####DESCRIPTIONBEGIN####
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
36 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
37 dnl Author(s): bartv
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
38 dnl Contact(s): bartv
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
39 dnl Date: 1998/12/16
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
40 dnl Version: 0.01
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
41 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
42 dnl####DESCRIPTIONEND####
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
43 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
44
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
45 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
46 dnl Ensure that configure is not being run in the source tree, i.e.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
47 dnl that a separate build tree has been created. This is not absolutely
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
48 dnl necessary at the time of writing but may become so in future, and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
49 dnl is good practice.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
50
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
51 AC_DEFUN(ECOS_CHECK_BUILD_ne_SRC,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
52 AC_MSG_CHECKING([that a separate build tree is being used])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
53 ecos_cwd=`/bin/pwd`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
54 if test "${srcdir}" = "." ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
55 srcdir=${ecos_cwd}
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
56 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
57 if test "${ecos_cwd}" = "${srcdir}" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
58 AC_MSG_RESULT([no])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
59 AC_MSG_ERROR([This configure script should not be run inside the source tree. Instead please use a separate build tree])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
60 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
61 AC_MSG_RESULT(yes)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
62 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
63 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
64
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
65 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
66 dnl The AM_INIT_AUTOMAKE() will define a symbol VERSION for the
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
67 dnl package's version number. Unfortunately this symbol is rather
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
68 dnl hard to share if several different packages are involved, so this
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
69 dnl macro is used to define an alternative symbol
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
70
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
71 AC_DEFUN(ECOS_SUBST_VERSION,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
72 AC_REQUIRE([AM_INIT_AUTOMAKE])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
73 ifelse($#,1,,AC_MSG_ERROR([Invalid number of arguments passed to ECOS SUBST_VERSION]))
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
74 AC_DEFINE_UNQUOTED($1, "$VERSION")
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
75 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
76
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
77 dnl --------------------------------------------------------------------
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
78 dnl Convert a cygwin pathname to something acceptable to VC++ (but
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
79 dnl still invoked from bash and cygwin's make). This means using
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
80 dnl the cygpath utility and then translating any backslashes into
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
81 dnl forward slashes to avoid confusing make.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
82
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
83 AC_DEFUN(ECOS_MSVC_PATH, [
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
84 AC_REQUIRE([ECOS_PROG_MSVC])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
85 ifelse($#, 1, , AC_MSG_ERROR("Invalid number of arguments passed to ECOS MSVC_PATH"))
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
86 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
87 $1=`cygpath -w ${$1} | tr \\\\\\\\ /`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
88 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
89 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
90
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
91 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
92 dnl An internal utility to define eCos variants of various compilation
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
93 dnl related flags. The aim is to avoid messing with CFLAGS, LIBS, and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
94 dnl so on because those are used for feature tests as well as for
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
95 dnl passing on to the application.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
96 AC_DEFUN(ECOS_PROG_DEFINE_COMPILER_FLAGS,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
97 ecos_CFLAGS=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
98 ecos_CXXFLAGS=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
99 ecos_LDADD=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
100 ecos_INCLUDES=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
101 ecos_LIBS=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
102 AC_SUBST(ecos_CFLAGS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
103 AC_SUBST(ecos_CXXFLAGS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
104 AC_SUBST(ecos_LDADD)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
105 AC_SUBST(ecos_INCLUDES)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
106 AC_SUBST(ecos_LIBS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
107 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
108
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
109 dnl For historical reasons some of the eCos host-side software can be
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
110 dnl built with Visual C++ as well as g++. The user can specify this
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
111 dnl at configure time using CC=cl, where cl.exe is the compiler driver.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
112 dnl This macro will set the variable MSVC to "yes" or to "no" depending
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
113 dnl on whether or not VC++ is being used, analogous to the variable
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
114 dnl GCC set by AC_PROG_CC. It provides support for an automake
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
115 dnl conditional thus allowing the makefile to adapt somewhat to the
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
116 dnl compiler being used. Finally it fills in the ECOS_INCLUDES,
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
117 dnl ECOS_LIBS and ECOS_LDADD variables with suitable initial values.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
118
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
119 AC_DEFUN(ECOS_PROG_MSVC,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
120 AC_REQUIRE([AC_PROG_CC])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
121 AC_REQUIRE([AC_PROG_CXX])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
122 AC_REQUIRE([ECOS_PROG_DEFINE_COMPILER_FLAGS])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
123
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
124 AC_MSG_CHECKING("for Visual C++")
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
125 MSVC="no";
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
126 if test "${CC}" = "cl" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
127 MSVC="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
128 CXX="cl"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
129 ECOS_MSVC_PATH(MSVC_SRCDIR)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
130 AC_SUBST(MSVC_SRCDIR)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
131 ecos_INCLUDES="${ecos_INCLUDES} \"-I${msvc_srcdir}\""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
132 ecos_LDADD="-link"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
133 ecos_LIBS="advapi32.lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
134 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
135 AM_CONDITIONAL(MSVC, test "${MSVC}" = "yes")
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
136 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
137 AC_MSG_RESULT([unfortunately yes])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
138 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
139 AC_MSG_RESULT([no])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
140 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
141 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
142
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
143 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
144 dnl Set up sensible flags for the various different compilers. This
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
145 dnl is achieved by manipulating AM-CFLAGS and AM-CXXFLAGS via a subst,
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
146 dnl plus undoing the setting of CFLAGS and CXXFLAGS done by
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
147 dnl the AC_PROC_CC and AC_PROG_CXX macros (e.g. setting the default
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
148 dnl compilation flags to -O2). Note that this relies
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
149 dnl on knowing about the internals of those macros.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
150 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
151 dnl There is little point in checking the cache: this macro does
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
152 dnl not do any feature tests so checking the cache would probably
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
153 dnl be more expensive than doing the work here.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
154 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
155 dnl For now the only supported compilers are gcc/g++ and VC++. Attempts
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
156 dnl to use another compiler will result in an error at configure-time.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
157 AC_DEFUN(ECOS_PROG_STANDARD_COMPILER_FLAGS, [
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
158 AC_REQUIRE([AC_PROG_CC])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
159 AC_REQUIRE([AC_PROG_CXX])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
160 AC_REQUIRE([ECOS_PROG_DEFINE_COMPILER_FLAGS])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
161 AC_REQUIRE([ECOS_PROG_MSVC])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
162
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
163 AC_MSG_CHECKING("the default compiler flags")
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
164
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
165 dnl Add a user-settable flag to control whether or debugging info is
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
166 dnl incorporated at compile-time.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
167 ecosflags_enable_debug="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
168 AC_ARG_ENABLE(debug,[ --enable-debug do a debug rather than a release build],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
169 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
170 yes) ecosflags_enable_debug="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
171 *) ecosflags_enable_debug="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
172 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
173
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
174 dnl For VC++ builds also provide a flag for ANSI vs. unicode builds.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
175 dnl For now this does not actually affect the compiler flags.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
176 dnl NOTE: there may also have to be a flag to control whether or
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
177 dnl the VC++ multi-threading flags are enabled.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
178 ecosflags_enable_ansi="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
179 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
180 AC_ARG_ENABLE(ansi,[ --enable-ansi do an ANSI rather than a unicode build],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
181 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
182 yes) ecosflags_enable_ansi="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
183 *) ecosflags_enable_ansi="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
184 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
185 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
186
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
187 dnl Now we know what the user is after.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
188 if test "${GCC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
189 ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
190 ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
191 elif test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
192 ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
193 ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
194 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
195 AC_MSG_ERROR("default flags for ${CC} are not known")
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
196 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
197
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
198 dnl Choose between debugging and optimization.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
199 if test "${ecosflags_enable_debug}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
200 if test "${GCC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
201 ecos_CFLAGS="${ecos_CFLAGS} -g -O0"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
202 ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
203 elif test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
204 ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
205 ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
206 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
207 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
208 dnl For now building with g++ implies -O0 rather than -O2. The
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
209 dnl compile-time performance of g++ at -O2 has been disappointing
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
210 dnl for quite some time, and the eCos host-side code is not
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
211 dnl sufficiently cpu-intensive to require -O2.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
212 if test "${GCC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
213 ecos_CFLAGS="${ecos_CFLAGS} -O0"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
214 ecos_CXXFLAGS="${ecos_CXXFLAGS} -O0"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
215 elif test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
216 ecos_CFLAGS="${ecos_CFLAGS} -MD -O2"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
217 ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
218 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
219 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
220
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
221 CFLAGS="${ac_save_CFLAGS}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
222 CXXFLAGS="${ac_save_CXXFLAGS}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
223
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
224 AC_MSG_RESULT(done)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
225 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
226
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
227 dnl --------------------------------------------------------------------
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
228 dnl User-settable options for assertions and tracing.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
229 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
230 dnl The settable options are:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
231 dnl --disable-asserts
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
232 dnl --disable-preconditions
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
233 dnl --disable-postconditions
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
234 dnl --disable-invariants
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
235 dnl --disable-loopinvariants
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
236 dnl --disable-tracing
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
237 dnl --disable-fntracing
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
238
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
239 AC_DEFUN(ECOS_ARG_INFRASTRUCTURE, [
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
240
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
241 AC_REQUIRE([ECOS_PROG_STANDARD_COMPILER_FLAGS])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
242
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
243 if test "${ecosflags_enable_debug}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
244 ecosinfra_asserts="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
245 ecosinfra_preconditions="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
246 ecosinfra_postconditions="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
247 ecosinfra_invariants="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
248 ecosinfra_loopinvariants="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
249 ecosinfra_tracing="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
250 ecosinfra_fntracing="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
251 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
252 ecosinfra_asserts="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
253 ecosinfra_preconditions="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
254 ecosinfra_postconditions="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
255 ecosinfra_invariants="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
256 ecosinfra_loopinvariants="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
257 ecosinfra_tracing="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
258 ecosinfra_fntracing="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
259 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
260
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
261 AC_ARG_ENABLE(asserts,[ --disable-asserts disable all assertions],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
262 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
263 yes) ecosinfra_asserts="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
264 no) ecosinfra_asserts="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
265 *) AC_MSG_ERROR([bad value ${enableval} for disable-asserts option]) ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
266 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
267 if test "${ecosinfra_asserts}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
268 AC_DEFINE(CYGDBG_USE_ASSERTS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
269 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
270
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
271 AC_ARG_ENABLE(preconditions, [ --disable-preconditions disable a subset of the assertions],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
272 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
273 yes) ecosinfra_preconditions="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
274 no) ecosinfra_preconditions="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
275 *) AC_MSG_ERROR([bad value ${enableval} for disable-preconditions option]) ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
276 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
277 if test "${ecosinfra_preconditions}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
278 AC_DEFINE(CYGDBG_INFRA_DEBUG_PRECONDITIONS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
279 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
280
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
281 AC_ARG_ENABLE(postconditions, [ --disable-postconditions disable a subset of the assertions],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
282 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
283 yes) ecosinfra_postconditions="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
284 no) ecosinfra_postconditions="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
285 *) AC_MSG_ERROR([bad value ${enableval} for disable-postconditions option]) ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
286 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
287 if test "${ecosinfra_postconditions}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
288 AC_DEFINE(CYGDBG_INFRA_DEBUG_POSTCONDITIONS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
289 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
290
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
291 AC_ARG_ENABLE(invariants, [ --disable-invariants disable a subset of the assertions],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
292 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
293 yes) ecosinfra_invariants="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
294 no) ecosinfra_invariants="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
295 *) AC_MSG_ERROR([bad value ${enableval} for disable-invariants option]) ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
296 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
297 if test "${ecosinfra_invariants}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
298 AC_DEFINE(CYGDBG_INFRA_DEBUG_INVARIANTS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
299 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
300
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
301 AC_ARG_ENABLE(loopinvariants, [ --disable-loopinvariants disable a subset of the assertions],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
302 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
303 yes) ecosinfra_loopinvariants="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
304 no) ecosinfra_loopinvariants="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
305 *) AC_MSG_ERROR([bad value ${enableval} for disable-loopinvariants option]) ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
306 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
307 if test "${ecosinfra_loopinvariants}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
308 AC_DEFINE(CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
309 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
310
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
311 AC_ARG_ENABLE(tracing,[ --disable-tracing disable tracing],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
312 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
313 yes) ecosinfra_tracing="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
314 no) ecosinfra_tracing="no" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
315 *) AC_MSG_ERROR([bad value ${enableval} for disable-tracing option]) ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
316 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
317 if test "${ecosinfra_tracing}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
318 AC_DEFINE(CYGDBG_USE_TRACING)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
319 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
320
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
321 AC_ARG_ENABLE(fntracing,[ --disable-fntracing disable function entry/exit tracing],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
322 [case "${enableval}" in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
323 yes) ecosinfra_fntracing="yes" ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
324 no) ecosinfra_fntracing=no ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
325 *) AC_MSG_ERROR([bad value ${enableval} for disable-fntracing option]) ;;
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
326 esac])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
327 if test "${ecosinfra_fntracing}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
328 AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
329 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
330 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
331
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
332 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
333 dnl Inspired by KDE's autoconfig
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
334 dnl This macro takes three Arguments like this:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
335 dnl AC_FIND_FILE(foo.h, $incdirs, incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
336 dnl the filename to look for, the list of paths to check and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
337 dnl the variable with the result.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
338
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
339 AC_DEFUN(AC_FIND_FILE,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
340 $3=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
341 for i in $2; do
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
342 if test -r "$i/$1"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
343 $3=$i
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
344 break
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
345 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
346 done
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
347 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
348
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
349 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
350 dnl Variation of the above.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
351 dnl This macro takes three Arguments like this:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
352 dnl AC_FIND_DIR(infra, $incdirs, incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
353 dnl the directory name to look for, the list of paths to check and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
354 dnl the variable with the result.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
355
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
356 AC_DEFUN(AC_FIND_DIR,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
357 $3=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
358 for i in $2; do
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
359 if test -d "$i/$1"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
360 $3=$i
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
361 break
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
362 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
363 done
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
364 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
365
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
366 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
367 dnl Work out details of the Tcl/tk installation that should be used.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
368 dnl This adds two main command-line options, --with-tcl=<prefix> to
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
369 dnl specify the Tcl install directory, and --with-tcl-version=<vsn>
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
370 dnl to control which version of Tcl should be used. For finer-grained
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
371 dnl control there are additional options --with-tcl-header and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
372 dnl --with-tcl-version. It is assumed that Tcl and Tk are installed
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
373 dnl in the same place.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
374 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
375 dnl On Unix systems and under cygwin there should be a file
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
376 dnl $(tcl_prefix)/lib/tclConfig.sh containing all the information
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
377 dnl needed for Tcl. This file is consulted and the appropriate
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
378 dnl variables extracted. Similar information for Tk lives in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
379 dnl tkConfig.sh. As a useful side effect all variables defined
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
380 dnl in those scripts can be accessed.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
381 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
382 dnl To confuse matters, subtly different naming conventions are used
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
383 dnl under Unix and NT. Under Unix the Tcl library will be called
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
384 dnl libtcl8.0.a, libtcl8.1.a, etc. with a dot between the major and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
385 dnl minor version. Under NT (including cygwin) the library will be
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
386 dnl called tcl80.lib, tcl81.lib, libtcl80.a, libtcl81.a, etc.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
387 dnl without a dot.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
388 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
389 dnl Currently this macro assumes that Tcl is preinstalled, and not
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
390 dnl built alongside eCos. Specifically the macro checks that
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
391 dnl tcl.h can be found, plus on Unix systems tclConfig.sh and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
392 dnl tkConfig.sh as well.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
393 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
394 dnl This macro updates the build-related variables ecos_INCLUDES,
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
395 dnl ecos_LDADD, and ecos_LIBS. The latter assumes the application
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
396 dnl only needs Tcl. If Tk is needed as well then the variable
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
397 dnl ecos_tklibs should be used in addition.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
398
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
399 AC_DEFUN(ECOS_PATH_TCL, [
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
400
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
401 AC_REQUIRE([ECOS_PROG_MSVC])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
402 AC_REQUIRE([AC_CYGWIN])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
403
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
404 ecos_tcl_version=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
405 ecos_tcl_incdir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
406 ecos_tcl_libdir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
407 ecos_tk_libs=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
408
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
409 dnl Look for the version of Tcl. If none is specified, default to
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
410 dnl 8.0 under VC++ and cygwin, nothing under Unix. A version has to be
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
411 dnl specified under NT because there is no symbolic link from libtcl.a
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
412 dnl to whatever happens to be the most recent installed version.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
413
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
414 AC_MSG_CHECKING([for Tcl version])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
415 AC_ARG_WITH(tcl-version,[ --with-tcl-version=<vsn> version of Tcl to be used],[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
416 ecos_tcl_version=${with_tcl_version}
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
417 ],[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
418 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
419 ecos_tcl_version=80
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
420 elif test "${ac_cv_cygwin}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
421 ecos_tcl_version=80
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
422 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
423 ecos_tcl_version=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
424 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
425 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
426 AC_MSG_RESULT([${ecos_tcl_version}])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
427
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
428 dnl Where is the Tcl installation?
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
429 AC_MSG_CHECKING(for Tcl installation)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
430
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
431 AC_ARG_WITH(tcl-header,[ --with-tcl-header=<path> location of Tcl header])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
432 AC_ARG_WITH(tcl-lib,[ --with-tcl-lib=<path> location of Tcl libraries])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
433 AC_ARG_WITH(tcl,[ --with-tcl=<path> location of Tcl header and libraries])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
434
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
435 dnl If using VC++ then there are no sensible default directories
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
436 dnl to search for a Tcl installation. Instead the user must
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
437 dnl supply either --with-tcl, or both --with-tcl-header and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
438 dnl --with-tcl-lib.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
439 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
440 dnl Also when using VC++ there is no tclConfig.sh file to
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
441 dnl consult about which libraries are needed. Instead that
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
442 dnl information is hard-wired here.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
443
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
444 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
445
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
446 if test "${with_tcl_header+set}" = set ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
447 ecos_tcl_incdir=${with_tcl_header}
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
448 elif test "${with_tcl+set}" = set ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
449 ecos_tcl_incdir="${with_tcl}/include"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
450 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
451 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-header=<path>)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
452 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
453
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
454 dnl Sanity check, make sure that there is a tcl.h header file.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
455 dnl If not then there is no point in proceeding.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
456 if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
457 AC_MSG_ERROR([unable to locate Tcl header file tcl.h])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
458 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
459 ecos_msvc_tcl_incdir="${ecos_tcl_incdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
460 ECOS_MSVC_PATH(ecos_msvc_tcl_incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
461 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_tcl_incdir}\""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
462
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
463 if test "${with_tcl_lib+set}" = set; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
464 ecos_tcl_libdir=${with_tcl_lib}
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
465 elif test "${with_tcl+set}" = set; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
466 ecos_tcl_libdir="${with_tcl}/lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
467 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
468 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-lib=<path>)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
469 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
470 ECOS_MSVC_PATH(ecos_tcl_libdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
471 ecos_LIBS="${ecos_LIBS} tcl${ecos_tcl_version}.lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
472 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
473
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
474 dnl FIXME: what libraries are needed for a tk application under VC++?
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
475 dnl and can the version be determined more accurately?
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
476 ecos_tk_libs=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
477
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
478 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
479 dnl Depending on the installation there are a number of reasonable locations for tcl.h
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
480 dnl so this code performs a search.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
481 possibles="${with_tcl_header} ${with_tcl}/include ${prefix}/include /usr/include/tcl${ecos_tcl_version} /usr/include"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
482 AC_FIND_FILE("tcl.h", ${possibles}, ecos_tcl_incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
483 if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
484 AC_MSG_ERROR(unable to locate Tcl header file tcl.h)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
485 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
486 dnl On Unix systems -I/usr/include is unnecessary, and can cause problems on hosts
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
487 dnl where gcc is not the platform's default compiler because of the use of
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
488 dnl unfixed headers. Hence it is explicitly removed here. Similarly
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
489 dnl -I/usr/lib serves no purpose, although it should be harmless.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
490 dnl Under cygwin this check may be wrong, should the mount table
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
491 dnl be set up such that /usr/include points at the main cygwin
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
492 dnl headers. That assumes that gcc under cygwin does not have
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
493 dnl /usr/include in its default path, an untested assumption.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
494 if test "${ecos_tcl_incdir}" != "/usr/include" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
495 ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_tcl_incdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
496 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
497 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
498 possibles="${with_tcl_lib} ${with_tcl}/lib ${libdir} ${prefix}/lib /usr/lib/tcl$${ecos_tcl_version} /usr/lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
499 AC_FIND_FILE("tclConfig.sh", ${possibles}, ecos_tcl_libdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
500 if test \! -r "${ecos_tcl_libdir}/tclConfig.sh" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
501 AC_MSG_ERROR(unable to locate Tcl config file tclConfig.sh)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
502 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
503 . ${ecos_tcl_libdir}/tclConfig.sh
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
504 ecos_LIBS="${ecos_LIBS} -ltcl${ecos_tcl_version} ${TCL_LIBS}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
505 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
506
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
507 if test \! -r "${ecos_tcl_libdir}/tkConfig.sh" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
508 AC_MSG_ERROR(unable to locate Tk config file tkConfig.sh)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
509 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
510 . ${ecos_tcl_libdir}/tkConfig.sh
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
511 ecos_tk_libs="-ltk${ecos_tcl_version} ${TK_LIBS}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
512 dnl Remove any library duplicates. It is not quite clear why,
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
513 dnl but they seem to cause problems.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
514 for lib in ${TCL_LIBS} ; do
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
515 ecos_tk_libs=`echo ${ecos_tk_libs} | sed -e "s!${lib}!!"`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
516 done
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
517 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
518 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
519
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
520 AC_MSG_RESULT([-I${ecos_tcl_incdir} -L${ecos_tcl_libdir}])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
521
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
522 AC_SUBST(ecos_tk_libs)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
523 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
524
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
525 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
526 dnl Search for the infrastructure headers. Usually these can be picked
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
527 dnl up from host/infra in the build tree. This macro updates
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
528 dnl ecos_INCLUDES, ecos_LDADD and ecos_LIBS appropriately. In addition
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
529 dnl it defines new variables ecos_infra_incdir and ecos_infra_libdir,
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
530 dnl useful for listing explicit dependencies.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
531 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
532 dnl This macro should only be used in configure scripts that run after
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
533 dnl the infrastructure has been configured because it relies on the
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
534 dnl infra directory already having been created in the build tree.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
535
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
536 AC_DEFUN(ECOS_PATH_INFRA, [
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
537 AC_MSG_CHECKING([for eCos host-side infrastructure])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
538
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
539 dnl Where are we in the build tree? First assume that we are in the host
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
540 dnl tree, thus allowing configury of just the host-side. If that fails
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
541 dnl assume we can be anywhere.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
542 infra_builddir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
543 possibles=".. ../.. ../../.. ../../../.. ../../../../.."
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
544 AC_FIND_DIR("infra", ${possibles}, infra_builddir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
545 if test "${infra_builddir}" = "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
546 possibles="../host ../../host ../../../host ../../../../host ../../../../../host ../../../../../../host"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
547 AC_FIND_DIR("infra", ${possibles}, infra_builddir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
548 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
549 if test "${infra_builddir}" != "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
550 infra_builddir="${infra_builddir}/infra"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
551 infra_builddir=`cd ${infra_builddir} && /bin/pwd`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
552 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
553
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
554 ecos_infra_incdir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
555 ecos_infra_libdir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
556 ecos_infra_libs=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
557
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
558 AC_ARG_WITH(infra-header,[ --with-infra-header=<path> location of eCos infrastructure headers])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
559 AC_ARG_WITH(infra-lib,[ --with-infra-lib=<path> location of eCos infrastructure library])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
560 AC_ARG_WITH(infra,[ --with-infra=<path> location of eCos infrastructure installation])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
561
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
562 if test "${with_infra_header+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
563 ecos_infra_incdir="${with_infra_header}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
564 elif test "${with_infra+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
565 ecos_infra_incdir="${with_infra}/include"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
566 elif test "${infra_builddir}" != "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
567 ecos_infra_incdir="${infra_builddir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
568 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
569 AC_MSG_ERROR([infrastructure headers not found])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
570 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
571 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
572 ecos_msvc_infra_incdir = ${ecos_infra_incdir}
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
573 ECOS_MSVC_PATH(ecos_msvc_infra_incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
574 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_infra_incdir}\""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
575 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
576 ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_infra_incdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
577 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
578
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
579 if test "${with_infra_lib+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
580 ecos_infra_libdir="${with_infra_lib}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
581 elif test "${with_infra+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
582 ecos_infra_libdir="${with_infra}/lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
583 elif test "${infra_builddir}" != "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
584 ecos_infra_libdir="${infra_builddir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
585 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
586 AC_MSG_ERROR([infrastructure library not found])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
587 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
588 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
589 ecos_msvc_infra_libdir=${ecos_infra_libdir}
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
590 ECOS_MSVC_PATH(ecos_msvc_infra_libdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
591 ecos_LIBS="${ecos_LIBS} cyginfra.lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
592 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_infra_libdir}\""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
593 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
594 ecos_LIBS="${ecos_LIBS} -lcyginfra"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
595 ecos_LDADD="${ecos_LDADD} -L${ecos_infra_libdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
596 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
597
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
598 AC_SUBST(ecos_infra_incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
599 AC_SUBST(ecos_infra_libdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
600 AC_MSG_RESULT(-I[${ecos_infra_incdir} -L${ecos_infra_libdir}])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
601 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
602
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
603 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
604 dnl And a very similar macro for libcdl, but note that the headers
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
605 dnl are in the source tree rather than the build tree.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
606
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
607 AC_DEFUN(ECOS_PATH_LIBCDL, [
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
608 AC_MSG_CHECKING([for libcdl])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
609
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
610 dnl Where are we in the source tree?
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
611 libcdl_srcdir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
612 possibles="${srcdir}/.. ${srcdir}/../.. ${srcdir}/../../.. ${srcdir}/../../../.. ${srcdir}/../../../../.."
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
613 AC_FIND_DIR("libcdl", ${possibles}, libcdl_srcdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
614 if test "${libcdl_srcdir}" = "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
615 possibles="${srcdir}/../host ${srcdir}/../../host ${srcdir}/../../../host ${srcdir}/../../../../host ${srcdir}/../../../../../host ${srcdir}/../../../../../../host"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
616 AC_FIND_DIR("libcdl", ${possibles}, libcdl_srcdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
617 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
618 if test "${libcdl_srcdir}" != "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
619 libcdl_srcdir="${libcdl_srcdir}/libcdl"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
620 libcdl_srcdir=`cd ${libcdl_srcdir} && /bin/pwd`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
621 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
622
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
623 dnl And where are we in the build tree?
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
624 libcdl_builddir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
625 possibles=".. ../.. ../../.. ../../../.. ../../../../.."
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
626 AC_FIND_DIR("libcdl", ${possibles}, libcdl_builddir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
627 if test "${libcdl_builddir}" = "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
628 possibles="../host ../../host ../../../host ../../../../host ../../../../../host ../../../../../../host"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
629 AC_FIND_DIR("libcdl", ${possibles}, libcdl_builddir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
630 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
631 if test "${libcdl_builddir}" != "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
632 libcdl_builddir="${libcdl_builddir}/libcdl"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
633 libcdl_builddir=`cd ${libcdl_builddir} && /bin/pwd`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
634 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
635
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
636 ecos_libcdl_incdir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
637 ecos_libcdl_libdir=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
638 ecos_libcdl_libs=""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
639
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
640 AC_ARG_WITH(libcdl-header,[ --with-libcdl-header=<path> location of eCos libcdl headers])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
641 AC_ARG_WITH(libcdl-lib,[ --with-libcdl-lib=<path> location of eCos libcdl library])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
642 AC_ARG_WITH(libcdl,[ --with-libcdl=<path> location of eCos libcdl installation])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
643
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
644 if test "${with_libcdl_header+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
645 ecos_libcdl_incdir="${with_libcdl_header}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
646 elif test "${with_libcdl+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
647 ecos_libcdl_incdir="${with_libcdl}/include"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
648 elif test "${libcdl_srcdir}" != "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
649 ecos_libcdl_incdir="${libcdl_srcdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
650 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
651 if test \! -r "${ecos_libcdl_incdir}/cdl.hxx" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
652 AC_MSG_ERROR([libcdl headers not found])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
653 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
654 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
655 ecos_msvc_libcdl_incdir = "${ecos_libcdl_incdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
656 ECOS_MSVC_PATH(ecos_msvc_libcdl_incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
657 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_libcdl_incdir}\""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
658 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
659 ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_libcdl_incdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
660 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
661
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
662 if test "${with_libcdl_lib+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
663 ecos_libcdl_libdir="${with_libcdl_lib}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
664 elif test "${with_libcdl+set}" = "set"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
665 ecos_libcdl_libdir="${with_libcdl}/lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
666 elif test "${libcdl_builddir}" != "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
667 ecos_libcdl_libdir="${libcdl_builddir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
668 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
669 AC_MSG_ERROR([libcdl library not found])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
670 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
671 if test "${MSVC}" = "yes" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
672 ecos_msvc_libcdl_libdir=${ecos_libcdl_libdir}
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
673 ECOS_MSVC_PATH(ecos_msvc_libcdl_libdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
674 ecos_LIBS="${ecos_LIBS} cdl.lib"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
675 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_libcdl_libdir}\""
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
676 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
677 ecos_LIBS="${ecos_LIBS} -lcdl"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
678 ecos_LDADD="${ecos_LDADD} -L${ecos_libcdl_libdir}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
679 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
680
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
681 AC_SUBST(ecos_libcdl_incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
682 AC_SUBST(ecos_libcdl_libdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
683 AC_MSG_RESULT([-I${ecos_libcdl_incdir} -L${ecos_libcdl_libdir}])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
684 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
685
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
686 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
687 dnl Look for a 64 bit data type. It is necessary to check both C and C++
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
688 dnl compilers.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
689 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
690 dnl A better implementation would check whether or not AC_PROG_CC and
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
691 dnl AC_PROG_CXX have been invoked and only test the appropriate
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
692 dnl compiler.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
693 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
694 dnl When cross-compiling, default to long long on the assumption that
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
695 dnl gcc/g++ must be used and long long is likely to be the 64 bit data
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
696 dnl type. This is not guaranteed, but sufficiently likely to meet
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
697 dnl the requirements for the time being. The CHECK_SIZEOF() macro
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
698 dnl might be another way to get the desired information.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
699
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
700 AC_DEFUN(ECOS_TYPE_64bit, [
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
701 AC_REQUIRE([AC_PROG_CC])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
702 AC_REQUIRE([AC_PROG_CXX])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
703
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
704 AC_CACHE_CHECK("for a 64 bit data type",ecos_cv_type_64bit,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
705 for type in "long" "long long" "__int64"; do
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
706 AC_LANG_SAVE
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
707 AC_LANG_C
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
708 AC_TRY_RUN([
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
709 main() {
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
710 return 8 != sizeof($type);
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
711 }
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
712 ],ctype_64bit=$type,ctype_64bit="unknown",ctype_64bit="long long")
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
713 AC_LANG_CPLUSPLUS
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
714 AC_TRY_RUN([
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
715 int main(int argc, char ** argv) {
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
716 return 8 != sizeof($type);
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
717 }
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
718 ],cxxtype_64bit=$type,cxxtype_64bit="unknown",cxxtype_64bit="long long")
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
719 AC_LANG_RESTORE
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
720 if test "${ctype_64bit}" = "${type}" -a "${cxxtype_64bit}" = "${type}"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
721 ecos_cv_type_64bit="${type}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
722 break
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
723 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
724 done
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
725 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
726 if test "${ecos_cv_type_64bit}" = ""; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
727 AC_MSG_ERROR(Unable to figure out how to do 64 bit arithmetic)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
728 else
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
729 if test "${ecos_cv_type_64bit}" != "long long"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
730 AC_DEFINE_UNQUOTED(cyg_halint64,${ecos_cv_type_64bit})
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
731 AC_DEFINE_UNQUOTED(cyg_halcount64,${ecos_cv_type_64bit})
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
732 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
733 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
734 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
735
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
736 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
737 dnl Check that both the C and C++ compilers support __PRETTY_FUNCTION__
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
738
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
739 AC_DEFUN(ECOS_C_PRETTY_FUNCTION,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
740 AC_REQUIRE([AC_PROG_CC])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
741 AC_REQUIRE([AC_PROG_CXX])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
742
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
743 AC_CACHE_CHECK("for __PRETTY_FUNCTION__ support",ecos_cv_c_pretty_function,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
744 AC_LANG_SAVE
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
745 AC_LANG_C
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
746 AC_TRY_LINK(
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
747 [#include <stdio.h>],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
748 [puts(__PRETTY_FUNCTION__);],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
749 c_ok="yes",
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
750 c_ok="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
751 )
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
752 AC_LANG_CPLUSPLUS
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
753 AC_TRY_LINK(
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
754 [#include <cstdio>],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
755 [puts(__PRETTY_FUNCTION__);],
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
756 cxx_ok="yes",
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
757 cxx_ok="no"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
758 )
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
759 AC_LANG_RESTORE
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
760 if test "${c_ok}" = "yes" -a "${cxx_ok}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
761 ecos_cv_c_pretty_function="yes"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
762 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
763 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
764 if test "${ecos_cv_c_pretty_function}" = "yes"; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
765 AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
766 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
767 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
768
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
769 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
770 dnl During installation eCos package-specific host-side code should be
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
771 dnl versioned in the same way as the packages themselves, allowing
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
772 dnl different versions to coexist in one installation. This is analogous
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
773 dnl to having multiple versions of a shared library installed so that
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
774 dnl applications can load whichever one they were linked with.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
775 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
776 dnl To support all this the host-side code needs access to a number
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
777 dnl of directory names:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
778 dnl ECOS_REPOSITORY e.g. ~/ecc/ecc
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
779 dnl PACKAGE_DIR e.g. hal/synth/arch
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
780 dnl PACKAGE_VERSION e.g. current
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
781 dnl PACKAGE_INSTALL e.g. hal/synth/arch/current
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
782 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
783 dnl These, together with the standard variable libexecdir, allow
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
784 dnl the host-side code to navigate around both source and install
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
785 dnl trees.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
786
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
787 AC_DEFUN(ECOS_PACKAGE_DIRS,[
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
788
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
789 dnl srcdir will be something like <path>/packages/<package_path>/<version>/host
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
790 package_dir=`cd ${srcdir} && /bin/pwd`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
791 PACKAGE_VERSION=`dirname ${package_dir}`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
792 PACKAGE_VERSION=`basename ${PACKAGE_VERSION}`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
793
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
794 dnl Now look for an "acsupport" directory as a good way of identifying
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
795 dnl the root of the repository. Assume that this does not clash with
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
796 dnl any real packages in the repository. Also assume that no silly games
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
797 dnl are being played with symlinks.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
798 package_dir=`dirname ${package_dir}`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
799 package_dir=`dirname ${package_dir}`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
800
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
801 possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.. ${package_dir}/../../../../../.."
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
802 AC_FIND_DIR("acsupport", ${possibles}, repository_root)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
803 if test "${repository_root}" = "" ; then
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
804 AC_MSG_ERROR([Failed to identify this package's position within the eCos repository])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
805 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
806 dnl repository_root will still contain the ..'s, instead of an absolute path
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
807 ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
808
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
809 dnl Now we have two absolute paths, so just remove one from the other
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
810 PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
811
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
812 dnl To avoid creating too many subdirectories on the host-side, turn
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
813 dnl e.g. hal/synth/arch into hal_synth_arch. Theoretically this could
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
814 dnl go wrong because multiple packages could map onto the same string,
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
815 dnl but in practice there should be a net reduction in complexity.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
816 dnl bartv: / to _ conversion disabled for now, 5 March 2002
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
817 PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}"
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
818 dnl PACKAGE_INSTALL=`echo ${PACKAGE_INSTALL} | sed -e "s:/:_:g"`
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
819
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
820 AC_SUBST(ECOS_REPOSITORY)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
821 AC_SUBST(PACKAGE_DIR)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
822 AC_SUBST(PACKAGE_VERSION)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
823 AC_SUBST(PACKAGE_INSTALL)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
824 ])