Patch xmlrpc-epi

From Second Life Wiki
Jump to navigation Jump to search

patch 1

Save this into the file linden/xmlrpc-epi-0.51/remove_iconv.patch

--- xmlrpc-epi-0.51/src/encodings.c	2002-03-12 10:08:18.000000000 -0800
+++ src/src/encodings.c	2006-05-02 08:16:07.000000000 -0700
@@ -35,12 +35,18 @@
 
 #include <stdlib.h>
 #include <errno.h>
-#include <iconv.h>
+//#include <iconv.h>
 #include "encodings.h"
 
 static char* convert(const char* src, int src_len, int *new_len, const char* from_enc, const char* to_enc) {
    char* outbuf = 0;
 
+   /*
+	*
+	*NOTE: Removed becuase windows does not have iconv, and mac
+	*      has link problems with it. For now, always use UTF8.
+	*
+
    if(src && src_len && from_enc && to_enc) {
       int outlenleft = src_len;
       int outlen = src_len;
@@ -87,6 +93,7 @@
          outbuf[outlen] = 0;
       }
    }
+   */
    return outbuf;
 }

Apply the patch:

patch -p1 < remove_iconv.patch

patch 2

Save this into the file linden/xmlrpc-epi-0.51/rename_queue.patch:

--- xmlrpc-epi-0.51-old/src/queue.h	2001-05-18 10:29:09.000000000 -0700
+++ xmlrpc-epi-0.51-new/src/queue.h	2006-05-02 14:25:30.573246791 -0700
@@ -24,6 +24,9 @@
    #define True_ 1
 #endif
 
+/* 2006-05-02 Inserted to enable compilation of rpcserver on linux. Phoenix */
+#define queue xmlrpc_queue
+
 typedef struct nodeptr datanode;
 
 typedef struct nodeptr {

Apply the patch:

patch -p1 < rename_queue.patch

patch 3

Save this into the file linden/xmlrpc-epi-0.51/excise_expat.patch:

--- xmlrpc-epi-0.51/configure.in.orig	2002-06-24 01:48:29.000000000 +0200
+++ xmlrpc-epi-0.51/configure.in	2007-02-19 12:33:04.000000000 +0100
@@ -19,8 +19,7 @@
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h)
-
+AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h expat.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -35,8 +34,9 @@
 AC_FUNC_STRFTIME
 
 AC_CHECK_FUNCS(mktime strstr)
+AC_CHECK_LIB(expat, XML_Parse, , [AC_MSG_ERROR(libexpat not found)])
 
-AC_OUTPUT(src/Makefile Makefile sample/Makefile expat/Makefile expat/xmltok/Makefile expat/xmlparse/Makefile)
+AC_OUTPUT(src/Makefile Makefile sample/Makefile)
 
 
 
--- xmlrpc-epi-0.51/Makefile.am.orig	2001-04-10 03:37:40.000000000 +0200
+++ xmlrpc-epi-0.51/Makefile.am	2007-02-19 12:16:17.000000000 +0100
@@ -1,4 +1,4 @@
-SUBDIRS = expat src sample
+SUBDIRS = src sample
 
 CHANGE_LOG_GEN_BIN = scripts/cvs2cl.pl
 CHANGE_LOG_GEN_FLAGS = -t -r -b --accum -I ChangeLog --gmt --prune
--- xmlrpc-epi-0.51/src/Makefile.am.orig	2001-09-16 22:27:27.000000000 +0200
+++ xmlrpc-epi-0.51/src/Makefile.am	2007-02-19 12:16:35.000000000 +0100
@@ -1,9 +1,5 @@
-INCLUDES=-I../liblm -I../expat/xmltok -I../expat/xmlparse -I/usr/local/ssl/include 
-
 lib_LTLIBRARIES = libxmlrpc.la
 
-libxmlrpc_la_LIBADD = ../expat/xmltok/libexpat_tok.la ../expat/xmlparse/libexpat_parse.la
-
 libxmlrpc_la_SOURCES = \
 	base64.c \
 	encodings.c \
--- xmlrpc-epi-0.51/src/xml_element.c.orig	2007-02-19 12:23:38.000000000 +0100
+++ xmlrpc-epi-0.51/src/xml_element.c	2007-02-19 22:23:45.000000000 +0100
@@ -91,7 +91,7 @@
 
 #include "xml_element.h"
 #include "queue.h"
-#include "xmlparse.h"
+#include "expat.h"
 #include "encodings.h"
 
 #define my_free(thing)  if(thing) {free(thing); thing = 0;}
--- xmlrpc-epi-0.51/src/xmlrpc.c.orig	2007-02-19 12:23:33.000000000 +0100
+++ xmlrpc-epi-0.51/src/xmlrpc.c	2007-02-19 22:24:29.000000000 +0100
@@ -121,7 +121,7 @@
 
 #include "queue.h"
 #include "xmlrpc.h"
-#include "xmlparse.h"
+#include "expat.h"
 #include "base64.h"
 
 #include "xml_to_xmlrpc.h"

Apply the patch:

patch -p1 < excise_expat.patch