This is the mail archive of the ecos-patches@sourceware.org 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]

Re: once again about host-side configure


>>>>> "Sergei" == Sergei Gavrikov <sg@belvok.com> writes:

    Sergei> Hello
    Sergei> At first, nobody won't run in a problem if he/she uses
    Sergei> legal Tcl/Tk packages from his/her distro, i.e. when
    Sergei> Tcl/Tk was installed with /usr prefix. So, all described
    Sergei> the below is a rare condition, therefore, it is a minor
    Sergei> issue.

    Sergei> If he/she uses a handy installed Tcl/Tk, I use in example
    Sergei> a prefix: /opt/tcltk/8.5, it's normal to keep the
    Sergei> different Tcl versions separately, he/she can notice that
    Sergei> eCos host tools won't be linked with tk8.5, as he/she
    Sergei> could expect, it will be linked with the distro's Tk
    Sergei> library (usually it is /usr/lib/libtk8.4.so).

    Sergei> Demo sniplet

    Sergei> .../configure --with-tcl=/opt/tcltk/8.5 --with-tk=/opt/tcltk/8.5
    Sergei> ...
    Sergei> checking for Tcl/Tk installation... 
    Sergei> configure: looking for tclConfig.sh in /opt/tcltk/8.5/lib /usr/local/lib /usr/lib
    Sergei> configure: found /opt/tcltk/8.5/lib/tclConfig.sh
    Sergei> configure: trying TCL_INCLUDE_SPEC - looking for tcl.h in -I/opt/tcltk/8.5/include
    Sergei> configure: using -I/opt/tcltk/8.5/include
    Sergei> configure: using TCL_LIB_SPEC -L/opt/tcltk/8.5/lib -ltcl8.5
    Sergei> configure: using additional libraries for Tcl -ldl  -lpthread -lieee -lm
    Sergei> configure: using additional linker flags for Tcl  -Wl,--export-dynamic 
    Sergei> configure: looking for tkConfig.sh in /opt/tktk/8.5/lib /usr/local/lib /usr/lib
    Sergei> configure: found /usr/lib/tkConfig.sh
    Sergei> configure: trying TK_INCLUDE_SPEC - looking for tk.h in -I/usr/include
    Sergei> configure: using -I/usr/include
    Sergei> configure: trying TK_LIB_SPEC -L/usr/lib -ltk8.4
    Sergei> configure: using -L/usr/lib -ltk8.4
    Sergei> configure: using additional libraries for Tk -lX11 
    Sergei> checking for Tcl/Tk installation... done
    Sergei> ...

    Sergei> For a reference (vi +589 acsupport/acinclude.m4):

    Sergei>     possibles=`echo ${possibles} | sed -e 's,tcl,tk,g'`

    Sergei> At first, I thinked to fix sed's substitution, i.e. to use
    Sergei> something like 's,<tcl>,tk,g', but if I used /opt/tcl/8.5
    Sergei> prefix? Then it seems for me that a better way is just do
    Sergei> not check possibles, when Tk prefix was set exactly with a
    Sergei> configure option.

    Sergei> If you can see, we won't run in problem with
    Sergei> /opt/TclTk/8.5 prefix. And I have ActiveState's Tcl/Tk 8.5
    Sergei> installed in /opt/ActiveTcl-8.5. So, it's possible, the
    Sergei> described issue here is a forced issue.

    Sergei> Bart, What do you think about?

It is a real problem. The solution is to recalculate ${possibles} from
scratch when searching for Tk, rather than try to re-use the Tcl
search path. For completeness I have also added a --with-tk option and
I have updated the README.host file.

Index: acsupport/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/acsupport/ChangeLog,v
retrieving revision 1.7
diff -u -p -r1.7 ChangeLog
--- acsupport/ChangeLog	20 Aug 2008 14:41:40 -0000	1.7
+++ acsupport/ChangeLog	28 Aug 2008 14:04:02 -0000
@@ -1,3 +1,7 @@
+2008-08-28  Bart Veer  <bartv@ecoscentric.com>
+
+	* acinclude.m4: update Tcl/Tk macro again
+
 2008-08-20  Bart Veer  <bartv@ecoscentric.com>
 
 	* acinclude.m4: update Tcl/Tk macro
Index: acsupport/acinclude.m4
===================================================================
RCS file: /cvs/ecos/ecos/acsupport/acinclude.m4,v
retrieving revision 1.7
diff -u -p -r1.7 acinclude.m4
--- acsupport/acinclude.m4	20 Aug 2008 14:41:40 -0000	1.7
+++ acsupport/acinclude.m4	28 Aug 2008 14:04:39 -0000
@@ -429,7 +429,8 @@ AC_DEFUN([ECOS_PATH_TCL], [
   AC_MSG_RESULT()
   
   AC_ARG_WITH(tcl,[ --with-tcl=<path>        location of Tcl header and libraries])
-  AC_ARG_WITH(tcl-version,[ --with-tcl-version=<vsn> version of Tcl to be used])
+  AC_ARG_WITH(tcl,[ --with-tk=<path>         location of Tk header and libraries])
+  AC_ARG_WITH(tcl-version,[ --with-tcl-version=<vsn> version of Tcl/Tk to be used])
 
   dnl If using VC++ then there are no sensible default directories
   dnl to search for a Tcl installation. Instead the user must
@@ -487,18 +488,15 @@ AC_DEFUN([ECOS_PATH_TCL], [
       possibles="${with_tcl}/lib"
       if test "${with_tcl_version+set}" = set ; then
         possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}"
-        possibles="${possibles} ${with_tcl}/lib/tk${with_tcl_version}"
       fi
     fi
     possibles="${possibles} ${prefix}/lib"
     if test "${with_tcl_version+set}" = set ; then
       possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}"
-      possibles="${possibles} ${prefix}/lib/tk${with_tcl_version}"
     fi
     possibles="${possibles} /usr/lib"
     if test "${with_tcl_version+set}" = set ; then
       possibles="${possibles} /usr/lib/tcl${with_tcl_version}"
-      possibles="${possibles} /usr/lib/tk${with_tcl_version}"
     fi
     AC_MSG_NOTICE(looking for tclConfig.sh in ${possibles})
     AC_FIND_FILE("tclConfig.sh", ${possibles}, tclconfig)
@@ -583,10 +581,38 @@ AC_DEFUN([ECOS_PATH_TCL], [
 
         
     dnl --------------------------------------------------------
-    dnl We now repeat the exercise for tk and tkConfig.sh, but
+    dnl We now repeat the exercise for tk and tkConfig.sh.
+    dnl Typically this will be in a similar location to tclConfig.sh,
+    dnl but allow for separate 
     dnl we assume that the Tk installation is in a similar
-    dnl location to the Tcl one.
-    possibles=`echo ${possibles} | sed -e 's,tcl,tk,g'`
+    dnl location to the Tcl one, but allow for different ones
+    dnl just in case.
+    possibles=""
+    if test "${with_tk+set}" = set ; then
+      possibles="${possibles} ${with_tk}/lib"
+      if test "${with_tcl_version+set}" = set ; then
+        possibles="${possibles} ${with_tk}/lib/tcl${with_tcl_version}"
+        possibles="${possibles} ${with_tk}/lib/tk${with_tcl_version}"
+      fi
+    fi
+    if test "${with_tcl+set}" = set ; then
+      possibles="${possibles} ${with_tcl}/lib"
+      if test "${with_tcl_version+set}" = set ; then
+        possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}"
+        possibles="${possibles} ${with_tcl}/lib/tk${with_tcl_version}"
+      fi
+    fi
+    possibles="${possibles} ${prefix}/lib"
+    if test "${with_tcl_version+set}" = set ; then
+      possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}"
+      possibles="${possibles} ${prefix}/lib/tk${with_tcl_version}"
+    fi
+    possibles="${possibles} /usr/lib"
+    if test "${with_tcl_version+set}" = set ; then
+      possibles="${possibles} /usr/lib/tcl${with_tcl_version}"
+      possibles="${possibles} /usr/lib/tk${with_tcl_version}"
+    fi
+
     AC_MSG_NOTICE(looking for tkConfig.sh in ${possibles})
     AC_FIND_FILE("tkConfig.sh", ${possibles}, tkconfig)
     if test \! -r "${tkconfig}/tkConfig.sh" ; then
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/ChangeLog,v
retrieving revision 1.6
diff -u -p -r1.6 ChangeLog
--- ChangeLog	18 Aug 2008 13:34:31 -0000	1.6
+++ ChangeLog	28 Aug 2008 14:04:55 -0000
@@ -1,3 +1,7 @@
+2008-08-28  Bart Veer  <bartv@ecoscentric.com>
+
+	* README.host: update description of Tcl/Tk searching.
+
 2008-08-18  Bart Veer  <bartv@ecoscentric.com>
 
 	* Makefile.am, configure.in: update host-side configury.
Index: README.host
===================================================================
RCS file: /cvs/ecos/ecos/README.host,v
retrieving revision 1.4
diff -u -p -r1.4 README.host
--- README.host	12 Feb 2003 17:22:10 -0000	1.4
+++ README.host	28 Aug 2008 14:05:06 -0000
@@ -4,7 +4,7 @@
 This README file only describes the eCos host-side software. For
 details of the eCos target-side software or the required toolchains,
 please see other documentation. A good starting point is
-http://sources.redhat.com/ecos
+http://sourceware.com/ecos
 		
 There are two categories of host-side software. The host subdirectory
 contains generic software, primarily related to the eCos configuration
@@ -186,6 +186,7 @@ A list of all the command-line options c
 
 3) --with-tcl=<path>
    --with-tcl-version=<number>
+   --with-tk=<path>
 
    The host-side tools have a dependency on Tcl, which is not supplied
    with the sources because many people will already have a suitable
@@ -225,8 +226,8 @@ A list of all the command-line options c
 
    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
+      <with-tcl>/lib/tclConfig.sh
+      <with-tcl>/lib/tcl<vsn>/tclConfig.sh
       <prefix>/lib/tclConfig.sh
       <prefix>/lib/tcl<vsn>/tclConfig.sh
       /usr/lib/tclConfig.sh
@@ -234,32 +235,36 @@ A list of all the command-line options c
 
    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
+   fail.
 
-      <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
+   To search for Tk the configure scripts use much the same rules as
+   for Tcl. It is also possible to specify a path using the --with-tk
+   option, useful if for some reason Tk has been installed in a
+   different location from Tcl. There is no --with-tk-version: it is
+   assumed that the same version should be used for both Tcl and Tk.
 
    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.
+   <tcl.h> is needed. A tclConfig.sh file may define TCL_INCLUDE_SPEC
+   or 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
+   specified using --with-tcl-version, then for a library libtcl.a.
+   tclConfig.sh may also list additional libraries in TCL_LIBS and
+   additional linker flags in TCL_LD_FLAGS.
+
+   For Tk the relevant tkConfig.sh settings are TK_INCLUDE_SPEC or
+   TK_INC_DIR, TK_XINCLUDES, TK_LIB_SPEC, and TK_LIBS.
+
 
 Following the configure step the build tree should be set up
 correctly. All that remains is the actual build and install:
@@ -330,12 +335,12 @@ in the normal fashion:
 More Information
 ================
 
-Please see the eCos web site, http://sources.redhat.com/ecos/, for
+Please see the eCos web site, http://sourceware.com/ecos/, for
 further details. This includes the FAQ, a form for reporting problems,
 and details of the various mailing lists
 (http://sources.redhat.com/ecos/intouch.html) At the time of writing
 there are no separate mailing lists for the eCos host-side sources,
-the main mailing list ecos-discuss@sources.redhat.com should be used
+the main mailing list ecos-discuss@sourceware.com should be used
 instead.
 
 //####COPYRIGHTBEGIN####

Plus updated configure script in host/libcdl,
host/tools/configtool/standalone/common,
packages/ha/synth/arch/current, and packages/io/usb/slave/current.

Bart

-- 
Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.


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