Conan_Kudo / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone
Blob Blame History Raw
--- irssi-0.8.18/build-aux/config.sub.orig	2016-02-08 20:16:25.000000000 +0000
+++ irssi-0.8.18/build-aux/config.sub	2016-03-06 18:06:18.154558135 +0000
@@ -804,6 +804,10 @@
 	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	midipix)
+		basic_machine=x86_64-pc
+		os=-midipix
+		;;
 	mingw64)
 		basic_machine=x86_64-pc
 		os=-mingw64
@@ -1384,7 +1388,7 @@
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
--- irssi-0.8.18/src/core/servers.c.orig	2016-01-20 22:08:07.000000000 +0000
+++ irssi-0.8.18/src/core/servers.c	2016-06-13 11:28:49.187797037 +0000
@@ -407,6 +407,36 @@
 		/* connect with unix socket */
 		server_real_connect(server, NULL, server->connrec->address);
 	} else {
+	#ifdef __midipix__
+		IPADDR ip4, ip6, *ip;
+
+		connect_address = server->connrec->proxy != NULL ?
+			server->connrec->proxy : server->connrec->address;
+		if (net_gethostbyname(connect_address, &ip4, &ip6) == -1) {
+			g_warning("net_gethostbyname(): -1");
+			g_free(server->tag);
+			g_free(server->nick);
+			return FALSE;
+		} else if (server->connrec->family == 0) {
+			/* prefer IPv4 addresses */
+			ip = ip4.family != 0 ? &ip4 : &ip6;
+		} else if (server->connrec->family == AF_INET6) {
+			/* IPv6 address, use if possible */
+			if (ip6.family != 0) {
+				ip = &ip6;
+			} else {
+				ip = &ip4;
+			}
+		} else {
+			/* IPv4 address, use if possible */
+			if (ip4.family != 0) {
+				ip = &ip4;
+			} else {
+				ip = &ip6;
+			}
+		}
+		server_real_connect(server, ip, NULL);
+	#else
 		/* resolve host name */
 		if (pipe(fd) != 0) {
 			g_warning("server_connect(): pipe() failed.");
@@ -433,6 +463,7 @@
 		lookup_servers = g_slist_append(lookup_servers, server);
 
 		signal_emit("server looking", 1, server);
+	#endif
 	}
 	return TRUE;
 }