Mercurial > ecos
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 |
| 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 | 51 AC_DEFUN([ECOS_CHECK_BUILD_ne_SRC],[ |
| 52 AC_MSG_CHECKING([that a separate build tree is being used]) | |
| 53 ecos_cwd=`/bin/pwd` | |
| 54 if test "${srcdir}" = "." ; then | |
| 55 srcdir=${ecos_cwd} | |
| 56 fi | |
| 57 if test "${ecos_cwd}" = "${srcdir}" ; then | |
| 58 AC_MSG_RESULT([no]) | |
| 59 AC_MSG_ERROR([This configure script should not be run inside the source tree. Instead please use a separate build tree]) | |
| 60 else | |
| 61 AC_MSG_RESULT([yes]) | |
| 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 | 71 AC_DEFUN([ECOS_SUBST_VERSION],[ |
| 72 AC_REQUIRE([AM_INIT_AUTOMAKE]) | |
| 73 ifelse($#,1,,AC_MSG_ERROR([Invalid number of arguments passed to ECOS SUBST_VERSION])) | |
| 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 | 83 AC_DEFUN([ECOS_MSVC_PATH], [ |
| 84 dnl AC_REQUIRE([ECOS_PROG_MSVC]) | |
| 85 ifelse($#, 1, , AC_MSG_ERROR("Invalid number of arguments passed to ECOS MSVC_PATH")) | |
| 86 if test "${MSVC}" = "yes" ; then | |
| 87 $1=`cygpath -w ${$1} | tr \\\\\\\\ /` | |
| 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 | 96 AC_DEFUN([ECOS_PROG_DEFINE_COMPILER_FLAGS],[ |
| 97 ecos_CFLAGS="" | |
| 98 ecos_CXXFLAGS="" | |
| 99 ecos_LDADD="" | |
| 100 ecos_INCLUDES="" | |
| 101 ecos_LIBS="" | |
| 102 AC_SUBST(ecos_CFLAGS) | |
| 103 AC_SUBST(ecos_CXXFLAGS) | |
| 104 AC_SUBST(ecos_LDADD) | |
| 105 AC_SUBST(ecos_INCLUDES) | |
| 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 | 119 AC_DEFUN([ECOS_PROG_MSVC],[ |
| 120 AC_REQUIRE([AC_PROG_CC]) | |
| 121 AC_REQUIRE([AC_PROG_CXX]) | |
| 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 | 124 AC_MSG_CHECKING("for Visual C++") |
| 125 MSVC="no"; | |
| 126 if test "${CC}" = "cl" ; then | |
| 127 MSVC="yes" | |
| 128 CXX="cl" | |
| 129 MSVC_SRCDIR=${srcdir} | |
| 130 ECOS_MSVC_PATH(MSVC_SRCDIR) | |
| 131 AC_SUBST(MSVC_SRCDIR) | |
| 132 ecos_INCLUDES="${ecos_INCLUDES} \"-I${MSVC_SRCDIR}\"" | |
| 133 ecos_LDADD="-link" | |
| 134 ecos_LIBS="advapi32.lib" | |
| 135 fi | |
| 136 AM_CONDITIONAL(MSVC, test "${MSVC}" = "yes") | |
| 137 if test "${MSVC}" = "yes" ; then | |
| 138 AC_MSG_RESULT([unfortunately yes]) | |
| 139 else | |
| 140 AC_MSG_RESULT([no]) | |
| 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 | 158 AC_DEFUN([ECOS_PROG_STANDARD_COMPILER_FLAGS], [ |
| 159 AC_REQUIRE([AC_PROG_CC]) | |
| 160 AC_REQUIRE([AC_PROG_CXX]) | |
| 161 AC_REQUIRE([ECOS_PROG_DEFINE_COMPILER_FLAGS]) | |
| 162 AC_REQUIRE([ECOS_PROG_MSVC]) | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
163 |
| 2528 | 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 | 166 dnl Add a user-settable flag to control whether or debugging info is |
| 167 dnl incorporated at compile-time. | |
| 168 ecosflags_enable_debug="no" | |
| 169 AC_ARG_ENABLE(debug,[ --enable-debug do a debug rather than a release build], | |
| 170 [case "${enableval}" in | |
| 171 yes) ecosflags_enable_debug="yes" ;; | |
| 172 *) ecosflags_enable_debug="no" ;; | |
| 173 esac]) | |
| 174 | |
| 175 dnl For VC++ builds also provide a flag for ANSI vs. unicode builds. | |
| 176 dnl For now this does not actually affect the compiler flags. | |
| 177 dnl NOTE: there may also have to be a flag to control whether or | |
| 178 dnl the VC++ multi-threading flags are enabled. | |
| 179 ecosflags_enable_ansi="no" | |
| 180 if test "${MSVC}" = "yes" ; then | |
| 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 | 183 yes) ecosflags_enable_ansi="yes" ;; |
| 184 *) ecosflags_enable_ansi="no" ;; | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
185 esac]) |
| 2528 | 186 fi |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
187 |
| 2528 | 188 dnl Now we know what the user is after. |
| 189 if test "${GCC}" = "yes" ; then | |
| 190 ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" | |
| 191 ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wcast-qual -Woverloaded-virtual" | |
| 192 elif test "${MSVC}" = "yes" ; then | |
| 193 ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3" | |
| 194 ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX" | |
| 195 else | |
| 196 AC_MSG_ERROR("default flags for ${CC} are not known") | |
| 197 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
198 |
| 2528 | 199 dnl Choose between debugging and optimization. |
| 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 | 202 ecos_CFLAGS="${ecos_CFLAGS} -g -O0" |
| 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 | 205 ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi" |
| 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 | 208 else |
| 209 dnl With older versions of g++ building the host-side tools with | |
| 210 dnl -O2 took forever. These problems should now have gone away. | |
| 211 if test "${GCC}" = "yes" ; then | |
| 212 ecos_CFLAGS="${ecos_CFLAGS} -O2" | |
| 213 ecos_CXXFLAGS="${ecos_CXXFLAGS} -O2" | |
| 214 elif test "${MSVC}" = "yes" ; then | |
| 215 ecos_CFLAGS="${ecos_CFLAGS} -MD -O2" | |
| 216 ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2" | |
| 217 fi | |
| 218 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
219 |
| 2528 | 220 CFLAGS="${ac_save_CFLAGS}" |
| 221 CXXFLAGS="${ac_save_CXXFLAGS}" | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
222 |
| 2528 | 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 | 238 AC_DEFUN([ECOS_ARG_INFRASTRUCTURE], [ |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
239 |
| 2528 | 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 | 242 if test "${ecosflags_enable_debug}" = "yes" ; then |
| 243 ecosinfra_asserts="yes" | |
| 244 ecosinfra_preconditions="yes" | |
| 245 ecosinfra_postconditions="yes" | |
| 246 ecosinfra_invariants="yes" | |
| 247 ecosinfra_loopinvariants="yes" | |
| 248 ecosinfra_tracing="yes" | |
| 249 ecosinfra_fntracing="yes" | |
| 250 else | |
| 251 ecosinfra_asserts="no" | |
| 252 ecosinfra_preconditions="no" | |
| 253 ecosinfra_postconditions="no" | |
| 254 ecosinfra_invariants="no" | |
| 255 ecosinfra_loopinvariants="no" | |
| 256 ecosinfra_tracing="no" | |
| 257 ecosinfra_fntracing="no" | |
| 258 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
259 |
| 2528 | 260 AC_ARG_ENABLE(asserts,[ --disable-asserts disable all assertions], |
| 261 [case "${enableval}" in | |
| 262 yes) ecosinfra_asserts="yes" ;; | |
| 263 no) ecosinfra_asserts="no" ;; | |
| 264 *) AC_MSG_ERROR([bad value ${enableval} for disable-asserts option]) ;; | |
| 265 esac]) | |
| 266 if test "${ecosinfra_asserts}" = "yes"; then | |
| 267 AC_DEFINE(CYGDBG_USE_ASSERTS,[1],[assertions enabled]) | |
| 268 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
269 |
| 2528 | 270 AC_ARG_ENABLE(preconditions, [ --disable-preconditions disable a subset of the assertions], |
| 271 [case "${enableval}" in | |
| 272 yes) ecosinfra_preconditions="yes" ;; | |
| 273 no) ecosinfra_preconditions="no" ;; | |
| 274 *) AC_MSG_ERROR([bad value ${enableval} for disable-preconditions option]) ;; | |
| 275 esac]) | |
| 276 if test "${ecosinfra_preconditions}" = "yes"; then | |
| 277 AC_DEFINE(CYGDBG_INFRA_DEBUG_PRECONDITIONS,[1],[precondition asserts enabled]) | |
| 278 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
279 |
| 2528 | 280 AC_ARG_ENABLE(postconditions, [ --disable-postconditions disable a subset of the assertions], |
| 281 [case "${enableval}" in | |
| 282 yes) ecosinfra_postconditions="yes" ;; | |
| 283 no) ecosinfra_postconditions="no" ;; | |
| 284 *) AC_MSG_ERROR([bad value ${enableval} for disable-postconditions option]) ;; | |
| 285 esac]) | |
| 286 if test "${ecosinfra_postconditions}" = "yes"; then | |
| 287 AC_DEFINE(CYGDBG_INFRA_DEBUG_POSTCONDITIONS,[1], [postcondition asserts enabled]) | |
| 288 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
289 |
| 2528 | 290 AC_ARG_ENABLE(invariants, [ --disable-invariants disable a subset of the assertions], |
| 291 [case "${enableval}" in | |
| 292 yes) ecosinfra_invariants="yes" ;; | |
| 293 no) ecosinfra_invariants="no" ;; | |
| 294 *) AC_MSG_ERROR([bad value ${enableval} for disable-invariants option]) ;; | |
| 295 esac]) | |
| 296 if test "${ecosinfra_invariants}" = "yes"; then | |
| 297 AC_DEFINE(CYGDBG_INFRA_DEBUG_INVARIANTS,[1],[invariant asserts enabled]) | |
| 298 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
299 |
| 2528 | 300 AC_ARG_ENABLE(loopinvariants, [ --disable-loopinvariants disable a subset of the assertions], |
| 301 [case "${enableval}" in | |
| 302 yes) ecosinfra_loopinvariants="yes" ;; | |
| 303 no) ecosinfra_loopinvariants="no" ;; | |
| 304 *) AC_MSG_ERROR([bad value ${enableval} for disable-loopinvariants option]) ;; | |
| 305 esac]) | |
| 306 if test "${ecosinfra_loopinvariants}" = "yes"; then | |
| 307 AC_DEFINE(CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS,[1],[loop invariant asserts enabled]) | |
| 308 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
309 |
| 2528 | 310 AC_ARG_ENABLE(tracing,[ --disable-tracing disable tracing], |
| 311 [case "${enableval}" in | |
| 312 yes) ecosinfra_tracing="yes" ;; | |
| 313 no) ecosinfra_tracing="no" ;; | |
| 314 *) AC_MSG_ERROR([bad value ${enableval} for disable-tracing option]) ;; | |
| 315 esac]) | |
| 316 if test "${ecosinfra_tracing}" = "yes"; then | |
| 317 AC_DEFINE(CYGDBG_USE_TRACING,[1],[tracing enabled]) | |
| 318 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
319 |
| 2528 | 320 AC_ARG_ENABLE(fntracing,[ --disable-fntracing disable function entry/exit tracing], |
| 321 [case "${enableval}" in | |
| 322 yes) ecosinfra_fntracing="yes" ;; | |
| 323 no) ecosinfra_fntracing=no ;; | |
| 324 *) AC_MSG_ERROR([bad value ${enableval} for disable-fntracing option]) ;; | |
| 325 esac]) | |
| 326 if test "${ecosinfra_fntracing}" = "yes"; then | |
| 327 AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS,[1],[function entry/exit reporting enabled]) | |
| 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 | 338 AC_DEFUN([AC_FIND_FILE],[ |
| 339 $3="" | |
| 340 for i in $2; do | |
| 341 if test -r "$i/$1"; then | |
| 342 $3=$i | |
| 343 break | |
| 344 fi | |
| 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 | 355 AC_DEFUN([AC_FIND_DIR],[ |
| 356 $3="" | |
| 357 for i in $2; do | |
| 358 if test -d "$i/$1"; then | |
| 359 $3=$i | |
| 360 break | |
| 361 fi | |
| 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 | 421 AC_DEFUN([ECOS_PATH_TCL], [ |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
422 |
| 2528 | 423 AC_REQUIRE([ECOS_PROG_MSVC]) |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
424 |
| 2528 | 425 dnl Where is the Tcl installation, and what version should be used? |
| 2530 | 426 dnl This macro is rather more verbose than usual because of the many |
| 427 dnl problems encountered over the years with Tcl installations. | |
| 428 AC_MSG_CHECKING(for Tcl/Tk installation) | |
| 429 AC_MSG_RESULT() | |
| 430 | |
| 2528 | 431 AC_ARG_WITH(tcl,[ --with-tcl=<path> location of Tcl header and libraries]) |
| 2538 | 432 AC_ARG_WITH(tcl,[ --with-tk=<path> location of Tk header and libraries]) |
| 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 | 435 dnl If using VC++ then there are no sensible default directories |
| 436 dnl to search for a Tcl installation. Instead the user must | |
| 437 dnl supply either --with-tcl, or both --with-tcl-header and | |
| 438 dnl --with-tcl-lib. | |
| 439 dnl | |
| 440 dnl Also when using VC++ there is no tclConfig.sh file to | |
| 441 dnl consult about which libraries are needed. Instead that | |
| 442 dnl information is hard-wired here. | |
| 443 if test "${MSVC}" = "yes" ; then | |
| 444 AC_ARG_WITH(tcl-header,[ --with-tcl-header=<path> location of Tcl header]) | |
| 445 AC_ARG_WITH(tcl-lib,[ --with-tcl-lib=<path> location of Tcl libraries]) | |
| 446 ecos_tcl_incdir="" | |
| 447 ecos_tcl_libdir="" | |
| 448 if test "${with_tcl_version+set}" != set ; then | |
| 449 AC_MSG_ERROR(You must specify a Tcl version using --with-tcl-version=<vsn>) | |
| 450 fi | |
| 451 if test "${with_tcl_header+set}" = set ; then | |
| 452 ecos_tcl_incdir=${with_tcl_header} | |
| 453 elif test "${with_tcl+set}" = set ; then | |
| 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 | 456 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-header=<path>) |
| 457 fi | |
| 458 if test "${with_tcl_lib+set}" = set; then | |
| 459 ecos_tcl_libdir=${with_tcl_lib} | |
| 460 elif test "${with_tcl+set}" = set; then | |
| 461 ecos_tcl_libdir="${with_tcl}/lib" | |
| 462 else | |
| 463 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-lib=<path>) | |
| 464 fi | |
| 465 | |
| 466 dnl Sanity check, make sure that there is a tcl.h header file. | |
| 467 dnl If not then there is no point in proceeding. | |
| 468 if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then | |
| 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 | 472 ECOS_MSVC_PATH(ecos_tcl_incdir) |
| 473 ECOS_MSVC_PATH(ecos_tcl_libdir) | |
| 474 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_tcl_incdir}\"" | |
| 475 ecos_LIBS="${ecos_LIBS} tcl${with_tcl_version}.lib" | |
| 476 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\"" | |
| 477 | |
| 478 dnl FIXME: what libraries are needed for a tk application under VC++? | |
| 479 dnl and can the version be determined more accurately? | |
| 480 ecos_tk_libs="" | |
| 481 | |
| 482 else | |
| 483 dnl ------------------------------------------------------------ | |
| 484 dnl Not Visual C++ so try to do things properly by finding and | |
| 485 dnl using tclConfig.sh | |
| 486 possibles="" | |
| 487 if test "${with_tcl+set}" = set ; then | |
| 488 possibles="${with_tcl}/lib" | |
| 489 if test "${with_tcl_version+set}" = set ; then | |
| 490 possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}" | |
| 491 fi | |
| 492 fi | |
| 493 possibles="${possibles} ${prefix}/lib" | |
| 494 if test "${with_tcl_version+set}" = set ; then | |
| 495 possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}" | |
| 496 fi | |
| 497 possibles="${possibles} /usr/lib" | |
| 498 if test "${with_tcl_version+set}" = set ; then | |
| 499 possibles="${possibles} /usr/lib/tcl${with_tcl_version}" | |
| 500 fi | |
| 2530 | 501 AC_MSG_NOTICE(looking for tclConfig.sh in ${possibles}) |
| 2528 | 502 AC_FIND_FILE("tclConfig.sh", ${possibles}, tclconfig) |
| 503 if test \! -r "${tclconfig}/tclConfig.sh" ; then | |
| 504 AC_MSG_ERROR(unable to locate Tcl configuration file tclConfig.sh) | |
| 505 else | |
| 2530 | 506 AC_MSG_NOTICE(found ${tclconfig}/tclConfig.sh) |
| 2528 | 507 . ${tclconfig}/tclConfig.sh |
| 508 | |
| 509 dnl Now we need to figure out where to find the Tcl header files. | |
| 510 dnl tclConfig.sh may define a variable TCL_INCLUDE_SPEC or | |
| 511 dnl TCL_INCLUDE_DIR, otherwise use TCL_PREFIX/include | |
| 512 if test -n "${TCL_INCLUDE_SPEC}" ; then | |
| 513 ecos_tcl_incdir="${TCL_INCLUDE_SPEC}" | |
| 2530 | 514 AC_MSG_NOTICE(trying TCL_INCLUDE_SPEC - looking for tcl.h in ${ecos_tcl_incdir}) |
| 2528 | 515 elif test -n "${TCL_INC_DIR}" ; then |
| 516 ecos_tcl_incdir="${TCL_INC_DIR}" | |
| 2530 | 517 AC_MSG_NOTICE(trying TCL_INC_DIR - looking for tcl.h in ${ecos_tcl_incdir}) |
| 2528 | 518 else |
| 519 ecos_tcl_incdir="-I${TCL_PREFIX}/include" | |
| 2530 | 520 AC_MSG_WARN(no TCL_INCLUDE_SPEC or TCL_INC_DIR in tclConfig.sh) |
| 521 AC_MSG_NOTICE(fallback - looking for tcl.h in ${ecos_tcl_incdir}) | |
| 2528 | 522 fi |
| 523 dnl But verify that the resulting incdir is valid. | |
| 524 ecos_tcl_tmpdir=`echo ${ecos_tcl_incdir} | sed -e "s:-I::g"` | |
| 525 if test \! -r "${ecos_tcl_tmpdir}/tcl.h" ; then | |
| 526 AC_MSG_ERROR(unable to locate Tcl header file tcl.h) | |
| 527 else | |
| 528 dnl On Unix systems -I/usr/include is unnecessary, and can | |
| 529 dnl cause problems on hosts where gcc is not the platform's | |
| 530 dnl default compiler because of the use of unfixed headers. | |
| 531 dnl Hence it is explicitly removed here. | |
| 2530 | 532 AC_MSG_NOTICE(using ${ecos_tcl_incdir}) |
| 2528 | 533 if test "${ecos_tcl_incdir}" != "-I/usr/include" ; then |
| 534 ecos_INCLUDES="${ecos_INCLUDES} ${ecos_tcl_incdir}" | |
| 535 fi | |
| 536 fi | |
| 537 | |
| 538 dnl There should be a variable TCL_LIB_SPEC which defines | |
| 539 dnl exactly how to link with Tcl. Without that, try to search | |
| 540 dnl for a libtcl.a | |
| 541 ecos_tcl_libs="" | |
| 542 if test -n "${TCL_LIB_SPEC}" ; then | |
| 543 ecos_tcl_libs="${ecos_LIBS} ${TCL_LIB_SPEC}" | |
| 2530 | 544 AC_MSG_NOTICE(using TCL_LIB_SPEC ${TCL_LIB_SPEC}) |
| 2528 | 545 else |
| 2530 | 546 AC_MSG_WARN(no TCL_LIB_SPEC in tclConfig.sh) |
| 2528 | 547 if test "${with_tcl_version+set}" = set ; then |
| 2530 | 548 AC_MSG_NOTICE(fallback - looking for libtcl${with_tcl_version}.a in ${possibles}) |
| 2528 | 549 AC_FIND_FILE("libtcl${with_tcl_version}.a", ${possibles}, libtcl) |
| 550 if test -r "${libtcl}/libtcl${with_tcl_version}.a" ; then | |
| 551 ecos_tcl_libs="-L${libtcl} -ltcl${with_tcl_version}" | |
| 2530 | 552 AC_MSG_NOTICE(using ${ecos_tcl_libs}) |
| 2528 | 553 fi |
| 554 fi | |
| 555 if test -z "${ecos_tcl_libs}" ; then | |
| 2530 | 556 AC_MSG_NOTICE(fallback - looking for libtcl.a in ${possibles}) |
| 2528 | 557 AC_FIND_FILE("libtcl.a", ${possibles}, libtcl) |
| 558 if test -r "${libtcl}/libtcl.a" ; then | |
| 559 ecos_tcl_libs="-L${libtcl} -ltcl" | |
| 2530 | 560 AC_MSG_NOTICE(using ${ecos_tcl_libs}) |
| 2528 | 561 fi |
| 562 fi | |
| 563 fi | |
| 564 | |
| 565 dnl If at this stage we have not found a libtcl.a, complain. | |
| 566 if test -z "${ecos_tcl_libs}" ; then | |
| 2530 | 567 AC_MSG_ERROR(${tclconfig}/tclConfig.sh does not define TCL_LIB_SPEC, and unable to find libtcl.a) |
| 2528 | 568 fi |
| 569 | |
| 570 dnl tclConfig.sh may specify additional flags and libraries. | |
| 571 if test -n "${TCL_LIBS}" ; then | |
| 572 ecos_tcl_libs="${ecos_tcl_libs} ${TCL_LIBS}" | |
| 2530 | 573 AC_MSG_NOTICE(using additional libraries for Tcl ${TCL_LIBS}) |
| 2528 | 574 fi |
| 575 if test -n "${TCL_LD_FLAGS}" ; then | |
| 576 ecos_tcl_libs="${ecos_tcl_libs} ${TCL_LD_FLAGS}" | |
| 2530 | 577 AC_MSG_NOTICE(using additional linker flags for Tcl ${TCL_LD_FLAGS}) |
| 2528 | 578 fi |
| 579 ecos_LIBS="${ecos_LIBS} ${ecos_tcl_libs}" | |
| 580 fi | |
| 581 | |
| 582 | |
| 583 dnl -------------------------------------------------------- | |
| 2538 | 584 dnl We now repeat the exercise for tk and tkConfig.sh. |
| 585 dnl Typically this will be in a similar location to tclConfig.sh, | |
| 586 dnl but allow for separate | |
| 2528 | 587 dnl we assume that the Tk installation is in a similar |
| 2538 | 588 dnl location to the Tcl one, but allow for different ones |
| 589 dnl just in case. | |
| 590 possibles="" | |
| 591 if test "${with_tk+set}" = set ; then | |
| 592 possibles="${possibles} ${with_tk}/lib" | |
| 593 if test "${with_tcl_version+set}" = set ; then | |
| 594 possibles="${possibles} ${with_tk}/lib/tcl${with_tcl_version}" | |
| 595 possibles="${possibles} ${with_tk}/lib/tk${with_tcl_version}" | |
| 596 fi | |
| 597 fi | |
| 598 if test "${with_tcl+set}" = set ; then | |
| 599 possibles="${possibles} ${with_tcl}/lib" | |
| 600 if test "${with_tcl_version+set}" = set ; then | |
| 601 possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}" | |
| 602 possibles="${possibles} ${with_tcl}/lib/tk${with_tcl_version}" | |
| 603 fi | |
| 604 fi | |
| 605 possibles="${possibles} ${prefix}/lib" | |
| 606 if test "${with_tcl_version+set}" = set ; then | |
| 607 possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}" | |
| 608 possibles="${possibles} ${prefix}/lib/tk${with_tcl_version}" | |
| 609 fi | |
| 610 possibles="${possibles} /usr/lib" | |
| 611 if test "${with_tcl_version+set}" = set ; then | |
| 612 possibles="${possibles} /usr/lib/tcl${with_tcl_version}" | |
| 613 possibles="${possibles} /usr/lib/tk${with_tcl_version}" | |
| 614 fi | |
| 615 | |
| 2530 | 616 AC_MSG_NOTICE(looking for tkConfig.sh in ${possibles}) |
| 2528 | 617 AC_FIND_FILE("tkConfig.sh", ${possibles}, tkconfig) |
| 618 if test \! -r "${tkconfig}/tkConfig.sh" ; then | |
| 619 AC_MSG_ERROR(unable to locate Tk config file tkConfig.sh) | |
| 620 else | |
| 2530 | 621 AC_MSG_NOTICE(found ${tkconfig}/tkConfig.sh) |
| 2528 | 622 . ${tkconfig}/tkConfig.sh |
| 623 | |
| 624 if test -n "${TK_INCLUDE_SPEC}" ; then | |
| 2530 | 625 ecos_tk_includes="${TK_INCLUDE_SPEC}" |
| 626 AC_MSG_NOTICE(trying TK_INCLUDE_SPEC - looking for tk.h in ${ecos_tk_includes}) | |
| 2528 | 627 elif test -n "${TK_INC_DIR}" ; then |
| 628 ecos_tk_includes="${TK_INC_DIR}" | |
| 2530 | 629 AC_MSG_NOTICE(trying TK_INC_DIR - looking for tk.h in ${ecos_tk_includes}) |
| 2528 | 630 else |
| 631 ecos_tk_includes="-I${TCL_PREFIX}/include" | |
| 2530 | 632 AC_MSG_WARN(no TK_INCLUDE_SPEC or TK_INC_DIR in tkConfig.sh) |
| 633 AC_MSG_NOTICE(fallback - looking for tk.h in ${ecos_tk_includes}) | |
| 2528 | 634 fi |
| 635 dnl But verify that the resulting incdir is valid. | |
| 636 ecos_tk_tmpdir=`echo ${ecos_tk_includes} | sed -e "s:-I::g"` | |
| 637 if test \! -r "${ecos_tk_tmpdir}/tk.h" ; then | |
| 638 AC_MSG_ERROR(unable to locate Tk header file tk.h) | |
| 639 else | |
| 640 dnl On Unix systems -I/usr/include is unnecessary, and can | |
| 641 dnl cause problems on hosts where gcc is not the platform's | |
| 642 dnl default compiler because of the use of unfixed headers. | |
| 643 dnl Hence it is explicitly removed here. | |
| 2530 | 644 AC_MSG_NOTICE(using ${ecos_tk_includes}) |
| 645 if test "${ecos_tk_includes}" = "-I/usr/include" ; then | |
| 2528 | 646 ecos_tk_includes="" |
| 647 fi | |
| 648 fi | |
| 649 dnl There may be additional include directories for X, although | |
| 650 dnl unlikely on a Unix system. | |
| 651 if test -n "${TK_XINCLUDES}" ; then | |
| 2530 | 652 AC_MSG_NOTICE(adding TK_XINCLUDES ${TK_XINCLUDES}) |
| 2528 | 653 ecos_tk_includes="${ecos_tk_includes} ${TK_XINCLUDES}" |
| 654 fi | |
| 655 | |
| 656 ecos_tk_libs="" | |
| 657 if test -n "${TK_LIB_SPEC}" ; then | |
| 658 ecos_tk_libs="${TK_LIB_SPEC}" | |
| 2530 | 659 AC_MSG_NOTICE(trying TK_LIB_SPEC ${TK_LIB_SPEC}) |
| 2528 | 660 else |
| 2530 | 661 AC_MSG_WARN(no TK_LIB_SPEC in tkConfig.sh) |
| 2528 | 662 if test "${with_tcl_version+set}" = set ; then |
| 2530 | 663 AC_MSG_NOTICE(fallback - looking for libtk${with_tcl_version}.a in ${possibles}) |
| 2528 | 664 AC_FIND_FILE("libtk${with_tcl_version}.a", ${possibles}, libtk) |
| 665 if test -r "${libtk}/libtk${with_tcl_version}.a" ; then | |
| 2530 | 666 ecos_tk_libs="-L${libtk} -ltk${with_tcl_version}" |
| 2528 | 667 fi |
| 668 fi | |
| 669 if test -z "${ecos_tk_libs}" ; then | |
| 2530 | 670 AC_MSG_NOTICE(fallback - looking for libtk.a in ${possibles}) |
| 2528 | 671 AC_FIND_FILE("libtk.a", ${possibles}, libtk) |
| 672 if test -r "${libtk}/libtk.a" ; then | |
| 673 ecos_tk_libs="-L${libtk} -ltk" | |
| 674 fi | |
| 675 fi | |
| 676 fi | |
| 677 if test -z "${ecos_tk_libs}" ; then | |
| 678 AC_MSG_ERROR(${tkconfig}/tkConfig.sh does not define TK_LIB_SPEC, and unable to find libtk.a) | |
| 2530 | 679 else |
| 680 AC_MSG_NOTICE(using ${ecos_tk_libs}) | |
| 2528 | 681 fi |
| 682 | |
| 683 dnl Tk may need additional libraries. Unfortunately some of these | |
| 684 dnl duplicate the Tcl ones, causing occasional linker upsets. It | |
| 685 dnl is assumed here that Tk will only be used in conjunction with | |
| 686 dnl tcl. | |
| 687 if test -n "${TK_LIBS}" ; then | |
| 688 if test -n "${TCL_LIBS}" ; then | |
| 689 ecos_tk_tmp="${TK_LIBS}" | |
| 690 for i in ${TCL_LIBS} ; do | |
| 691 ecos_tk_tmp=`echo ${ecos_tk_tmp} | sed -e "s:${i}::g"` | |
| 692 done | |
| 693 ecos_tk_libs="${ecos_tk_libs} ${ecos_tk_tmp}" | |
| 2530 | 694 AC_MSG_NOTICE(using additional libraries for Tk ${ecos_tk_tmp}) |
| 2528 | 695 else |
| 696 ecos_tk_libs="${ecos_tk_libs} ${TK_LIBS}" | |
| 2530 | 697 AC_MSG_NOTICE(using additional libraries for Tk ${TK_LIBS}) |
| 2528 | 698 fi |
| 699 fi | |
| 700 fi | |
| 701 fi | |
| 702 | |
| 2530 | 703 AC_MSG_CHECKING(for Tcl/Tk installation) |
| 704 AC_MSG_RESULT(done) | |
| 2528 | 705 AC_SUBST(ecos_tk_includes) |
| 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 | 720 AC_DEFUN([ECOS_PATH_INFRA], [ |
| 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 | 723 dnl Where are we in the build tree? First assume that we are in the host |
| 724 dnl tree, thus allowing configury of just the host-side. If that fails | |
| 725 dnl assume we can be anywhere. | |
| 726 infra_builddir="" | |
| 727 possibles=".. ../.. ../../.. ../../../.. ../../../../.." | |
| 728 AC_FIND_DIR("infra", ${possibles}, infra_builddir) | |
| 729 if test "${infra_builddir}" = "" ; then | |
| 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 | 732 fi |
| 733 if test "${infra_builddir}" != "" ; then | |
| 734 infra_builddir="${infra_builddir}/infra" | |
| 735 infra_builddir=`cd ${infra_builddir} && /bin/pwd` | |
| 736 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
737 |
| 2528 | 738 ecos_infra_incdir="" |
| 739 ecos_infra_libdir="" | |
| 740 ecos_infra_libs="" | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
741 |
| 2528 | 742 AC_ARG_WITH(infra-header,[ --with-infra-header=<path> location of eCos infrastructure headers]) |
| 743 AC_ARG_WITH(infra-lib,[ --with-infra-lib=<path> location of eCos infrastructure library]) | |
| 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 | 746 if test "${with_infra_header+set}" = "set"; then |
| 747 ecos_infra_incdir="${with_infra_header}" | |
| 748 elif test "${with_infra+set}" = "set"; then | |
| 749 ecos_infra_incdir="${with_infra}/include" | |
| 750 elif test "${infra_builddir}" != "" ; then | |
| 751 ecos_infra_incdir="${infra_builddir}" | |
| 752 else | |
| 753 AC_MSG_ERROR([infrastructure headers not found]) | |
| 754 fi | |
| 755 if test "${MSVC}" = "yes" ; then | |
| 756 ecos_msvc_infra_incdir=${ecos_infra_incdir} | |
| 757 ECOS_MSVC_PATH(ecos_msvc_infra_incdir) | |
| 758 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_infra_incdir}\"" | |
| 759 else | |
| 760 ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_infra_incdir}" | |
| 761 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
762 |
| 2528 | 763 if test "${with_infra_lib+set}" = "set"; then |
| 764 ecos_infra_libdir="${with_infra_lib}" | |
| 765 elif test "${with_infra+set}" = "set"; then | |
| 766 ecos_infra_libdir="${with_infra}/lib" | |
| 767 elif test "${infra_builddir}" != "" ; then | |
| 768 ecos_infra_libdir="${infra_builddir}" | |
| 769 else | |
| 770 AC_MSG_ERROR([infrastructure library not found]) | |
| 771 fi | |
| 772 if test "${MSVC}" = "yes" ; then | |
| 773 ecos_msvc_infra_libdir=${ecos_infra_libdir} | |
| 774 ECOS_MSVC_PATH(ecos_msvc_infra_libdir) | |
| 775 ecos_LIBS="${ecos_LIBS} cyginfra.lib" | |
| 776 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_infra_libdir}\"" | |
| 777 else | |
| 778 ecos_LIBS="${ecos_LIBS} -lcyginfra" | |
| 779 ecos_LDADD="${ecos_LDADD} -L${ecos_infra_libdir}" | |
| 780 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
781 |
| 2528 | 782 AC_SUBST(ecos_infra_incdir) |
| 783 AC_SUBST(ecos_infra_libdir) | |
| 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 | 791 AC_DEFUN([ECOS_PATH_LIBCDL], [ |
| 792 AC_MSG_CHECKING([for libcdl]) | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
793 |
| 2528 | 794 dnl Where are we in the source tree? |
| 795 libcdl_srcdir="" | |
| 796 possibles="${srcdir}/.. ${srcdir}/../.. ${srcdir}/../../.. ${srcdir}/../../../.. ${srcdir}/../../../../.." | |
| 797 AC_FIND_DIR("libcdl", ${possibles}, libcdl_srcdir) | |
| 798 if test "${libcdl_srcdir}" = "" ; then | |
| 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 | 801 fi |
| 802 if test "${libcdl_srcdir}" != "" ; then | |
| 803 libcdl_srcdir="${libcdl_srcdir}/libcdl" | |
| 804 libcdl_srcdir=`cd ${libcdl_srcdir} && /bin/pwd` | |
| 805 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
806 |
| 2528 | 807 dnl And where are we in the build tree? |
| 808 libcdl_builddir="" | |
| 809 possibles=".. ../.. ../../.. ../../../.. ../../../../.." | |
| 810 AC_FIND_DIR("libcdl", ${possibles}, libcdl_builddir) | |
| 811 if test "${libcdl_builddir}" = "" ; then | |
| 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 | 814 fi |
| 815 if test "${libcdl_builddir}" != "" ; then | |
| 816 libcdl_builddir="${libcdl_builddir}/libcdl" | |
| 817 libcdl_builddir=`cd ${libcdl_builddir} && /bin/pwd` | |
| 818 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
819 |
| 2528 | 820 ecos_libcdl_incdir="" |
| 821 ecos_libcdl_libdir="" | |
| 822 ecos_libcdl_libs="" | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
823 |
| 2528 | 824 AC_ARG_WITH(libcdl-header,[ --with-libcdl-header=<path> location of eCos libcdl headers]) |
| 825 AC_ARG_WITH(libcdl-lib,[ --with-libcdl-lib=<path> location of eCos libcdl library]) | |
| 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 | 828 if test "${with_libcdl_header+set}" = "set"; then |
| 829 ecos_libcdl_incdir="${with_libcdl_header}" | |
| 830 elif test "${with_libcdl+set}" = "set"; then | |
| 831 ecos_libcdl_incdir="${with_libcdl}/include" | |
| 832 elif test "${libcdl_srcdir}" != "" ; then | |
| 833 ecos_libcdl_incdir="${libcdl_srcdir}" | |
| 834 fi | |
| 835 if test \! -r "${ecos_libcdl_incdir}/cdl.hxx" ; then | |
| 836 AC_MSG_ERROR([libcdl headers not found]) | |
| 837 fi | |
| 838 if test "${MSVC}" = "yes" ; then | |
| 839 ecos_msvc_libcdl_incdir="${ecos_libcdl_incdir}" | |
| 840 ECOS_MSVC_PATH(ecos_msvc_libcdl_incdir) | |
| 841 ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_libcdl_incdir}\"" | |
| 842 else | |
| 843 ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_libcdl_incdir}" | |
| 844 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
845 |
| 2528 | 846 if test "${with_libcdl_lib+set}" = "set"; then |
| 847 ecos_libcdl_libdir="${with_libcdl_lib}" | |
| 848 elif test "${with_libcdl+set}" = "set"; then | |
| 849 ecos_libcdl_libdir="${with_libcdl}/lib" | |
| 850 elif test "${libcdl_builddir}" != "" ; then | |
| 851 ecos_libcdl_libdir="${libcdl_builddir}" | |
| 852 else | |
| 853 AC_MSG_ERROR([libcdl library not found]) | |
| 854 fi | |
| 855 if test "${MSVC}" = "yes" ; then | |
| 856 ecos_msvc_libcdl_libdir=${ecos_libcdl_libdir} | |
| 857 ECOS_MSVC_PATH(ecos_msvc_libcdl_libdir) | |
| 858 ecos_LIBS="${ecos_LIBS} cdl.lib" | |
| 859 ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_libcdl_libdir}\"" | |
| 860 else | |
| 861 ecos_LIBS="${ecos_LIBS} -lcdl" | |
| 862 ecos_LDADD="${ecos_LDADD} -L${ecos_libcdl_libdir}" | |
| 863 fi | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
864 |
| 2528 | 865 AC_SUBST(ecos_libcdl_incdir) |
| 866 AC_SUBST(ecos_libcdl_libdir) | |
| 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 | 884 AC_DEFUN([ECOS_TYPE_64bit], [ |
| 885 AC_REQUIRE([AC_PROG_CC]) | |
| 886 AC_REQUIRE([AC_PROG_CXX]) | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
887 |
| 2528 | 888 AC_CACHE_CHECK("for a 64 bit data type",ecos_cv_type_64bit,[ |
| 889 for type in "long" "long long" "__int64"; do | |
| 890 AC_LANG_SAVE | |
| 891 AC_LANG_C | |
| 892 AC_TRY_RUN([ | |
| 893 main() { | |
| 894 return 8 != sizeof($type); | |
| 895 } | |
| 896 ],ctype_64bit=$type,ctype_64bit="unknown",ctype_64bit="long long") | |
| 897 AC_LANG_CPLUSPLUS | |
| 898 AC_TRY_RUN([ | |
| 899 int main(int argc, char ** argv) { | |
| 900 return 8 != sizeof($type); | |
| 901 } | |
| 902 ],cxxtype_64bit=$type,cxxtype_64bit="unknown",cxxtype_64bit="long long") | |
| 903 AC_LANG_RESTORE | |
| 904 if test "${ctype_64bit}" = "${type}" -a "${cxxtype_64bit}" = "${type}"; then | |
| 905 ecos_cv_type_64bit="${type}" | |
| 906 break | |
| 907 fi | |
| 908 done | |
| 909 ]) | |
| 910 if test "${ecos_cv_type_64bit}" = ""; then | |
| 911 AC_MSG_ERROR(Unable to figure out how to do 64 bit arithmetic) | |
| 912 else | |
| 913 if test "${ecos_cv_type_64bit}" != "long long"; then | |
| 914 AC_DEFINE_UNQUOTED(cyg_halint64,${ecos_cv_type_64bit},[size of 64-bit datatype]) | |
| 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 | 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 | 923 AC_DEFUN([ECOS_C_PRETTY_FUNCTION],[ |
| 924 AC_REQUIRE([AC_PROG_CC]) | |
| 925 AC_REQUIRE([AC_PROG_CXX]) | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
926 |
| 2528 | 927 AC_CACHE_CHECK("for __PRETTY_FUNCTION__ support",ecos_cv_c_pretty_function,[ |
| 928 AC_LANG_SAVE | |
| 929 AC_LANG_C | |
| 930 AC_TRY_LINK( | |
| 931 [#include <stdio.h>], | |
| 932 [puts(__PRETTY_FUNCTION__);], | |
| 933 c_ok="yes", | |
| 934 c_ok="no" | |
| 935 ) | |
| 936 AC_LANG_CPLUSPLUS | |
| 937 AC_TRY_LINK( | |
| 938 [#include <cstdio>], | |
| 939 [puts(__PRETTY_FUNCTION__);], | |
| 940 cxx_ok="yes", | |
| 941 cxx_ok="no" | |
| 942 ) | |
| 943 AC_LANG_RESTORE | |
| 944 if test "${c_ok}" = "yes" -a "${cxx_ok}" = "yes"; then | |
| 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 | 947 ]) |
| 948 if test "${ecos_cv_c_pretty_function}" = "yes"; then | |
| 949 AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO,[1],[compiler supports __PRETTY_FUNCTION__]) | |
| 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 | 971 AC_DEFUN([ECOS_PACKAGE_DIRS],[ |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
972 |
| 2528 | 973 dnl srcdir will be something like <path>/packages/<package_path>/<version>/host |
| 974 package_dir=`cd ${srcdir} && /bin/pwd` | |
| 975 PACKAGE_VERSION=`dirname ${package_dir}` | |
| 976 PACKAGE_VERSION=`basename ${PACKAGE_VERSION}` | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
977 |
| 2528 | 978 dnl Now look for an "acsupport" directory as a good way of identifying |
| 979 dnl the root of the repository. Assume that this does not clash with | |
| 980 dnl any real packages in the repository. Also assume that no silly games | |
| 981 dnl are being played with symlinks. | |
| 982 package_dir=`dirname ${package_dir}` | |
| 983 package_dir=`dirname ${package_dir}` | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
984 |
| 2528 | 985 possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.." |
| 986 possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.." | |
| 987 AC_FIND_DIR("acsupport", ${possibles}, repository_root) | |
| 988 if test "${repository_root}" = "" ; then | |
| 989 AC_MSG_ERROR([Failed to identify this package's position within the eCos repository]) | |
| 990 fi | |
| 991 dnl repository_root will still contain the ..'s, instead of an absolute path | |
| 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 | 994 dnl Now we have two absolute paths, so just remove one from the other |
| 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 | 997 dnl To avoid creating too many subdirectories on the host-side, turn |
| 998 dnl e.g. hal/synth/arch into hal_synth_arch. Theoretically this could | |
| 999 dnl go wrong because multiple packages could map onto the same string, | |
| 1000 dnl but in practice there should be a net reduction in complexity. | |
| 1001 dnl bartv: / to _ conversion disabled for now, 5 March 2002 | |
| 1002 PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}" | |
| 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 | 1005 AC_SUBST(ECOS_REPOSITORY) |
| 1006 AC_SUBST(PACKAGE_DIR) | |
| 1007 AC_SUBST(PACKAGE_VERSION) | |
| 1008 AC_SUBST(PACKAGE_INSTALL) | |
|
283
f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
bartv
parents:
diff
changeset
|
1009 ]) |
