diff mbox

configure: remove separate so_version file

Message ID 1459507135-19126-1-git-send-email-anders.roxell@linaro.org
State Superseded
Headers show

Commit Message

Anders Roxell April 1, 2016, 10:38 a.m. UTC
Set versioning in configure.ac directly, folks familiar with autotools
will expect it to be set there.

Suggested-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 .so_version      | 1 -
 Makefile.am      | 2 +-
 configure.ac     | 2 +-
 scripts/builddeb | 3 ++-
 4 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 100644 .so_version

Comments

Maxim Uvarov April 1, 2016, 3:47 p.m. UTC | #1
On 04/01/16 13:38, Anders Roxell wrote:
> Set versioning in configure.ac directly, folks familiar with autotools
> will expect it to be set there.
>
> Suggested-by: Fathi Boudra <fathi.boudra@linaro.org>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>   .so_version      | 1 -
>   Makefile.am      | 2 +-
>   configure.ac     | 2 +-
>   scripts/builddeb | 3 ++-
>   4 files changed, 4 insertions(+), 4 deletions(-)
>   delete mode 100644 .so_version
>
> diff --git a/.so_version b/.so_version
> deleted file mode 100644
> index dfa6588..0000000
> --- a/.so_version
> +++ /dev/null
> @@ -1 +0,0 @@
> -108:0:0
> diff --git a/Makefile.am b/Makefile.am
> index a90eb91..2129472 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -17,4 +17,4 @@ SUBDIRS = @platform_with_platform@ \
>   
>   @DX_RULES@
>   
> -EXTRA_DIST = bootstrap $(DX_CONFIG) CHANGELOG config/README .scmversion .so_version
> +EXTRA_DIST = bootstrap $(DX_CONFIG) CHANGELOG config/README .scmversion
> diff --git a/configure.ac b/configure.ac
> index 4d86817..ba814b3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -63,7 +63,7 @@ AC_SUBST([ARCH])
>   ##########################################################################
>   # Set correct platform library version
>   ##########################################################################
> -ODP_LIBSO_VERSION=$(cat ${srcdir}/.so_version)
> +ODP_LIBSO_VERSION=108:0:0
>   AC_SUBST(ODP_LIBSO_VERSION)
>   PKGCONFIG_VERSION=$(echo $VERSION | awk -F '.git' '{print $1}')
>   AC_SUBST(PKGCONFIG_VERSION)
> diff --git a/scripts/builddeb b/scripts/builddeb
> index b832df6..f28ee02 100755
> --- a/scripts/builddeb
> +++ b/scripts/builddeb
> @@ -20,7 +20,8 @@ fi
>   pushd ${ROOT_DIR}/${package}-${version}
>   cp -r ${ROOT_DIR}/pkg/debian .
>   
> -current=$(cat .so_version |awk -F : '{print $1}')
> +current=$(grep "^ODP_LIBSO_VERSION" ${ROOT_DIR}/configure.ac| \
> +	awk -F'=' '{print $2}' |awk -F : '{print $1}')
>   rename 's,(.*linux)(.*),${1}'"${current}"'${2},' debian/*odp*-linux.install
>   
>   sed -i "s:\(libodp[a-zA-Z\-]\+linux\)\(-dbg\|$\| \):\1${current}\2:g" debian/control
Can we generate number in configure.ac in ./bootstrap ?
What is the real problem with current code? Can you add that to patch 
description?

Maxim.
Ricardo Salveti April 1, 2016, 7:51 p.m. UTC | #2
On Fri, Apr 1, 2016 at 12:47 PM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> On 04/01/16 13:38, Anders Roxell wrote:
>>
>> Set versioning in configure.ac directly, folks familiar with autotools
>> will expect it to be set there.
>>
>> Suggested-by: Fathi Boudra <fathi.boudra@linaro.org>
>> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>> ---
>>   .so_version      | 1 -
>>   Makefile.am      | 2 +-
>>   configure.ac     | 2 +-
>>   scripts/builddeb | 3 ++-
>>   4 files changed, 4 insertions(+), 4 deletions(-)
>>   delete mode 100644 .so_version
>>
>> diff --git a/.so_version b/.so_version
>> deleted file mode 100644
>> index dfa6588..0000000
>> --- a/.so_version
>> +++ /dev/null
>> @@ -1 +0,0 @@
>> -108:0:0
>> diff --git a/Makefile.am b/Makefile.am
>> index a90eb91..2129472 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -17,4 +17,4 @@ SUBDIRS = @platform_with_platform@ \
>>     @DX_RULES@
>>   -EXTRA_DIST = bootstrap $(DX_CONFIG) CHANGELOG config/README .scmversion
>> .so_version
>> +EXTRA_DIST = bootstrap $(DX_CONFIG) CHANGELOG config/README .scmversion
>> diff --git a/configure.ac b/configure.ac
>> index 4d86817..ba814b3 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -63,7 +63,7 @@ AC_SUBST([ARCH])
>>
>> ##########################################################################
>>   # Set correct platform library version
>>
>> ##########################################################################
>> -ODP_LIBSO_VERSION=$(cat ${srcdir}/.so_version)
>> +ODP_LIBSO_VERSION=108:0:0
>>   AC_SUBST(ODP_LIBSO_VERSION)
>>   PKGCONFIG_VERSION=$(echo $VERSION | awk -F '.git' '{print $1}')
>>   AC_SUBST(PKGCONFIG_VERSION)
>> diff --git a/scripts/builddeb b/scripts/builddeb
>> index b832df6..f28ee02 100755
>> --- a/scripts/builddeb
>> +++ b/scripts/builddeb
>> @@ -20,7 +20,8 @@ fi
>>   pushd ${ROOT_DIR}/${package}-${version}
>>   cp -r ${ROOT_DIR}/pkg/debian .
>>   -current=$(cat .so_version |awk -F : '{print $1}')
>> +current=$(grep "^ODP_LIBSO_VERSION" ${ROOT_DIR}/configure.ac| \
>> +       awk -F'=' '{print $2}' |awk -F : '{print $1}')
>>   rename 's,(.*linux)(.*),${1}'"${current}"'${2},'
>> debian/*odp*-linux.install
>>     sed -i "s:\(libodp[a-zA-Z\-]\+linux\)\(-dbg\|$\| \):\1${current}\2:g"
>> debian/control
>
> Can we generate number in configure.ac in ./bootstrap ?
> What is the real problem with current code? Can you add that to patch
> description?

I had this suggestion in my head at the original patch, but decided to
not raise it simply because we are already maintaining the odp version
in a separated file.

For me it is indeed better to have it directly in configure.ac, as
that is how most projects handle it. My only suggestion would be to
move this to the top of the file, as otherwise it's not necessarily
trivial to find it (and later you can just have everything that needs
version changes all together).

Thanks,
diff mbox

Patch

diff --git a/.so_version b/.so_version
deleted file mode 100644
index dfa6588..0000000
--- a/.so_version
+++ /dev/null
@@ -1 +0,0 @@ 
-108:0:0
diff --git a/Makefile.am b/Makefile.am
index a90eb91..2129472 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,4 +17,4 @@  SUBDIRS = @platform_with_platform@ \
 
 @DX_RULES@
 
-EXTRA_DIST = bootstrap $(DX_CONFIG) CHANGELOG config/README .scmversion .so_version
+EXTRA_DIST = bootstrap $(DX_CONFIG) CHANGELOG config/README .scmversion
diff --git a/configure.ac b/configure.ac
index 4d86817..ba814b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,7 +63,7 @@  AC_SUBST([ARCH])
 ##########################################################################
 # Set correct platform library version
 ##########################################################################
-ODP_LIBSO_VERSION=$(cat ${srcdir}/.so_version)
+ODP_LIBSO_VERSION=108:0:0
 AC_SUBST(ODP_LIBSO_VERSION)
 PKGCONFIG_VERSION=$(echo $VERSION | awk -F '.git' '{print $1}')
 AC_SUBST(PKGCONFIG_VERSION)
diff --git a/scripts/builddeb b/scripts/builddeb
index b832df6..f28ee02 100755
--- a/scripts/builddeb
+++ b/scripts/builddeb
@@ -20,7 +20,8 @@  fi
 pushd ${ROOT_DIR}/${package}-${version}
 cp -r ${ROOT_DIR}/pkg/debian .
 
-current=$(cat .so_version |awk -F : '{print $1}')
+current=$(grep "^ODP_LIBSO_VERSION" ${ROOT_DIR}/configure.ac| \
+	awk -F'=' '{print $2}' |awk -F : '{print $1}')
 rename 's,(.*linux)(.*),${1}'"${current}"'${2},' debian/*odp*-linux.install
 
 sed -i "s:\(libodp[a-zA-Z\-]\+linux\)\(-dbg\|$\| \):\1${current}\2:g" debian/control