From 6d18658c5ef71eae29572f80d7c916397bf685c6 Mon Sep 17 00:00:00 2001 From: Leif Middelschulte Date: Sun, 24 Feb 2013 23:59:11 +0000 Subject: [PATCH] Add libbsd dependency for Linux. Use on all other systems. SVN revision: 84352 --- configure.ac | 10 ++++++++++ src/Makefile.am | 5 +++-- src/sourcedrop.c | 6 +++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 4344630..5b27776 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,16 @@ AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture") PKG_CHECK_MODULES(JSON, [json]) +# +# Platform specific setup +# +############################# +case $host_os in + linux*) + PKG_CHECK_MODULES(BSD, [libbsd]) + ;; +esac + # Find edje_cc PKG_CHECK_MODULES(EDJE, [edje >= 0.5.0]) AC_ARG_WITH(edje-cc, diff --git a/src/Makefile.am b/src/Makefile.am index 87ed16d..dcfd792 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,8 @@ INCLUDES = -I. \ -I$(top_srcdir) \ -I$(includedir) \ @E_CFLAGS@ \ - @JSON_CFLAGS@ + @JSON_CFLAGS@ \ + @BSD_CFLAGS@ pkgdir = $(datadir)/$(MODULE_ARCH) pkg_LTLIBRARIES = module.la @@ -13,7 +14,7 @@ module_la_SOURCES = e_mod_main.c \ e_share.h \ sourcedrop.c -module_la_LIBADD = @E_LIBS@ @JSON_LIBS@ -lm -lbsd +module_la_LIBADD = @E_LIBS@ @JSON_LIBS@ @BSD_LIBS@ -lm module_la_LDFLAGS = -module -avoid-version module_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/src/sourcedrop.c b/src/sourcedrop.c index 274457c..8a790a9 100644 --- a/src/sourcedrop.c +++ b/src/sourcedrop.c @@ -1,6 +1,10 @@ #include #include -#include +#ifdef __linux__ +#include // strlcpy, etc. found in libbsd +#else +#include +#endif #include "e_mod_main.h" #include "e_share.h"