Re: Next autoconf problem for today libdisorder
Hi Christian,
On Mon, Jun 27, 2016 at 07:49:53PM +0200, Christian Seiler wrote:
> However, I think you're making your life far more complicated than it
> needs to be:
Yep - as I said my knowledge here is limited.
> I've attached an updated version of your autoconf patch that does just
> his.
Thanks a lot. That was very helpful.
> Other comments regarding the package:
>
> - if you use autoconf/automake, you don't need to use d-moveshlibs
> for multiarch, dh_auto_configure / dh_auto_build / dh_auto_install
> will do all the heavy lifting for you (just create proper .install
> files for the packages, and use /usr/lib/*/filename to select the
> proper file names) That's a matter of taste, of course.
I agree that its not necessary to copy files around. However, I like
d-shlibs to ensure that debian/control is properly designed.
> - you build tool/ropy, but you never use it? Neither in the test suite
> (dh_auto_test doesn't do anything) nor do you package that - why?
Since I wanted to get things working somehow first. I've now reated a
libdisorder-tools package (will write a ropy.1 as well). If you could
help with a sensible test suite - I have no idea how to get this working
with autoconf.
> - you don't provide a symbols file for your library. Not required,
> but it's good practice to provide one (I've attached one based on
> your current package, save it as debian/libdisorder0.symbols, dh
> will take care of the rest)
Thanks a lot for this as well.
> - why hardening only +bindnow? The package builds with +all in the
> hardening options just fine?
Cut-n-pasto. Fixed now, thanks for the hint.
> - Have you actually tested this with automake 1.6 and autoconf
> 2.57? (they are ancient!) If not I'd recommend using autoconf 2.64
> and automake 1.11 as the minimal required versions for each (just
> to be on the safe side, even though it won't have any effect on
> Debian's package build)
Fixed.
> - you could consider installing a pkg-config file for the library,
> as it requires linking against -lm. While this works automatically
> with the shared library, this is not the case for the static
> library, where you explicitly have to add -lm after libdisorder.a
> when linking against it
I have no specific reason not to use pkg-config. If you recommend this
I'd happily apply a patch.
> - I would recommend maybe sending the build system changes upstream,
> so that other people can also profit from this?
Sure. Once it works I'll propose it upstream.
> - you install everything into the proper multiarch locations, but
> libdisorder0 and libdisorder-dev are not Multi-Arch: same, even
> though they easily could be
How?
> - you don't build the test program (although it doesn't serve as
> a unit test, because it will never fail unless /dev/urandom is
> not accessible, so there's no actual check whether the routine
> works as expected or not - so I don't think that's a problem
> really, just wanted to make you aware of it)
Well, upstream provides a test and I would like to run it - if I would
know how to do this. Any patch is welcome.
> - this is more of an upstream issue (i.e. not related to your
> packaging): the library uses global state and is non-reentrant;
> which is actually not a great thing for a shared library to be
I guess upstream is MIA since a long time.
> Unfortunately, improving that would require breaking both API
> and ABI, so I'm not suggesting to you to do so, but I would
> maybe talk with upstream about improving that in the future.
I can forward this but my guess is that upstream will not change
anything. It would also spoil my primary goal for the libraries that
are using libdisorder.
Thanks a lot for your great help
Andreas.
> [1] https://www.gnu.org/software/automake/manual/libtool.html#LT_005fINIT
> Author: Andreas Tille <tille@debian.org>
> Last-Update: Wed, 22 Jun 2016 16:27:46 +0200
> Description: Add autoconf stuff to enable simple library creation
>
> --- /dev/null
> +++ b/Makefile.am
> @@ -0,0 +1,12 @@
> +lib_LTLIBRARIES = libdisorder.la
> +libdisorder_la_SOURCES = src/disorder.c
> +libdisorder_la_LDFLAGS = -version-info @LIB_VERSION@
> +libdisorder_la_CPPFLAGS = -Iinclude
> +libdisorder_la_LIBADD = -lm
> +
> +bin_PROGRAMS = ropy
> +ropy_SOURCES = tool/ropy.c
> +ropy_LDADD = libdisorder.la
> +
> +include_HEADERS = include/disorder.h
> +man_MANS = man/shannon_H.3
> --- /dev/null
> +++ b/configure.ac
> @@ -0,0 +1,62 @@
> +# -*- Autoconf -*-
> +# Process this file with autoconf to produce a configure script.
> +
> +AC_INIT(disorder, 0.0.2, michael@freshdefense.net)
> +AC_CONFIG_HEADERS([config.h])
> +
> +AC_PREREQ(2.57)
> +
> +# Directory that contains install-sh and other auxiliary files
> +AC_CONFIG_AUX_DIR([config])
> +
> +################################################################################
> +# According to (http://www.mail-archive.com/autoconf@gnu.org/msg14232.html)
> +# this macro should be after AC_INIT but before AM_INIT_AUTOMAKE
> +################################################################################
> +AC_CONFIG_MACRO_DIR(config)
> +
> +AM_INIT_AUTOMAKE([1.6 foreign subdir-objects dist-zip tar-ustar filename-length-max=299])
> +
> +LIB_VERSION=0:0
> +
> +AC_SUBST([VERSION])
> +AC_SUBST([LIB_VERSION])
> +
> +AC_SUBST([VERSION])
> +
> +# Checks for programs.
> +AC_PROG_LN_S
> +AC_PROG_INSTALL
> +
> +LT_PREREQ(2.2)
> +LT_INIT
> +
> +################################################################################
> +# calling AC_PROG_CXX resets CXXFLAGS, we use our own flags set in the
> +# the AX_CXXFLAGS macro below.
> +# So we cache the argument to configure
> +# here in ARG_CXX_FLAGS (so that our macro does not override them)
> +################################################################################
> +ARG_CXX_FLAGS="$CXXFLAGS"
> +AC_PROG_CXX
> +
> +#Ranlib handled by check for libtool
> +CXXFLAGS="$ARG_CXX_FLAGS"
> +AX_CXXFLAGS
> +
> +AC_SUBST(CXXFLAGS)
> +
> +CPPFLAGS="-I\$(top_srcdir) $CPPFLAGS"
> +# Checks for libraries.
> +
> +# Checks for header files.
> +AC_HEADER_STDC
> +AC_CHECK_HEADERS([stdlib.h])
> +
> +AC_PROG_MAKE_SET
> +
> +AC_CONFIG_FILES([
> + Makefile
> + ])
> +AC_OUTPUT
> +
>
> libdisorder.so.0 libdisorder0 #MINVER#
> get_entropy_ratio@Base 0.0.2
> get_max_entropy@Base 0.0.2
> get_num_tokens@Base 0.0.2
> shannon_H@Base 0.0.2
>
--
http://fam-tille.de
Reply to: