]> git.sur5r.net Git - bacula/bacula/commitdiff
Implement cross compiled bconsole
authorKern Sibbald <kern@sibbald.com>
Wed, 26 Apr 2006 05:20:17 +0000 (05:20 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 26 Apr 2006 05:20:17 +0000 (05:20 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2971 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kes-1.39
bacula/src/console/console.c
bacula/src/filed/filed.c
bacula/src/filed/filed.h
bacula/src/lib/Makefile.in
bacula/src/lib/attr.c
bacula/src/lib/bget_msg.c
bacula/src/lib/message.c
bacula/src/lib/winapi.c
bacula/src/version.h
bacula/src/win32/Makefile.in

index 9b7b094c830eddb8227bc3449623ed0325e83ab4..b8a864255fa65d0335a004c2fc1dec27036e2655 100644 (file)
@@ -2,6 +2,8 @@
                         Kern Sibbald
 
 General:
+26Apr06
+- Implement cross compiled bconsole
 25Apr06
 - Fix barcode test, eliminate BOOL (doesn't exist on Linux).
 - Write first cut of README.mingw32
index 7611e9008e7b42b5097bf5e99e5f8a05bc498793..9f20f6de0a20d36b5a2c1f4cc5bd3ef90b32a14d 100644 (file)
@@ -7,7 +7,7 @@
  *     Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -53,9 +53,6 @@ extern int rl_catch_signals;
 /* Imported functions */
 int authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons);
 
-/* Dummy functions */
-int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
-
 /* Forward referenced functions */
 static void terminate_console(int sig);
 static int check_resources();
index f274444fe6ed7bd1405d0115eb6e6e1ec772fef3..ae021bbf2c456c147e877db962fcec564c22e97d 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -36,16 +36,8 @@ static int check_resources();
 
 /* Exported variables */
 CLIENT *me;                           /* my resource */
-char OK_msg[]   = "2000 OK\n";
-char TERM_msg[] = "2999 Terminate\n";
 bool no_signals = false;
 
-#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
-const int win32_client = 1;
-#else
-const int win32_client = 0;
-#endif
-
 
 #define CONFIG_FILE "./bacula-fd.conf" /* default config file */
 
index cfe3e56dec954ac08f550a0a00bd805af957ca86..906aab7c6c657267b3cd6e2c80ee7bb124e18d7d 100644 (file)
@@ -32,6 +32,6 @@
 #define uLongf uint32_t
 #endif
 
-extern const int win32_client;              /* Are we running on Windows? */
+extern int win32_client;              /* Are we running on Windows? */
 
 extern CLIENT *me;                    /* "Global" Client resource */
index 1256c46f867cf0c1484e54a567c895f69cd8b766..b7693cfc3b07aa1c455a15e71290e1cf155006f3 100644 (file)
@@ -32,7 +32,7 @@ LIBSRCS = alloc.c attr.c base64.c berrno.c bsys.c bget_msg.c \
          res.c rwlock.c scan.c serial.c sha1.c \
          semlock.c signal.c smartall.c tls.c tree.c \
          util.c var.c watchdog.c workq.c btimers.c \
-         address_conf.c pythonlib.c 
+         address_conf.c pythonlib.c winapi.c
 
 
 LIBOBJS = alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o \
@@ -45,7 +45,7 @@ LIBOBJS = alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o \
          res.o rwlock.o scan.o serial.o sha1.o \
          semlock.o signal.o smartall.o tls.o tree.o \
          util.o var.o watchdog.o workq.o btimers.o \
-         address_conf.o pythonlib.o
+         address_conf.o pythonlib.o winapi.o
 
 
 EXTRAOBJS = @OBJLIST@
index 1b56f866185ed3b8250036ac16ab26d3d7d78792..c041f5fd566eb2297b04dbaef45e42c3013fd187 100644 (file)
@@ -6,7 +6,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2003-2005 Kern Sibbald
+   Copyright (C) 2003-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@
 #include "bacula.h"
 #include "jcr.h"
 
-extern const int win32_client;
+extern int win32_client;
 
 ATTR *new_attr()
 {
index 912aa5786b356cfbb3f7134b98da9dc511ebf2de..9a5005b4fbe7fd876e170f26dfb7e7fb2d0abe25 100644 (file)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2001-2005 Kern Sibbald
+   Copyright (C) 2001-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -24,8 +24,8 @@
 
 #include "bacula.h"                   /* pull in global headers */
 
-extern char OK_msg[];
-extern char TERM_msg[];
+static char OK_msg[]   = "2000 OK\n";
+static char TERM_msg[] = "2999 Terminate\n";
 
 #define msglvl 500
 
index 724015463e3ff9b59ea76dd971d7c7e2d5272a41..a394f0dac5bf92629488144553af50abb9057a12 100755 (executable)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -51,6 +51,7 @@ char con_fname[500];                  /* Console filename */
 FILE *con_fd = NULL;                  /* Console file descriptor */
 brwlock_t con_lock;                   /* Console lock structure */
 
+
 #ifdef HAVE_POSTGRESQL
 char catalog_db[] = "PostgreSQL";
 #else
index d8f8bbc420ded1a272394a07fb709f2467e74e11..5f649edcc43101e422bb4fa2d6e1203a46fa0d66 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "winapi.h"
 
+int win32_client = 1;
+
 #ifdef WIN32_VSS
 #include "vss.h"   
 #endif
@@ -244,4 +246,9 @@ InitWinAPIWrapper()
 #endif /* WIN32_VSS */
 }
 
+#else
+
+/* Not Windows */
+int win32_client = 0;
+
 #endif
index 77fa477a427970db3b14ba0a301cb51a67d63c75..e0810e5c875fb3a58cf27cc380a5fe37de759c67 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.10"
-#define BDATE   "25 April 2006"
-#define LSMDATE "25Apr06"
+#define BDATE   "26 April 2006"
+#define LSMDATE "26Apr06"
 
 /* Debug flags */
 #undef  DEBUG
index e42a432939d102763473f3938d2498cadd0f5b8b..56e8c068c808312afff485097692bf09d8c591fe 100644 (file)
@@ -119,15 +119,15 @@ verify_vol.o:     ../filed/verify_vol.c
 
 ######################################################################
 
-# Files in win32/compat
+# Files in src/win32/compat
 
 OBJS_COMPAT = \
-               $(OBJDIR)/print.o \
-               $(OBJDIR)/compat.o \
-               $(OBJDIR)/getopt.o \
-               $(OBJDIR)/vss.o \
-               $(OBJDIR)/vss_xp.o \
-               $(OBJDIR)/vss_w2k3.o \
+       $(OBJDIR)/print.o \
+       $(OBJDIR)/compat.o \
+       $(OBJDIR)/getopt.o \
+       $(OBJDIR)/vss.o \
+       $(OBJDIR)/vss_xp.o \
+       $(OBJDIR)/vss_w2k3.o \
 
 compat.o:      ./compat/compat.cpp
        $(CXX) -c ./compat/compat.cpp -o $(OBJDIR)/compat.o
@@ -230,7 +230,7 @@ save-cwd.o: ../findlib/save-cwd.c
 
 ######################################################################
 
-# Files in src/win32/lib, based on files in src/lib
+# Files files in src/lib
 
 LIB_OBJS = \
        $(OBJDIR)/address_conf.o \
@@ -282,24 +282,6 @@ LIB_OBJS = \
        $(OBJDIR)/tree.o \
        $(OBJDIR)/util.o \
 
-OBJS = $(LIB_OBJS) $(OBJS_COMPAT) $(OBJS_WIN) $(OBJS_FINDLIB) $(OBJS_FILED)
-
-LIBS = \
-       -L$(LIB_MINGW) \
-       $(LIB_PTHREADS) \
-       $(LIB_SSL) \
-       $(LIB_CRYPTO) \
-       $(LIB_ZLIB) \
-       $(LIB_MINGW)/libole32.a \
-       $(LIB_MINGW)/liboleaut32.a \
-       $(LIB_MINGW)/libuser32.a \
-       $(LIB_MINGW)/libadvapi32.a \
-       $(LIB_MINGW)/libgdi32.a \
-       $(LIB_MINGW)/libwsock32.a \
-       $(LIB_MINGW)/libshell32.a \
-       $(LIB_MINGW)/libnetapi32.a \
-       $(LIB_MINGW)/libuuid.a
-
 #
 # Rules for generating from ../lib
 # 
@@ -448,19 +430,85 @@ winapi.o: ../lib/winapi.c
 workq.o:       ../lib/workq.c
        $(CXX) -c ../lib/workq.c -o $(OBJDIR)/workq.o
 
+
+######################################################################
+
+# Files in src/console
+OBJS_CONSOLE = \
+       $(OBJDIR)/cons_authenticate.o \
+       $(OBJDIR)/console.o \
+       $(OBJDIR)/console_conf.o
+
+cons_authenticate.o:  ../console/authenticate.c
+       $(CXX) -I../src/console -c ../console/authenticate.c -o $(OBJDIR)/cons_authenticate.o
+
+console.o:  ../console/console.c
+       $(CXX) -I../src/console -c ../console/console.c -o $(OBJDIR)/console.o
+
+console_conf.o:  ../console/console_conf.c
+       $(CXX) -I../src/console -c ../console/console_conf.c -o $(OBJDIR)/console_conf.o
+
+######################################################################
+
+
+FD_OBJS = $(LIB_OBJS) $(OBJS_COMPAT) $(OBJS_WIN) $(OBJS_FINDLIB) $(OBJS_FILED)
+
+FD_LIBS = \
+       -L$(LIB_MINGW) \
+       $(LIB_PTHREADS) \
+       $(LIB_SSL) \
+       $(LIB_CRYPTO) \
+       $(LIB_ZLIB) \
+       $(LIB_MINGW)/libole32.a \
+       $(LIB_MINGW)/liboleaut32.a \
+       $(LIB_MINGW)/libuser32.a \
+       $(LIB_MINGW)/libadvapi32.a \
+       $(LIB_MINGW)/libgdi32.a \
+       $(LIB_MINGW)/libwsock32.a \
+       $(LIB_MINGW)/libshell32.a \
+       $(LIB_MINGW)/libnetapi32.a \
+       $(LIB_MINGW)/libuuid.a
+
+CONS_OBJS = $(LIB_OBJS) $(OBJS_COMPAT) $(OBJS_CONSOLE)
+
+CONS_LIBS = \
+       -L$(LIB_MINGW) \
+       $(LIB_PTHREADS) \
+       $(LIB_SSL) \
+       $(LIB_CRYPTO) \
+       $(LIB_MINGW)/libole32.a \
+       $(LIB_MINGW)/liboleaut32.a \
+       $(LIB_MINGW)/libuser32.a \
+       $(LIB_MINGW)/libadvapi32.a \
+       $(LIB_MINGW)/libgdi32.a \
+       $(LIB_MINGW)/libwsock32.a \
+       $(LIB_MINGW)/libshell32.a \
+       $(LIB_MINGW)/libnetapi32.a \
+       $(LIB_MINGW)/libuuid.a
+
+
+
 # Targets
 
-all: bacula-fd.exe
+all: bacula-fd.exe bconsole.exe
 
 clean:
        rm -f $(OBJDIR)/*.o $(OBJDIR)/bacula-fd.exe $(OBJDIR)/winres.res
-       rm -f pthreadGCE.dll
+       rm -f pthreadGCE.dll $(OBJDIR)/bconsole.exe
+
+# Link the File daemon executable ...
+bacula-fd.exe: $(FD_OBJS)
+       $(CXX) $(FD_OBJS) $(FD_LIBS) -o $(OBJDIR)/bacula-fd.exe
+       cp -f $(DEPKGS)/pthreads/pthreadGCE.dll .
 
-# Link the executable ...
-bacula-fd.exe: $(OBJS)
-       $(CXX) $(OBJS) $(LIBS) -o $(OBJDIR)/bacula-fd.exe
+# Link the File daemon executable ...
+bconsole.exe: $(CONS_OBJS)
+       $(CXX) $(CONS_OBJS) $(CONS_LIBS) -o $(OBJDIR)/bconsole.exe
        cp -f $(DEPKGS)/pthreads/pthreadGCE.dll .
 
+
+
+
 # TODO ...
 # Fix vss files: check for consistent levels of pointer indirection
 # vss_generic.c: VSS_TIMEOUT defined as empty/null