Page MenuHomeDevCentral

Allow to easily compile test an eggdrop on Eglide
Closed, ResolvedPublic

Description

According @tomjerr, eggdrop doesn't currently compile on Eglide.

Do a test compile and if needed, install missing packages.

Event Timeline

dereckson moved this task from Backlog to Server config on the Eglide board.
dereckson moved this task from Backlog to Next on the User-Dereckson board.
Eglide
$ ./configure
[…]
checking for Tcl library... not found
checking for Tcl header... not found
checking whether the Tcl system has changed... yes
configure: error:

  Tcl cannot be found on this system.

  Eggdrop requires Tcl and the Tcl development files to compile.
  If you already have Tcl installed on this system, make sure you
  also have the development files (common package names include
  'tcl-dev' and 'tcl-devel'). If I just wasn't looking
  in the right place for it, re-run ./configure using the
  --with-tcllib='/path/to/libtcl.so' and
  --with-tclinc='/path/to/tcl.h' options.

  See doc/COMPILE-GUIDE's 'Tcl Detection and Installation' section for more
  information.

Configure step

The headers file tcl.h is located at a fairly standard place, /usr/include/tcl8.6/tcl.h.

But the library libtcl8.6.so is in a queer location: /usr/lib/arm-linux-gnueabihf/libtcl8.6.so.

None are detected by eggdrop configure script. To compile an eggdrop, you so needs to specify paths manually.

See the transcript below for the syntax to use.

Build step
Compilation works fine, with some compiler warnings. Linking failed for two missing references:

  • garbage_collect_tclhash (required by main.c)
  • open_listen (required by tcldcc.c)

Transcript

Eglide
$ ./configure --with-tclinc=/usr/include/tcl8.6/tcl.h --with-tcllib=/usr/lib/arm-linux-gnueabihf/libtcl8.6.so
[…]
checking for Tcl library... using /usr/lib/arm-linux-gnueabihf/libtcl8.6.so
checking for Tcl header... using /usr/include/tcl8.6/tcl.h
[…]
checking for Tcl version... 8.6
checking for Tcl patch level... 8.6.6
[…]
Type 'make config' to configure the modules, or type 'make iconfig'
to interactively choose which modules to compile.
$ make iconfig
[…]
$ make
[…]
---------- Yeah! That's the compiling, now the linking! ----------

Linking eggdrop (standard build).

gcc -o ../eggdrop bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o tclmisc.o tcluser.o userent.o userrec.o users.o  -L/usr/lib/arm-linux-gnueabihf -ltcl8.6 -lm -ldl -lnsl  -lpthread md5/md5c.o compat/*.o `cat mod/mod.xlibs`
main.o: In function `garbage_collect':
/home/dereckson/test-eggdrop/eggdrop1.6.21/src/./main.c:710: undefined reference to `garbage_collect_tclhash'
modules.o:(.data.rel+0x168): undefined reference to `open_listen'
tcldcc.o: In function `tcl_listen':
/home/dereckson/test-eggdrop/eggdrop1.6.21/src/tcldcc.c:942: undefined reference to `open_listen'
collect2: error: ld returned 1 exit status
Makefile:37: recipe for target '../eggdrop' failed

http://forum.egghelp.org/viewtopic.php?t=20009 pointed to http://eggwiki.org/Inline, which provides as solution to specify as a C89 standard to gcc compiler.

I prepared a fetch/extract/configure/build/install script tested on both Debian and FreeBSD:

1#!/bin/sh
2
3# -------------------------------------------------------------
4# Install an eggdrop
5# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6# Project: Eglide
7# Created: 2016-11-06
8# License: Trivial work, not eligible to copyright
9# -------------------------------------------------------------
10
11# -------------------------------------------------------------
12# TCL and eggdrop versions
13# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
14
15EGGDROP_VERSION_MAJOR=1.6
16EGGDROP_VERSION=1.6.21
17TCL_VERSION=8.6
18
19# -------------------------------------------------------------
20# Fetch, extract
21# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
22
23wget ftp://ftp.eggheads.org/pub/eggdrop/source/${EGGDROP_VERSION_MAJOR}/eggdrop${EGGDROP_VERSION}.tar.gz
24tar xzf eggdrop${EGGDROP_VERSION}.tar.gz
25cd eggdrop${EGGDROP_VERSION}
26
27# -------------------------------------------------------------
28# Configure step
29#
30# This is the tricky part, as we need to provide path to TCL
31# header and library files, heavily OS/distro/arch dependant.
32# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33
34if [ -f /etc/debian_version ]; then
35 ARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`
36 CFLAGS="-std=gnu89" ./configure --with-tclinc=/usr/include/tcl${TCL_VERSION}/tcl.h --with-tcllib=/usr/lib/$ARCH/libtcl${TCL_VERSION}.so
37elif [ `uname` = "FreeBSD" ]; then
38 TCL_VERSION_LIB=`echo $TCL_VERSION | tr -d .`
39 ./configure --with-tclinc=/usr/local/include/tcl${TCL_VERSION}/tcl.h -with-tcllib=/usr/local/lib/libtcl${TCL_VERSION_LIB}.so
40else
41 ./configure
42fi
43
44# -------------------------------------------------------------
45# Build, install
46# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
47
48make config
49make
50make install

dereckson renamed this task from Do an eggdrop compile test on Eglide to Allow to easily compile test an eggdrop on Eglide.Nov 6 2016, 21:32
dereckson moved this task from Next to Needs Review / Blocked / Waiting on the User-Dereckson board.