# lang/expect would like to compile the port against tcl85 not tcl86



## torqueturns (Jul 15, 2015)

I have a legacy in-house product which is having a lot of issues running with tcl/tk 8.6  the engineers responsible for the software asked if I can put in the supported tcl/tk 8.5 as a base for the time being.   I used pkg(8) to manage the ports affected and have identified those that need to be recompiled,

`root@srvcmts2:/usr/ports/lang/tcl85 # pkg info -r tcl86-8.6.3`

```
tcl86-8.6.3:
        tk86-8.6.3
        expect-5.45_1
        mpexpr-1.1
```
 
`root@srvcmts2:/usr/ports/lang/tcl85 # pkg info -r tk86-8.6.3`

```
tk86-8.6.3:
        blt-2.5.3_2
```

I have built tcl85-8.5.17 tk85-8.5.17, which are also in the portsnap I am working with.

I now want to build expect from ports but the port trying to use libtcl86.so, to link against.


```
root@srvcmts2:/usr/ports/lang/expect # make config
===> No options to configure
root@srvcmts2:/usr/ports/lang/expect # make
===>   expect-5.45_1 depends on file: /usr/local/sbin/pkg - found
=> expect5.45.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://downloads.sourceforge.net/project/expect/Expect/5.45/expect5.45.tar.gz
expect5.45.tar.gz                             100% of  614 kB  170 kBps 00m04s
===> Fetching all distfiles required by expect-5.45_1 for building
===>  Extracting for expect-5.45_1
=> SHA256 Checksum OK for expect5.45.tar.gz.
===>  Patching for expect-5.45_1
===>  Applying FreeBSD patches for expect-5.45_1
===>   expect-5.45_1 depends on shared library: libtcl86.so - not found
===>    Verifying for libtcl86.so in /usr/ports/lang/tcl86
```
I would like the port to try and build against the libtcl85.so which is currently the installed base tcl/tk version.  I have read the handbook and searched the web but could not find the place to override the required tcl/tk 8.6 version.  Of course I can hack the makefile, but do not think that is a good practice in general.  I also understand that there may be other issues during compile which could cause problems, I just would like to understand how to force the make to use tcl/tk8.5 as a requirement.


----------



## talsamon (Jul 15, 2015)

I think you can try it with `make install clean DEFAULT_VERSIONS=tcltk=8.5`.

or in /etc/make.conf

```
.if ${.CURDIR:M*/ports/lang/expect}
DEFAULT_VERSIONS=tcltk=8.5
.endif
```


----------



## torqueturns (Jul 15, 2015)

Thanks talsamon that was just what I needed, the pkg(8) now confirms that it is compiled/linked  against the correct libs.

```
root@srvcmts2:/usr/ports/lang/expect # make install DEFAULT_VERSIONS=tcltk=8.5
===>  Installing for expect-5.45_1
===>   expect-5.45_1 depends on shared library: libtcl85.so - found (/usr/local/lib/libtcl85.so.1.0)
===>  Checking if expect already installed
===>   Registering installation for expect-5.45_1
Installing expect-5.45_1...
root@srvcmts2:/usr/ports/lang/expect # pkg info expect-5.45_1
expect-5.45_1
Name           : expect
Version        : 5.45_1
Installed on   : Wed Jul 15 14:40:54 CDT 2015
Origin         : lang/expect
Architecture   : freebsd:10:x86:64
Prefix         : /usr/local
Categories     : tk tcl lang
Licenses       :
Maintainer     : tcltk@FreeBSD.org
WWW            : http://expect.nist.gov/
Comment        : Sophisticated scripter based on Tcl/Tk
Shared Libs required:
        libtcl85.so.1.0
Shared Libs provided:
        libexpect545.so
Annotations    :
Flat size      : 386KiB
Description    :
Expect is a program that performs programmed dialogue with other
interactive programs.  It is briefly described by its man page, expect(1).
```


----------

