diff --git a/lib/libpe b/lib/libpe index c2502c68..b760e280 160000 --- a/lib/libpe +++ b/lib/libpe @@ -1 +1 @@ -Subproject commit c2502c680937387ce4defc532362b5395b321776 +Subproject commit b760e280b86724cc85cda8667b03f14a5b775e82 diff --git a/src/Makefile b/src/Makefile index d646602e..71f0feab 100644 --- a/src/Makefile +++ b/src/Makefile @@ -151,7 +151,7 @@ $(pev_BUILDDIR)/%.o: %.c install: installdirs for prog in $(PROGS); do \ - $(INSTALL_PROGRAM) $(pev_BUILDDIR)/$$prog $(DESTDIR)$(bindir); \ + $(INSTALL_PROGRAM) $(INSTALL_FLAGS) $(pev_BUILDDIR)/$$prog $(DESTDIR)$(bindir); \ $(CHK_FILE_EXISTS) $(MANDIR)/$$prog$(man1ext) && \ gzip -c -9 $(MANDIR)/$$prog$(man1ext) > $(DESTDIR)$(man1dir)/$$prog$(man1ext).gz || \ echo -n; \ @@ -160,6 +160,9 @@ install: installdirs $(INSTALL_DATA) $(srcdir)/userdb.txt $(DESTDIR)$(SHAREDIR) cd $(PLUGINS_DIR) && $(MAKE) $@ +install-strip: INSTALL_FLAGS += -s +install-strip: install + installdirs: @$(CHK_DIR_EXISTS) $(DESTDIR) || $(MKDIR) $(DESTDIR) @$(CHK_DIR_EXISTS) $(DESTDIR)$(bindir) || $(MKDIR) $(DESTDIR)$(bindir) diff --git a/src/config.c b/src/config.c index 86f47dca..825d7a1f 100644 --- a/src/config.c +++ b/src/config.c @@ -40,11 +40,7 @@ #include #if defined(__linux__) #include -#elif defined(__NetBSD__) -#include -#elif defined(__APPLE__) -#include -#elif defined(__CYGWIN__) +#elif defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) #include #endif diff --git a/src/plugins.c b/src/plugins.c index 74880434..a22faba5 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -167,7 +167,7 @@ int plugins_load_all_from_directory(const char *path) { const char *filename = dir_entry->d_name; // TODO(jweyrich): Use macro conditions for each system: .so, .dylib, .dll -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) const bool possible_plugin = utils_str_ends_with(filename, ".so") != 0; #elif defined(__APPLE__) const bool possible_plugin = utils_str_ends_with(filename, ".dylib") != 0; diff --git a/src/plugins/Makefile b/src/plugins/Makefile index 1bd329e4..e5f45eb7 100644 --- a/src/plugins/Makefile +++ b/src/plugins/Makefile @@ -57,6 +57,12 @@ json: $(json_OBJS) $(PLUGINS): ifeq ($(PLATFORM_OS), Linux) $(LINK) -shared -Wl,-soname,$(LIBNAME).so.1 $(LDFLAGS) -o ${plugins_BUILDDIR}/$(LIBNAME).so $^ +else ifeq ($(PLATFORM_OS), NetBSD) + $(LINK) -shared -Wl,-soname,$(LIBNAME).so.1 $(LDFLAGS) -o ${plugins_BUILDDIR}/$(LIBNAME).so $^ +else ifeq ($(PLATFORM_OS), FreeBSD) + $(LINK) -shared -Wl,-soname,$(LIBNAME).so.1 $(LDFLAGS) -o ${plugins_BUILDDIR}/$(LIBNAME).so $^ +else ifeq ($(PLATFORM_OS), OpenBSD) + $(LINK) -shared -Wl,-soname,$(LIBNAME).so.1 $(LDFLAGS) -o ${plugins_BUILDDIR}/$(LIBNAME).so $^ else ifeq ($(PLATFORM_OS), Darwin) $(LINK) -headerpad_max_install_names -dynamiclib \ -undefined dynamic_lookup -fno-common \ @@ -77,11 +83,14 @@ clean: ### install: installdirs - $(INSTALL_PROGRAM) -m 755 $(plugins_BUILDDIR)/$(csv_LIBNAME).* $(DESTDIR)$(pluginsdir) - $(INSTALL_PROGRAM) -m 755 $(plugins_BUILDDIR)/$(html_LIBNAME).* $(DESTDIR)$(pluginsdir) - $(INSTALL_PROGRAM) -m 755 $(plugins_BUILDDIR)/$(text_LIBNAME).* $(DESTDIR)$(pluginsdir) - $(INSTALL_PROGRAM) -m 755 $(plugins_BUILDDIR)/$(xml_LIBNAME).* $(DESTDIR)$(pluginsdir) - $(INSTALL_PROGRAM) -m 755 $(plugins_BUILDDIR)/$(json_LIBNAME).* $(DESTDIR)$(pluginsdir) + $(INSTALL_PROGRAM) $(INSTALL_FLAGS) -m 755 $(plugins_BUILDDIR)/$(csv_LIBNAME).* $(DESTDIR)$(pluginsdir) + $(INSTALL_PROGRAM) $(INSTALL_FLAGS) -m 755 $(plugins_BUILDDIR)/$(html_LIBNAME).* $(DESTDIR)$(pluginsdir) + $(INSTALL_PROGRAM) $(INSTALL_FLAGS) -m 755 $(plugins_BUILDDIR)/$(text_LIBNAME).* $(DESTDIR)$(pluginsdir) + $(INSTALL_PROGRAM) $(INSTALL_FLAGS) -m 755 $(plugins_BUILDDIR)/$(xml_LIBNAME).* $(DESTDIR)$(pluginsdir) + $(INSTALL_PROGRAM) $(INSTALL_FLAGS) -m 755 $(plugins_BUILDDIR)/$(json_LIBNAME).* $(DESTDIR)$(pluginsdir) + +install-strip: INSTALL_FLAGS += -s +install-strip: install installdirs: @$(CHK_DIR_EXISTS) $(DESTDIR)$(pluginsdir) || $(MKDIR) $(DESTDIR)$(pluginsdir)