summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-06-19 10:23:21 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-06-19 14:54:59 +0000
commita45dc0fd0bd3675471f4f18a77df0a5785f54ebb (patch)
treeafb27e3d229925534441c85d0fe5cc269ef40a43
parent22e753176e62d3c7377ccb2e51108191a4b41d9d (diff)
downloadostree-a45dc0fd0bd3675471f4f18a77df0a5785f54ebb.tar.gz
build-sys: Add "release build" flag, use for symbol versioning
I was trying to do a release and move the symbols from `-devel.sym` into `-release.sym`, but it turns out that at least GNU binutils `ld` treats an empty version script as a syntax error. Fix this by adding a "release build" flag, and only include `-devel` in non-release builds. This would also make it easier to inject that flag into our `.pc` and `ostree-version.h` and `ostree --version` metadata, but I didn't do that yet. EDIT: Turns out a simpler fix is just to add an empty section. However I kept this commit since it's a useful sanity check for whether we should include `-devel.sym` in builds, and we may want to inject the metadata later. Closes: #942 Approved by: jlebon
-rw-r--r--Makefile-libostree.am7
-rw-r--r--configure.ac9
2 files changed, 10 insertions, 6 deletions
diff --git a/Makefile-libostree.am b/Makefile-libostree.am
index 3c2b6237..61ad1f4a 100644
--- a/Makefile-libostree.am
+++ b/Makefile-libostree.am
@@ -155,8 +155,10 @@ libostree_1_la_SOURCES += \
$(NULL)
endif
-symbol_files = $(top_srcdir)/src/libostree/libostree-released.sym \
- $(top_srcdir)/src/libostree/libostree-devel.sym
+symbol_files = $(top_srcdir)/src/libostree/libostree-released.sym
+if BUILDOPT_IS_DEVEL_BUILD
+symbol_files += $(top_srcdir)/src/libostree/libostree-devel.sym
+endif
if ENABLE_EXPERIMENTAL_API
symbol_files += $(top_srcdir)/src/libostree/libostree-experimental.sym
endif
@@ -164,7 +166,6 @@ endif
wl_versionscript_arg = -Wl,--version-script=
EXTRA_DIST += $(symbol_files)
-
libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(builddir)/src/libostree \
$(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_INTERNAL_GPGME_CFLAGS) $(OT_DEP_LZMA_CFLAGS) $(OT_DEP_ZLIB_CFLAGS) $(OT_DEP_OPENSSL_CFLAGS) \
-fvisibility=hidden '-D_OSTREE_PUBLIC=__attribute__((visibility("default"))) extern'
diff --git a/configure.ac b/configure.ac
index cf8a01b8..448c7f4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,12 +1,13 @@
AC_PREREQ([2.63])
dnl If doing a final release, remember to follow the instructions to
dnl update libostree-released.sym from libostree-devel.sym, and update the checksum
-dnl in test-symbols.sh
+dnl in test-symbols.sh, and also set is_release_build=yes below. Then make
+dnl another post-release commit to bump the version, and set is_release_build=no.
m4_define([year_version], [2017])
m4_define([release_version], [7])
m4_define([package_version], [year_version.release_version])
-
AC_INIT([libostree], [package_version], [walters@verbum.org])
+is_release_build=no
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([buildutil])
AC_CONFIG_AUX_DIR([build-aux])
@@ -458,6 +459,8 @@ AS_IF([test x$enable_experimental_api = xyes],
OSTREE_FEATURES="$OSTREE_FEATURES experimental"]
)
AM_CONDITIONAL([ENABLE_EXPERIMENTAL_API],[test x$enable_experimental_api = xyes])
+AM_CONDITIONAL([BUILDOPT_IS_DEVEL_BUILD],[test x$is_release_build != xyes])
+AM_COND_IF([BUILDOPT_IS_DEVEL_BUILD], release_build_type=devel, release_build_type=release)
AC_CONFIG_FILES([
Makefile
@@ -468,7 +471,7 @@ src/libostree/ostree-version.h
AC_OUTPUT
echo "
- libOSTree $VERSION
+ libOSTree $VERSION ($release_build_type)
===============