Download binary package from GNU project's official homepage. An execute the following command to install it:
# /usr/sbin/pkgadd -d `pwd`/gcc-2.95.pkg
This HowTo was extracted from Michele’s blog and modified to compile with bacula ver. 2.2.4 (the last release at the moment).
I’m on of those poor souls, who still has an old SCO Unix box around. Having the need to compile a bacula-fd client on this box, I’m writing down a couple of notes, because I keep forgetting it everytime I need to upgrade to a newer bacula version (this time it was 1.38.11):
Configure with:
LDFLAGS=-lthread ./configure –enable-client-only –disable-conio –prefix=/usr/local
You’ll get the following errors:
bnet_server.c:36: warning: aggregate has a partly bracketed initializer
bnet_server.c:36: warning: aggregate has a partly bracketed initializer
bnet_server.c:36: warning: aggregate has a partly bracketed initializer
bnet_server.c:36: warning: aggregate has a partly bracketed initializer
bnet_server.c:36: warning: aggregate has a partly bracketed initializer
bnet_server.c:36: warning: aggregate has a partly bracketed initializer
bnet_server.c: In function `void bnet_thread_server(dlist *, int, workq_t *, void * (*)(void *))’:
bnet_server.c:166: passing `int *’ as argument 3 of `accept(int, sockaddr *, size_t *)’ changes signedness
*** Error code 1 (bu21)
UX:make: ERROR: fatal error.
You need to apply the following changes to src/lib/bnet_server.c:
*** bnet_server.c.orig Thu Sep 7 10:43:25 2006 --- bnet_server.c Thu Sep 7 10:46:52 2006 *************** *** 163,169 **** /* Got a connection, now accept it. */ do { clilen = sizeof(cli_addr); ! newsockfd = accept(fd_ptr->fd, &cli_addr, &clilen); } while (newsockfd < 0 && errno == EINTR); if (newsockfd < 0) { continue; --- 163,169 ---- /* Got a connection, now accept it. */ do { clilen = sizeof(cli_addr); ! newsockfd = accept(fd_ptr->fd, &cli_addr, &(size_t)clilen); } while (newsockfd < 0 && errno == EINTR); if (newsockfd < 0) { continue;
If you come across this error:
Compiling bsock.c bsock.c: In method `int BSOCK::get_peer(char *, int)': bsock.c:549: passing `int *' as argument 3 of `getpeername(int, sockaddr*, size_t *)' changes signedness *** Codigo de error 1 (bu21)
Apply this patch too:
--- bacula-2.2.4.orig/src/lib/bsock.c 2007-06-24 14:27:12.000000000 -0300 +++ bacula-2.2.4/src/lib/bsock.c 2007-09-21 13:56:03.000000000 -0300 @@ -545,7 +545,7 @@ { #if !defined(HAVE_WIN32) if (peer_addr.sin_family == 0) { - socklen_t salen = sizeof(peer_addr); + size_t salen = sizeof(peer_addr); int rval = (getpeername)(m_fd, (struct sockaddr *)&peer_addr, &salen); if (rval < 0) return rval; }
After that compilation should end up cleanly (I use a gcc version 2.95 on this box)
Note: This was updated to patch the getpeername compile error.