Mercurial > ecos
comparison configure.in @ 283:f58bc1b2c2bc
Reorganization of the host-side autoconfiscation support, and a couple
of minor bug fixes. The main goal is to support per-package host-side
software in addition to the generic host-side tools. For example, the
synthetic target HAL and device driver packages can now have host
subdirectories with support code.
| author | bartv |
|---|---|
| date | Sun, 11 Aug 2002 21:40:50 +0000 |
| parents | e0c0827131d1 |
| children | d6a1854fdc1b |
comparison
equal
deleted
inserted
replaced
| 282:a29ee6c2dd3c | 283:f58bc1b2c2bc |
|---|---|
| 1 dnl Process this file with autoconf to produce a configure script. | 1 dnl Process this file with autoconf to produce a configure script. |
| 2 dnl ==================================================================== | 2 dnl ==================================================================== |
| 3 dnl | 3 dnl |
| 4 dnl configure.in | 4 dnl configure.in |
| 5 dnl | 5 dnl |
| 6 dnl Top-level configure script for eCos host-side software. | 6 dnl Top-level configure script for eCos software. |
| 7 dnl | 7 dnl |
| 8 dnl ==================================================================== | 8 dnl ==================================================================== |
| 9 dnl ####ECOSGPLCOPYRIGHTBEGIN#### | 9 dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### |
| 10 dnl ------------------------------------------- | 10 dnl ---------------------------------------------------------------------------- |
| 11 dnl This file is part of eCos, the Embedded Configurable Operating System. | 11 dnl Copyright (C) 2002 Bart Veer |
| 12 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. | 12 dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. |
| 13 dnl | 13 dnl |
| 14 dnl eCos is free software; you can redistribute it and/or modify it under | 14 dnl This file is part of the eCos host tools. |
| 15 dnl the terms of the GNU General Public License as published by the Free | |
| 16 dnl Software Foundation; either version 2 or (at your option) any later version. | |
| 17 dnl | 15 dnl |
| 18 dnl eCos is distributed in the hope that it will be useful, but WITHOUT ANY | 16 dnl This program is free software; you can redistribute it and/or modify it |
| 19 dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or | 17 dnl under the terms of the GNU General Public License as published by the Free |
| 20 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | 18 dnl Software Foundation; either version 2 of the License, or (at your option) |
| 21 dnl for more details. | 19 dnl any later version. |
| 22 dnl | 20 dnl |
| 23 dnl You should have received a copy of the GNU General Public License along | 21 dnl This program is distributed in the hope that it will be useful, but WITHOUT |
| 24 dnl with eCos; if not, write to the Free Software Foundation, Inc., | 22 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 25 dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | 23 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 26 dnl | 24 dnl more details. |
| 27 dnl As a special exception, if other files instantiate templates or use macros | 25 dnl |
| 28 dnl or inline functions from this file, or you compile this file and link it | 26 dnl You should have received a copy of the GNU General Public License along with |
| 29 dnl with other works to produce a work based on this file, this file does not | 27 dnl this program; if not, write to the Free Software Foundation, Inc., |
| 30 dnl by itself cause the resulting work to be covered by the GNU General Public | 28 dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 31 dnl License. However the source code for this file must still be made available | 29 dnl ---------------------------------------------------------------------------- |
| 32 dnl in accordance with section (3) of the GNU General Public License. | 30 dnl ####ECOSHOSTGPLCOPYRIGHTEND#### |
| 33 dnl | |
| 34 dnl This exception does not invalidate any other reasons why a work based on | |
| 35 dnl this file might be covered by the GNU General Public License. | |
| 36 dnl | |
| 37 dnl Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. | |
| 38 dnl at http://sources.redhat.com/ecos/ecos-license | |
| 39 dnl ------------------------------------------- | |
| 40 dnl ####ECOSGPLCOPYRIGHTEND#### | |
| 41 dnl ==================================================================== | 31 dnl ==================================================================== |
| 42 dnl#####DESCRIPTIONBEGIN#### | 32 dnl#####DESCRIPTIONBEGIN#### |
| 43 dnl | 33 dnl |
| 44 dnl Author(s): bartv | 34 dnl Author(s): bartv |
| 45 dnl Contact(s): bartv | 35 dnl Contact(s): bartv |
| 47 dnl Version: 0.01 | 37 dnl Version: 0.01 |
| 48 dnl | 38 dnl |
| 49 dnl####DESCRIPTIONEND#### | 39 dnl####DESCRIPTIONEND#### |
| 50 dnl ==================================================================== | 40 dnl ==================================================================== |
| 51 | 41 |
| 52 dnl For now the only work done via configure/make/make install is the | 42 dnl eCos is a componentized architecture for deeply embedded systems. |
| 53 dnl host-side libs and tools. At some point this work may be extended | 43 dnl It requires a very different configuration system from typical |
| 54 dnl to process the generic (non-package) documentation, and possibly | 44 dnl autoconfiscated software such as the various GNU packages. |
| 55 dnl to make releases of the target-side. | |
| 56 dnl | 45 dnl |
| 57 dnl The support files are all kept in the host sub-directory, allowing | 46 dnl The main eCos host-side software is autoconfiscated to some extent, |
| 58 dnl that to be distributed as a coherent set of sources. | 47 dnl in that the usual sequence of "configure;make;make install" will |
| 48 dnl work under the right conditions. However it does not conform to | |
| 49 dnl the GNU coding standards in numerous ways, for example "make dist" | |
| 50 dnl will not work. The main eCos host-side software lives in the | |
| 51 dnl "host" subdirectory, and is built unconditionally. | |
| 52 dnl | |
| 53 dnl The eCos target-side software lives in the "packages" subdirectory, | |
| 54 dnl and is organized in numerous subdirectories corresponding to different | |
| 55 dnl packages and potentially different versions of each package. In the | |
| 56 dnl master repository managed by CVS there will only be one version of | |
| 57 dnl each package, "current", which simplifies things somewhat. Other | |
| 58 dnl repositories will not be quite so straightforward and require a | |
| 59 dnl suitable administration tool. | |
| 60 dnl | |
| 61 dnl The various eCos packages are not currently auto-confiscated. | |
| 62 dnl In particular building eCos requires the use of eCos configuration | |
| 63 dnl technology, not autoconf - there is simply no good way of handling | |
| 64 dnl a system as highly configurable as eCos using a few command-line | |
| 65 dnl options passed to "configure". There would also be serious confusion | |
| 66 dnl between host and target, especially when e.g. cross-compiling the | |
| 67 dnl host tools. However a possible future enhancement | |
| 68 dnl would involve making eCos releases via configure and make, thus | |
| 69 dnl allowing for a release process that combines building the various | |
| 70 dnl host-side tools such as gcc with creating eCos epk's for the various | |
| 71 dnl packages. | |
| 72 dnl | |
| 73 dnl A complication is that some of the eCos target-side packages also | |
| 74 dnl contain package-specific host-side support. For example the | |
| 75 dnl Linux synthetic target support uses special host-side software | |
| 76 dnl to provide I/O facilities: the architectural HAL package provdes | |
| 77 dnl generic support, the synthetic ethernet package extends this | |
| 78 dnl with ethernet support, and so on. Such package-specific host-side | |
| 79 dnl software does not belong in the main host subdirectory, that | |
| 80 dnl would make it very difficult to distribute new packages or | |
| 81 dnl new versions of a package. However keeping the code with the | |
| 82 dnl various packages makes building more complicated. | |
| 83 dnl | |
| 84 dnl 1) if the entire repository is managed by CVS or anoncvs, this | |
| 85 dnl configure script will search the packages tree for any packages | |
| 86 dnl that have host-side software that needs to be built - | |
| 87 dnl specifically, that have a file "configure" inside a "host" | |
| 88 dnl subdirectory in version "current" of a package. | |
| 89 dnl | |
| 90 dnl 2) if instead the repository contains additional packages | |
| 91 dnl installed as epk's and managed by an administration tool then | |
| 92 dnl it is the responsibility of that tool to let the users build | |
| 93 dnl and rebuild the host-side software as required, for whichever | |
| 94 dnl host platform or platforms are being used. In other words | |
| 95 dnl it is the responsibility of the admin tool to create a | |
| 96 dnl suitable build directory and run "configure; make; make install", | |
| 97 dnl usually as part of the installation process. Note that several | |
| 98 dnl versions of a package may be installed, and it is the | |
| 99 dnl responsibility of each package to take this into account | |
| 100 dnl (although the configure macros are aware of this to some extent, | |
| 101 dnl and will e.g. generate suitable install directory names). | |
| 102 dnl Also note that the top-level configure script will not pick | |
| 103 dnl up such packages because they will be versioned, i.e. the | |
| 104 dnl test for current/host/configure will fail because the | |
| 105 dnl version will not be "current". | |
| 106 dnl | |
| 107 dnl 3) as a special case it may be desirable to ship pre-built binaries | |
| 108 dnl of some of the package-specific software. It is not clear | |
| 109 dnl just what would be the best way of shipping these - putting | |
| 110 dnl them into the epk's would not be quite right because that would | |
| 111 dnl make the epk's host-specific rather than generic. | |
| 112 dnl | |
| 113 dnl There is an unresolved problem with possible dependencies between | |
| 114 dnl packages, if e.g. the host-side of the synthetic ethernet package could | |
| 115 dnl only be built after the architectural synthetic target package. | |
| 59 | 116 |
| 60 AC_INIT(host/COPYING) | 117 dnl Some of the eCos documentation is generic and lives in the "doc" |
| 61 AC_CONFIG_AUX_DIR(host) | 118 dnl subdirectory. Other eCos documentation is package-specific and lives |
| 119 dnl in the appropriate package directory. At present there is no support | |
| 120 dnl for building the documentation via configure and make, but such | |
| 121 dnl support may be added in future. | |
| 122 dnl | |
| 123 dnl There is a subdirectory acsupport containing various files such | |
| 124 dnl as config.guess and install.sh that are common. This also contains | |
| 125 dnl an acinclude.m4 file with various macros that are useful for | |
| 126 dnl eCos. | |
| 127 | |
| 128 dnl Generic initialization. | |
| 129 AC_INIT(acsupport/config.guess) | |
| 130 AC_CONFIG_AUX_DIR(acsupport) | |
| 62 AC_CANONICAL_HOST | 131 AC_CANONICAL_HOST |
| 63 AM_INIT_AUTOMAKE(eCos,2.0,0) | 132 AM_INIT_AUTOMAKE(eCos,2.0,0) |
| 64 AM_MAINTAINER_MODE | 133 AM_MAINTAINER_MODE |
| 134 ECOS_CHECK_BUILD_ne_SRC | |
| 65 | 135 |
| 66 dnl The automake options include cygnus, so AC_EXEEXT is required and | 136 dnl Nothing actually gets built in this directory, so there should be no |
| 67 dnl hence it is a good idea to include all of the compiler-selection | 137 dnl need to worry about compiler flags etc. Instead, the problem is |
| 68 dnl tests. | 138 dnl figuring out what should actually get built. |
| 69 AC_PROG_MAKE_SET | 139 dnl |
| 70 AC_PROG_CC | 140 dnl 1) the host subdirectory should always get built. |
| 71 AC_PROG_CXX | 141 SUBDIRS="host" |
| 72 AC_OBJEXT | |
| 73 AC_EXEEXT | |
| 74 | 142 |
| 75 AC_CONFIG_SUBDIRS(host) | 143 dnl 2) any package which has a configure script in a |
| 144 dnl current/host subdirectory should also get built. | |
| 145 dnl | |
| 146 dnl Searching the directory tree is currently done by shell globbing. | |
| 147 dnl Invoking "find" with suitable arguments might be quicker, but | |
| 148 dnl less portable. On some hosts there may be problems with environmental | |
| 149 dnl limits if too many packages provide host-side software. | |
| 150 dnl | |
| 151 dnl Currently there is no ordering of packages, so e.g. a device | |
| 152 dnl driver's host-side support cannot depend on some HAL package | |
| 153 dnl because the latter may not have been built and installed yet. | |
| 154 dnl This is a good thing because packages are meant to be self-contained | |
| 155 dnl whenever possible. Interaction between packages is typically handled | |
| 156 dnl at the Tcl level at run-time, so there are no build-time complications. | |
| 157 | |
| 158 PKGHOSTDIRS="" | |
| 159 FOUND_CONFIGURES="" | |
| 160 FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/current/host/configure" | |
| 161 FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/current/host/configure" | |
| 162 FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/current/host/configure" | |
| 163 FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/current/host/configure" | |
| 164 FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/*/current/host/configure" | |
| 165 for configure in ${FOUND_CONFIGURES}; do | |
| 166 if test -f ${configure}; then | |
| 167 dnl A configure script has been found in the source tree. | |
| 168 dnl First turn it into a directory, then replace the absolute path | |
| 169 dnl with a relative one. | |
| 170 hostdir=`dirname ${configure}` | |
| 171 hostdir=`echo ${hostdir} | sed -e "s:^${srcdir}/::"` | |
| 172 PKGHOSTDIRS="${PKGHOSTDIRS} ${hostdir}" | |
| 173 fi | |
| 174 done | |
| 175 | |
| 176 SUBDIRS="${SUBDIRS} ${PKGHOSTDIRS}" | |
| 177 | |
| 178 dnl Because the eCos directory layout does not conform to GNU conventions | |
| 179 dnl it is necessary to create various levels of intermediate directories. | |
| 180 dnl This happens via config.status, prior to the recursion into the | |
| 181 dnl appropriate directories. | |
| 182 AC_OUTPUT_COMMANDS([${CONFIG_SHELL-/bin/sh} ${top_srcdir}/acsupport/mkinstalldirs ${REQUIRED_DIRS}],REQUIRED_DIRS="${SUBDIRS}") | |
| 183 | |
| 184 AC_SUBST(SUBDIRS) | |
| 185 AC_CONFIG_SUBDIRS(${SUBDIRS}) | |
| 76 AC_OUTPUT(Makefile) | 186 AC_OUTPUT(Makefile) |
