Skip to content

Commit

Permalink
Merge pull request #3 from ggtakec/fix_build
Browse files Browse the repository at this point in the history
Version control in the build process is centralized by ChangeLog
  • Loading branch information
ggtakec authored Apr 25, 2022
2 parents 2f54497 + e0b4e3e commit 13b3383
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,20 @@ if test "${K2H_HAVE_PHP_BINARY}" = "yes"; then
AC_SUBST([K2H_PHP_MAJOR_VERSION], [$(php -r 'echo "".PHP_MAJOR_VERSION."";')])
AC_SUBST([K2H_PHP_MINOR_VERSION], [$(php -r 'echo "".PHP_MINOR_VERSION."";')])
AC_SUBST([K2H_EXT_PKGNAME], [$(head -n 1 $(pwd)/ChangeLog | awk '{print $1}')])
AC_SUBST([K2H_EXT_VERSION], [$(head -n 1 $(pwd)/ChangeLog | sed -e 's/[(]//g' -e 's/[)]//g' | awk '{print $2}' | sed -e 's/-.*$//g')])
AC_SUBST([K2H_EXT_RELEASE], [$(head -n 1 $(pwd)/ChangeLog | sed -e 's/[(]//g' -e 's/[)]//g' | awk '{print $2}' | sed -e 's/^.*-//g')])
AC_SUBST([K2H_EXT_VERSION], [$(head -n 1 $(pwd)/ChangeLog | sed -e 's/[(]//g' -e 's/[)]//g' | awk '{print $2}' | sed -e 's/-.*$//g')])

AC_DEFINE_UNQUOTED(PHP_K2HASH_VERSION, ["$(head -n 1 $(pwd)/ChangeLog | sed -e 's/[(]//g' -e 's/[)]//g' | awk '{print $2}' | sed -e 's/-.*$//g')"], [ PHP Extension version ])
else
AC_SUBST([K2H_PHP_VERSION], "0.0")
AC_SUBST([K2H_PHP_RAW_VERSION], "00")
AC_SUBST([K2H_PHP_MAJOR_VERSION], "0")
AC_SUBST([K2H_PHP_MINOR_VERSION], "0")
AC_SUBST([K2H_EXT_PKGNAME], "php-pecl-k2hash")
AC_SUBST([K2H_EXT_VERSION], "0.0.0")
AC_SUBST([K2H_EXT_RELEASE], "0")
AC_SUBST([K2H_EXT_VERSION], "0.0.0")

AC_DEFINE(PHP_K2HASH_VERSION, "0.0.0", [ PHP Extension version ])
fi

#
Expand Down
4 changes: 1 addition & 3 deletions php_k2hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@

#include <k2hash.h>
#include <fcntl.h>
#include "config.h"

extern zend_module_entry k2hash_module_entry;
# define k2hash_ptr &k2hash_module_entry

# define PHP_K2HASH_VERSION "1.1.3"

/* {{{ k2hash object */
typedef struct php_k2hash_object_ {
Expand Down

0 comments on commit 13b3383

Please sign in to comment.