Multiple backend files patch



Figured that the hackiness that is backends with multiple source files deserved fixing, so here's a patch. Allows multiple source file backends, and patches the debian and redhat backends to make them do this properly. Should still work ok with single-file backends. I've added the backends/interface_parser.{c,h} lines to Makefile.am that may conflict with j's earlier patch if that's already been merged.

Tom
--
palfrey tevp net - http://tevp.net
Illegitimus non carborundum
Index: configure.in
===================================================================
RCS file: /cvs/gnome/NetworkManager/configure.in,v
retrieving revision 1.44
diff -u -r1.44 configure.in
--- configure.in	19 Oct 2004 18:20:44 -0000	1.44
+++ configure.in	11 Nov 2004 16:26:43 -0000
@@ -46,7 +46,7 @@
 	case $with_distro in
 		redhat)
 			TARGET_DISTRO=RedHat
-			SYSTEM_BACKEND_FILE=NetworkManagerRedHat.o
+			SYSTEM_BACKEND_FILE="NetworkManagerRedHat.o shvar.o"
 			;;
 		gentoo)
 			TARGET_DISTRO=Gentoo
@@ -54,7 +54,7 @@
 			;;
 		debian)
 			TARGET_DISTRO=Debian
-			SYSTEM_BACKEND_FILE=NetworkManagerDebian.o
+			SYSTEM_BACKEND_FILE="NetworkManagerDebian.o interface_parser.o"
 			;;
 		slackware)
 			TARGET_DISTRO=Slackware
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/Makefile.am,v
retrieving revision 1.14
diff -u -r1.14 Makefile.am
--- src/Makefile.am	29 Oct 2004 20:24:34 -0000	1.14
+++ src/Makefile.am	11 Nov 2004 16:26:43 -0000
@@ -41,10 +41,11 @@
 		backends/NetworkManagerRedHat.c	\
 		backends/NetworkManagerSlackware.c	\
 		backends/shvar.c				\
-		backends/shvar.h
+		backends/shvar.h				\
+		backends/interface_parser.c		\
+		backends/interface_parser.h
 
 
-NetworkManager_LDADD = $(NM_LIBS) $(IWLIB) backends/$(SYSTEM_BACKEND_FILE)
+NetworkManager_LDADD = $(NM_LIBS) $(IWLIB) $(foreach backend,$(SYSTEM_BACKEND_FILE),backends/$(backend))
 if WITH_GCRYPT
 NetworkManager_LDADD += $(LIBGCRYPT_LIBS)
 endif
Index: src/backends/NetworkManagerDebian.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/backends/NetworkManagerDebian.c,v
retrieving revision 1.9
diff -u -r1.9 NetworkManagerDebian.c
--- src/backends/NetworkManagerDebian.c	11 Nov 2004 02:24:04 -0000	1.9
+++ src/backends/NetworkManagerDebian.c	11 Nov 2004 16:26:43 -0000
@@ -34,9 +34,6 @@
 
 #define ARPING "/usr/sbin/arping"
 
-/* hacky, but the redhat one does this as well... */
-#include "interface_parser.c"
-
 /*
  * nm_system_init
  *
Index: src/backends/NetworkManagerRedHat.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/backends/NetworkManagerRedHat.c,v
retrieving revision 1.12
diff -u -r1.12 NetworkManagerRedHat.c
--- src/backends/NetworkManagerRedHat.c	21 Oct 2004 17:42:14 -0000	1.12
+++ src/backends/NetworkManagerRedHat.c	11 Nov 2004 16:26:43 -0000
@@ -27,13 +27,7 @@
 #include "NetworkManagerUtils.h"
 #include "NetworkManagerDevice.h"
 
-
-/* Hmm, not good form, but we don't have support
- * for multiple files for each system-specific
- * backend yet...
- */
-#include "shvar.c"
-
+#include "shvar.h"
 
 /*
  * nm_system_init
Index: src/backends/interface_parser.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/backends/interface_parser.c,v
retrieving revision 1.1
diff -u -r1.1 interface_parser.c
--- src/backends/interface_parser.c	11 Nov 2004 02:24:04 -0000	1.1
+++ src/backends/interface_parser.c	11 Nov 2004 16:26:43 -0000
@@ -21,7 +21,7 @@
 
 
 #include "interface_parser.h"
-
+#include "NetworkManagerUtils.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]