From 7da97e73384abaf2213b5038e97ae3dbf392e407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Tue, 25 Jan 2022 22:04:11 +0800 Subject: Use cURL when not Emscripten --- Makefile.am | 8 +++++++- configure.ac | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index b6fee15..43a977c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,13 @@ librtclient_la_SOURCES = \ search.c \ client.c librtclient_la_CPPFLAGS = -I${prefix}/include -librtclient_la_LDFLAGS = -L${prefix}/lib -lcurl +librtclient_la_LDFLAGS = -L${prefix}/lib +if EMSCRIPTEN +librtclient_la_LDFLAGS += -static +else +librtclient_la_CPPFLAGS += $(CURL_CFLAGS) +librtclient_la_LDFLAGS += $(CURL_LIBS) +endif include_HEADERS = rtclient.h pkginclude_HEADERS = \ rtclient/user.h \ diff --git a/configure.ac b/configure.ac index 5dbf567..028b315 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,15 @@ AC_FUNC_MALLOC AC_FUNC_REALLOC AC_TYPE_SIZE_T AC_TYPE_SSIZE_T +AC_CANONICAL_HOST +case $host_os in + *emscripten* ) emscripten=true;; + *) emscripten=false;; +esac +if test "x$emscripten" = "xfalse"; then + PKG_CHECK_MODULES([CURL], [libcurl]) +fi +AM_CONDITIONAL([EMSCRIPTEN], [test x$emscripten = xtrue]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT -- cgit v1.2.3