annotate acsupport/acinclude.m4 @ 3224:4ef59b2cf8d3

Update ETH macros for F4 device.
author vae
date Sun, 14 Apr 2013 23:30:51 +0000
parents 74dbf4c3f2e1
children
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 ====================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
11 dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
12 dnl -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
13 dnl This file is part of the eCos host tools.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
14 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
15 dnl
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
16 dnl This program is free software; you can redistribute it and/or modify
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
17 dnl it under the terms of the GNU General Public License as published by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
18 dnl the Free Software Foundation; either version 2 or (at your option) any
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
19 dnl later version.
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
20 dnl
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
21 dnl This program is distributed in the hope that it will be useful, but
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
22 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
23 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
24 dnl General Public License for more details.
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
25 dnl
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
26 dnl You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
27 dnl along with this program; if not, write to the
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
28 dnl Free Software Foundation, Inc., 51 Franklin Street,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
29 dnl Fifth Floor, Boston, MA 02110-1301, USA.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
30 dnl -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2538
diff changeset
31 dnl ####ECOSHOSTGPLCOPYRIGHTEND####
283
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#####DESCRIPTIONBEGIN####
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 Author(s): bartv
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
36 dnl Contact(s): bartv
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
37 dnl Date: 1998/12/16
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
38 dnl Version: 0.01
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
39 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
40 dnl####DESCRIPTIONEND####
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
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 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
45 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
46 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
47 dnl is good practice.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
48
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
49 AC_DEFUN([ECOS_CHECK_BUILD_ne_SRC],[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
50 AC_MSG_CHECKING([that a separate build tree is being used])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
51 ecos_cwd=`/bin/pwd`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
52 if test "${srcdir}" = "." ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
53 srcdir=${ecos_cwd}
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
54 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
55 if test "${ecos_cwd}" = "${srcdir}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
56 AC_MSG_RESULT([no])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
57 AC_MSG_ERROR([This configure script should not be run inside the source tree. Instead please use a separate build tree])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
58 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
59 AC_MSG_RESULT([yes])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
60 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
61 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
62
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
63 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
64 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
65 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
66 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
67 dnl macro is used to define an alternative symbol
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
68
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
69 AC_DEFUN([ECOS_SUBST_VERSION],[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
70 AC_REQUIRE([AM_INIT_AUTOMAKE])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
71 ifelse($#,1,,AC_MSG_ERROR([Invalid number of arguments passed to ECOS SUBST_VERSION]))
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
72 AC_DEFINE_UNQUOTED($1, "$VERSION", "eCos host-side package version")
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
73 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
74
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
75 dnl --------------------------------------------------------------------
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
76 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
77 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
78 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
79 dnl forward slashes to avoid confusing make.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
80
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
81 AC_DEFUN([ECOS_MSVC_PATH], [
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
82 dnl AC_REQUIRE([ECOS_PROG_MSVC])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
83 ifelse($#, 1, , AC_MSG_ERROR("Invalid number of arguments passed to ECOS MSVC_PATH"))
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
84 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
85 $1=`cygpath -w ${$1} | tr \\\\\\\\ /`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
86 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
87 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
88
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
89 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
90 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
91 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
92 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
93 dnl passing on to the application.
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
94 AC_DEFUN([ECOS_PROG_DEFINE_COMPILER_FLAGS],[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
95 ecos_CFLAGS=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
96 ecos_CXXFLAGS=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
97 ecos_LDADD=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
98 ecos_INCLUDES=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
99 ecos_LIBS=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
100 AC_SUBST(ecos_CFLAGS)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
101 AC_SUBST(ecos_CXXFLAGS)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
102 AC_SUBST(ecos_LDADD)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
103 AC_SUBST(ecos_INCLUDES)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
104 AC_SUBST(ecos_LIBS)
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
105 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
106
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
107 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
108 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
109 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
110 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
111 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
112 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
113 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
114 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
115 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
116
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
117 AC_DEFUN([ECOS_PROG_MSVC],[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
118 AC_REQUIRE([AC_PROG_CC])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
119 AC_REQUIRE([AC_PROG_CXX])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
120 AC_REQUIRE([ECOS_PROG_DEFINE_COMPILER_FLAGS])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
121
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
122 AC_MSG_CHECKING("for Visual C++")
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
123 MSVC="no";
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
124 if test "${CC}" = "cl" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
125 MSVC="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
126 CXX="cl"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
127 MSVC_SRCDIR=${srcdir}
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
128 ECOS_MSVC_PATH(MSVC_SRCDIR)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
129 AC_SUBST(MSVC_SRCDIR)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
130 ecos_INCLUDES="${ecos_INCLUDES} \"-I${MSVC_SRCDIR}\""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
131 ecos_LDADD="-link"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
132 ecos_LIBS="advapi32.lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
133 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
134 AM_CONDITIONAL(MSVC, test "${MSVC}" = "yes")
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
135 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
136 AC_MSG_RESULT([unfortunately yes])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
137 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
138 AC_MSG_RESULT([no])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
139 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
140 ])
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 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
143 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
144 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
145 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
146 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
147 dnl compilation flags to -O2). Note that this relies
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
148 dnl on knowing about the internals of those macros.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
149 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
150 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
151 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
152 dnl be more expensive than doing the work here.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
153 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
154 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
155 dnl to use another compiler will result in an error at configure-time.
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
156 AC_DEFUN([ECOS_PROG_STANDARD_COMPILER_FLAGS], [
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
157 AC_REQUIRE([AC_PROG_CC])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
158 AC_REQUIRE([AC_PROG_CXX])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
159 AC_REQUIRE([ECOS_PROG_DEFINE_COMPILER_FLAGS])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
160 AC_REQUIRE([ECOS_PROG_MSVC])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
161
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
162 AC_MSG_CHECKING("the default compiler flags")
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
163
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
164 dnl Add a user-settable flag to control whether or debugging info is
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
165 dnl incorporated at compile-time.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
166 ecosflags_enable_debug="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
167 AC_ARG_ENABLE(debug,[ --enable-debug do a debug rather than a release build],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
168 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
169 yes) ecosflags_enable_debug="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
170 *) ecosflags_enable_debug="no" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
171 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
172
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
173 dnl For VC++ builds also provide a flag for ANSI vs. unicode builds.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
174 dnl For now this does not actually affect the compiler flags.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
175 dnl NOTE: there may also have to be a flag to control whether or
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
176 dnl the VC++ multi-threading flags are enabled.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
177 ecosflags_enable_ansi="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
178 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
179 AC_ARG_ENABLE(ansi,[ --enable-ansi do an ANSI rather than a unicode build],
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
180 [case "${enableval}" in
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
181 yes) ecosflags_enable_ansi="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
182 *) ecosflags_enable_ansi="no" ;;
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
183 esac])
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
184 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
185
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
186 dnl Now we know what the user is after.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
187 if test "${GCC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
188 ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
189 ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wcast-qual -Woverloaded-virtual"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
190 elif test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
191 ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
192 ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
193 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
194 AC_MSG_ERROR("default flags for ${CC} are not known")
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
195 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
196
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
197 dnl Choose between debugging and optimization.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
198 if test "${ecosflags_enable_debug}" = "yes" ; then
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
199 if test "${GCC}" = "yes" ; then
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
200 ecos_CFLAGS="${ecos_CFLAGS} -g -O0"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
201 ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
202 elif test "${MSVC}" = "yes" ; then
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
203 ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
204 ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
205 fi
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
206 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
207 dnl With older versions of g++ building the host-side tools with
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
208 dnl -O2 took forever. These problems should now have gone away.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
209 if test "${GCC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
210 ecos_CFLAGS="${ecos_CFLAGS} -O2"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
211 ecos_CXXFLAGS="${ecos_CXXFLAGS} -O2"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
212 elif test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
213 ecos_CFLAGS="${ecos_CFLAGS} -MD -O2"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
214 ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
215 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
216 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
217
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
218 CFLAGS="${ac_save_CFLAGS}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
219 CXXFLAGS="${ac_save_CXXFLAGS}"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
220
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
221 AC_MSG_RESULT(done)
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
222 ])
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 dnl --------------------------------------------------------------------
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
225 dnl User-settable options for assertions and tracing.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
226 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
227 dnl The settable options are:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
228 dnl --disable-asserts
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
229 dnl --disable-preconditions
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
230 dnl --disable-postconditions
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
231 dnl --disable-invariants
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
232 dnl --disable-loopinvariants
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
233 dnl --disable-tracing
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
234 dnl --disable-fntracing
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
235
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
236 AC_DEFUN([ECOS_ARG_INFRASTRUCTURE], [
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
237
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
238 AC_REQUIRE([ECOS_PROG_STANDARD_COMPILER_FLAGS])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
239
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
240 if test "${ecosflags_enable_debug}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
241 ecosinfra_asserts="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
242 ecosinfra_preconditions="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
243 ecosinfra_postconditions="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
244 ecosinfra_invariants="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
245 ecosinfra_loopinvariants="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
246 ecosinfra_tracing="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
247 ecosinfra_fntracing="yes"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
248 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
249 ecosinfra_asserts="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
250 ecosinfra_preconditions="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
251 ecosinfra_postconditions="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
252 ecosinfra_invariants="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
253 ecosinfra_loopinvariants="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
254 ecosinfra_tracing="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
255 ecosinfra_fntracing="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
256 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
257
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
258 AC_ARG_ENABLE(asserts,[ --disable-asserts disable all assertions],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
259 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
260 yes) ecosinfra_asserts="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
261 no) ecosinfra_asserts="no" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
262 *) AC_MSG_ERROR([bad value ${enableval} for disable-asserts option]) ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
263 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
264 if test "${ecosinfra_asserts}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
265 AC_DEFINE(CYGDBG_USE_ASSERTS,[1],[assertions enabled])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
266 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
267
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
268 AC_ARG_ENABLE(preconditions, [ --disable-preconditions disable a subset of the assertions],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
269 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
270 yes) ecosinfra_preconditions="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
271 no) ecosinfra_preconditions="no" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
272 *) AC_MSG_ERROR([bad value ${enableval} for disable-preconditions option]) ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
273 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
274 if test "${ecosinfra_preconditions}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
275 AC_DEFINE(CYGDBG_INFRA_DEBUG_PRECONDITIONS,[1],[precondition asserts enabled])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
276 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
277
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
278 AC_ARG_ENABLE(postconditions, [ --disable-postconditions disable a subset of the assertions],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
279 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
280 yes) ecosinfra_postconditions="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
281 no) ecosinfra_postconditions="no" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
282 *) AC_MSG_ERROR([bad value ${enableval} for disable-postconditions option]) ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
283 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
284 if test "${ecosinfra_postconditions}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
285 AC_DEFINE(CYGDBG_INFRA_DEBUG_POSTCONDITIONS,[1], [postcondition asserts enabled])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
286 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
287
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
288 AC_ARG_ENABLE(invariants, [ --disable-invariants disable a subset of the assertions],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
289 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
290 yes) ecosinfra_invariants="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
291 no) ecosinfra_invariants="no" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
292 *) AC_MSG_ERROR([bad value ${enableval} for disable-invariants option]) ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
293 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
294 if test "${ecosinfra_invariants}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
295 AC_DEFINE(CYGDBG_INFRA_DEBUG_INVARIANTS,[1],[invariant asserts enabled])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
296 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
297
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
298 AC_ARG_ENABLE(loopinvariants, [ --disable-loopinvariants disable a subset of the assertions],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
299 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
300 yes) ecosinfra_loopinvariants="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
301 no) ecosinfra_loopinvariants="no" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
302 *) AC_MSG_ERROR([bad value ${enableval} for disable-loopinvariants option]) ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
303 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
304 if test "${ecosinfra_loopinvariants}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
305 AC_DEFINE(CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS,[1],[loop invariant asserts enabled])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
306 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
307
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
308 AC_ARG_ENABLE(tracing,[ --disable-tracing disable tracing],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
309 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
310 yes) ecosinfra_tracing="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
311 no) ecosinfra_tracing="no" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
312 *) AC_MSG_ERROR([bad value ${enableval} for disable-tracing option]) ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
313 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
314 if test "${ecosinfra_tracing}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
315 AC_DEFINE(CYGDBG_USE_TRACING,[1],[tracing enabled])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
316 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
317
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
318 AC_ARG_ENABLE(fntracing,[ --disable-fntracing disable function entry/exit tracing],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
319 [case "${enableval}" in
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
320 yes) ecosinfra_fntracing="yes" ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
321 no) ecosinfra_fntracing=no ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
322 *) AC_MSG_ERROR([bad value ${enableval} for disable-fntracing option]) ;;
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
323 esac])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
324 if test "${ecosinfra_fntracing}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
325 AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS,[1],[function entry/exit reporting enabled])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
326 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
327 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
328
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
329 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
330 dnl Inspired by KDE's autoconfig
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
331 dnl This macro takes three Arguments like this:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
332 dnl AC_FIND_FILE(foo.h, $incdirs, incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
333 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
334 dnl the variable with the result.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
335
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
336 AC_DEFUN([AC_FIND_FILE],[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
337 $3=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
338 for i in $2; do
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
339 if test -r "$i/$1"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
340 $3=$i
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
341 break
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
342 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
343 done
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
344 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
345
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
346 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
347 dnl Variation of the above.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
348 dnl This macro takes three Arguments like this:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
349 dnl AC_FIND_DIR(infra, $incdirs, incdir)
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
350 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
351 dnl the variable with the result.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
352
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
353 AC_DEFUN([AC_FIND_DIR],[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
354 $3=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
355 for i in $2; do
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
356 if test -d "$i/$1"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
357 $3=$i
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
358 break
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
359 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
360 done
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
361 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
362
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
363 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
364 dnl Work out details of the Tcl/tk installation that should be used.
595
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
365 dnl In theory this is simple: when Tcl is installed in <tcl_prefix>
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
366 dnl (usually /usr) there should be a file <tcl_prefix>/lib/tclConfig.sh
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
367 dnl which defines exactly how to build Tcl-based applications. Of course
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
368 dnl Tcl may be installed anywhere, not just in /usr, so it is necessary
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
369 dnl to do some searching. There is a command-line argument
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
370 dnl --with-tcl=<path> to specify the Tcl installation, so the macro
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
371 dnl can search for <with_tcl>/lib/tclConfig.sh, <prefix>/lib/tclConfig.sh
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
372 dnl and /usr/lib/tclConfig.sh
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
373 dnl
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
374 dnl Unfortunately not all systems use this convention. For example,
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
375 dnl at the time of writing Debian installs tclConfig.sh in a versioned
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
376 dnl subdirectory /usr/lib/tcl8.3/tclConfig.sh. Hence there is an
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
377 dnl additional argument --with-tcl-version=<vsn> which is used to
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
378 dnl extend the search path.
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
379 dnl
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
380 dnl For VC++ builds the situation is different again. Tcl may be
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
381 dnl installed anywhere, so the data in tclConfig.sh is not useful
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
382 dnl (and that file may not be provided at all). Instead --with-tcl
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
383 dnl must be used to specify the path. Alternatively separate paths
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
384 dnl for headers and libraries can be specified using --with-tcl-header
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
385 dnl and --with-tcl-lib. Usually it will also be necessary to specify
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
386 dnl the library version number using --with-tcl-version.
c2d1fd823f09 Update autoconf macro for Tcl, and regenerate affected files
bartv
parents: 392
diff changeset
387
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
388 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
389 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
390 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
391 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
392 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
393 dnl in the same place.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
394 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
395 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
396 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
397 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
398 dnl variables extracted. Similar information for Tk lives in
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
399 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
400 dnl in those scripts can be accessed.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
401 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
402 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
403 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
404 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
405 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
406 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
407 dnl without a dot.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
408 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
409 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
410 dnl built alongside eCos. Specifically the macro checks that
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
411 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
412 dnl tkConfig.sh as well.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
413 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
414 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
415 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
416 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
417 dnl ecos_tklibs should be used in addition.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
418
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
419 AC_DEFUN([ECOS_PATH_TCL], [
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
420
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
421 AC_REQUIRE([ECOS_PROG_MSVC])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
422
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
423 dnl Where is the Tcl installation, and what version should be used?
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
424 dnl This macro is rather more verbose than usual because of the many
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
425 dnl problems encountered over the years with Tcl installations.
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
426 AC_MSG_CHECKING(for Tcl/Tk installation)
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
427 AC_MSG_RESULT()
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
428
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
429 AC_ARG_WITH(tcl,[ --with-tcl=<path> location of Tcl header and libraries])
2538
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
430 AC_ARG_WITH(tcl,[ --with-tk=<path> location of Tk header and libraries])
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
431 AC_ARG_WITH(tcl-version,[ --with-tcl-version=<vsn> version of Tcl/Tk to be used])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
432
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
433 dnl If using VC++ then there are no sensible default directories
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
434 dnl to search for a Tcl installation. Instead the user must
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
435 dnl supply either --with-tcl, or both --with-tcl-header and
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
436 dnl --with-tcl-lib.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
437 dnl
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
438 dnl Also when using VC++ there is no tclConfig.sh file to
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
439 dnl consult about which libraries are needed. Instead that
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
440 dnl information is hard-wired here.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
441 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
442 AC_ARG_WITH(tcl-header,[ --with-tcl-header=<path> location of Tcl header])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
443 AC_ARG_WITH(tcl-lib,[ --with-tcl-lib=<path> location of Tcl libraries])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
444 ecos_tcl_incdir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
445 ecos_tcl_libdir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
446 if test "${with_tcl_version+set}" != set ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
447 AC_MSG_ERROR(You must specify a Tcl version using --with-tcl-version=<vsn>)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
448 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
449 if test "${with_tcl_header+set}" = set ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
450 ecos_tcl_incdir=${with_tcl_header}
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
451 elif test "${with_tcl+set}" = set ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
452 ecos_tcl_incdir="${with_tcl}/include"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
453 else
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
454 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-header=<path>)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
455 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
456 if test "${with_tcl_lib+set}" = set; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
457 ecos_tcl_libdir=${with_tcl_lib}
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
458 elif test "${with_tcl+set}" = set; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
459 ecos_tcl_libdir="${with_tcl}/lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
460 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
461 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-lib=<path>)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
462 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
463
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
464 dnl Sanity check, make sure that there is a tcl.h header file.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
465 dnl If not then there is no point in proceeding.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
466 if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
467 AC_MSG_ERROR([unable to locate Tcl header file tcl.h])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
468 fi
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
469
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
470 ECOS_MSVC_PATH(ecos_tcl_incdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
471 ECOS_MSVC_PATH(ecos_tcl_libdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
472 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_tcl_incdir}\""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
473 ecos_LIBS="${ecos_LIBS} tcl${with_tcl_version}.lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
474 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
475
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
476 dnl FIXME: what libraries are needed for a tk application under VC++?
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
477 dnl and can the version be determined more accurately?
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
478 ecos_tk_libs=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
479
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
480 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
481 dnl ------------------------------------------------------------
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
482 dnl Not Visual C++ so try to do things properly by finding and
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
483 dnl using tclConfig.sh
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
484 possibles=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
485 if test "${with_tcl+set}" = set ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
486 possibles="${with_tcl}/lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
487 if test "${with_tcl_version+set}" = set ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
488 possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
489 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
490 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
491 possibles="${possibles} ${prefix}/lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
492 if test "${with_tcl_version+set}" = set ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
493 possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
494 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
495 possibles="${possibles} /usr/lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
496 if test "${with_tcl_version+set}" = set ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
497 possibles="${possibles} /usr/lib/tcl${with_tcl_version}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
498 fi
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
499 AC_MSG_NOTICE(looking for tclConfig.sh in ${possibles})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
500 AC_FIND_FILE("tclConfig.sh", ${possibles}, tclconfig)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
501 if test \! -r "${tclconfig}/tclConfig.sh" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
502 AC_MSG_ERROR(unable to locate Tcl configuration file tclConfig.sh)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
503 else
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
504 AC_MSG_NOTICE(found ${tclconfig}/tclConfig.sh)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
505 . ${tclconfig}/tclConfig.sh
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
506
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
507 dnl Now we need to figure out where to find the Tcl header files.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
508 dnl tclConfig.sh may define a variable TCL_INCLUDE_SPEC or
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
509 dnl TCL_INCLUDE_DIR, otherwise use TCL_PREFIX/include
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
510 if test -n "${TCL_INCLUDE_SPEC}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
511 ecos_tcl_incdir="${TCL_INCLUDE_SPEC}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
512 AC_MSG_NOTICE(trying TCL_INCLUDE_SPEC - looking for tcl.h in ${ecos_tcl_incdir})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
513 elif test -n "${TCL_INC_DIR}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
514 ecos_tcl_incdir="${TCL_INC_DIR}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
515 AC_MSG_NOTICE(trying TCL_INC_DIR - looking for tcl.h in ${ecos_tcl_incdir})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
516 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
517 ecos_tcl_incdir="-I${TCL_PREFIX}/include"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
518 AC_MSG_WARN(no TCL_INCLUDE_SPEC or TCL_INC_DIR in tclConfig.sh)
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
519 AC_MSG_NOTICE(fallback - looking for tcl.h in ${ecos_tcl_incdir})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
520 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
521 dnl But verify that the resulting incdir is valid.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
522 ecos_tcl_tmpdir=`echo ${ecos_tcl_incdir} | sed -e "s:-I::g"`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
523 if test \! -r "${ecos_tcl_tmpdir}/tcl.h" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
524 AC_MSG_ERROR(unable to locate Tcl header file tcl.h)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
525 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
526 dnl On Unix systems -I/usr/include is unnecessary, and can
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
527 dnl cause problems on hosts where gcc is not the platform's
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
528 dnl default compiler because of the use of unfixed headers.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
529 dnl Hence it is explicitly removed here.
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
530 AC_MSG_NOTICE(using ${ecos_tcl_incdir})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
531 if test "${ecos_tcl_incdir}" != "-I/usr/include" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
532 ecos_INCLUDES="${ecos_INCLUDES} ${ecos_tcl_incdir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
533 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
534 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
535
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
536 dnl There should be a variable TCL_LIB_SPEC which defines
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
537 dnl exactly how to link with Tcl. Without that, try to search
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
538 dnl for a libtcl.a
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
539 ecos_tcl_libs=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
540 if test -n "${TCL_LIB_SPEC}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
541 ecos_tcl_libs="${ecos_LIBS} ${TCL_LIB_SPEC}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
542 AC_MSG_NOTICE(using TCL_LIB_SPEC ${TCL_LIB_SPEC})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
543 else
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
544 AC_MSG_WARN(no TCL_LIB_SPEC in tclConfig.sh)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
545 if test "${with_tcl_version+set}" = set ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
546 AC_MSG_NOTICE(fallback - looking for libtcl${with_tcl_version}.a in ${possibles})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
547 AC_FIND_FILE("libtcl${with_tcl_version}.a", ${possibles}, libtcl)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
548 if test -r "${libtcl}/libtcl${with_tcl_version}.a" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
549 ecos_tcl_libs="-L${libtcl} -ltcl${with_tcl_version}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
550 AC_MSG_NOTICE(using ${ecos_tcl_libs})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
551 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
552 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
553 if test -z "${ecos_tcl_libs}" ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
554 AC_MSG_NOTICE(fallback - looking for libtcl.a in ${possibles})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
555 AC_FIND_FILE("libtcl.a", ${possibles}, libtcl)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
556 if test -r "${libtcl}/libtcl.a" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
557 ecos_tcl_libs="-L${libtcl} -ltcl"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
558 AC_MSG_NOTICE(using ${ecos_tcl_libs})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
559 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
560 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
561 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
562
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
563 dnl If at this stage we have not found a libtcl.a, complain.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
564 if test -z "${ecos_tcl_libs}" ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
565 AC_MSG_ERROR(${tclconfig}/tclConfig.sh does not define TCL_LIB_SPEC, and unable to find libtcl.a)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
566 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
567
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
568 dnl tclConfig.sh may specify additional flags and libraries.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
569 if test -n "${TCL_LIBS}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
570 ecos_tcl_libs="${ecos_tcl_libs} ${TCL_LIBS}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
571 AC_MSG_NOTICE(using additional libraries for Tcl ${TCL_LIBS})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
572 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
573 if test -n "${TCL_LD_FLAGS}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
574 ecos_tcl_libs="${ecos_tcl_libs} ${TCL_LD_FLAGS}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
575 AC_MSG_NOTICE(using additional linker flags for Tcl ${TCL_LD_FLAGS})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
576 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
577 ecos_LIBS="${ecos_LIBS} ${ecos_tcl_libs}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
578 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
579
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
580
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
581 dnl --------------------------------------------------------
2538
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
582 dnl We now repeat the exercise for tk and tkConfig.sh.
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
583 dnl Typically this will be in a similar location to tclConfig.sh,
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
584 dnl but allow for separate
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
585 dnl we assume that the Tk installation is in a similar
2538
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
586 dnl location to the Tcl one, but allow for different ones
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
587 dnl just in case.
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
588 possibles=""
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
589 if test "${with_tk+set}" = set ; then
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
590 possibles="${possibles} ${with_tk}/lib"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
591 if test "${with_tcl_version+set}" = set ; then
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
592 possibles="${possibles} ${with_tk}/lib/tcl${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
593 possibles="${possibles} ${with_tk}/lib/tk${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
594 fi
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
595 fi
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
596 if test "${with_tcl+set}" = set ; then
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
597 possibles="${possibles} ${with_tcl}/lib"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
598 if test "${with_tcl_version+set}" = set ; then
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
599 possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
600 possibles="${possibles} ${with_tcl}/lib/tk${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
601 fi
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
602 fi
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
603 possibles="${possibles} ${prefix}/lib"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
604 if test "${with_tcl_version+set}" = set ; then
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
605 possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
606 possibles="${possibles} ${prefix}/lib/tk${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
607 fi
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
608 possibles="${possibles} /usr/lib"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
609 if test "${with_tcl_version+set}" = set ; then
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
610 possibles="${possibles} /usr/lib/tcl${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
611 possibles="${possibles} /usr/lib/tk${with_tcl_version}"
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
612 fi
8f5c64d663f7 Another attempt at the Tcl/Tk autoconf macro
bartv
parents: 2530
diff changeset
613
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
614 AC_MSG_NOTICE(looking for tkConfig.sh in ${possibles})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
615 AC_FIND_FILE("tkConfig.sh", ${possibles}, tkconfig)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
616 if test \! -r "${tkconfig}/tkConfig.sh" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
617 AC_MSG_ERROR(unable to locate Tk config file tkConfig.sh)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
618 else
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
619 AC_MSG_NOTICE(found ${tkconfig}/tkConfig.sh)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
620 . ${tkconfig}/tkConfig.sh
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
621
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
622 if test -n "${TK_INCLUDE_SPEC}" ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
623 ecos_tk_includes="${TK_INCLUDE_SPEC}"
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
624 AC_MSG_NOTICE(trying TK_INCLUDE_SPEC - looking for tk.h in ${ecos_tk_includes})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
625 elif test -n "${TK_INC_DIR}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
626 ecos_tk_includes="${TK_INC_DIR}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
627 AC_MSG_NOTICE(trying TK_INC_DIR - looking for tk.h in ${ecos_tk_includes})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
628 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
629 ecos_tk_includes="-I${TCL_PREFIX}/include"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
630 AC_MSG_WARN(no TK_INCLUDE_SPEC or TK_INC_DIR in tkConfig.sh)
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
631 AC_MSG_NOTICE(fallback - looking for tk.h in ${ecos_tk_includes})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
632 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
633 dnl But verify that the resulting incdir is valid.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
634 ecos_tk_tmpdir=`echo ${ecos_tk_includes} | sed -e "s:-I::g"`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
635 if test \! -r "${ecos_tk_tmpdir}/tk.h" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
636 AC_MSG_ERROR(unable to locate Tk header file tk.h)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
637 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
638 dnl On Unix systems -I/usr/include is unnecessary, and can
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
639 dnl cause problems on hosts where gcc is not the platform's
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
640 dnl default compiler because of the use of unfixed headers.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
641 dnl Hence it is explicitly removed here.
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
642 AC_MSG_NOTICE(using ${ecos_tk_includes})
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
643 if test "${ecos_tk_includes}" = "-I/usr/include" ; then
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
644 ecos_tk_includes=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
645 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
646 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
647 dnl There may be additional include directories for X, although
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
648 dnl unlikely on a Unix system.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
649 if test -n "${TK_XINCLUDES}" ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
650 AC_MSG_NOTICE(adding TK_XINCLUDES ${TK_XINCLUDES})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
651 ecos_tk_includes="${ecos_tk_includes} ${TK_XINCLUDES}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
652 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
653
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
654 ecos_tk_libs=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
655 if test -n "${TK_LIB_SPEC}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
656 ecos_tk_libs="${TK_LIB_SPEC}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
657 AC_MSG_NOTICE(trying TK_LIB_SPEC ${TK_LIB_SPEC})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
658 else
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
659 AC_MSG_WARN(no TK_LIB_SPEC in tkConfig.sh)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
660 if test "${with_tcl_version+set}" = set ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
661 AC_MSG_NOTICE(fallback - looking for libtk${with_tcl_version}.a in ${possibles})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
662 AC_FIND_FILE("libtk${with_tcl_version}.a", ${possibles}, libtk)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
663 if test -r "${libtk}/libtk${with_tcl_version}.a" ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
664 ecos_tk_libs="-L${libtk} -ltk${with_tcl_version}"
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
665 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
666 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
667 if test -z "${ecos_tk_libs}" ; then
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
668 AC_MSG_NOTICE(fallback - looking for libtk.a in ${possibles})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
669 AC_FIND_FILE("libtk.a", ${possibles}, libtk)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
670 if test -r "${libtk}/libtk.a" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
671 ecos_tk_libs="-L${libtk} -ltk"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
672 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
673 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
674 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
675 if test -z "${ecos_tk_libs}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
676 AC_MSG_ERROR(${tkconfig}/tkConfig.sh does not define TK_LIB_SPEC, and unable to find libtk.a)
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
677 else
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
678 AC_MSG_NOTICE(using ${ecos_tk_libs})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
679 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
680
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
681 dnl Tk may need additional libraries. Unfortunately some of these
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
682 dnl duplicate the Tcl ones, causing occasional linker upsets. It
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
683 dnl is assumed here that Tk will only be used in conjunction with
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
684 dnl tcl.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
685 if test -n "${TK_LIBS}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
686 if test -n "${TCL_LIBS}" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
687 ecos_tk_tmp="${TK_LIBS}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
688 for i in ${TCL_LIBS} ; do
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
689 ecos_tk_tmp=`echo ${ecos_tk_tmp} | sed -e "s:${i}::g"`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
690 done
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
691 ecos_tk_libs="${ecos_tk_libs} ${ecos_tk_tmp}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
692 AC_MSG_NOTICE(using additional libraries for Tk ${ecos_tk_tmp})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
693 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
694 ecos_tk_libs="${ecos_tk_libs} ${TK_LIBS}"
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
695 AC_MSG_NOTICE(using additional libraries for Tk ${TK_LIBS})
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
696 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
697 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
698 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
699 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
700
2530
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
701 AC_MSG_CHECKING(for Tcl/Tk installation)
54ab5a936365 Update host-side configury Tcl macro
bartv
parents: 2528
diff changeset
702 AC_MSG_RESULT(done)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
703 AC_SUBST(ecos_tk_includes)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
704 AC_SUBST(ecos_tk_libs)
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
705 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
706
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
707 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
708 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
709 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
710 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
711 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
712 dnl useful for listing explicit dependencies.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
713 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
714 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
715 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
716 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
717
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
718 AC_DEFUN([ECOS_PATH_INFRA], [
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
719 AC_MSG_CHECKING([for eCos host-side infrastructure])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
720
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
721 dnl Where are we in the build tree? First assume that we are in the host
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
722 dnl tree, thus allowing configury of just the host-side. If that fails
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
723 dnl assume we can be anywhere.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
724 infra_builddir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
725 possibles=".. ../.. ../../.. ../../../.. ../../../../.."
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
726 AC_FIND_DIR("infra", ${possibles}, infra_builddir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
727 if test "${infra_builddir}" = "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
728 possibles="../host ../../host ../../../host ../../../../host ../../../../../host ../../../../../../host"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
729 AC_FIND_DIR("infra", ${possibles}, infra_builddir)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
730 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
731 if test "${infra_builddir}" != "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
732 infra_builddir="${infra_builddir}/infra"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
733 infra_builddir=`cd ${infra_builddir} && /bin/pwd`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
734 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
735
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
736 ecos_infra_incdir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
737 ecos_infra_libdir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
738 ecos_infra_libs=""
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
739
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
740 AC_ARG_WITH(infra-header,[ --with-infra-header=<path> location of eCos infrastructure headers])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
741 AC_ARG_WITH(infra-lib,[ --with-infra-lib=<path> location of eCos infrastructure library])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
742 AC_ARG_WITH(infra,[ --with-infra=<path> location of eCos infrastructure installation])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
743
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
744 if test "${with_infra_header+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
745 ecos_infra_incdir="${with_infra_header}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
746 elif test "${with_infra+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
747 ecos_infra_incdir="${with_infra}/include"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
748 elif test "${infra_builddir}" != "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
749 ecos_infra_incdir="${infra_builddir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
750 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
751 AC_MSG_ERROR([infrastructure headers not found])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
752 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
753 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
754 ecos_msvc_infra_incdir=${ecos_infra_incdir}
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
755 ECOS_MSVC_PATH(ecos_msvc_infra_incdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
756 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_infra_incdir}\""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
757 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
758 ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_infra_incdir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
759 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
760
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
761 if test "${with_infra_lib+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
762 ecos_infra_libdir="${with_infra_lib}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
763 elif test "${with_infra+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
764 ecos_infra_libdir="${with_infra}/lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
765 elif test "${infra_builddir}" != "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
766 ecos_infra_libdir="${infra_builddir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
767 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
768 AC_MSG_ERROR([infrastructure library not found])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
769 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
770 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
771 ecos_msvc_infra_libdir=${ecos_infra_libdir}
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
772 ECOS_MSVC_PATH(ecos_msvc_infra_libdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
773 ecos_LIBS="${ecos_LIBS} cyginfra.lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
774 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_infra_libdir}\""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
775 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
776 ecos_LIBS="${ecos_LIBS} -lcyginfra"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
777 ecos_LDADD="${ecos_LDADD} -L${ecos_infra_libdir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
778 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
779
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
780 AC_SUBST(ecos_infra_incdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
781 AC_SUBST(ecos_infra_libdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
782 AC_MSG_RESULT(-I[${ecos_infra_incdir} -L${ecos_infra_libdir}])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
783 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
784
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
785 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
786 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
787 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
788
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
789 AC_DEFUN([ECOS_PATH_LIBCDL], [
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
790 AC_MSG_CHECKING([for libcdl])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
791
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
792 dnl Where are we in the source tree?
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
793 libcdl_srcdir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
794 possibles="${srcdir}/.. ${srcdir}/../.. ${srcdir}/../../.. ${srcdir}/../../../.. ${srcdir}/../../../../.."
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
795 AC_FIND_DIR("libcdl", ${possibles}, libcdl_srcdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
796 if test "${libcdl_srcdir}" = "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
797 possibles="${srcdir}/../host ${srcdir}/../../host ${srcdir}/../../../host ${srcdir}/../../../../host ${srcdir}/../../../../../host ${srcdir}/../../../../../../host"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
798 AC_FIND_DIR("libcdl", ${possibles}, libcdl_srcdir)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
799 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
800 if test "${libcdl_srcdir}" != "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
801 libcdl_srcdir="${libcdl_srcdir}/libcdl"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
802 libcdl_srcdir=`cd ${libcdl_srcdir} && /bin/pwd`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
803 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
804
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
805 dnl And where are we in the build tree?
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
806 libcdl_builddir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
807 possibles=".. ../.. ../../.. ../../../.. ../../../../.."
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
808 AC_FIND_DIR("libcdl", ${possibles}, libcdl_builddir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
809 if test "${libcdl_builddir}" = "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
810 possibles="../host ../../host ../../../host ../../../../host ../../../../../host ../../../../../../host"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
811 AC_FIND_DIR("libcdl", ${possibles}, libcdl_builddir)
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
812 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
813 if test "${libcdl_builddir}" != "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
814 libcdl_builddir="${libcdl_builddir}/libcdl"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
815 libcdl_builddir=`cd ${libcdl_builddir} && /bin/pwd`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
816 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
817
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
818 ecos_libcdl_incdir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
819 ecos_libcdl_libdir=""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
820 ecos_libcdl_libs=""
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
821
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
822 AC_ARG_WITH(libcdl-header,[ --with-libcdl-header=<path> location of eCos libcdl headers])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
823 AC_ARG_WITH(libcdl-lib,[ --with-libcdl-lib=<path> location of eCos libcdl library])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
824 AC_ARG_WITH(libcdl,[ --with-libcdl=<path> location of eCos libcdl installation])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
825
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
826 if test "${with_libcdl_header+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
827 ecos_libcdl_incdir="${with_libcdl_header}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
828 elif test "${with_libcdl+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
829 ecos_libcdl_incdir="${with_libcdl}/include"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
830 elif test "${libcdl_srcdir}" != "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
831 ecos_libcdl_incdir="${libcdl_srcdir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
832 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
833 if test \! -r "${ecos_libcdl_incdir}/cdl.hxx" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
834 AC_MSG_ERROR([libcdl headers not found])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
835 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
836 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
837 ecos_msvc_libcdl_incdir="${ecos_libcdl_incdir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
838 ECOS_MSVC_PATH(ecos_msvc_libcdl_incdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
839 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_libcdl_incdir}\""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
840 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
841 ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_libcdl_incdir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
842 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
843
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
844 if test "${with_libcdl_lib+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
845 ecos_libcdl_libdir="${with_libcdl_lib}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
846 elif test "${with_libcdl+set}" = "set"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
847 ecos_libcdl_libdir="${with_libcdl}/lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
848 elif test "${libcdl_builddir}" != "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
849 ecos_libcdl_libdir="${libcdl_builddir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
850 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
851 AC_MSG_ERROR([libcdl library not found])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
852 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
853 if test "${MSVC}" = "yes" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
854 ecos_msvc_libcdl_libdir=${ecos_libcdl_libdir}
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
855 ECOS_MSVC_PATH(ecos_msvc_libcdl_libdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
856 ecos_LIBS="${ecos_LIBS} cdl.lib"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
857 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_libcdl_libdir}\""
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
858 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
859 ecos_LIBS="${ecos_LIBS} -lcdl"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
860 ecos_LDADD="${ecos_LDADD} -L${ecos_libcdl_libdir}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
861 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
862
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
863 AC_SUBST(ecos_libcdl_incdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
864 AC_SUBST(ecos_libcdl_libdir)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
865 AC_MSG_RESULT([-I${ecos_libcdl_incdir} -L${ecos_libcdl_libdir}])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
866 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
867
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
868 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
869 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
870 dnl compilers.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
871 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
872 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
873 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
874 dnl compiler.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
875 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
876 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
877 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
878 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
879 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
880 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
881
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
882 AC_DEFUN([ECOS_TYPE_64bit], [
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
883 AC_REQUIRE([AC_PROG_CC])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
884 AC_REQUIRE([AC_PROG_CXX])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
885
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
886 AC_CACHE_CHECK("for a 64 bit data type",ecos_cv_type_64bit,[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
887 for type in "long" "long long" "__int64"; do
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
888 AC_LANG_SAVE
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
889 AC_LANG_C
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
890 AC_TRY_RUN([
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
891 main() {
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
892 return 8 != sizeof($type);
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
893 }
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
894 ],ctype_64bit=$type,ctype_64bit="unknown",ctype_64bit="long long")
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
895 AC_LANG_CPLUSPLUS
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
896 AC_TRY_RUN([
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
897 int main(int argc, char ** argv) {
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
898 return 8 != sizeof($type);
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
899 }
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
900 ],cxxtype_64bit=$type,cxxtype_64bit="unknown",cxxtype_64bit="long long")
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
901 AC_LANG_RESTORE
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
902 if test "${ctype_64bit}" = "${type}" -a "${cxxtype_64bit}" = "${type}"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
903 ecos_cv_type_64bit="${type}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
904 break
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
905 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
906 done
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
907 ])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
908 if test "${ecos_cv_type_64bit}" = ""; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
909 AC_MSG_ERROR(Unable to figure out how to do 64 bit arithmetic)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
910 else
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
911 if test "${ecos_cv_type_64bit}" != "long long"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
912 AC_DEFINE_UNQUOTED(cyg_halint64,${ecos_cv_type_64bit},[size of 64-bit datatype])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
913 AC_DEFINE_UNQUOTED(cyg_halcount64,${ecos_cv_type_64bit},[size of >= 64-bit datatype])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
914 fi
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
915 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
916 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
917
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
918 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
919 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
920
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
921 AC_DEFUN([ECOS_C_PRETTY_FUNCTION],[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
922 AC_REQUIRE([AC_PROG_CC])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
923 AC_REQUIRE([AC_PROG_CXX])
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
924
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
925 AC_CACHE_CHECK("for __PRETTY_FUNCTION__ support",ecos_cv_c_pretty_function,[
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
926 AC_LANG_SAVE
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
927 AC_LANG_C
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
928 AC_TRY_LINK(
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
929 [#include <stdio.h>],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
930 [puts(__PRETTY_FUNCTION__);],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
931 c_ok="yes",
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
932 c_ok="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
933 )
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
934 AC_LANG_CPLUSPLUS
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
935 AC_TRY_LINK(
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
936 [#include <cstdio>],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
937 [puts(__PRETTY_FUNCTION__);],
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
938 cxx_ok="yes",
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
939 cxx_ok="no"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
940 )
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
941 AC_LANG_RESTORE
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
942 if test "${c_ok}" = "yes" -a "${cxx_ok}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
943 ecos_cv_c_pretty_function="yes"
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
944 fi
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
945 ])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
946 if test "${ecos_cv_c_pretty_function}" = "yes"; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
947 AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO,[1],[compiler supports __PRETTY_FUNCTION__])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
948 fi
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
949 ])
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
950
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
951 dnl ====================================================================
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
952 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
953 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
954 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
955 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
956 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
957 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
958 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
959 dnl of directory names:
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
960 dnl ECOS_REPOSITORY e.g. ~/ecc/ecc
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
961 dnl PACKAGE_DIR e.g. hal/synth/arch
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
962 dnl PACKAGE_VERSION e.g. current
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
963 dnl PACKAGE_INSTALL e.g. hal/synth/arch/current
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
964 dnl
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
965 dnl These, together with the standard variable libexecdir, allow
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
966 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
967 dnl trees.
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
968
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
969 AC_DEFUN([ECOS_PACKAGE_DIRS],[
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
970
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
971 dnl srcdir will be something like <path>/packages/<package_path>/<version>/host
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
972 package_dir=`cd ${srcdir} && /bin/pwd`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
973 PACKAGE_VERSION=`dirname ${package_dir}`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
974 PACKAGE_VERSION=`basename ${PACKAGE_VERSION}`
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
975
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
976 dnl Now look for an "acsupport" directory as a good way of identifying
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
977 dnl the root of the repository. Assume that this does not clash with
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
978 dnl any real packages in the repository. Also assume that no silly games
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
979 dnl are being played with symlinks.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
980 package_dir=`dirname ${package_dir}`
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
981 package_dir=`dirname ${package_dir}`
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
982
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
983 possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.."
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
984 possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.."
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
985 AC_FIND_DIR("acsupport", ${possibles}, repository_root)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
986 if test "${repository_root}" = "" ; then
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
987 AC_MSG_ERROR([Failed to identify this package's position within the eCos repository])
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
988 fi
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
989 dnl repository_root will still contain the ..'s, instead of an absolute path
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
990 ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd`
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
991
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
992 dnl Now we have two absolute paths, so just remove one from the other
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
993 PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"`
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
994
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
995 dnl To avoid creating too many subdirectories on the host-side, turn
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
996 dnl e.g. hal/synth/arch into hal_synth_arch. Theoretically this could
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
997 dnl go wrong because multiple packages could map onto the same string,
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
998 dnl but in practice there should be a net reduction in complexity.
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
999 dnl bartv: / to _ conversion disabled for now, 5 March 2002
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
1000 PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}"
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
1001 dnl PACKAGE_INSTALL=`echo ${PACKAGE_INSTALL} | sed -e "s:/:_:g"`
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
1002
2528
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
1003 AC_SUBST(ECOS_REPOSITORY)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
1004 AC_SUBST(PACKAGE_DIR)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
1005 AC_SUBST(PACKAGE_VERSION)
a2fb80f5315f Update host-side configury
bartv
parents: 595
diff changeset
1006 AC_SUBST(PACKAGE_INSTALL)
283
f58bc1b2c2bc Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff changeset
1007 ])