1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-15 20:03:57 +02:00
openwrt-packages/net/addrwatch/patches/004-more-specific-library-linking.patch
Jeffery To 31ae85bca9
addrwatch: Various fixes
Makefile changes include:

* Remove USE_UCLIBC, as uclibc is no longer supported

* Package output modules

* Move main binary (back) to /usr/sbin, as it is system administration
  related and requires superuser privileges

New patches:

* 003-add-space-for-null-byte.patch - from
  374cfd2cab

* 004-more-specific-library-linking.patch - from
  27b57d9da3

* 005-use-c99-format-macro-constants.patch - from
  https://github.com/fln/addrwatch/pull/28

Init script changes include:

* Change from explicit disable to explicit enable, so that the service
  is disabled by default and on first install

* Set config option default values to default values of the main binary

* Fix command-line option names and format (from
  https://forum.openwrt.org/t/cant-start-addrwatch-service/60499/3)

* Always use the --quiet command-line option, as the procd instance is
  not configured to capture stdout/stderr

* Change the syslog config option to start the syslog output module

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-07-07 00:18:47 +08:00

47 lines
1.7 KiB
Diff

From 1988f6228225e10bccc50941798f1e1b4ca1ff62 Mon Sep 17 00:00:00 2001
From: Jeffery To <jeffery.to@gmail.com>
Date: Fri, 18 Jun 2021 15:46:47 +0800
Subject: [PATCH] More specific library linking
Currently, the main binary and all output modules are linked to the same
set of libraries. This changes the linking so that only the main binary
is linked to pcap, and only addrwatch_mysql is linked to mysqlclient.
This allows the main binary and output modules to be packaged separately
with fewer dependencies for each individual package.
---
configure.ac | 4 ++--
src/Makefile.am | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@ optional_modules=""
AC_SUBST([optional_modules])
# Checks for libraries.
-AC_CHECK_LIB([pcap], [pcap_open_live])
+AC_CHECK_LIB([pcap], [pcap_open_live], :)
AC_CHECK_LIB([rt], [shm_open])
PKG_CHECK_MODULES(LIBEVENT, [libevent >= 1.4], , [
@@ -46,7 +46,7 @@ AC_ARG_ENABLE([sqlite3],
)
AC_ARG_ENABLE([mysql],
AS_HELP_STRING([--enable-mysql], [Enable MySQL database output]),
- AC_CHECK_LIB([mysqlclient], [mysql_real_connect], , [
+ AC_CHECK_LIB([mysqlclient], [mysql_real_connect], :, [
AC_MSG_ERROR([Unable to find libmysqlclient.])
])
optional_modules="${optional_modules} addrwatch_mysql"
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,5 +9,6 @@ addrwatch_stdout_SOURCES = addrwatch_std
addrwatch_syslog_SOURCES = addrwatch_syslog.c shm_client.c shm_client.h
addrwatch_mysql_SOURCES = addrwatch_mysql.c shm_client.c shm_client.h util.c util.h
-addrwatch_LDADD = @LIBEVENT_LIBS@
+addrwatch_LDADD = @LIBEVENT_LIBS@ -lpcap
+addrwatch_mysql_LDADD = -lmysqlclient