From 9386f2ca94b1218c159661a83070f560a2022443 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Tue, 12 Apr 2016 11:06:36 +1000 Subject: [PATCH] build, mingw: set LIBS in configure.ac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of doing it instead Makefile.am, this fixes libuv.pc on MinGW. Previous version generates libuv.pc with LIBS = "-lpthread" instead of "-lpthread -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv" on MinGW. Previous version generates the following Makefile.am: am__append_4 = -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv ... LIBS = -lpthread $(am__append_4) and the following configure.ac: AS_IF([test "x$PKG_CONFIG" != "x"], [ AC_CONFIG_FILES([libuv.pc]) ]) AC_CONFIG_FILES([Makefile]) Therefore, Makefile is generated after libuv.pc. Variables from Makefile don't affect config.status and libuv.pc. PR-URL: https://github.com/libuv/libuv/pull/841 Reviewed-By: Saúl Ibarra Corretgé --- Makefile.am | 1 - configure.ac | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 88b53624..05ccd58a 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 2d5a3b9d..4f861968 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"])