4 \section*{Bacula Porting Notes}
6 \index{Notes!Bacula Porting}
7 \index{Bacula Porting Notes}
8 \addcontentsline{toc}{section}{Bacula Porting Notes}
10 This document is intended mostly for developers who wish to port Bacula to a
11 system that is not {\bf officially} supported.
13 It is hoped that Bacula clients will eventually run on every imaginable system
14 that needs backing up (perhaps even a Palm). It is also hoped that the Bacula
15 Directory and Storage daemons will run on every system capable of supporting
18 \subsection*{Porting Requirements}
19 \index{Requirements!Porting}
20 \index{Porting Requirements}
21 \addcontentsline{toc}{subsection}{Porting Requirements}
23 In General, the following holds true:
26 \item {\bf Bacula} has been compiled and run on Linux RedHat, FreeBSD, and
28 \item In addition, clients exist on Win32 (Cygwin), and Irix
29 \item It requires GNU C++ to compile. You can try with other compilers, but
30 you are on your own. The Irix client is built with the Irix complier, but, in
31 general, you will need GNU.
32 \item Your compiler must provide support for 64 bit signed and unsigned
34 \item You will need a recent copy of the {\bf autoconf} tools loaded on your
35 system (version 2.13 or later). The {\bf autoconf} tools are used to build
36 the configuration program, but are not part of the Bacula source
38 \item There are certain third party packages that Bacula needs. Except for
39 MySQL, they can all be found in the {\bf depkgs} and {\bf depkgs1} releases.
40 \item If you want to build the Win32 binaries, you will need the full Cygwin
41 1.5.5 release. Although all components build (console has some warnings),
42 only the File daemon has been tested. Please note that if you attempt to
43 build Bacula on any other version of Cygwin, particularly previous versions,
44 you will be on your own.
45 \item {\bf Bacula} requires a good implementation of pthreads to work.
46 \item The source code has been written with portability in mind and is mostly
47 POSIX compatible. Thus porting to any POSIX compatible operating system
48 should be relatively easy.
51 \subsection*{Steps to Take for Porting}
52 \index{Porting!Steps to Take for}
53 \index{Steps to Take for Porting}
54 \addcontentsline{toc}{subsection}{Steps to Take for Porting}
57 \item The first step is to ensure that you have version 2.13 or later of the
58 {\bf autoconf} tools loaded. You can skip this step, but making changes to
59 the configuration program will be difficult or impossible.
60 \item The run a {\bf ./configure} command in the main source directory and
61 examine the output. It should look something like the following:
65 Configuration on Mon Oct 28 11:42:27 CET 2002:
66 Host: i686-pc-linux-gnu -- redhat 7.3
67 Bacula version: 1.27 (26 October 2002)
68 Source code location: .
69 Install binaries: /sbin
70 Install config files: /etc/bacula
73 Compiler flags: -g -O2
76 Statically Linked Tools: no
78 Database type: Internal
80 Job Output Email: root@localhost
81 Traceback Email: root@localhost
82 SMTP Host Address: localhost
85 Storage daemon Port 9103
86 Working directory /etc/bacula/working
87 SQL binaries Directory
88 Large file support: yes
90 cweb support: yes /home/kern/bacula/depkgs/cweb
91 TCP Wrappers support: no
93 enable-smartalloc: yes
99 The details depend on your system. The first thing to check is that it
100 properly identified your host on the {\bf Host:} line. The first part (added
101 in version 1.27) is the GNU four part identification of your system. The part
102 after the -- is your system and the system version. Generally, if your system
103 is not yet supported, you must correct these.
104 \item If the {\bf ./configure} does not function properly, you must determine
105 the cause and fix it. Generally, it will be because some required system
106 routine is not available on your machine.
107 \item To correct problems with detection of your system type or with routines
108 and libraries, you must edit the file {\bf
109 \lt{}bacula-src\gt{}/autoconf/configure.in}. This is the ``source'' from
110 which {\bf configure} is built. In general, most of the changes for your
111 system will be made in {\bf autoconf/aclocal.m4} in the routine {\bf
112 BA\_CHECK\_OPSYS} or in the routine {\bf BA\_CHECK\_OPSYS\_DISTNAME}. I have
113 already added the necessary code for most systems, but if yours shows up as
114 {\bf unknown} you will need to make changes. Then as mentioned above, you
115 will need to set a number of system dependent items in {\bf configure.in} in
116 the {\bf case} statement at approximately line 1050 (depending on the Bacula
118 \item The items to in the case statement that corresponds to your system are
122 \item DISTVER -- set to the version of your operating system. Typically some
123 form of {\bf uname} obtains it.
124 \item TAPEDRIVE -- the default tape drive. Not too important as the user can
126 \item PSCMD -- set to the {\bf ps} command that will provide the PID in the
127 first field and the program name in the second field. If this is not set
128 properly, the {\bf bacula stop} script will most likely not be able to stop
130 \item hostname -- command to return the base host name (non-qualified) of
131 your system. This is generally the machine name. Not too important as the
132 user can correct this in his configuration file.
133 \item CFLAGS -- set any special compiler flags needed. Many systems need a
134 special flag to make pthreads work. See cygwin for an example.
135 \item LDFLAGS -- set any special loader flags. See cygwin for an example.
136 \item PTHREAD\_LIB -- set for any special pthreads flags needed during
137 linking. See freebsd as an example.
138 \item lld -- set so that a ``long long int'' will be properly edited in a
140 \item llu -- set so that a ``long long unsigned'' will be properly edited in
142 \item PFILES -- set to add any files that you may define is your platform
143 subdirectory. These files are used for installation of automatic system
144 startup of Bacula daemons.
147 \item To rebuild a new version of {\bf configure} from a changed {\bf
148 autoconf/configure.in} you enter {\bf make configure} in the top level Bacula
149 source directory. You must have done a ./configure prior to trying to rebuild
150 the configure script or it will get into an infinite loop.
151 \item If the {\bf make configure} gets into an infinite loop, ctl-c it, then
152 do {\bf ./configure} (no options are necessary) and retry the {\bf make
153 configure}, which should now work.
154 \item To rebuild {\bf configure} you will need to have {\bf autoconf} version
155 2.57-3 or higher loaded. Older versions of autoconf will complain about
156 unknown or bad options, and won't work.
157 \item After you have a working {\bf configure} script, you may need to make a
158 few system dependent changes to the way Bacula works. Generally, these are
159 done in {\bf src/baconfig.h}. You can find a few examples of system dependent
160 changes toward the end of this file. For example, on Irix systems, there is
161 no definition for {\bf socklen\_t}, so it is made in this file. If your
162 system has structure alignment requirements, check the definition of BALIGN
163 in this file. Currently, all Bacula allocated memory is aligned on a {\bf
165 \item If you are having problems with Bacula's type definitions, you might
166 look at {\bf src/bc\_types.h} where all the types such as {\bf uint32\_t},
167 {\bf uint64\_t}, etc. that Bacula uses are defined.