Skip to content

Commit

Permalink
switch to semantic versioning: 3.7, change PACKAGE name
Browse files Browse the repository at this point in the history
the tardist name went from libsafec-02092020 to safeclib-3.7.
this should stay the established public name.
packagers still should use libsafec and libsafec-devel for the lib parts.

without git tag versioning for now.
See GH rurban#91
  • Loading branch information
rurban committed Mar 19, 2021
1 parent f46a336 commit dbdf460
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 26 deletions.
10 changes: 7 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,11 @@ CLEANFILES += Doxyfile doc/footer
MAINTAINERCLEANFILES = *~ README.rst

# avoid parallel doxygen
if HAVE_DOXYGEN
$(dist_man_MANS) ::
doc/man/man3/EOK.3 :: Doxyfile README.rst doc/footer include/safe_config.h
-rm $@
doxygen

$(DOXYGEN)
docs man: Doxyfile doc/footer $(BUILT_SOURCES) README.rst \
doc/man/man1/check_for_unsafe_apis.1 doc/man/man3/EOK.3
-rm -rf doc/man/man3/d[0-9a-f]
Expand Down Expand Up @@ -561,8 +561,11 @@ docs man: Doxyfile doc/footer $(BUILT_SOURCES) README.rst \
-rm doc/man/man3/handle_{,w,mem_}error.3
-rm doc/man/man3/handle_{str,mem}_bos_*.3
-rm doc/man/man3/handle_str_src_bos_*.3
endif
if HAVE_PANDOC
README.rst: README.md
pandoc -o README.rst README.md
endif
all-local: Doxyfile doc/footer
clean-local:
rm -rf $(builddir)/doc/html
Expand Down Expand Up @@ -612,6 +615,7 @@ gh-pages: docs
release: docs distcheck
git branch |grep '^* master'
git tag -f v`date +%d%m%Y`
git tag -f $(PACKAGE_VERSION)
build-aux/autogen.sh
./configure
$(MAKE)
Expand All @@ -626,6 +630,6 @@ release: docs distcheck
$(MAKE) docs
$(MAKE) gh-pages
git branch |grep '^* gh-pages'
git commit -m"Update to v`date +%d%m%Y`"
git commit -m"Update to $(PACKAGE_VERSION)"
git push
git checkout master
29 changes: 21 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@
AC_PREREQ([2.69])

# information on the package
AC_INIT([Safe C Library],
[m4_esyscmd(build-aux/version-gen.sh .tarball-version)],
#AC_SUBST([PACKAGE_VERSION], [3.7])
AC_INIT([Safe C Library], [3.7],
[https://github.com/rurban/safeclib/issues],
[libsafec],
[http://github.com/rurban/safeclib/])
[safeclib], [http://github.com/rurban/safeclib/])

# Configure the configure script
# ===============================================
Expand Down Expand Up @@ -81,7 +80,6 @@ PKG_INSTALLDIR

# Global Variable & Defaults
# ===============================================

# Keep this in sync with what is passed in AC_INIT
TARBALL_VERSION_FILE=".tarball-version"

Expand All @@ -98,6 +96,16 @@ dnl enable_static=no
dnl ;;
dnl esac

AC_MSG_CHECKING([package version])
AC_MSG_RESULT($PACKAGE_VERSION)
AC_MSG_CHECKING([so version-info])
AC_MSG_RESULT($SAFECLIB_SO_VERSION)

ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)

AC_CANONICAL_HOST

# Configure options
# ===============================================

Expand Down Expand Up @@ -654,6 +662,10 @@ AC_CHECK_PROGS([POD2MAN], [pod2man])
if test -z "POD2MAN";
then AC_MSG_WARN([pod2man not found - continuing without pod2man support])
fi
AC_CHECK_PROGS([PANDOC], [pandoc])
if test -z "$PANDOC";
then AC_MSG_WARN([pandoc not found - README.rst cannot be generated from README.md])
fi
AM_CONDITIONAL([HAVE_DSYMUTIL], [test -n "$ac_ct_DSYMUTIL"])

case $host_os in
Expand Down Expand Up @@ -1004,8 +1016,8 @@ AC_SUBST([TARBALL_VERSION_FILE])
# version information, refer to the libtool manual, section "Updating
# library version information":
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
AC_SUBST([SAFEC_SO_VERSION], [3:6:0])
AC_SUBST([SAFEC_API_VERSION], [3.6.0])
AC_SUBST([SAFEC_SO_VERSION], [3:7:0])
AC_SUBST([SAFEC_API_VERSION], [3.7.0])

# Automake variables, these variables get automagically included at the top
# of all automake generated make files. This is why you don't see them
Expand Down Expand Up @@ -1044,7 +1056,8 @@ AC_CONFIG_FILES([include/safe_lib_errno.h], [chmod -w include/safe_lib_errno.h])
AC_CONFIG_FILES([include/safe_types.h], [chmod -w include/safe_types.h])

AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AM_CONDITIONAL([HAVE_POD2MAN], [test -n "POD2MAN"])
AM_CONDITIONAL([HAVE_POD2MAN], [test -n "$POD2MAN"])
AM_CONDITIONAL([HAVE_PANDOC], [test -n "$PANDOC"])
AM_CONDITIONAL([HAVE_WINE], [test -n "$WINE"])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([Doxyfile])])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/footer])])
Expand Down
2 changes: 1 addition & 1 deletion libsafec.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Name: @PACKAGE@
Description: A safe coding library for C, ref ISO TR24731, C11 Annex K
Version: @VERSION@
URL: @PACKAGE_URL@
Libs: -L${libdir} -lsafec-@SAFEC_API_VERSION@
Libs: -L${libdir} -lsafec
Cflags: -I${includedir}/@PACKAGE@
21 changes: 11 additions & 10 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -265,35 +265,36 @@ endif
#$(EXPORT_SYM): safec.h.in
# sed -n -e 's/^..*SAFEC_EXPORT[[:space:]][[:space:]]*\([[:alnum:]_][[:alnum:]_]*\)..*$$/\1/p' @top_srcdir@/src/safec.h.in > $@

lib_LTLIBRARIES = libsafec-@SAFEC_API_VERSION@.la
libsafec_@SAFEC_API_VERSION@_la_SOURCES = \
lib_LTLIBRARIES = libsafec.la
libsafec_la_SOURCES = \
$(STD_MEM_FILES) \
$(STD_STR_FILES) \
$(STD_IO_FILES) \
$(STD_OS_FILES) \
$(STD_MISC_FILES)
if ENABLE_WCHAR
libsafec_@SAFEC_API_VERSION@_la_SOURCES += \
libsafec_la_SOURCES += \
$(STD_WCHAR_FILES)
endif
if ENABLE_EXTS
libsafec_@SAFEC_API_VERSION@_la_SOURCES += \
libsafec_la_SOURCES += \
$(EXT_MEM_FILES) \
$(EXT_STR_FILES)
endif

libsafec_@SAFEC_API_VERSION@_la_LIBADD = \
libsafec_la_LIBADD = \
libmemprims.la \
libsafeccore.la
if ENABLE_UNSAFE
libsafec_@SAFEC_API_VERSION@_la_LIBADD += \
libsafec_la_LIBADD += \
libstdunsafe.la
endif
libsafec_@SAFEC_API_VERSION@_la_LDFLAGS = \
libsafec_la_LDFLAGS = \
-version-info $(SAFEC_SO_VERSION) \
-no-undefined
-no-undefined \
$(LDFLAGS) $(AM_LDFLAGS)
# -export-symbols $(EXPORT_SYM)
#libsafec_@SAFEC_API_VERSION@_la_DEPENDENCIES = $(EXPORT_SYM)
#libsafec_la_DEPENDENCIES = $(EXPORT_SYM)

# emacs flymake-mode
check-syntax:
Expand All @@ -306,7 +307,7 @@ AM_CFLAGS += @GCOV_CFLAGS@
LIBS += @GCOV_LIBS@
gcov:
-test -f $(builddir)/gcov.log && rm $(builddir)/gcov.log
for c in $(libsafec_@SAFEC_API_VERSION@_la_SOURCES); do \
for c in $(libsafec_la_SOURCES); do \
dir="`dirname $$c`"; base="`basename $$c .c`"; \
if test -e "$$dir/$$base.gcno" -a -e $$c; then \
$(GCOV) -s $$dir $$c | tee -a $(builddir)/gcov.log; \
Expand Down
4 changes: 2 additions & 2 deletions src/wchar/mbstowcs_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include "safeclib_private.h"
#endif

#if (defined(TEST_MSVCRT) && defined(HAVE_MBSRTOWC_S)) || \
!defined(HAVE_WCHAR_H) || !defined(HAVE_MBSTOWCS)
#if (defined(TEST_MSVCRT) && defined(HAVE_MBSTOWCS_S)) || \
!defined(HAVE_WCHAR_H)
#else

/* newlib, cygwin64 has no STDC_HEADERS!
Expand Down
2 changes: 1 addition & 1 deletion src/wchar/wcsrtombs_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "safeclib_private.h"
#endif

#if (defined(TEST_MSVCRT) && defined(HAVE_WCSTOK_S)) || !defined(HAVE_WCHAR_H)
#if (defined(TEST_MSVCRT) && defined(HAVE_WCSRTOMBS_S)) || !defined(HAVE_WCHAR_H)
#else

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ AM_CFLAGS += -I$(top_builddir)/include -I$(srcdir)
# WARN_CFLAGS works mostly, but too strict with gnu extensions
AM_CFLAGS += $(WARN_CFLAGS_TESTS)

LDADD = $(top_builddir)/src/libsafec-@SAFEC_API_VERSION@.la
LDADD = $(top_builddir)/src/libsafec.la

TESTS = $(SAFEC_BUILT_TESTS)
check_PROGRAMS = $(SAFEC_BUILT_TESTS)
Expand Down

0 comments on commit dbdf460

Please sign in to comment.