File: libxml2.patch

package info (click to toggle)
baycomusb 0.10-15.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,884 kB
  • sloc: ansic: 49,182; asm: 17,572; sh: 2,442; makefile: 542; pascal: 183; sed: 93; perl: 31
file content (352 lines) | stat: -rw-r--r-- 12,108 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
--- baycomusb-0.10.orig/configure.in
+++ baycomusb-0.10/configure.in
@@ -12,6 +12,7 @@ AC_PROG_MAKE_SET
 AC_ISC_POSIX
 AC_PROG_CC
 AM_PROG_CC_STDC
+AC_GNU_SOURCE
 dnl AC_PROG_RANLIB
 AC_C_CONST
 AC_C_INLINE
@@ -126,60 +127,7 @@ if test x$ac_cv_cygwin = xyes -o x$ac_cv
   LIBS="$LIBS -lgdi32"
 fi
 
-if test x$ac_cv_prog_cc_cross = xyes; then
-  gtk=no
-  xlibs="$LIBS"
-  LIBS="$LIBS -L$CROSSCOMPPATH/gtk/lib"
-  AC_CHECK_LIB(gtk,gtk_main,gtk=yes)
-  LIBS="$xlibs"
-  if test x$gtk = xyes; then
-    GTK_CFLAGS="-I$CROSSCOMPPATH/gtk/include"
-    GTK_LIBS="-L$CROSSCOMPPATH/gtk/lib -lgtk -lgdk -lglib"
-    PTHREAD_CFLAGS="-L$CROSSCOMPPATH/gtk/include"
-    PTHREAD_LIBS="-L$CROSSCOMPPATH/gtk/lib"
-  fi
-else
-  AM_PATH_GTK(1.2.0,gtk=yes,AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?))
-fi
-
-dnl check for ORBit
-if test x$ac_cv_cygwin = xyes -o x$ac_cv_mingw32 = xyes; then
-  AC_ARG_ENABLE(orbit,
-  [  --enable-orbit          Enable ORBit interprocess communication],
-  [case "${enableval}" in
-    yes) orbitipc=true ;;
-    no)  orbitipc=false ;;
-    *) AC_MSG_ERROR(bad value ${enableval} for --enable-orbit) ;;
-  esac],[orbitipc=false])
-else
-  orbitipc=true
-fi
-
-dnl even if cross compiling, we use the native IDL compiler
-if test x$orbitipc = xtrue; then
-  AC_DEFINE(ORBITIPC)
-  AC_PATH_PROG(ORBIT_CONFIG, orbit-config, no)
-  if test "$ORBIT_CONFIG" = "no"; then
-    AC_ERROR("orbit not found")
-  fi
-  ORBIT_EXEC_PREFIX=`$ORBIT_CONFIG --exec-prefix`
-  ORBIT_IDL=$ORBIT_EXEC_PREFIX/bin/orbit-idl
-  if test x$ac_cv_prog_cc_cross = xyes; then
-    ORBIT_CFLAGS="-I$CROSSCOMPPATH/orbit/include/ -mno-cygwin"
-    ORBIT_VERSION=5.0.1
-    ORBIT_LIBS="-L$CROSSCOMPPATH/orbit/lib/ -L$CROSSCOMPPATH/gtk/lib/ -lORBit -lIIOP -lORBitutil -lglib -lwsock32 -mno-cygwin"
-  else
-    ORBIT_CFLAGS=`$ORBIT_CONFIG --cflags server`
-    ORBIT_VERSION=`$ORBIT_CONFIG --version server`
-    ORBIT_LIBS=`$ORBIT_CONFIG --libs server`
-  fi
-else
-  ORBIT_IDL=true
-  ORBIT_CFLAGS=""
-  ORBIT_VERSION=5.0.1
-  ORBIT_LIBS=""
-fi
-
+PKG_CHECK_MODULES(XML, libxml-2.0)
 
 dnl Only use -Wall if we have gcc
 if test "x$GCC" = "xyes"; then
@@ -197,20 +145,6 @@ else
   AC_CHECK_LIB(util,openpty)
   AC_CHECK_FUNCS(openpty,LIBTHREAD="$LIBTHREAD $LIBS",LIBOBJS="$LIBOBJS openpty.o")
   LIBS=$xlibs
-
-  AC_PATH_PROG(XML_CONFIG,xml-config,:)
-  if test "$XML_CONFIG" = ":" ; then
-    AC_MSG_ERROR(Could not find xml-config; libxml installed?)
-  fi
-  XMLCFLAGS=`$XML_CONFIG --cflags`
-  XMLLIBS=`$XML_CONFIG --libs`
-  xcflags=$CFLAGS
-  xlibs=$LIBS
-  LIBS="$LIBS $XMLLIBS"
-  CFLAGS="$CFLAGS $XMLCFLAGS"
-  AC_CHECK_LIB(xml, xmlNewDoc,, AC_MSG_ERROR(Cannot link libxml))
-  LIBS=$xlibs
-  CFLAGS=$xcflags
 fi
 
 if test x$ac_cv_cygwin = xyes -o x$ac_cv_mingw32 = xyes; then
@@ -225,10 +159,6 @@ if test x$ac_cv_cygwin = xyes -o x$ac_cv
   CFLAGS="$xcflags"
 fi
 
-dnl Add the languages which your application supports here.
-ALL_LINGUAS=""
-AM_GNU_GETTEXT
-
 dnl Set PACKAGE_LOCALE_DIR in config.h.
 if test "x${prefix}" = "xNONE"; then
   AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
@@ -331,8 +261,6 @@ AC_SUBST(HAVE_IFRNEWNAME)
 AC_SUBST(HAVE_DIRECTX)
 AC_SUBST(WIN32)
 AC_OUTPUT([Makefile
-po/Makefile.in
-intl/Makefile
 fpga/Makefile
 firmware/Makefile
 firmware/fskfirmware/Makefile
@@ -350,11 +278,7 @@ wdmdrv/Makefile
 misc/Makefile
 usbdrv/Makefile
 trxapi/Makefile
-trxctrl/Makefile
 flexdrv/Makefile
-trxclient/Makefile
 winserv/Makefile
 diag/Makefile
-trxapp/Makefile
-trxapp/src/Makefile
 coinstaller/Makefile])
--- baycomusb-0.10.orig/diag/Makefile.am
+++ baycomusb-0.10/diag/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-INCLUDES = @GTK_CFLAGS@ @XMLCFLAGS@ -DCONFIGDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" \
+INCLUDES = @GTK_CFLAGS@ @XML_CFLAGS@ -DCONFIGDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" \
 	-I$(top_srcdir) -I$(top_srcdir)/misc -I$(top_srcdir)/usbdrv -I$(top_srcdir)/diag \
 	-I$(top_srcdir)/directx/include -I$(top_srcdir)/directx/include/directx6 -I$(top_srcdir)/kerneldrv -I$(top_srcdir)/wdmdrv
 
@@ -10,7 +10,7 @@ sbin_PROGRAMS = baycomusb writeeeprom
 noinst_LIBRARIES = libbaycomusb.a
 
 baycomusb_SOURCES = baycomusb.c
-baycomusb_LDADD = libbaycomusb.a ../flexdrv/libusb.a ../misc/libmisc.a @XMLLIBS@
+baycomusb_LDADD = libbaycomusb.a ../flexdrv/libusb.a ../misc/libmisc.a @XML_LIBS@
 
 writeeeprom_SOURCES = writeeeprom.c
 writeeeprom_LDADD = libbaycomusb.a ../flexdrv/libusb.a ../misc/libmisc.a
--- baycomusb-0.10.orig/diag/cfgunix.c
+++ baycomusb-0.10/diag/cfgunix.c
@@ -35,8 +35,8 @@
 #include "baycomusb.h"
 
 /* libxml includes */
-#include <tree.h>
-#include <parser.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
 
 /* ---------------------------------------------------------------------- */
 
@@ -258,11 +258,11 @@ int config_parse(void)
 	doc = xmlParseFile(configfile);
 	if (!doc)
 		goto err;
-	if (strcmp(doc->root->name, "baycomusb")) {
+	if (strcmp(doc->children->name, "baycomusb")) {
 		lprintf(10, "Config file does not contain baycomusb data\n");
 		goto err2;
 	}
-	for (node = doc->root->childs; node; node = node->next) {
+	for (node = doc->children->children; node; node = node->next) {
                 if (!node->name || strcmp(node->name, "device"))
                         continue;
 		cp = xmlGetProp(node, "serial");
@@ -279,7 +279,7 @@ int config_parse(void)
 				strncpy(cfg->serial, cp, sizeof(cfg->serial));
 			}
 		}
-		parseone(node->childs, cfg);
+		parseone(node->children, cfg);
 	}
 	xmlFreeDoc(doc);
 	return 0;
@@ -302,11 +302,11 @@ int config_save(void)
 
 	if (!(doc = xmlNewDoc("1.0")))
 		return -1;
-	doc->root = xmlNewDocNode(doc, NULL, "baycomusb", NULL);
+	doc->children = xmlNewDocNode(doc, NULL, "baycomusb", NULL);
 	for (i = 0, cfg = configs; i < MAXCONFIGENTRIES; i++, cfg++) {
 		if (!cfg->serial[0])
 			continue;
-		node = xmlNewChild(doc->root, NULL, "device", NULL);
+		node = xmlNewChild(doc->children, NULL, "device", NULL);
 		xmlSetProp(node, "serial", cfg->serial);
 		node2 = xmlNewChild(node, NULL, "adapter", NULL);
 		xmlSetProp(node2, "mode", 
--- baycomusb-0.10.orig/trxapp/src/Makefile.am
+++ baycomusb-0.10/trxapp/src/Makefile.am
@@ -2,7 +2,7 @@
 
 INCLUDES = \
 	-I$(top_srcdir)/intl \
-	@ORBIT_CFLAGS@ @GTK_CFLAGS@ @XMLCFLAGS@ \
+	@ORBIT_CFLAGS@ @GTK_CFLAGS@ @XML_CFLAGS@ \
 	-I$(top_srcdir) -I$(top_srcdir)/misc -I$(top_srcdir)/trxapp -I$(top_srcdir)/trxapi
 
 if WIN32
@@ -25,7 +25,7 @@ baycomusbtrx_SOURCES = \
 	signalhist.h signalhist.c \
 	widgets.h widgets.c
 
-baycomusbtrx_LDADD = @INTLLIBS@ @GTK_LIBS@ ../../flexdrv/libtrxapi.a ../../misc/libmisc.a @ORBIT_LIBS@ @XMLLIBS@ \
+baycomusbtrx_LDADD = @INTLLIBS@ @GTK_LIBS@ ../../flexdrv/libtrxapi.a ../../misc/libmisc.a @ORBIT_LIBS@ @XML_LIBS@ \
 	$(RCOBJ) $(DIRECTXLIBS)
 baycomusbtrx_LDFLAGS = $(MWINDOWS)
 
--- baycomusb-0.10.orig/trxapp/src/freqdb.c
+++ baycomusb-0.10/trxapp/src/freqdb.c
@@ -36,8 +36,8 @@
 #else
 
 /* libxml includes */
-#include <tree.h>
-#include <parser.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
 
 #endif
 
@@ -381,7 +381,7 @@ static int deletestn(const char *newname
 	xmlNodePtr node;
 	const char *name;
 
-	for (node = doc->root->childs; node; node = node->next) {
+	for (node = doc->children->children; node; node = node->next) {
                 if (!node->name || strcmp(node->name, "station"))
                         continue;
                 name = xmlGetProp(node, "name");
@@ -402,7 +402,7 @@ static int writestn(const struct stndb_e
 	char buf[32];
 
 	deletestn(ent->name);
-	node = xmlNewChild(doc->root, NULL, "station", NULL);
+	node = xmlNewChild(doc->children, NULL, "station", NULL);
 	if (!node)
 		return -1;
 	xmlSetProp(node, "name", ent->name);
@@ -425,7 +425,7 @@ static int readstns(void)
 	const char *name;
 
 	stns.nrstn = 0;
-	for (node = doc->root->childs; node; node = node->next) {
+	for (node = doc->children->children; node; node = node->next) {
                 if (!node->name || strcmp(node->name, "station"))
                         continue;
                 name = xmlGetProp(node, "name");
@@ -458,17 +458,17 @@ void stndb_open(void)
 	if ((home = getenv("HOME")))
 		snprintf(cfgfile, sizeof(cfgfile), "%s/.t7fstndb", home);
         doc = xmlParseFile(cfgfile);
-	if (doc && (!doc->root || !doc->root->name || strcmp(doc->root->name, "t7fstations"))) {
+	if (doc && (!doc->children || !doc->children->name || strcmp(doc->children->name, "t7fstations"))) {
 		g_printerr("t7f: Invalid configuration file %s\n", cfgfile);
 		xmlFreeDoc(doc);
 		doc = NULL;
 	}
 	if (!doc && (doc = xmlNewDoc("1.0"))) {
-		doc->root = xmlNewDocNode(doc, NULL, "t7fstations", NULL);
+		doc->children = xmlNewDocNode(doc, NULL, "t7fstations", NULL);
 		for (i = 0; i < sizeof(default_stations)/sizeof(default_stations[0]); i++)
 			writestn(&default_stations[i]);
 	}
-	if (!doc || !doc->root) {
+	if (!doc || !doc->children) {
 		g_printerr("t7f: out of memory\n");
 		exit(1);
 	}
--- baycomusb-0.10.orig/trxctrl/Makefile.am
+++ baycomusb-0.10/trxctrl/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = @ORBIT_CFLAGS@ @XMLCFLAGS@ -DCONFIGDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" \
+INCLUDES = @ORBIT_CFLAGS@ @XML_CFLAGS@ -DCONFIGDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" \
 	-I$(top_srcdir) -I$(top_srcdir)/misc -I$(top_srcdir)/usbdrv -I$(top_srcdir)/trxapi \
 	-I$(top_srcdir)/directx/include -I$(top_srcdir)/directx/include/directx6 \
 	-I$(top_srcdir)/kerneldrv -I$(top_srcdir)/wdmdrv -I$(top_srcdir)/flexdrv
@@ -40,7 +40,7 @@ sbin_PROGRAMS = baycomusbserv
 noinst_PROGRAMS = $(PPROG) $(CPROG)
 
 baycomusbserv_SOURCES = trx.h common.c cfgadapt.c list.h $(PSRC)
-baycomusbserv_LDADD = ../trxapi/libtrxapiserver.a @ORBIT_LIBS@ ../usbdrv/libusb.a ../misc/libmisc.a @XMLLIBS@ @LIBTHREAD@ $(DIRECTXLIBS)
+baycomusbserv_LDADD = ../trxapi/libtrxapiserver.a @ORBIT_LIBS@ ../usbdrv/libusb.a ../misc/libmisc.a @XML_LIBS@ @LIBMULTITHREAD@ $(DIRECTXLIBS)
 
 EXTRA_DIST = mainunix.c mainunixuser.c mainwin32.c ifconftest.c \
 	cfgwin32.c cfgunix.c delservice.c common.c \
--- baycomusb-0.10.orig/trxctrl/cfgunix.c
+++ baycomusb-0.10/trxctrl/cfgunix.c
@@ -35,13 +35,14 @@
 #include "trx.h"
 
 /* libxml includes */
-#include <tree.h>
-#include <parser.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
 
 /* ---------------------------------------------------------------------- */
 
 static char configfile[256] = "/etc/ax25/baycomusb.conf";
 static xmlDocPtr doc;
+xmlNodePtr root;
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
 #define FALSE 0
@@ -57,11 +58,11 @@ int config_load(const char *name)
 	if (!(doc = xmlParseFile(configfile))) {
 		if (!(doc = xmlNewDoc("1.0")))
 			goto errmem;
-		if (!(doc->root = xmlNewDocNode(doc, NULL, "baycomusb", NULL)))
+		if (!(doc->children = xmlNewDocNode(doc, NULL, "baycomusb", NULL)))
 			goto errmem;
 		goto retok;
 	}
-	if (strcmp(doc->root->name, "baycomusb")) {
+	if (strcmp(doc->children->name, "baycomusb")) {
 		lprintf(1, "Config file does not contain baycomusb data\n");
 		pthread_mutex_unlock(&mutex);
 		return -1;
@@ -96,7 +97,7 @@ static xmlNodePtr getserialnode(const ch
 	xmlNodePtr node;
 	const char *cp;
 
-	for (node = doc->root->childs; node; node = node->next) {
+	for (node = doc->children->children; node; node = node->next) {
                 if (!node->name || strcmp(node->name, "device"))
                         continue;
 		cp = xmlGetProp(node, "serial");
@@ -106,7 +107,7 @@ static xmlNodePtr getserialnode(const ch
 			continue;
 		return node;
 	}
-	node = xmlNewChild(doc->root, NULL, "device", NULL);
+	node = xmlNewChild(doc->children, NULL, "device", NULL);
 	if (node)
 		xmlSetProp(node, "serial", serial);
 	return node;
@@ -118,7 +119,7 @@ static xmlNodePtr getsectionnode(xmlNode
 {
 	xmlNodePtr node;
 
-	for (node = sernode->childs; node; node = node->next) {
+	for (node = sernode->children; node; node = node->next) {
                 if (!node->name)
 			continue;
 		if (strcmp(node->name, secname))