diff options
author | Tony Theodore <tonyt@logyst.com> | 2016-04-14 04:11:14 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2016-04-14 04:11:14 (GMT) |
commit | 27c184880a82de525e53378c80143695fad5428c (patch) | |
tree | 78d749cf65af0fa47a33d19cbdfe9a34122f0a8f /src | |
parent | d09c67e1f031ead458f3479f903f4e9dc2cbdfb9 (diff) | |
parent | 6c36b8acb4b683d97f2caf9141464a3532761663 (diff) | |
download | mxe-27c184880a82de525e53378c80143695fad5428c.zip mxe-27c184880a82de525e53378c80143695fad5428c.tar.gz mxe-27c184880a82de525e53378c80143695fad5428c.tar.bz2 |
Merge #1291 add libuv
from LuaAndC/libuv
Diffstat (limited to 'src')
-rw-r--r-- | src/libuv-1-fixes.patch | 37 | ||||
-rw-r--r-- | src/libuv-test.c | 15 | ||||
-rw-r--r-- | src/libuv.mk | 28 |
3 files changed, 80 insertions, 0 deletions
diff --git a/src/libuv-1-fixes.patch b/src/libuv-1-fixes.patch new file mode 100644 index 0000000..6a5a197 --- /dev/null +++ b/src/libuv-1-fixes.patch @@ -0,0 +1,37 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tony Theodore <tonyt@logyst.com> +Date: Tue, 12 Apr 2016 11:06:36 +1000 +Subject: [PATCH] set LIBS in configure.ac instead of Makefile.am + + +diff --git a/Makefile.am b/Makefile.am +index 1111111..2222222 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -45,7 +45,6 @@ include_HEADERS += include/uv-win.h include/tree.h + AM_CPPFLAGS += -I$(top_srcdir)/src/win \ + -DWIN32_LEAN_AND_MEAN \ + -D_WIN32_WINNT=0x0600 +-LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv + libuv_la_SOURCES += src/win/async.c \ + src/win/atomicops-inl.h \ + src/win/core.c \ +diff --git a/configure.ac b/configure.ac +index 1111111..2222222 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -58,6 +58,9 @@ AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false]) + AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])]) + AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])]) + AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])]) ++AS_CASE([$host_os],[mingw*], [ ++ LIBS="$LIBS -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv" ++]) + AC_CHECK_HEADERS([sys/ahafs_evProds.h]) + AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes) + AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"]) diff --git a/src/libuv-test.c b/src/libuv-test.c new file mode 100644 index 0000000..a31bf88 --- /dev/null +++ b/src/libuv-test.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include <stdlib.h> +#include <uv.h> + +int main() { + uv_loop_t *loop = malloc(sizeof(uv_loop_t)); + uv_loop_init(loop); + + printf("Now quitting.\n"); + uv_run(loop, UV_RUN_DEFAULT); + + uv_loop_close(loop); + free(loop); + return 0; +} diff --git a/src/libuv.mk b/src/libuv.mk new file mode 100644 index 0000000..5dd70a2 --- /dev/null +++ b/src/libuv.mk @@ -0,0 +1,28 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := libuv +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.8.0 +$(PKG)_CHECKSUM := 6511f734da4fe082dacf85967606d600b7bce557bb9b2f0d2539193535323125 +$(PKG)_SUBDIR := $(PKG)-v$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-v$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://dist.libuv.org/dist/v$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + $(call MXE_GET_GITHUB_TAGS, libuv/libuv, v) +endef + +define $(PKG)_BUILD + cd '$(1)' && sh autogen.sh + cd '$(1)' && ./configure \ + $(MXE_CONFIGURE_OPTS) + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install + + '$(TARGET)-gcc' \ + -W -Wall -Werror -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ + `'$(TARGET)-pkg-config' $(PKG) --libs` +endef |