<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Steps to Take for Porting</TITLE> <META NAME="description" CONTENT="Steps to Take for Porting"> <META NAME="keywords" CONTENT="developers"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="developers.css"> <LINK REL="previous" HREF="Porting_Requirements.html"> <LINK REL="up" HREF="Bacula_Porting_Notes.html"> <LINK REL="next" HREF="Implementing_GUI_Interface.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html1287" HREF="Implementing_GUI_Interface.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html1281" HREF="Bacula_Porting_Notes.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html1277" HREF="Porting_Requirements.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html1283" HREF="Contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html1285" HREF="GNU_Free_Documentation_Lice.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1288" HREF="Implementing_GUI_Interface.html">Implementing a GUI Interface</A> <B> Up:</B> <A NAME="tex2html1282" HREF="Bacula_Porting_Notes.html">Bacula Porting Notes</A> <B> Previous:</B> <A NAME="tex2html1278" HREF="Porting_Requirements.html">Porting Requirements</A> <B> <A NAME="tex2html1284" HREF="Contents.html">Contents</A></B> <B> <A NAME="tex2html1286" HREF="GNU_Free_Documentation_Lice.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION001220000000000000000"></A> <A NAME="4434"></A> <A NAME="4435"></A> <BR> Steps to Take for Porting </H1> <P> <UL> <LI>The first step is to ensure that you have version 2.13 or later of the <B>autoconf</B> tools loaded. You can skip this step, but making changes to the configuration program will be difficult or impossible. </LI> <LI>The run a <B>./configure</B> command in the main source directory and examine the output. It should look something like the following: <P> <PRE> Configuration on Mon Oct 28 11:42:27 CET 2002: Host: i686-pc-linux-gnu -- redhat 7.3 Bacula version: 1.27 (26 October 2002) Source code location: . Install binaries: /sbin Install config files: /etc/bacula C Compiler: gcc C++ Compiler: c++ Compiler flags: -g -O2 Linker flags: Libraries: -lpthread Statically Linked Tools: no Database found: no Database type: Internal Database lib: Job Output Email: root@localhost Traceback Email: root@localhost SMTP Host Address: localhost Director Port 9101 File daemon Port 9102 Storage daemon Port 9103 Working directory /etc/bacula/working SQL binaries Directory Large file support: yes readline support: yes cweb support: yes /home/kern/bacula/depkgs/cweb TCP Wrappers support: no ZLIB support: yes enable-smartalloc: yes enable-gnome: no gmp support: yes </PRE> <P> The details depend on your system. The first thing to check is that it properly identified your host on the <B>Host:</B> line. The first part (added in version 1.27) is the GNU four part identification of your system. The part after the - is your system and the system version. Generally, if your system is not yet supported, you must correct these. </LI> <LI>If the <B>./configure</B> does not function properly, you must determine the cause and fix it. Generally, it will be because some required system routine is not available on your machine. </LI> <LI>To correct problems with detection of your system type or with routines and libraries, you must edit the file <B> bacula-src/autoconf/configure.in</B>. This is the ``source'' from which <B>configure</B> is built. In general, most of the changes for your system will be made in <B>autoconf/aclocal.m4</B> in the routine <B>BA_CHECK_OPSYS</B> or in the routine <B>BA_CHECK_OPSYS_DISTNAME</B>. I have already added the necessary code for most systems, but if yours shows up as <B>unknown</B> you will need to make changes. Then as mentioned above, you will need to set a number of system dependent items in <B>configure.in</B> in the <B>case</B> statement at approximately line 1050 (depending on the Bacula release). </LI> <LI>The items to in the case statement that corresponds to your system are the following: <P> <UL> <LI>DISTVER - set to the version of your operating system. Typically some form of <B>uname</B> obtains it. </LI> <LI>TAPEDRIVE - the default tape drive. Not too important as the user can set it as an option. </LI> <LI>PSCMD - set to the <B>ps</B> command that will provide the PID in the first field and the program name in the second field. If this is not set properly, the <B>bacula stop</B> script will most likely not be able to stop Bacula in all cases. </LI> <LI>hostname - command to return the base host name (non-qualified) of your system. This is generally the machine name. Not too important as the user can correct this in his configuration file. </LI> <LI>CFLAGS - set any special compiler flags needed. Many systems need a special flag to make pthreads work. See cygwin for an example. </LI> <LI>LDFLAGS - set any special loader flags. See cygwin for an example. </LI> <LI>PTHREAD_LIB - set for any special pthreads flags needed during linking. See freebsd as an example. </LI> <LI>lld - set so that a ``long long int'' will be properly edited in a printf() call. </LI> <LI>llu - set so that a ``long long unsigned'' will be properly edited in a printf() call. </LI> <LI>PFILES - set to add any files that you may define is your platform subdirectory. These files are used for installation of automatic system startup of Bacula daemons. </LI> </UL> <P> </LI> <LI>To rebuild a new version of <B>configure</B> from a changed <B> autoconf/configure.in</B> you enter <B>make configure</B> in the top level Bacula source directory. You must have done a ./configure prior to trying to rebuild the configure script or it will get into an infinite loop. </LI> <LI>If the <B>make configure</B> gets into an infinite loop, ctl-c it, then do <B>./configure</B> (no options are necessary) and retry the <B>make configure</B>, which should now work. </LI> <LI>To rebuild <B>configure</B> you will need to have <B>autoconf</B> version 2.57-3 or higher loaded. Older versions of autoconf will complain about unknown or bad options, and won't work. </LI> <LI>After you have a working <B>configure</B> script, you may need to make a few system dependent changes to the way Bacula works. Generally, these are done in <B>src/baconfig.h</B>. You can find a few examples of system dependent changes toward the end of this file. For example, on Irix systems, there is no definition for <B>socklen_t</B>, so it is made in this file. If your system has structure alignment requirements, check the definition of BALIGN in this file. Currently, all Bacula allocated memory is aligned on a <B>double</B> boundary. </LI> <LI>If you are having problems with Bacula's type definitions, you might look at <B>src/bc_types.h</B> where all the types such as <B>uint32_t</B>, <B>uint64_t</B>, etc. that Bacula uses are defined. </LI> </UL> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html1287" HREF="Implementing_GUI_Interface.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html1281" HREF="Bacula_Porting_Notes.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html1277" HREF="Porting_Requirements.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html1283" HREF="Contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html1285" HREF="GNU_Free_Documentation_Lice.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1288" HREF="Implementing_GUI_Interface.html">Implementing a GUI Interface</A> <B> Up:</B> <A NAME="tex2html1282" HREF="Bacula_Porting_Notes.html">Bacula Porting Notes</A> <B> Previous:</B> <A NAME="tex2html1278" HREF="Porting_Requirements.html">Porting Requirements</A> <B> <A NAME="tex2html1284" HREF="Contents.html">Contents</A></B> <B> <A NAME="tex2html1286" HREF="GNU_Free_Documentation_Lice.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> 2010-06-14 </ADDRESS> </BODY> </HTML>