]> git.sur5r.net Git - bacula/bacula/commitdiff
simplify the link process for win32/win64
authorEric Bollengier <eric@eb.homelinux.org>
Sun, 25 Oct 2009 08:53:09 +0000 (09:53 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Sun, 25 Oct 2009 08:53:09 +0000 (09:53 +0100)
bacula/src/win32/lib/Makefile
bacula/src/win32/lib/make_def
bacula/technotes

index 619dc50ca5facf5cec52bdd085bfd3274b677779..d2d4a52e1a2a11cba7cee20b9be3e51d5fd7605d 100644 (file)
@@ -134,6 +134,10 @@ clean:
 # Rules for generating from ../lib
 #
 
+bacula$(WIN_VERSION).def: $(DLL_OBJS)
+       ./make_def $(WIN_VERSION) $(DLL_OBJS) >bacula$(WIN_VERSION).def.new && \
+         mv bacula$(WIN_VERSION).def.new bacula$(WIN_VERSION).def
+
 $(LIBDIR)/libbacula.a: DLL_DEFINE=USING_DLL
 
 $(LIBDIR)/libbacula.a: $(BINDIR)/bacula.dll $(STATIC_OBJS)
index 89d21cbcd2de6f36d42f623a02a571a003dc198a..aaad7d0576ccae9fca36e0bdb2b266579f42696b 100755 (executable)
@@ -4,27 +4,47 @@
 #    manually
 #
 #  Kern Sibbald, June 2007
+#  Rewritten by James Harper, October 2009
 #
 
-TOPDIR=`(cd ../../..;pwd)`
-TOPDIR=${DEPKGS:-${TOPDIR}}
-NM=${TOPDIR}/cross-tools/mingw32/mingw32/bin/nm
-echo "LIBRARY bacula.dll"
-echo "EXPORTS"
-echo " "
 
-cd obj32
-for i in *.o ; do \
-   echo "; $i"; \
-   ${NM} $i | grep "^[0-9a-f]* T _" | cut -c13- ; \
-   echo " "; \
-done
+FILES="$@"
+if [ "$FILES" = "" ]
+then
+  exit 1
+fi
 
-DATA="\
-   console_command \
-   plugin_list"
+TOPDIR=`(cd ../../../..;pwd)`
+TOPDIR=${DEPKGS:-${TOPDIR}}
+VERSION=$1
+shift
+if [ "$VERSION" = 64 ]; then
+   NM=${TOPDIR}/cross-tools/mingw-w64/bin/mingw32-nm
+elif [ "$VERSION" = 32 ]; then
+   NM=${TOPDIR}/cross-tools/mingw32/mingw32/bin/nm
+else 
+   echo "Usage: make_def [32|64] *.o" >&2
+   exit 1
+fi
 
-for i in ${DATA}; do \
-   echo "$i DATA"; \
+echo LIBRARY bacula.dll
+echo EXPORTS
+echo ""
+
+$NM \
+ --defined-only --extern-only $@ | while read addr type sym
+do
+ sym=`echo $sym | cut -c2-`
+ case "$type" in
+  "B")
+   echo $sym DATA
+   ;;
+  "T")
+   echo $sym
+   ;;
+  "")
+   echo "; $addr"
+   ;;
+ esac
 done
+
index f196c77a54bca594d73e1824b980ea2afff9c132..39981829401c65f0768e124b96fbe337a9ba7f69 100644 (file)
@@ -2,6 +2,9 @@
           
 General:
 
+25Oct09
+ebl  Apply James make_def version to simplify the link process for Windows
+ebl  Update it for win64.
 23Oct09
 kes  When dequeuing messages, don't allow queuing more, but send them
      to syslog. Fixes Eric's messages-test regression script.