Compiling Eggdrop For MacOSX 10.3 Panther
This is a basic guide to compiling Eggdrop 1.6.17 for MacOSX 10.3. This document assumes you have some degree of familiarity with Darwin/Linux/BSD.
Before you begin to compile eggdrop you will need to install XCode for MacOSX. This will give you access to gcc (the GNU C compiler). You can get XCode directly from Apple's web site http://www.apple.com/macosx/features/xcode/.
I also suggest you create a new user account for eggdrop. For this rest of this document I will assume you have created a user called eggdropuser. Once the user is created you can use the su command to open a shell as eggdropuser:
host:~ jotham$ su eggdropuser
Password:
host:/Users/jotham eggdropuser$
Now change to the home directory of eggdropuser:
host:/Users/jotham eggdropuser$ cd ~
host:~ eggdropuser$
You will need to get the eggdrop source code from http://www.eggheads.org/downloads/. Downloading the source code can be done by using curl directly from the command line:
host:~ eggdropuser$ curl -O ftp://ftp.eggheads.org/pub/eggdrop/source/1.6/eggdrop1.6.17.tar.gz
The source code should be in the current directory:
host:~ eggdropuser$ ls -l ./eggdrop*
-rw-r--r-- 1 eggdropu eggdropu 1021902 1 Dec 11:40 ./eggdrop1.6.17.tar.gz
Use tar to uncompress the source code then cd into the directory:
host:~ eggdropuser$ tar -zxf ./eggdrop1.6.17.tar.gz
host:~ eggdropuser$ cd eggdrop1.6.17
host:~/eggdrop1.6.17 eggdropuser$
I suggest reading ~/eggdrop1.6.17/README and ~/eggdrop1.6.17/INSTALL. You should now attempt to compile the eggdrop with the instructions given in ~/eggdrop1.6.17/INSTALL.
It should all go horribly wrong. Something like:
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE_CONFIG_H -DMAKING_MODS -c .././dns.mod/dns.c
In file included from ../dns.mod/dns.c:37:
../dns.mod/coredns.c:163: error: `PACKETSZ' undeclared here (not in a function)
In file included from ../dns.mod/dns.c:37:
../dns.mod/coredns.c: In function `dorequest':
../dns.mod/coredns.c:569: error: `PACKETSZ' undeclared (first use in this function)
../dns.mod/coredns.c:569: error: (Each undeclared identifier is reported only once
../dns.mod/coredns.c:569: error: for each function it appears in.)
../dns.mod/coredns.c:571: error: `QUERY' undeclared (first use in this function)
../dns.mod/coredns.c:571: error: `C_IN' undeclared (first use in this function)
../dns.mod/coredns.c:569: warning: unused variable `buf'
../dns.mod/coredns.c: In function `resendrequest':
../dns.mod/coredns.c:594: error: `T_A' undeclared (first use in this function)
../dns.mod/coredns.c:597: error: `T_PTR' undeclared (first use in this function)
../dns.mod/coredns.c: In function `parserespacket':
../dns.mod/coredns.c:713: error: `NOERROR' undeclared (first use in this function)
../dns.mod/coredns.c:737: error: `MAXDNAME' undeclared (first use in this function)
../dns.mod/coredns.c:756: error: `C_IN' undeclared (first use in this function)
../dns.mod/coredns.c:762: error: `T_PTR' undeclared (first use in this function)
../dns.mod/coredns.c:769: error: `T_A' undeclared (first use in this function)
../dns.mod/coredns.c:871: error: `T_CNAME' undeclared (first use in this function)
../dns.mod/coredns.c:896: error: `NXDOMAIN' undeclared (first use in this function)
../dns.mod/coredns.c: In function `dns_ack':
../dns.mod/coredns.c:927: error: `PACKETSZ' undeclared (first use in this function)
../dns.mod/coredns.c: In function `dns_check_expires':
../dns.mod/coredns.c:973: error: `T_PTR' undeclared (first use in this function)
../dns.mod/coredns.c:982: error: `T_A' undeclared (first use in this function)
../dns.mod/coredns.c: In function `dns_lookup':
../dns.mod/coredns.c:1007: error: `T_PTR' undeclared (first use in this function)
../dns.mod/coredns.c: In function `dns_forward':
../dns.mod/coredns.c:1044: error: `T_A' undeclared (first use in this function)
../dns.mod/dns.c: In function `dns_event_success':
../dns.mod/dns.c:48: error: `T_PTR' undeclared (first use in this function)
../dns.mod/dns.c:51: error: `T_A' undeclared (first use in this function)
../dns.mod/dns.c: In function `dns_event_failure':
../dns.mod/dns.c:62: error: `T_PTR' undeclared (first use in this function)
../dns.mod/dns.c:68: error: `T_A' undeclared (first use in this function)
../dns.mod/coredns.c: At top level:
../dns.mod/coredns.c:163: error: storage size of `resrecvbuf' isn't known
../../../src/tclegg.h:142: warning: `localeTable' defined but not used
../dns.mod/coredns.c:163: warning: `resrecvbuf' defined but not used
make[2]: *** [../dns.o] Error 1
make[1]: *** [dns.mod_so] Error 2
make: *** [modules] Error 2
host:~/eggdrop1.6.17 eggdropuser$
To resolve this you will need to edit ~/eggdrop1.6.17/src/mod/dns.mod/coredns.c and add an additional include directive. I use vim to edit these files but any text editor is suitable.
host:~/eggdrop1.6.17 eggdropuser$ vim src/mod/dns.mod/coredns.c
Inside the coredns.c file, scroll down until you find:
#include <errno.h>
Append an additional directive after <errno.h>:
#include <arpa/nameser_compat.h>
The coredns.c file should look something like this:
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <errno.h>
#include <arpa/nameser_compat.h>
Save and close the coredns.c file. Now you will need to edit ~/eggdrop1.6.17/Makefile
host:~/eggdrop1.6.17 eggdropuser$ vim Makefile
Inside the Makefile file, scroll down until you find:
XLIBS = -L/usr/lib -ltcl8.4 -lm -lpthread -ldl
This line may look slightly different on your machine. Append the flag -lresolv to the end of the XLIBS line:
XLIBS = -L/usr/lib -ltcl8.4 -lm -lpthread -ldl -lresolv
Save and close the Makefile file. Again, you should now attempt to compile the eggdrop with the instructions given in ~/eggdrop1.6.17/INSTALL. Everything should go according to plan and you should be informed that eggdrop has been compiled.
I would suggest installing the eggdrop into its own folder, such as: /Users/eggdropuser/eggdrop-botname
host:~/eggdrop1.6.17 eggdropuser$ mkdir ~/eggdrop-botname
host:~/eggdrop1.6.17 eggdropuser$ make install DEST=~/eggdrop-botname/
The rest of the process is well documented and you should have no problems from here on. Additional help can be found at http://www.eggheads.org/, and http://www.google.com.
References:
For comments or suggested improvements please E-mail me at jotham.read [at] gmail.com.