]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/win32/README.mingw32
Update README.mingw32 to include gdb info
[bacula/bacula] / bacula / src / win32 / README.mingw32
index 8ad7d12a27270c1234abf7ad1cd9f22a5e10916a..eaac14ea0e6773359577a9d6b63f1d4b862a61a7 100644 (file)
@@ -15,6 +15,40 @@ expect that there may be problems on systems other than Linux where you
 are pretty much on your own.  However, we will try to provide responses to
 your questions on the bacula-devel list, but we can't guarantee anything.
 
+Directory Structure
+=====================
+The new directory structure is:
+
+  bacula-top                 Top level directory -- any name
+    bacula                   Top level Bacula source directory -- any name
+      src
+        win32                Main directory where Windows version is built.
+
+    docs                     Top level Bacula documentation directory
+
+    depkgs-mingw32 (MinGW32) 3rd Party Dependencies for MinGW32 build
+or
+    depkgs-msvc (MS VC++)    3rd Party Dependencies for Microsoft VC++ build.
+      bin              --
+      include            |
+      lib                |
+      man                |   Created by script
+      nsis               |-- .../bacula/src/win32/build-depkgs-mingw32
+      scons              |
+      share              |
+      src                |
+      ssl              --
+      vss
+        inc                  A copy of the Windows VSS/inc directory
+
+    cross-tools (MinGW32)    Cross compilation tools (gcc, g++, mingw32, ...)
+      binutils-mingw32 --
+      gcc-mingw32        |   Created by script
+      mingw32            |-- .../bacula/src/win32/build-win32-cross-tools
+      mingw-utils        |
+      source           --
+
+
 One-time Setup
 ==============
 
@@ -29,6 +63,24 @@ The extracted doc directory name will be bacula-docs-version where version
 is the version number.  The directory must be renamed to docs (ie remove
 the leading bacula- and the -version portion of the name).
 
+Note, a number of packages must be installed to build the cross-tools
+and the depkgs files.  Most are rather standard such as gcc, g++,
+make, ...  However a few that you may not have are:
+
+  texinfo
+  flex
+  bison
+  patch (Debian)
+  m4
+  postgresql (at least client)
+  mysql (at least client)
+  SQLite3 (from depkgs or as package)
+  readline (readlineN-dev on Debian)
+  ...
+
+NB: On Debian, I had to remove /usr/bin/lorder for
+postresql to build correctly.
+
 Once the source is on your system, change to the win32 directory
         cd .../bacula/src/win32
 
@@ -38,6 +90,26 @@ Download and build the cross compiler tools
 Download and build the 3rd party dependencies
         ./build-depkgs-mingw32
 
+Note, that during the build process you will see a moderate amount of
+output. If something fails, it is probably because you don't have one
+of the build dependencies (hopefully all mentioned above) loaded on your  
+system. To find out what is going wrong, do the following:
+
+  cd .../depkgs-mingw32/src/<package-name>
+   
+where <package-name> is where the package is unpacked and built. Normally
+it is relatively obvious when looking at the src directory.             
+
+In that directory, you should find a make.log, which has the full details
+of the compiles, links, and installs done for that package.
+
+Note, if you are building on a 64 bit machine, please know that
+the build for the depkgs-mingw32/scons puts the python scons libraries
+in depkgs-mingw32/scons/lib64 but when running scons it looks for the
+libs in depkgs-mingw32/scons/lib. So adding symlink from
+depkgs-mingw32/scons/lib64 to depkgs-mingw32/scons/lib will fix the
+problem.
+
 You need the header files from the Microsoft VSS SDK.  Unfortunately the SDK
 can only be downloaded and installed on a Windows system.  You can find it on
 Microsoft's web-site at:
@@ -48,12 +120,16 @@ If that link doesn't work then go to http://www.microsoft.com and search for
 
         "download volume shadow copy service sdk"
 
+we are currently using version 7.2 released 8/3/2005.
+
 Normally the files will be installed in:
 
         c:\Program Files\Microsoft\VSSSDK72
 
 You only need to copy everything under the c:\Program Files\Microsoft\VSSSDK72\inc
-directory into .../depkgs-mingw32/vss/inc.
+directory into .../depkgs-mingw32/vss/inc.  In doing so, please ensure that
+the case in maintained on the directory and filenames -- some contain uppercase 
+characters !!!
 
 The above only needs to be done once unless we change the cross-tools
 or the dependencies versions.  In general, you can run the script multiple
@@ -65,6 +141,7 @@ following:
         wget
         texinfo
         bison
+        flex
 
 and possibly other packages.
 
@@ -85,7 +162,7 @@ to ensure that you pick up all the new Win32 changes:
 
    cd .../bacula
    make clean
-   cvs -q update -d -P
+   svn update
    cd src/win32
    make
 
@@ -128,7 +205,16 @@ exported.
 New data variables are exported by adding the macro DLL_IMP_EXP to
 the variable declaration in the header file.  All exported variables
 must be declared in a header file and MUST NOT be declared in a
-source file referencing the variable.
+source file referencing the variable. Example, src/lib/runscript.h:
+
+extern DLL_IMP_EXP bool (*console_command)(JCR *jcr, const char *cmd);
+
+or src/jcr.h
+
+extern int DLL_IMP_EXP num_jobs_run;
+extern DLL_IMP_EXP dlist * last_jobs;
+...
+
 
 Exporting functions is now more or less automated.  If you find that
 a function name has been added, changed, or an argument modified,    
@@ -138,7 +224,11 @@ simply do the following:
    make                  (to build the .o files, note the link will fail)
    ./make_def >bacula.def
 
-This should rebuild the bacula.def file.
+This should rebuild the bacula.def file, but it uses relative paths
+and assumes you have the directory structure noted above. If you 
+are using something different, you can set the NM variable at the
+top of the make_def file to use an absolute path to the correct
+directory.
 
 ===== manual changing of bacula.def no longer necessary =====
 If you want to do it manually, please see below:
@@ -188,8 +278,9 @@ New data variables are exported by placing their name in the file
 As with the bacula.def file above, this is now more or less automated.
 When the link dies, simply do the following:
 
-   cd .../bacula/src/win32/cats
+   cd .../bacula/src/win32
    make                  (to build the .o files, note the link will fail)
+   cd cats
    ./make_def >bacula_cats.def
 
 This should rebuild the bacula_cats.def file. Note, if you have
@@ -215,6 +306,21 @@ in the .../bacula/src/win32/cats/bacula_cats.def file.
 === end manual changing of bacula_cats.def ==========
 
 
+Running gdb on the Win32 files
+==================================================
+You can use the mingw32 gdb to debug Bacula on Win32 by downloading
+it from Source Forge:
+
+http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=20507
+
+Download one of their .exe versions, which is an installer that you
+can run on Win32 to install gdb.  This gdb is built with mingw32 so will
+run independently of any cygwin installation.  Note, not all the releases
+come with an installer. I had to go back 3 or 4 versions to find it.  Otherwise
+you can download the source and build it.  Thanks to Eric Bollengier for
+this tip.
+
+
 Structure of the MinGW32 build environment
 ==========================================