Skip to content

Commit

Permalink
Now generating version defines in configure (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
j256 authored Dec 26, 2020
1 parent 2f0e695 commit 8894786
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 64 deletions.
6 changes: 3 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ chunk.o: chunk.c conf.h settings.h dmalloc.h append.h chunk.h chunk_loc.h \
error.h error_val.h heap.h
compat.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
dmalloc.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h append.h \
compat.h debug_tok.h dmalloc_loc.h env.h error_val.h version.h
compat.h debug_tok.h dmalloc_loc.h env.h error_val.h
dmalloc_argv.o: dmalloc_argv.c conf.h settings.h append.h dmalloc_argv.h \
dmalloc_argv_loc.h compat.h
dmalloc_fc_t.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
Expand All @@ -445,7 +445,7 @@ dmalloc_tab.o: dmalloc_tab.c conf.h settings.h append.h chunk.h compat.h \
env.o: env.c conf.h settings.h dmalloc.h append.h compat.h dmalloc_loc.h \
debug_tok.h env.h error.h
error.o: error.c conf.h settings.h dmalloc.h append.h chunk.h compat.h \
debug_tok.h dmalloc_loc.h env.h error.h error_val.h version.h
debug_tok.h dmalloc_loc.h env.h error.h error_val.h
heap.o: heap.c conf.h settings.h dmalloc.h append.h chunk.h compat.h \
debug_tok.h dmalloc_loc.h error.h error_val.h heap.h
protect.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
Expand All @@ -458,7 +458,7 @@ chunk_th.o: chunk.c conf.h settings.h dmalloc.h append.h chunk.h chunk_loc.h \
dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h \
error.h error_val.h heap.h
error_th.o: error.c conf.h settings.h dmalloc.h append.h chunk.h compat.h \
debug_tok.h dmalloc_loc.h env.h error.h error_val.h version.h
debug_tok.h dmalloc_loc.h env.h error.h error_val.h
user_malloc_th.o: user_malloc.c conf.h settings.h dmalloc.h append.h chunk.h \
compat.h debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
user_malloc.h return.h
23 changes: 14 additions & 9 deletions BUILD.txt → RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

The following set of tasks should be performed when the dmalloc library gets released.

1) Update the version number in version.h and where else it lists.
2) Update the ChangeLog file.
3) Update doc files: make docs
4) Consider updating the copyright heads in all files and in chunk.c strings.
5) Run autoconf to make sure configure up to date.
1) Update the ChangeLog file with the release date.
2) Run autoconf to make sure configure up to date.
3) Update the version numbers in the following files:
Changlog
README.md
configure.ac (in AC_INIT)
dmalloc.spec
dmalloc.texi
4) Update doc files: make docs
5) Consider updating the copyright heads in all files and in chunk.c strings.
6) Check in all files.
7) Run tests:
- [ maybe mkdir x ; cd x ]
Expand All @@ -20,12 +25,12 @@ The following set of tasks should be performed when the dmalloc library gets rel
8) Clone on linux and others and run tests: git clone [email protected]:j256/dmalloc.git
9) Run release.sh script. It will run tests on repo.
11) git tag the release:
git tag dmalloc_release_X_X_X
git push origin dmalloc_release_X_X_X
git tag dmalloc_release_X_X_X
git push origin dmalloc_release_X_X_X
12) create release on github for X.X.X from that tag
13) Upload tgz file as part of that release
14) Install the tgz file and html file in the dmalloc.com repo
14) Install the tgz file in the dmalloc.com repo
15) Edit releases/index.html to include the new version
16) Go to the /docs dir and run the explode-docs.sh script.
16) Go to the docs subdir and run the explode-docs.sh script.

-------------------------------------------------------------------------------
20 changes: 18 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2408,8 +2408,17 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers conf.h"
{ $as_echo "$as_me:${as_lineno-$LINENO}: configurations for the dmalloc library" >&5
$as_echo "$as_me: configurations for the dmalloc library" >&6;}
dmalloc_version_major=`echo $PACKAGE_VERSION | sed -e 's/\.[0-9][0-9]*\.[0-9][0-9]*$//'`
export dmalloc_version_major
export dmalloc_version_minor=`echo $PACKAGE_VERSION | sed -e 's/^[0-9][0-9]*\.//' | sed -e 's/\.[0-9][0-9]*$//'`
export dmalloc_version_minor
export dmalloc_version_patch=`echo $PACKAGE_VERSION | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
export dmalloc_version_patch
dmalloc_version="${dmalloc_version_major}.${dmalloc_version_minor}.${dmalloc_version_patch}"
export dmalloc_version
{ $as_echo "$as_me:${as_lineno-$LINENO}: configurations for the dmalloc library version $dmalloc_version" >&5
$as_echo "$as_me: configurations for the dmalloc library version $dmalloc_version" >&6;}
##############################################################################
# arguments
Expand Down Expand Up @@ -7231,6 +7240,13 @@ else
echo "#define DMALLOC_STDARG 0" >> $newfile.t
fi
echo '' >> $newfile.t
echo '/* dmalloc version defines */' >> $newfile.t
echo "#define DMALLOC_VERSION_MAJOR ${dmalloc_version_major} /* X.0.0 */" >> $newfile.t
echo "#define DMALLOC_VERSION_MINOR ${dmalloc_version_minor} /* 0.X.0 */" >> $newfile.t
echo "#define DMALLOC_VERSION_PATCH ${dmalloc_version_patch} /* 0.0.X */" >> $newfile.t
echo '' >> $newfile.t
echo "static char *dmalloc_version = \"${dmalloc_version}\";" >> $newfile.t
echo '' >> $newfile.t
if cmp -s $newfile $newfile.t 2>/dev/null; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $newfile is unchanged" >&5
$as_echo "$as_me: $newfile is unchanged" >&6;}
Expand Down
19 changes: 18 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@
#
# The author may be contacted via http://dmalloc.com/
#

AC_INIT(dmalloc, 5.6.4, [http://dmalloc.com/])
AC_CONFIG_SRCDIR(dmalloc.c)
AC_CONFIG_HEADER(conf.h)

AC_MSG_NOTICE([configurations for the dmalloc library])
dmalloc_version_major=`echo $PACKAGE_VERSION | sed -e '[s/\.[0-9][0-9]*\.[0-9][0-9]*$//]'`
export dmalloc_version_major
export dmalloc_version_minor=`echo $PACKAGE_VERSION | sed -e '[s/^[0-9][0-9]*\.//]' | sed -e '[s/\.[0-9][0-9]*$//]'`
export dmalloc_version_minor
export dmalloc_version_patch=`echo $PACKAGE_VERSION | sed -e '[s/^[0-9][0-9]*\.[0-9][0-9]*\.//]'`
export dmalloc_version_patch
dmalloc_version="${dmalloc_version_major}.${dmalloc_version_minor}.${dmalloc_version_patch}"
export dmalloc_version

AC_MSG_NOTICE([configurations for the dmalloc library version $dmalloc_version])

##############################################################################
# arguments
Expand Down Expand Up @@ -872,6 +882,13 @@ else
echo "#define DMALLOC_STDARG 0" >> $newfile.t
fi
echo '' >> $newfile.t
echo '/* dmalloc version defines */' >> $newfile.t
echo "#define DMALLOC_VERSION_MAJOR ${dmalloc_version_major} /* X.0.0 */" >> $newfile.t
echo "#define DMALLOC_VERSION_MINOR ${dmalloc_version_minor} /* 0.X.0 */" >> $newfile.t
echo "#define DMALLOC_VERSION_PATCH ${dmalloc_version_patch} /* 0.0.X */" >> $newfile.t
echo '' >> $newfile.t
echo "static char *dmalloc_version = \"${dmalloc_version}\";" >> $newfile.t
echo '' >> $newfile.t
if cmp -s $newfile $newfile.t 2>/dev/null; then
AC_MSG_NOTICE([$newfile is unchanged])
rm -f $newfile.t
Expand Down
1 change: 0 additions & 1 deletion dmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#include "env.h"
#include "error_val.h"
#include "dmalloc_loc.h"
#include "version.h"

#define HOME_ENVIRON "HOME" /* home directory */
#define SHELL_ENVIRON "SHELL" /* for the type of shell */
Expand Down
7 changes: 1 addition & 6 deletions dmalloc.h.3
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/* NOTE: start of dmalloc.h.4 */

/* dmalloc version defines */
#define DMALLOC_VERSION_MAJOR 5 /* X.0.0 */
#define DMALLOC_VERSION_MINOR 6 /* 0.X.0 */
#define DMALLOC_VERSION_PATCH 4 /* 0.0.X */
/* NOTE: start of dmalloc.h.3 */

/* this defines what type the standard void memory-pointer is */
#if (defined(__STDC__) && __STDC__ == 1) || defined(__cplusplus) || defined(STDC_HEADERS) || defined(_ISO_STDLIB_ISO_H)
Expand Down
1 change: 0 additions & 1 deletion error.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
#include "error.h"
#include "error_val.h"
#include "dmalloc_loc.h"
#include "version.h"

#if LOCK_THREADS
#if IDENT_WORKS
Expand Down
25 changes: 22 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,31 @@
# Shell script if you are going to package the library up for release
#

set -e

cwd=`pwd`
version=`grep dmalloc_version version.h | cut -f2 -d\"`
version=`grep dmalloc_version dmalloc.h.2 | cut -f2 -d\"`
dir=dmalloc-$version

head -1 ChangeLog.txt | grep -q $version
if [ $? -ne 0 ]; then
echo "First line of ChangeLog.txt does not include version $version"
head -1 ChangeLog.txt
exit 1
fi
grep -q "dmalloc_version Version $version" dmalloc.texi
if [ $? -ne 0 ]; then
echo "dmalloc.texi does not include version $version"
grep -q "dmalloc_version " dmalloc.texi
exit 1
fi
grep -q "Version: $version" dmalloc.spec
if [ $? -ne 0 ]; then
echo "dmalloc.spec does not include version $version"
grep "Version: " dmalloc.spec
exit 1
fi

set -e

# run tests
echo "Running tests"
rm -rf $dir
Expand Down
38 changes: 0 additions & 38 deletions version.h

This file was deleted.

0 comments on commit 8894786

Please sign in to comment.