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