aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2016-08-19 23:19:23 +0200
committerMarcel Holtmann <marcel@holtmann.org>2016-08-19 23:19:23 +0200
commit01b0aa14082f646b551ca3cf75d872d88501f844 (patch)
tree20dd0d164c386e286e1eddbaddca98807e26d19f
parentc2431c607f16bd950e9bc8ee26ecf5d0d2c4e2be (diff)
downloadpacrunner-01b0aa14082f646b551ca3cf75d872d88501f844.tar.gz
build: Only link -lcunit for unit tests itself
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac21
2 files changed, 11 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index 5564b0a..ee84b75 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -126,7 +126,7 @@ unit_test_pacrunner_SOURCES = unit/test-pacrunner.c src/pacrunner.h \
src/proxy.c src/manual.c src/download.c \
src/js.c src/log.c src/plugin.c $(js_sources)
-unit_test_pacrunner_LDADD = @GLIB_LIBS@ -ldl
+unit_test_pacrunner_LDADD = @GLIB_LIBS@ @CUNIT_LIBS@ -ldl
if CURL
@@ -162,7 +162,7 @@ endif
endif #UNIT
-AM_CFLAGS = @GLIB_CFLAGS@ @PTHREAD_LIBS@ @DBUS_CFLAGS@ \
+AM_CFLAGS = @GLIB_CFLAGS@ @PTHREAD_LIBS@ @DBUS_CFLAGS@ @CUNIT_CFLAGS@ \
$(builtin_cflags) \
-DPACRUNNER_PLUGIN_BUILTIN \
-DPLUGINDIR=\""$(plugindir)"\"
diff --git a/configure.ac b/configure.ac
index d31cdcc..42a64a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,15 +49,15 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
])
AC_ARG_ENABLE(unit, AC_HELP_STRING([--enable-unit],
- [enable compiling unit test binaries]), [
- if (test "${enable_unit}" = "yes"); then
- AC_CHECK_LIB([cunit], [CU_initialize_registry], [], [
- AC_MSG_ERROR([CUnit is required to get the unit tests])
- ])
- LDFLAGS="$LDFLAGS -lcunit"
- fi
-])
-
+ [enable compiling unit test binaries]))
+if (test "${enable_unit}" = "yes"); then
+ AC_CHECK_LIB([cunit], CU_initialize_registry, dummy=yes,
+ AC_MSG_ERROR([CUnit is required to get the unit tests]))
+ CUNIT_CFLAGS=""
+ CUNIT_LIBS="-lcunit"
+ AC_SUBST(CUNIT_CFLAGS)
+ AC_SUBST(CUNIT_LIBS)
+fi
AM_CONDITIONAL(UNIT, test "${enable_unit}" = "yes")
AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
@@ -71,7 +71,6 @@ AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
AC_ARG_ENABLE(duktape, AC_HELP_STRING([--enable-duktape],
[enable Duktape Javascript plugin support]))
-
AM_CONDITIONAL(DUKTAPE, test "${enable_duktape}" = "yes")
AC_ARG_ENABLE(mozjs, AC_HELP_STRING([--enable-mozjs],
@@ -79,13 +78,11 @@ AC_ARG_ENABLE(mozjs, AC_HELP_STRING([--enable-mozjs],
if (test "${enable_mozjs}" = "yes"); then
PKG_CHECK_MODULES(MOZJS, mozjs185, dummy=yes,
AC_MSG_ERROR(Mozilla Javascript >= 1.8 is required))
-
AC_SUBST(MOZJS_CFLAGS)
AC_SUBST(MOZJS_LIBS)
fi
AM_CONDITIONAL(MOZJS, test "${enable_mozjs}" = "yes")
-
AC_ARG_ENABLE(v8, AC_HELP_STRING([--enable-v8],
[enable V8 Javascript plugin support]))
if (test "${enable_v8}" = "yes"); then