summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-24 21:34:34 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-24 21:34:34 +0800
commit87ee715abd58bb5709637c5e16d1f0b87257f2af (patch)
tree6827c3a92d8ead8e9dbcc3ba049ccd3d61de4a93
parent235cd1df1e95e75754a5267988e1e13c63c376a3 (diff)
Make libtidy and the handler optional
-rw-r--r--Makefile.am30
-rw-r--r--configure.ac33
2 files changed, 35 insertions, 28 deletions
diff --git a/Makefile.am b/Makefile.am
index 8d4dfc8..c6ef2d1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,21 +1,25 @@
-lib_LTLIBRARIES = libicclient.la
-libicclient_la_SOURCES = \
+lib_LTLIBRARIES = libinterchange.la
+libinterchange_la_SOURCES = \
client.c \
request.c \
- handler.c \
ord.c \
login.c \
member.c \
admin.c
-libicclient_la_CPPFLAGS = -I${prefix}/include $(TIDY_CFLAGS)
-libicclient_la_LDFLAGS = $(TIDY_LIBS)
-if IOS
-libicclient_la_LDFLAGS += -static
-endif
+libinterchange_la_CPPFLAGS = -I${prefix}/include
if WASM
-libicclient_la_LDFLAGS += -static
+libinterchange_la_LDFLAGS = -static
else
-libicclient_la_LDFLAGS += -lcurl
+libinterchange_la_CPPFLAGS += $(CURL_CFLAGS)
+libinterchange_la_LDFLAGS = $(CURL_LIBS)
+endif
+if IOS
+libinterchange_la_LDFLAGS += -static
+endif
+if TIDY
+libinterchange_la_SOURCES += handler.c
+libinterchange_la_CPPFLAGS += $(TIDY_CFLAGS)
+libinterchange_la_LDFLAGS += $(TIDY_LIBS)
endif
include_HEADERS = icclient.h
pkginclude_HEADERS = \
@@ -23,9 +27,3 @@ pkginclude_HEADERS = \
icclient/ord.h \
icclient/member.h \
icclient/admin.h
-#if !WASM
-#bin_PROGRAMS = icclient
-#icclient_SOURCES = main.c client.c request.c handler.c login.c member.c admin.c
-#icclient_CPPFLAGS = $(TIDY_CFLAGS)
-#icclient_LDFLAGS = -lcurl $(TIDY_LIBS)
-#endif
diff --git a/configure.ac b/configure.ac
index cc4846b..4d895be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,27 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AM_PROG_AR
LT_INIT
-PKG_CHECK_MODULES([TIDY], [tidy])
+AC_ARG_WITH([tidy],
+ [AS_HELP_STRING([--with-tidy],
+ [enable HTML parsing with libtidy])],
+ [],
+ [with_tidy=no])
+AS_IF([test "x$with_tidy" != xno],
+ [PKG_CHECK_MODULES([TIDY], [tidy])])
+AM_CONDITIONAL([TIDY], [test "x$with_tidy" = xyes])
+AC_CANONICAL_HOST
+case $host_cpu in
+ *wasm* ) wasm=true;;
+ *) wasm=false;;
+esac
+AM_CONDITIONAL([WASM], [test "x$wasm" = xtrue])
+AS_IF([test "x$wasm" != xtrue],
+ [PKG_CHECK_MODULES([CURL], [libcurl])])
+case $host in
+ *arm*apple-darwin1* ) ios=true;;
+ *) ios=false;;
+esac
+AM_CONDITIONAL([IOS], [test "x$ios" = xtrue])
AC_CHECK_HEADERS([stddef.h, locale.h])
AC_CHECK_HEADERS([threads.h],
[AC_DEFINE([HAVE_THREADS_H])])
@@ -16,17 +36,6 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
-AC_CANONICAL_HOST
-case $host_cpu in
- *wasm* ) wasm=true;;
- *) wasm=false;;
-esac
-AM_CONDITIONAL([WASM], [test x$wasm = xtrue])
-case $host in
- *arm*apple-darwin1* ) ios=true;;
- *) ios=false;;
-esac
-AM_CONDITIONAL([IOS], [test x$ios = xtrue])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT