Introduction
Sometime it is useful to create a "static" link "expect" package. This enable us to have a self-contained package without a worry if other tools or libraries are available. A use case is to have expect run on a Juniper router or switch. When you run a "flex" image on a switch with Intel processor such as QFX series, or a EX9200, it is possible that you can install your own utilities written and compiling by using either FreeBSD 6.1, or Junos SDK. In this example, I am using a FreeBSD 6.1 VM to build expect package.
Configuring Expect
Read the README
file to understand the general idea and the prerequisites. Since expect
is a derivative of TCL
it is very likely that you will also need to install Tcl 8.4
also. Please check the TCL code for more information.
The following command is what I use to configure expect
.
This will also designate the location of the final directory to install into /var/tmp/expect
./configure --perfix=/var/tmp/expect --disable-load --disable-shared
After run the configure, it is time to run make
to compile the software. The make will fail to build expect
binary. But this is expected since we need to do a couple more things. I did the following modifications:
Makefile
line 397 - added "-lutil -static"libexpect545.a
to libexpect.a
using the following command:
ln -s libexpect.a libexpect545.a
The above is called soft linking - which will make libexpect545.a an alias of libexpect.a. IMHO, this could be done in the Makefile and I may put my version on github at some point
make install
- this time it should work fine and all needed files installed at /var/tmp/expect