Does not build on FreeBSD 11.0-RELEASE amd64

Issue #738 resolved
Marcel Bischoff created an issue

I followed the instructions for FreeBSD here. ./configure works, make does not. Please see the log below:

$ gmake clean all
Making clean in src
gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/src'
rm -f *.o *.a libpiler.so* piler pilerconf pilerget pileraget pilerimport pilerexport pilerpurge pilertest reindex
gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/src'
Making clean in etc
gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/etc'
rm -f piler.conf cron.jobs sphinx.conf.dist
gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/etc'
Making clean in util
gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/util'
rm -f postinstall.sh
gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/util'
Making clean in init.d
gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/init.d'
rm -f rc.piler rc.searchd
gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/init.d'
Making clean in unit_tests
gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/unit_tests'
rm -f check_parser_utils check_rules check_digest check_mydomains check_parser smtp
gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/unit_tests'
gmake[1]: Entering directory '/usr/local/src/piler-1.2.0'
gmake[1]: Nothing to be done for 'clean-am'.
gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0'
rm -f piler.key
Making all in src
gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/src'
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c dirs.c -o dirs.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c base64.c -o base64.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c misc.c -o misc.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c counters.c -o counters.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c cfg.c -o cfg.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c sig.c -o sig.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c decoder.c -o decoder.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c hash.c -o hash.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c parser.c -o parser.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c parser_utils.c -o parser_utils.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c rules.c -o rules.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c smtp.c -o smtp.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c session.c -o session.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c message.c -o message.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c attachment.c -o attachment.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c digest.c -o digest.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c store.c -o store.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c archive.c -o archive.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c tai.c -o tai.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import.c -o import.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_maildir.c -o import_maildir.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_mailbox.c -o import_mailbox.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_pop3.c -o import_pop3.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_imap.c -o import_imap.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_gui.c -o import_gui.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c imap.c -o imap.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c pop3.c -o pop3.o
gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c extract.c -o extract.o
extract.c: In function 'extract_attachment_content':
extract.c:286:17: error: 'SIGALRM' undeclared (first use in this function)
       sig_catch(SIGALRM, kill_helper);
                 ^
extract.c:286:17: note: each undeclared identifier is reported only once for each function it appears in
gmake[1]: *** [Makefile:76: extract.o] Error 1
gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/src'
gmake: *** [Makefile:41: all-recursive] Error 1

Comments (12)

  1. Janos SUTO repo owner

    Please add #include <signal.h> to extract.c (somewhere where the other inclusions are), and try to recompile.

  2. Janos SUTO repo owner

    Also, I've just learned at the right time that you use freebsd. I'm experimenting with another socket polling method, and it's clear now that I can't use epoll (though it's much better than select and poll), because it's Linux only. So I'll stick to poll().

  3. Marcel Bischoff reporter

    Thanks for your suggestion. I have done that, recompiled, just for another issue to appear:

    $ gmake clean all
    Making clean in src
    gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/src'
    rm -f *.o *.a libpiler.so* piler pilerconf pilerget pileraget pilerimport pilerexport pilerpurge pilertest reindex
    gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/src'
    Making clean in etc
    gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/etc'
    rm -f piler.conf cron.jobs sphinx.conf.dist
    gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/etc'
    Making clean in util
    gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/util'
    rm -f postinstall.sh
    gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/util'
    Making clean in init.d
    gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/init.d'
    rm -f rc.piler rc.searchd
    gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/init.d'
    Making clean in unit_tests
    gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/unit_tests'
    rm -f check_parser_utils check_rules check_digest check_mydomains check_parser smtp
    gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/unit_tests'
    gmake[1]: Entering directory '/usr/local/src/piler-1.2.0'
    gmake[1]: Nothing to be done for 'clean-am'.
    gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0'
    rm -f piler.key
    Making all in src
    gmake[1]: Entering directory '/usr/local/src/piler-1.2.0/src'
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c dirs.c -o dirs.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c base64.c -o base64.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c misc.c -o misc.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c counters.c -o counters.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c cfg.c -o cfg.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c sig.c -o sig.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c decoder.c -o decoder.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c hash.c -o hash.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c parser.c -o parser.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c parser_utils.c -o parser_utils.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c rules.c -o rules.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c smtp.c -o smtp.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c session.c -o session.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c message.c -o message.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c attachment.c -o attachment.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c digest.c -o digest.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c store.c -o store.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c archive.c -o archive.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c tai.c -o tai.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import.c -o import.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_maildir.c -o import_maildir.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_mailbox.c -o import_mailbox.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_pop3.c -o import_pop3.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_imap.c -o import_imap.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c import_gui.c -o import_gui.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c imap.c -o imap.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c pop3.c -o pop3.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c extract.c -o extract.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c mydomains.c -o mydomains.o
    gcc -O2 -Wall -g -I/usr/local/include -fPIC -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -c mysql.c -o mysql.o
    ar cr libpiler.a dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o smtp.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o import_maildir.o import_mailbox.o import_pop3.o import_imap.o import_gui.o imap.o pop3.o extract.o mydomains.o  mysql.o
    ranlib libpiler.a
    gcc -shared -o libpiler.so.0.1.1 dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o smtp.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o import_maildir.o import_mailbox.o import_pop3.o import_imap.o import_gui.o imap.o pop3.o extract.o mydomains.o  mysql.o
    ln -sf libpiler.so.0.1.1 libpiler.so
    ln -sf libpiler.so.0.1.1 libpiler.so.0
    gcc -O2 -Wall -g -I/usr/local/include -I. -I..  -I/usr/local/include/mysql -isystem /usr/local/include -fstack-protector -fno-strict-aliasing  -g -fno-omit-frame-pointer -fno-strict-aliasing -DFREEBSD -DHAVE_TRE -DNEED_MYSQL -o piler piler.c -lpiler -lz -lm -lcrypto -lssl -ltre -lzip -lwrap   -L/usr/local/lib/mysql  -lmysqlclient  -pthread -lm -L.  -L/usr/local/lib -L/usr/local/lib
    ./libpiler.so: undefined reference to `libiconv'
    ./libpiler.so: undefined reference to `libiconv_close'
    ./libpiler.so: undefined reference to `libiconv_open'
    collect2: error: ld returned 1 exit status
    gmake[1]: *** [Makefile:41: piler] Error 1
    gmake[1]: Leaving directory '/usr/local/src/piler-1.2.0/src'
    gmake: *** [Makefile:41: all-recursive] Error 1
    

    libiconv is installed though.

  4. Janos SUTO repo owner

    Try adding "-liconv" in the Makefile to the other library definitions, eg. -lcrypto -lssl, etc.

  5. Marcel Bischoff reporter

    Thanks again for the hint. I needed to add this to the Makefiles in src and unit_tests, after that the compilation went through without further errors.

    Sphinx is throwing warnings upon startup, it appears to be running correctly though. The 32-bit warning may very well be due to Sphinx being installed via pkg. Here's the log from the first run:

    $ /etc/init.d/rc.searchd start
    starting searchd . . .
    Sphinx 2.2.11-release (95ae9a6)
    Copyright (c) 2001-2016, Andrew Aksyonoff
    Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
    
    WARNING: 32-bit IDs are deprecated, rebuild your binaries with --enable-id64
    using config file '/usr/local/etc/piler/sphinx.conf'...
    listening on 127.0.0.1:9312
    listening on 127.0.0.1:9306
    WARNING: failed to init process shared rwlock: process shared rwlock is not supported by FreeBSD; ALTER disabled
    precaching index 'main1'
    precaching index 'main2'
    precaching index 'main3'
    precaching index 'main4'
    precaching index 'dailydelta1'
    precaching index 'delta1'
    WARNING: last message repeated 5 times
    WARNING: index 'delta1': preload: failed to open /var/piler/sphinx/delta1.sph: No such file or directory; NOT SERVING
    WARNING: failed to init process shared rwlock: process shared rwlock is not supported by FreeBSD; ALTER disabled
    precaching index 'tag1'
    precaching index 'note1'
    precaching index 'att1'
    precached 9 indexes in 0.012 sec
    
  6. Marcel Bischoff reporter

    Also, the web GUI apparently does not like PHP 7:

    Fatal error: Uncaught Error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in /var/www/piler/system/database/mysql.php:13 Stack trace: #0 /var/www/piler/system/db.php(12): MySQL->__construct('localhost', 'piler', '', 'piler', '') #1 /var/www/piler/index.php(36): DB->__construct('mysql', 'localhost', 'piler', '', 'piler', '') #2 {main} thrown in /var/www/piler/system/database/mysql.php on line 13
    

    Addition: even with PHP 5.6 the following error occurs

    Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in /var/www/piler/system/database/mysql.php on line 13
    

    I'm using nginx as web server.

    Update: My bad... Forgot to install php*-pdo_mysql.

  7. Marcel Bischoff reporter

    I just wanted to test it a little bit. But so far it seems to be working as it should. Importing emails works, the index works, searching works, the web interface works. ;)

  8. Marcel Bischoff reporter

    Just one more thing. In the web interface the following notice and warning appears:

    Notice: Undefined offset: 1 in /var/www/piler/model/health/health.php on line 72
    
    Warning: file_get_contents(/proc/meminfo): failed to open stream: No such file or directory in /var/www/piler/model/health/health.php on line 79
    

    I blame that on FreeBSD on not having a /proc like Linux does. On FreeBSD, you get the value through sysctl hw.realmem — just in case you're inclined to accommodate us BSD types. ;)

  9. Log in to comment