| 1 | 
         1254 | 
         phoenix | 
         dnl Process this file with autoconf to produce a configure script.
  | 
      
      
         | 2 | 
          | 
          | 
         dnl ====================================================================
  | 
      
      
         | 3 | 
          | 
          | 
         dnl
  | 
      
      
         | 4 | 
          | 
          | 
         dnl     configure.in
  | 
      
      
         | 5 | 
          | 
          | 
         dnl
  | 
      
      
         | 6 | 
          | 
          | 
         dnl     Top-level configure script for eCos software.
  | 
      
      
         | 7 | 
          | 
          | 
         dnl
  | 
      
      
         | 8 | 
          | 
          | 
         dnl ====================================================================
  | 
      
      
         | 9 | 
          | 
          | 
         dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN####
  | 
      
      
         | 10 | 
          | 
          | 
         dnl ----------------------------------------------------------------------------
  | 
      
      
         | 11 | 
          | 
          | 
         dnl Copyright (C) 2002, 2003 Bart Veer
  | 
      
      
         | 12 | 
          | 
          | 
         dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
  | 
      
      
         | 13 | 
          | 
          | 
         dnl
  | 
      
      
         | 14 | 
          | 
          | 
         dnl This file is part of the eCos host tools.
  | 
      
      
         | 15 | 
          | 
          | 
         dnl
  | 
      
      
         | 16 | 
          | 
          | 
         dnl This program is free software; you can redistribute it and/or modify it
  | 
      
      
         | 17 | 
          | 
          | 
         dnl under the terms of the GNU General Public License as published by the Free
  | 
      
      
         | 18 | 
          | 
          | 
         dnl Software Foundation; either version 2 of the License, or (at your option)
  | 
      
      
         | 19 | 
          | 
          | 
         dnl any later version.
  | 
      
      
         | 20 | 
          | 
          | 
         dnl
  | 
      
      
         | 21 | 
          | 
          | 
         dnl This program is distributed in the hope that it will be useful, but WITHOUT
  | 
      
      
         | 22 | 
          | 
          | 
         dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  | 
      
      
         | 23 | 
          | 
          | 
         dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  | 
      
      
         | 24 | 
          | 
          | 
         dnl more details.
  | 
      
      
         | 25 | 
          | 
          | 
         dnl
  | 
      
      
         | 26 | 
          | 
          | 
         dnl You should have received a copy of the GNU General Public License along with
  | 
      
      
         | 27 | 
          | 
          | 
         dnl this program; if not, write to the Free Software Foundation, Inc.,
  | 
      
      
         | 28 | 
          | 
          | 
         dnl 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  | 
      
      
         | 29 | 
          | 
          | 
         dnl ----------------------------------------------------------------------------
  | 
      
      
         | 30 | 
          | 
          | 
         dnl ####ECOSHOSTGPLCOPYRIGHTEND####
  | 
      
      
         | 31 | 
          | 
          | 
         dnl ====================================================================
  | 
      
      
         | 32 | 
          | 
          | 
         dnl#####DESCRIPTIONBEGIN####
  | 
      
      
         | 33 | 
          | 
          | 
         dnl
  | 
      
      
         | 34 | 
          | 
          | 
         dnl Author(s):  bartv
  | 
      
      
         | 35 | 
          | 
          | 
         dnl Contact(s): bartv
  | 
      
      
         | 36 | 
          | 
          | 
         dnl Date:       1998/12/17
  | 
      
      
         | 37 | 
          | 
          | 
         dnl Version:    0.01
  | 
      
      
         | 38 | 
          | 
          | 
         dnl
  | 
      
      
         | 39 | 
          | 
          | 
         dnl####DESCRIPTIONEND####
  | 
      
      
         | 40 | 
          | 
          | 
         dnl ====================================================================
  | 
      
      
         | 41 | 
          | 
          | 
          
  | 
      
      
         | 42 | 
          | 
          | 
         dnl eCos is a componentized architecture for deeply embedded systems.
  | 
      
      
         | 43 | 
          | 
          | 
         dnl It requires a very different configuration system from typical
  | 
      
      
         | 44 | 
          | 
          | 
         dnl autoconfiscated software such as the various GNU packages.
  | 
      
      
         | 45 | 
          | 
          | 
         dnl
  | 
      
      
         | 46 | 
          | 
          | 
         dnl The main eCos host-side software is autoconfiscated to some extent,
  | 
      
      
         | 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 a version 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.
  | 
      
      
         | 116 | 
          | 
          | 
          
  | 
      
      
         | 117 | 
          | 
          | 
         dnl Some of the eCos documentation is generic and lives in the "doc"
  | 
      
      
         | 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)
  | 
      
      
         | 131 | 
          | 
          | 
         AC_CANONICAL_HOST
  | 
      
      
         | 132 | 
          | 
          | 
         AM_INIT_AUTOMAKE(eCos,2.0,0)
  | 
      
      
         | 133 | 
          | 
          | 
         AM_MAINTAINER_MODE
  | 
      
      
         | 134 | 
          | 
          | 
         ECOS_CHECK_BUILD_ne_SRC
  | 
      
      
         | 135 | 
          | 
          | 
          
  | 
      
      
         | 136 | 
          | 
          | 
         dnl Nothing actually gets built in this directory, so there should be no
  | 
      
      
         | 137 | 
          | 
          | 
         dnl need to worry about compiler flags etc. Instead, the problem is
  | 
      
      
         | 138 | 
          | 
          | 
         dnl figuring out what should actually get built.
  | 
      
      
         | 139 | 
          | 
          | 
         dnl
  | 
      
      
         | 140 | 
          | 
          | 
         dnl  1) the host subdirectory should always get built, if it exists.
  | 
      
      
         | 141 | 
          | 
          | 
         dnl     With the 2.0 release system the directory gets moved to
  | 
      
      
         | 142 | 
          | 
          | 
         dnl     tools/src
  | 
      
      
         | 143 | 
          | 
          | 
          
  | 
      
      
         | 144 | 
          | 
          | 
         if test -f "${srcdir}/host/configure" ; then
  | 
      
      
         | 145 | 
          | 
          | 
            SUBDIRS="host"
  | 
      
      
         | 146 | 
          | 
          | 
         elif test -f "${srcdir}/tools/src/configure" ; then
  | 
      
      
         | 147 | 
          | 
          | 
            SUBDIRS="tools/src"
  | 
      
      
         | 148 | 
          | 
          | 
         else
  | 
      
      
         | 149 | 
          | 
          | 
            SUBDIRS=""
  | 
      
      
         | 150 | 
          | 
          | 
         fi
  | 
      
      
         | 151 | 
          | 
          | 
          
  | 
      
      
         | 152 | 
          | 
          | 
         dnl  2) any package which has a configure script in a
  | 
      
      
         | 153 | 
          | 
          | 
         dnl     current/host subdirectory should also get built.
  | 
      
      
         | 154 | 
          | 
          | 
         dnl
  | 
      
      
         | 155 | 
          | 
          | 
         dnl     Searching the directory tree is currently done by shell globbing.
  | 
      
      
         | 156 | 
          | 
          | 
         dnl     Invoking "find" with suitable arguments might be quicker, but
  | 
      
      
         | 157 | 
          | 
          | 
         dnl     less portable. On some hosts there may be problems with environmental
  | 
      
      
         | 158 | 
          | 
          | 
         dnl     limits if too many packages provide host-side software.
  | 
      
      
         | 159 | 
          | 
          | 
         dnl
  | 
      
      
         | 160 | 
          | 
          | 
         dnl     Currently there is no ordering of packages, so e.g. a device
  | 
      
      
         | 161 | 
          | 
          | 
         dnl     driver's host-side support cannot depend on some HAL package
  | 
      
      
         | 162 | 
          | 
          | 
         dnl     because the latter may not have been built and installed yet.
  | 
      
      
         | 163 | 
          | 
          | 
         dnl     This is a good thing because packages are meant to be self-contained
  | 
      
      
         | 164 | 
          | 
          | 
         dnl     whenever possible. Interaction between packages is typically handled
  | 
      
      
         | 165 | 
          | 
          | 
         dnl     at the Tcl level at run-time, so there are no build-time complications.
  | 
      
      
         | 166 | 
          | 
          | 
          
  | 
      
      
         | 167 | 
          | 
          | 
         PKGHOSTDIRS=""
  | 
      
      
         | 168 | 
          | 
          | 
         FOUND_CONFIGURES=""
  | 
      
      
         | 169 | 
          | 
          | 
         FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/host/configure"
  | 
      
      
         | 170 | 
          | 
          | 
         FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/host/configure"
  | 
      
      
         | 171 | 
          | 
          | 
         FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/host/configure"
  | 
      
      
         | 172 | 
          | 
          | 
         FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/*/host/configure"
  | 
      
      
         | 173 | 
          | 
          | 
         FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/*/*/host/configure"
  | 
      
      
         | 174 | 
          | 
          | 
         for configure in ${FOUND_CONFIGURES}; do
  | 
      
      
         | 175 | 
          | 
          | 
             if test -f ${configure}; then
  | 
      
      
         | 176 | 
          | 
          | 
                 dnl A configure script has been found in the source tree.
  | 
      
      
         | 177 | 
          | 
          | 
                 dnl First turn it into a directory, then replace the absolute path
  | 
      
      
         | 178 | 
          | 
          | 
                 dnl with a relative one.
  | 
      
      
         | 179 | 
          | 
          | 
                 hostdir=`dirname ${configure}`
  | 
      
      
         | 180 | 
          | 
          | 
                 hostdir=`echo ${hostdir} | sed -e "s:^${srcdir}/::"`
  | 
      
      
         | 181 | 
          | 
          | 
                 PKGHOSTDIRS="${PKGHOSTDIRS} ${hostdir}"
  | 
      
      
         | 182 | 
          | 
          | 
             fi
  | 
      
      
         | 183 | 
          | 
          | 
         done
  | 
      
      
         | 184 | 
          | 
          | 
          
  | 
      
      
         | 185 | 
          | 
          | 
         SUBDIRS="${SUBDIRS} ${PKGHOSTDIRS}"
  | 
      
      
         | 186 | 
          | 
          | 
          
  | 
      
      
         | 187 | 
          | 
          | 
         dnl Because the eCos directory layout does not conform to GNU conventions
  | 
      
      
         | 188 | 
          | 
          | 
         dnl it is necessary to create various levels of intermediate directories.
  | 
      
      
         | 189 | 
          | 
          | 
         dnl This happens via config.status, prior to the recursion into the
  | 
      
      
         | 190 | 
          | 
          | 
         dnl appropriate directories.
  | 
      
      
         | 191 | 
          | 
          | 
         AC_OUTPUT_COMMANDS([${CONFIG_SHELL-/bin/sh} ${top_srcdir}/acsupport/mkinstalldirs ${REQUIRED_DIRS}],REQUIRED_DIRS="${SUBDIRS}")
  | 
      
      
         | 192 | 
          | 
          | 
          
  | 
      
      
         | 193 | 
          | 
          | 
         AC_SUBST(SUBDIRS)
  | 
      
      
         | 194 | 
          | 
          | 
         AC_CONFIG_SUBDIRS(${SUBDIRS})
  | 
      
      
         | 195 | 
          | 
          | 
         AC_OUTPUT(Makefile)
  |