annotate acsupport/acinclude.m4 @ 2651:58591d23f55f

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