db-move: moved seahorse from [testing] to [extra] (x86_64)
[arch-packages.git] / pacrunner / trunk / duktape-shared.diff
blob0d28fa4c5b8d07bb039d41e5d5a0b0a01d0da66d
1 Makefile.am | 23 ++++++++++++++++++-----
2 configure.ac | 11 ++++++++++-
3 2 files changed, 28 insertions(+), 6 deletions(-)
5 diff --git c/Makefile.am i/Makefile.am
6 index 819abab..964f4c2 100644
7 --- c/Makefile.am
8 +++ i/Makefile.am
9 @@ -28,20 +28,28 @@ builtin_cflags += @CURL_CFLAGS@
10 builtin_libadd += @CURL_LIBS@
11 endif
13 -if DUKTAPE
14 +if DUKTAPE_STATIC
15 js_sources = src/js_funcs.c
16 builtin_modules += duktape
17 builtin_sources += plugins/duktape.c
18 builtin_libadd += duktape/libduktape.a -lm
20 noinst_LIBRARIES += duktape/libduktape.a
22 duktape_libduktape_a_SOURCES = duktape/duk_config.h \
23 duktape/duktape.h \
24 duktape/duktape.c
25 -endif
27 duktape_libduktape_a_SHORTNAME = libduktape
28 +endif
30 +if DUKTAPE_SHARED
31 +js_sources = src/js_funcs.c
32 +builtin_modules += duktape
33 +builtin_sources += plugins/duktape.c
34 +builtin_cflags += @DUKTAPE_CFLAGS@
35 +builtin_libadd += @DUKTAPE_LIBS@ -lm
36 +endif
38 sbin_PROGRAMS = src/pacrunner
40 @@ -102,50 +110,55 @@ noinst_PROGRAMS = unit/test-pacrunner
41 unit_test_pacrunner_SOURCES = unit/test-pacrunner.c src/pacrunner.h \
42 src/proxy.c src/manual.c src/download.c \
43 src/js.c src/log.c src/plugin.c $(js_sources)
45 unit_test_pacrunner_LDADD = @GLIB_LIBS@ @CUNIT_LIBS@ -ldl
47 if CURL
49 unit_test_pacrunner_SOURCES += plugins/curl.c
51 unit_test_pacrunner_LDADD += @CURL_LIBS@
53 endif
55 -if DUKTAPE
56 +if DUKTAPE_STATIC
57 unit_test_pacrunner_SOURCES += plugins/duktape.c
59 unit_test_pacrunner_LDADD += duktape/libduktape.a -lm
60 endif
62 +if DUKTAPE_SHARED
63 +unit_test_pacrunner_SOURCES += plugins/duktape.c
65 +unit_test_pacrunner_LDADD += @DUKTAPE_LIBS@ -lm
66 +endif
68 endif #UNIT
70 AM_CFLAGS = @GLIB_CFLAGS@ @PTHREAD_LIBS@ @DBUS_CFLAGS@ @CUNIT_CFLAGS@ \
71 $(builtin_cflags) \
72 -DPACRUNNER_PLUGIN_BUILTIN \
73 -DPLUGINDIR=\""$(plugindir)"\"
75 AM_CXXFLAGS = $(AM_CFLAGS) -fno-exceptions
77 AM_CPPFLAGS = -I$(builddir)/src -I$(srcdir)/src -I$(srcdir)/gdbus
79 test_scripts = test/find-proxy-for-url test/create-proxy-config
81 if TEST
82 testdir = $(pkglibdir)/test
83 test_SCRIPTS = $(test_scripts)
84 endif
86 CLEANFILES = src/builtin.h
88 EXTRA_DIST = src/genbuiltin src/pacrunner.conf $(test_scripts) \
89 doc/architecture.txt doc/libproxy.txt \
90 doc/manager-api.txt doc/client-api.txt \
91 doc/manual-configuration.txt
93 DISTCHECK_CONFIGURE_FLAGS = --enable-libproxy --disable-datafiles \
94 - --enable-duktape --enable-curl
95 + --enable-duktape=static --enable-curl
97 MAINTAINERCLEANFILES = Makefile.in \
98 aclocal.m4 configure config.h.in config.sub config.guess \
99 diff --git c/configure.ac i/configure.ac
100 index 0f041bd..971d2d1 100644
101 --- c/configure.ac
102 +++ i/configure.ac
103 @@ -67,7 +67,16 @@ AC_ARG_ENABLE(pie, AS_HELP_STRING([--enable-pie],
105 AC_ARG_ENABLE(duktape, AS_HELP_STRING([--enable-duktape],
106 [enable Duktape Javascript plugin support]))
107 -AM_CONDITIONAL(DUKTAPE, test "${enable_duktape}" = "yes")
108 +if (test "${enable_duktape}" = "yes"); then
109 + DUKTAPE_CFLAGS=""
110 + DUKTAPE_LIBS=""
111 + PKG_CHECK_MODULES(DUKTAPE, duktape >= 2.7.0, enable_duktape=shared,
112 + enable_duktape=static)
113 + AC_SUBST(DUKTAPE_CFLAGS)
114 + AC_SUBST(DUKTAPE_LIBS)
116 +AM_CONDITIONAL(DUKTAPE_STATIC, test "${enable_duktape}" = "static")
117 +AM_CONDITIONAL(DUKTAPE_SHARED, test "${enable_duktape}" = "shared")
119 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
120 AC_MSG_ERROR(GLib >= 2.16 is required))