This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

configury update


The recent cygwin Tcl 8.3 update did not work with the existing
autoconf macro for figuring out the Tcl support. Then the 8.4 update
came along and broke things in a different way. I have now updated the
macro to use the tclConfig.sh and tkConfig.sh files as much as
possible, although with cygwin 8.4 even those are incomplete and
another workaround is necessary. Also, rebuilding the host-side with
VC++ was broken some months ago.

I have tested rebuilding on RH7.3, Debian 3.0, and on cygwin with both
Tcl 8.3 and Tcl 8.4, in various different scenarios.

The main updates are to README.host and acsupport/acinclude.m4, but
various other files have had to be regenerated.

Bart

Index: README.host
===================================================================
RCS file: /cvs/ecos/ecos/README.host,v
retrieving revision 1.3
diff -u -r1.3 README.host
--- README.host	13 Jan 2003 04:17:05 -0000	1.3
+++ README.host	12 Feb 2003 17:20:33 -0000
@@ -78,8 +78,8 @@
 package documentation should be consulted for further information.
 
 
-Installing on Linux and Other Unix Systems
-------------------------------------------
+Installing on Linux, Other Unix Systems, and Cygwin
+---------------------------------------------------
 
 Both generic host-side software (infra, libcdl and ecosconfig) and
 package-specific software can be built with the conventional
@@ -185,48 +185,81 @@
    --disable-fntracing      disable function entry/exit tracing
 
 3) --with-tcl=<path>
-   --with-tcl-header=<path>
-   --with-tcl-lib=<path>
    --with-tcl-version=<number>
 
    The host-side tools have a dependency on Tcl, which is not supplied
    with the sources because many people will already have a suitable
    installation. Specifically it is necessary to have the header file
    tcl.h and appropriate libraries such that -ltcl will work - this
-   can involve either static or shared libraries.
+   can involve either static or shared libraries. Some tools may require
+   Tk as well as Tcl.
 
-   By default the configure script will assume that there is a
-   suitable Tcl installation in the install location, so if there is
-   no --prefix argument then it will look for /usr/local/include/tcl.h
-   and it will add -L/usr/local/lib to the library search path. If
-   Tcl is installed elsewhere then this can be specified with a
-   --with-tcl option. For example, if the default installation in
-   /usr should be used then the following configure option is
-   appropriate:
-
-   $ <path>/configure --with-tcl=/usr <args>
-
-   If the Tcl libraries and Tcl headers are installed in different
-   locations, such as when a separate --prefix and --exec-prefix are
-   used, the --with-tcl-header and --with-tcl-lib options can be used
-   to specify both location. The configure script will expect to find
-   <tcl-header-dir>/include/tcl.h and <tcl-lib-dir>/lib/tclConfig.sh.
-   The --with-tcl option has precedence and if used will override the
-   --with-tcl-header and --with-tcl-lib options.
-
-   It is possible to have multiple versions of Tcl installed, for
-   example libtcl8.0.a, libtcl8.1.a, and so on. Typically linking with
-   -ltcl will result in the latest version being used. It is possible
-   to specify a different version using --with-tcl-version, e.g.:
-
-   $ <path>configure --with-tcl=/usr/local/scriptics --with-tcl-version=8.1 <args>
-
-   It may be necessary to specify --with-tcl-version if there are
-   multiple installs in different locations. For example the
-   system may have a default install in /usr and a more up to date
-   install in /usr/local/tcl8.4. To use the latter it will usually
-   be necessary to specify both --with-tcl=/usr/local/tcl8.4 and
-   --with-tcl-version=8.4.
+   Unfortunately there is considerable variation in Tcl installations.
+   In theory all Tcl installations have a file tclConfig.sh which
+   defines exactly how to compile and link code that uses Tcl, and Tk
+   has a similar file tkConfig.sh. The eCos configure scripts look for
+   these files, first in $(prefix)/lib, then in /usr/lib. If the system
+   already has a Tcl installation in /usr then the configure script will
+   automatically find /usr/lib/tclConfig.sh and it is not necessary
+   to pass additional options when configuring the eCos host-side
+   software. Alternatively, if for example you have installed a more
+   recent version of Tcl/Tk in the same place that you want to install the
+   eCos software, e.g. /usr/local, then $(prefix)/lib/tclConfig.sh
+   will be read in.
+
+   It is also possible that a more recent version of Tcl has been installed
+   in a different location. For example, you may wish to install the eCos host
+   tools in /opt/ecos but use a version of Tcl installed in /usr/local. The
+   eCos configure scripts need to be told explicitly where to look for
+   the Tcl:
+
+   $ <path>/configure --with-tcl=/usr/local ...
+
+   Some systems, for example Debian Linux 3.0, do not install tclConfig.sh
+   in /usr/lib because that makes it more difficult to have several different
+   versions of Tcl installed at the same time. Instead tclConfig.sh is found
+   in a versioned directory such as /usr/lib/tcl8.3. Since several versions
+   may be installed the desired one must be specified explicitly.
+
+   $ <path>/configure --with-tcl-version=8.3
+
+   The --with-tcl and --with-tcl-version options are combined to give a search path:
+
+      <with>/lib/tclConfig.sh
+      <with>/lib/tcl<vsn>/tclConfig.sh
+      <prefix>/lib/tclConfig.sh
+      <prefix>/lib/tcl<vsn>/tclConfig.sh
+      /usr/lib/tclConfig.sh
+      /usr/lib/tcl<vsn>/tclConfig.sh
+
+   If tclConfig.sh cannot be found in any of these places then it is assumed
+   that Tcl has not been properly installed and the eCos configure script will
+   fail. The --with-tcl and --with-tcl-version are also used to give a search
+   path for tkConfig.sh
+
+      <with>/lib/tkConfig.sh
+      <with>/lib/tk<vsn>/tkConfig.sh
+      <prefix>/lib/tkConfig.sh
+      <prefix>/lib/tk<vsn>/tkConfig.sh
+      /usr/lib/tkConfig.sh
+      /usr/lib/tk<vsn>/tkConfig.sh
+
+   Again, the configure scripts must be able to find tkConfig.sh
+
+   Once tclConfig.sh and tkConfig.sh have been found and read in, the eCos
+   configure scripts should have all the information needed to compile and
+   link code that uses Tcl. First the location of key headers such as
+   <tcl.h> is needed. A tclConfig.sh file may define TCL_INC_DIR to give
+   a specific location, otherwise the header files should be in
+   $(TCL_PREFIX)/include. If <tcl.h> cannot be found then the eCos configure
+   scripts will fail.
+
+   Next it is necessary to work out how to link applications with Tcl. This
+   information should be provided by a tclConfig.sh variable TCL_LIB_SPEC.
+   Unfortunately not all Tcl installations set this, for example the cygwin
+   Tcl 8.4 release. If TCL_LIB_SPEC is not defined then instead the
+   configure script will look for a library libtcl<vsn>.a, where <vsn> is
+   specified using --with-tcl-version, then for a library libtcl.a
 
 Following the configure step the build tree should be set up
 correctly. All that remains is the actual build and install:
@@ -240,28 +273,6 @@
 require root privileges. Also some of the package-specific software
 has special installation requirements, for example programs that need
 to be installed suid root, and this will also need root privileges.
-
-
-Installing under Cygwin
------------------------
-
-Installing under cygwin requires essentially the same steps as
-under Linux. It is more likely that a suitable --prefix option will
-have to be used, and that the location of the Tcl installation needs
-to be specified with --with-tcl. However appropriate use of cygwin
-mount points may avoid some of these problems. If the full path to
-the configure script contains spaces, then the short form of the path
-should be used when invoking configure.
-
-One issue to be aware of is the naming convention for the Tcl library.
-On a Unix system this will typically be called libtcl8.3.a (adjusted
-according to the version number), with a symbolic link from libtcl.a
-to the most recent version. Under cygwin the equivalent library is
-called libtcl80.a, and symbolic links are not used. For a standard
-cygwin installation the configure script knows how to pick up the
-appropriate library, but if a more recent version of Tcl has been
-installed then due care has to be taken with the --with-tcl-version
-option.
 
 
 Installing with Visual C++

Index: acinclude.m4
===================================================================
RCS file: /cvs/ecos/ecos/acsupport/acinclude.m4,v
retrieving revision 1.4
diff -u -u -r1.4 acinclude.m4
--- acinclude.m4	27 Oct 2002 15:14:42 -0000	1.4
+++ acinclude.m4	12 Feb 2003 17:17:27 -0000
@@ -10,7 +10,7 @@
 dnl ====================================================================
 dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN####
 dnl ----------------------------------------------------------------------------
-dnl Copyright (C) 2002 Bart Veer
+dnl Copyright (C) 2002, 2003 Bart Veer
 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
 dnl
 dnl This file is part of the eCos host tools.
@@ -126,9 +126,10 @@
     if test "${CC}" = "cl" ; then
        MSVC="yes"
        CXX="cl"
+       MSVC_SRCDIR=${srcdir}
        ECOS_MSVC_PATH(MSVC_SRCDIR)
        AC_SUBST(MSVC_SRCDIR)
-       ecos_INCLUDES="${ecos_INCLUDES} \"-I${msvc_srcdir}\""
+       ecos_INCLUDES="${ecos_INCLUDES} \"-I${MSVC_SRCDIR}\""
        ecos_LDADD="-link"
        ecos_LIBS="advapi32.lib"
     fi
@@ -365,6 +366,29 @@
 
 dnl ====================================================================
 dnl Work out details of the Tcl/tk installation that should be used.
+dnl In theory this is simple: when Tcl is installed in <tcl_prefix>
+dnl (usually /usr) there should be a file <tcl_prefix>/lib/tclConfig.sh
+dnl which defines exactly how to build Tcl-based applications. Of course
+dnl Tcl may be installed anywhere, not just in /usr, so it is necessary
+dnl to do some searching. There is a command-line argument
+dnl --with-tcl=<path> to specify the Tcl installation, so the macro
+dnl can search for <with_tcl>/lib/tclConfig.sh, <prefix>/lib/tclConfig.sh
+dnl and /usr/lib/tclConfig.sh
+dnl
+dnl Unfortunately not all systems use this convention. For example,
+dnl at the time of writing Debian installs tclConfig.sh in a versioned
+dnl subdirectory /usr/lib/tcl8.3/tclConfig.sh. Hence there is an
+dnl additional argument --with-tcl-version=<vsn> which is used to
+dnl extend the search path.
+dnl
+dnl For VC++ builds the situation is different again. Tcl may be
+dnl installed anywhere, so the data in tclConfig.sh is not useful
+dnl (and that file may not be provided at all). Instead --with-tcl
+dnl must be used to specify the path. Alternatively separate paths
+dnl for headers and libraries can be specified using --with-tcl-header
+dnl and --with-tcl-lib. Usually it will also be necessary to specify
+dnl the library version number using --with-tcl-version.
+
 dnl This adds two main command-line options, --with-tcl=<prefix> to
 dnl specify the Tcl install directory, and --with-tcl-version=<vsn>
 dnl to control which version of Tcl should be used. For finer-grained
@@ -401,37 +425,13 @@
     AC_REQUIRE([ECOS_PROG_MSVC])
     AC_REQUIRE([AC_CYGWIN])
 
-    ecos_tcl_version=""
-    ecos_tcl_incdir=""
-    ecos_tcl_libdir=""
     ecos_tk_libs=""
     ecos_tk_libdir=""
 
-    dnl Look for the version of Tcl. If none is specified, default to
-    dnl 8.0 under VC++ and cygwin, nothing under Unix. A version has to be
-    dnl specified under NT because there is no symbolic link from libtcl.a
-    dnl to whatever happens to be the most recent installed version.
-
-    AC_MSG_CHECKING([for Tcl version])
-    AC_ARG_WITH(tcl-version,[ --with-tcl-version=<vsn> version of Tcl to be used],[
-        ecos_tcl_version=${with_tcl_version}
-    ],[
-        if test "${MSVC}" = "yes" ; then
-           ecos_tcl_version=80
-        elif test "${ac_cv_cygwin}" = "yes" ; then
-           ecos_tcl_version=80
-        else
-           ecos_tcl_version=""
-        fi
-    ])
-    AC_MSG_RESULT([${ecos_tcl_version}])
-
-    dnl Where is the Tcl installation?
+    dnl Where is the Tcl installation, and what version should be used?
     AC_MSG_CHECKING(for Tcl installation)
-
-    AC_ARG_WITH(tcl-header,[ --with-tcl-header=<path> location of Tcl header])
-    AC_ARG_WITH(tcl-lib,[ --with-tcl-lib=<path>    location of Tcl libraries])
     AC_ARG_WITH(tcl,[ --with-tcl=<path>        location of Tcl header and libra
+		if test -r "${libtcl}/libtcl.a" ; then
+		    TCL_LIB_SPEC="-L${libtcl} -ltcl"
+		fi
+	    fi
+	    if test -z "${TCL_LIB_SPEC}" ; then
+		AC_MSG_ERROR(${tclconfig}/tclConfig.sh does not define TCL_LIB_SPEC, and unable to find libtcl.a)
+	    fi
+	    ecos_LIBS="${ecos_LIBS} ${TCL_LIB_SPEC}"
+
+	    dnl Next, look for tkConfig.sh
+	    possibles=`echo ${possibles} | sed -e 's,tcl,tk,g'`
+	    AC_FIND_FILE("tkConfig.sh", ${possibles}, tkconfig)
+	    if test \! -r "${tkconfig}/tkConfig.sh" ; then
+		AC_MSG_ERROR(unable to locate Tk config file tkConfig.sh)
+	    else
+		. ${tkconfig}/tkConfig.sh
+		if test -z "${TK_INC_DIR}" ; then
+		    if test "${TK_PREFIX}" = "/usr" ; then
+			ecos_tk_includes="${TK_XINCLUDES}"
+		    else
+			ecos_tk_includes="-I${TK_PREFIX}/include ${TK_XINCLUDES}"
+		    fi
+		else
+		    ecos_tk_includes="-I${TK_INC_DIR} ${TK_XINCLUDES}"
+		fi
+
+		dnl As with TCL_LIB_SPEC, TK_LIB_SPEC may be empty
+		if test -z "${TK_LIB_SPEC}" -a "${with_tcl_version+set}" = set ; then
+		    AC_FIND_FILE("libtk${with_tcl_version}.a", ${possibles}, libtk)
+		    if test -r "${libtk}/libtk${with_tcl_version}.a" ; then
+			TK_LIB_SPEC="-L${libtk} -ltk${with_tcl_version}"
+		    fi
+		fi
+		if test -z "${TK_LIB_SPEC}" ; then
+		    AC_FIND_FILE("libtk.a", ${possibles}, libtk)
+		    if test -r "${libtk}/libtk.a" ; then
+			TK_LIB_SPEC="-L${libtk} -ltk"
+		    fi
+		fi
+		if test -z "${TK_LIB_SPEC}" ; then
+		    AC_MSG_ERROR(${tkconfig}/tkConfig.sh does not define TK_LIB_SPEC, and unable to find libtk.a)
+		fi
+		ecos_tk_libs="${TK_LIB_SPEC} ${TK_LIBS}"
+	    fi
+	fi
     fi
 
-    AC_MSG_RESULT([-I${ecos_tcl_incdir} -L${ecos_tcl_libdir}])
-
+    AC_MSG_RESULT([-I${ecos_tcl_incdir} ${TCL_LIB_SPEC}])
+    AC_SUBST(ecos_tk_includes)
     AC_SUBST(ecos_tk_libs)
 ])
 
@@ -585,7 +635,7 @@
         AC_MSG_ERROR([infrastructure headers not found])
     fi
     if test "${MSVC}" = "yes" ; then
-        ecos_msvc_infra_incdir = ${ecos_infra_incdir}
+        ecos_msvc_infra_incdir=${ecos_infra_incdir}
         ECOS_MSVC_PATH(ecos_msvc_infra_incdir)
         ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_infra_incdir}\""
     else
@@ -668,7 +718,7 @@
         AC_MSG_ERROR([libcdl headers not found])
     fi
     if test "${MSVC}" = "yes" ; then
-        ecos_msvc_libcdl_incdir = "${ecos_libcdl_incdir}"
+        ecos_msvc_libcdl_incdir="${ecos_libcdl_incdir}"
         ECOS_MSVC_PATH(ecos_msvc_libcdl_incdir)
         ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_libcdl_incdir}\""
     else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]