]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
install: makefile target to install libraries
authorJason Ish <jason.ish@oisf.net>
Thu, 11 Feb 2021 22:10:02 +0000 (16:10 -0600)
committerJason Ish <jason.ish@oisf.net>
Tue, 16 Feb 2021 17:43:26 +0000 (11:43 -0600)
As we don't install the libraries by default, provide a make target,
"install-library" to install the libsuricata library files.

If shared library support exists, both the static and shared
libraries will be installed, otherwise only the static libraries
will be installed.

Makefile.am
configure.ac
rust/Makefile.am
src/Makefile.am

index d6c4503c0559b45672e50c98d297947c65c0ddd6..5bcf9280a856d6e2b2780049480806f1cb112b90 100644 (file)
@@ -54,3 +54,7 @@ endif
        @echo "For more information please see:"
        @echo "  https://suricata.readthedocs.io/en/latest/rule-management/index.html"
        @echo ""
+
+install-library:
+       cd src && $(MAKE) $@
+       cd rust && $(MAKE) $@
index 4662fc64e32777696e239610ba487f610102095c..2caccc4cfd7f29b5204b306c533d2cc0b0cef2e5 100644 (file)
@@ -2680,6 +2680,7 @@ AC_SUBST(CONFIGURE_DATAROOTDIR)
 AC_SUBST(PACKAGE_VERSION)
 AC_SUBST(RUST_FEATURES)
 AC_SUBST(RUST_SURICATA_LIBDIR)
+AC_SUBST(RUST_SURICATA_LIBNAME)
 
 AM_CONDITIONAL([BUILD_SHARED_LIBRARY], [test "x$enable_shared" = "xyes"] && [test "x$can_build_shared_library" = "xyes"])
 
index 10dbb3051938a8d34c3e4ceb9f0862b2ece1bb53..a8c360e4234358f856c09e7b9e645ada090efdec 100644 (file)
@@ -51,6 +51,13 @@ endif
        fi
        $(MAKE) gen/rust-bindings.h
 
+install-library:
+       $(MKDIR_P) "$(DESTDIR)$(libdir)"
+       $(INSTALL_DATA) $(RUST_SURICATA_LIB) "$(DESTDIR)$(libdir)"
+
+uninstall-local:
+       rm -f "$(DESTDIR)$(libdir)/$(RUST_SURICATA_LIBNAME)"
+
 clean-local:
        rm -rf target
 if HAVE_CBINDGEN
index 27577ec1c739b274d33f4943393228744010f86c..6be971733a58977296834674b3729c384fd59f60 100755 (executable)
@@ -608,6 +608,23 @@ libsuricata.so:
        @exit 1
 endif
 
+if BUILD_SHARED_LIBRARY
+install-library: libsuricata.so.$(VERSION)
+else
+install-library:
+endif
+       $(MKDIR_P) "$(DESTDIR)$(libdir)"
+       $(INSTALL_DATA) libsuricata_c.a "$(DESTDIR)$(libdir)"
+if BUILD_SHARED_LIBRARY
+       $(INSTALL) libsuricata.so.$(VERSION) "$(DESTDIR)$(libdir)"
+       ln -sf libsuricata.so.$(VERSION) "$(DESTDIR)$(libdir)/libsuricata.so"
+endif
+
+uninstall-local:
+       rm -f "$(DESTDIR)$(libdir)/libsuricata_c.a"
+       rm -f "$(DESTDIR)$(libdir)/libsuricata.so"
+       rm -f "$(DESTDIR)$(libdir)/libsuricata.$(VERSION)"
+
 if BUILD_FUZZTARGETS
 
 LDFLAGS_FUZZ = $(all_libraries) $(SECLDFLAGS)