Skip to content

Commit

Permalink
Attempt to match libsoname with rust versioning
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Jun 22, 2021
1 parent 70714f4 commit b035779
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ doxyxml
cov*
*target/
*Cargo.lock
*Cargo.toml
*libknet/bindings/rust/src/sys/libknet.rs
*libnozzle/bindings/rust/src/sys/libnozzle.rs
*build.rs
1 change: 0 additions & 1 deletion build-aux/rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#

RUST_COMMON = \
Cargo.toml \
build.rs.in

RUST_SRCS = $(RUST_SHIP_SRCS) $(RUST_BUILT_SRCS)
Expand Down
28 changes: 28 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,30 @@ if test "x$enable_libnozzle" = xyes; then
fi
fi

# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
knetcurrent="2"
knetrevision="0"
knetage="0"
# c:r:a
libknetversion="$knetcurrent:$knetrevision:$knetage"
# soname derived from c:r:a
# use $VERSION as build info https://semver.org/. build info are incremental automatically
knetalpha="-alpha1"
libknetrustver="$(($knetcurrent - $knetage)).$knetage.$knetrevision$knetalpha+$VERSION"

nozzlecurrent="1"
nozzlerevision="0"
nozzleage="0"
libnozzleversion="$nozzlecurrent:$nozzlerevision:$nozzleage"
# nozzle is stable for now
nozzlealpha=""
libnozzlerustver="$(($nozzlecurrent - $nozzleage)).$nozzleage.$nozzlerevision$nozzlealpha+$VERSION"

AC_SUBST([libknetversion])
AC_SUBST([libknetrustver])
AC_SUBST([libnozzleversion])
AC_SUBST([libnozzlerustver])

# local options
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],[enable debug build])])
Expand Down Expand Up @@ -437,13 +461,17 @@ AC_CONFIG_FILES([
libnozzle/tests/Makefile
libnozzle/bindings/Makefile
libnozzle/bindings/rust/Makefile
libnozzle/bindings/rust/Cargo.toml
libnozzle/bindings/rust/tests/Makefile
libnozzle/bindings/rust/tests/Cargo.toml
libknet/Makefile
libknet/libknet.pc
libknet/tests/Makefile
libknet/bindings/Makefile
libknet/bindings/rust/Makefile
libknet/bindings/rust/Cargo.toml
libknet/bindings/rust/tests/Makefile
libknet/bindings/rust/tests/Cargo.toml
man/Makefile
man/Doxyfile-knet
man/Doxyfile-nozzle
Expand Down
5 changes: 1 addition & 4 deletions libknet/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ EXTRA_DIST = $(SYMFILE)

SUBDIRS = . tests bindings

# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libversion = 2:0:0

# override global LIBS that pulls in lots of craft we don't need here
LIBS =

Expand Down Expand Up @@ -100,7 +97,7 @@ EXTRA_libknet_la_DEPENDENCIES = $(SYMFILE)

libknet_la_LDFLAGS = $(AM_LDFLAGS) \
-Wl,--version-script=$(srcdir)/$(SYMFILE) \
-version-info $(libversion)
-version-info $(libknetversion)

libknet_la_LIBADD = $(PTHREAD_LIBS) $(dl_LIBS) $(rt_LIBS) $(m_LIBS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[package]
name = "knet-bindings"
version = "0.1.0"
version = "@libknetrustver@"
authors = ["Christine Caulfield <ccaulfie@redhat.com>"]
edition = "2018"
readme = "README"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[package]
name = "knet-bindings-tests"
version = "0.1.0"
version = "@libknetrustver@"
authors = ["Christine Caulfield <ccaulfie@redhat.com>"]
edition = "2018"

Expand Down
4 changes: 1 addition & 3 deletions libnozzle/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ if BUILD_LIBNOZZLE

SUBDIRS = . tests bindings

libversion = 1:0:0

sources = libnozzle.c \
internals.c

Expand All @@ -42,7 +40,7 @@ EXTRA_libnozzle_la_DEPENDENCIES = $(SYMFILE)

libnozzle_la_LDFLAGS = $(AM_LDFLAGS) \
-Wl,-version-script,$(srcdir)/$(SYMFILE) \
-version-info $(libversion)
-version-info $(libnozzleversion)

libnozzle_la_LIBADD = $(PTHREAD_LIBS) $(libnl_LIBS) $(libnlroute_LIBS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[package]
name = "nozzle-bindings"
version = "0.1.0"
version = "@libnozzlerustver@"
authors = ["Christine Caulfield <ccaulfie@redhat.com>"]
edition = "2018"
readme = "README"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[package]
name = "nozzle-bindings-tests"
version = "0.1.0"
version = "@libnozzlerustver@"
authors = ["Christine Caulfield <ccaulfie@redhat.com>"]
edition = "2018"

Expand Down

0 comments on commit b035779

Please sign in to comment.