You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.7 KiB

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