Recently I compiled an old release of Bacula on an AIX 5.3 host (oslevel command shows “5.3.0.0” as output), using a gcc 3.3.2 version. My need was to make a bacula-sd binary file. To end my compilation I performed some quick and dirty hack.
First, I downloaded and installed the MySQL includes and client, as a prerequisite:
# rpm -Uvh MySQL-client-3.23.58-2.aix5.1.ppc.rpm MySQL-devel-3.23.58-2.aix5.1.ppc.rpm
after downloading the tar.gz file, I uncompressed and opened it in a temporary directory. Then I moved to the bacula-2.4.4 directory and run the configure command with several options:
./configure -prefix=/usr/local/bacula -enable-largefile -disable-libtool -with-pid-dir=/usr/local/bacula/var/run -with-subsys-dir=/usr/local/bacula/var/run/subsys –disable-conio –enable-build-stored –with-mysql
Then, I opened the Makefile to comment out the line with .PATH variable definition
#.PATH: .
and I added some line to the ./src/bacula.h file before the pthread.h inclusion:
/* Beginning of the code added by hand */
#define __SIZEOF_PTHREAD_BARRIER_T 20
#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
typedef volatile int pthread_spinlock_t;
typedef union
{
char __size[__SIZEOF_PTHREAD_BARRIER_T];
long int __align;
} pthread_barrier_t;
typedef union
{
char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
int __align;
} pthread_barrierattr_t;
/* end of the added code, next line was the original one */
#include <pthread.h>
in the file ./src/stored/stored.h I made me sure to include mtio.h in the right place:
//#ifdef HAVE_MTIO_H
//#include <mtio.h>
//#else
//# ifdef HAVE_SYS_MTIO_H
# include <sys/mtio.h>
//# else
//# ifdef HAVE_SYS_TAPE_H
//# include <sys/tape.h>
//# endif
//# endif
//#endif
then in src./lib/bsys.c I commented out the initgroups definition:
/*
#ifdef HAVE_AIX_OS
extern “C” int initgroups(const char *,int);
#endif
*/
finally, as root, I commented out the line 104 of /usr/include/sys/mtio.h file (Yes, I know, It’s an ugly solution)
#ifndef _MTEXTEND_H
/* #include <sys/mtextend.h> */ /* XXXXX commented in order to compile bacula */
#endif
After making all theese changes, I was able to end the bacula-sd (and other) part of bacula suite.
Before the installation, You may find useful to strip the binary files
# cd ./src/stored
# strip bacula-sd bscan btape bcopy bextract bls
# make install
At this point I tested my bacula-sd starting it in foreground, verbose and debug mode
# /usr/local/bacula/sbin/bacula-sd -v -f -d 516
and I started my backup test.