• Automake issues on pngnq

    From Andreas Tille@21:1/5 to All on Mon Mar 7 21:00:01 2022
    Hi,

    I tried to adopt pngnq from QA and pushed it to Salsa[1].
    Unfortunately the new upstream version has some automake issues.

    Strangely enough one issue in configure script occures only in
    salsa-ci[2] but not in my local pbuilder. There I get another
    issue in a later stage of the build process:

    gcc `libpng-config --I_opts` -Wall --pedantic -std=gnu99 -g -O2 -ffile-prefix-map=/build/pngnq-1.1=. -fstack-protector-strong -Wformat -Werror=format-security `libpng-config --ldflags` -lz -lm -Wl,-z,relro -Wl,-z,now -o pngcomp pngcomp.o rwpng.o
    colorspace.o -lm -lz
    /usr/bin/ld: rwpng.o: in function `rwpng_error_handler':
    ./src/rwpng.c:563: undefined reference to `png_get_error_ptr'
    /usr/bin/ld: rwpng.o: in function `rwpng_version_info':
    ./src/rwpng.c:48: undefined reference to `png_get_header_ver'
    /usr/bin/ld: rwpng.o: in function `rwpng_read_image':
    ./src/rwpng.c:82: undefined reference to `png_sig_cmp'
    /usr/bin/ld: ./src/rwpng.c:88: undefined reference to `png_create_read_struct' ...


    The latter can be fixed by appending `libpng-config --ldflags` in the
    end of the command line. For whatever reason automake puts LDFLAGS
    before "-o pngcomp" instead of after and the last options are obtained
    from the LIBS variable. I have no idea how to tweak this sequence.

    Kind regards

    Andreas.


    [1] https://salsa.debian.org/debian-phototools-team/pngnq/
    [2] https://salsa.debian.org/debian-phototools-team/pngnq/-/jobs/2538883

    --
    http://fam-tille.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrey Rahmatullin@21:1/5 to Andreas Tille on Mon Mar 7 21:10:01 2022
    On Mon, Mar 07, 2022 at 08:59:38PM +0100, Andreas Tille wrote:
    For whatever reason automake puts LDFLAGS before "-o pngcomp"
    This is correct.

    instead of after and the last options are obtained from the LIBS variable.
    This is correct.

    I have no idea how to tweak this sequence.
    You don't need to tweak the sequence. You need to put libs into LIBS.

    --
    WBR, wRAR

    -----BEGIN PGP SIGNATURE-----

    iQJhBAABCgBLFiEEolIP6gqGcKZh3YxVM2L3AxpJkuEFAmImZeQtFIAAAAAAFQAP cGthLWFkZHJlc3NAZ251cGcub3Jnd3JhckBkZWJpYW4ub3JnAAoJEDNi9wMaSZLh hGIP/iY8BFuqtPf75vU0JYxc/Zy5V397m2rkMcogqBe2qKCbZB1yqloD9SQQVXf2 sOuM4dxcLHymT73TGto96h3hSmhvzVglPvTH0A/OU4OGQc71+acLJndeSgVoxhQ6 +xRK9h28xOoA4uVT5kHTNQEj44Plw/jsNFMteM66vq+6EPcqCH3xkW7AK2B5KnqH +raqkQpNe7o6FOPFyRf3z/3PLbk4XfS0Ys/eE+Lkhg2SEMaY/wHlsIj1SAZqAI/Y NuUqd2dt0G6OFkYf+yzMcvbE7KyNwMZ/vwcLFxaxqqHv3vE0RqtTfNQi89Kt1pfA ruoCCgOO2u3LzP6oEhzCxDUyQ7oCq2UfLUAVRe+H846dpmcmpmy1jrZqeb3OkeEK mc4Ugk3FhjmPrx9uiSoN8H2lka06aPzD8Tu1A+3WPDUAw/UWrjXxq12Gaq547RV0 zBuOd0CcMo4fhDmvt08ZlnBDPCEpPw9NSRcgezs0Mfu++0xifJh/mKSAP1MkyUrk 4Zb40bYMVGLmTre7+y9A5xU7xfzhBWvdx4oB2BT+eT57/3rio05eauBEkQxHyq/P EgaeiE9CofU1Fk1BC94E5l9bKr7wusfT49KmyRF2tQ5hxZ0jnt4ZyP8eZ8XqY68v scOx1K+D6KTKlOmIxQeEmS/HXjrMqVWDKEdJQ583bTCv83tD
    =2A8L
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Tille@21:1/5 to All on Mon Mar 7 21:30:01 2022
    Am Tue, Mar 08, 2022 at 01:07:05AM +0500 schrieb Andrey Rahmatullin:
    On Mon, Mar 07, 2022 at 08:59:38PM +0100, Andreas Tille wrote:
    For whatever reason automake puts LDFLAGS before "-o pngcomp"
    This is correct.

    instead of after and the last options are obtained from the LIBS variable.
    This is correct.

    I have no idea how to tweak this sequence.
    You don't need to tweak the sequence. You need to put libs into LIBS.

    I was checking this as well - seems here is something broken:


    # checks for libraries
    AC_SEARCH_LIBS([zlibVersion],[z])
    AC_SEARCH_LIBS([sqrt],[m])
    PKG_CHECK_MODULES([PNG], [libpng >= 1.2.0])


    Any idea how to make sure the correct -lpng expression is added here?


    Kind regards

    Andreas.


    --
    http://fam-tille.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Filip Hroch@21:1/5 to Andreas Tille on Mon Mar 7 23:10:01 2022
    Dear Andreas,

    Andreas Tille <[email protected]> writes:

    ...

    I was checking this as well - seems here is something broken:


    # checks for libraries
    AC_SEARCH_LIBS([zlibVersion],[z])
    AC_SEARCH_LIBS([sqrt],[m])
    PKG_CHECK_MODULES([PNG], [libpng >= 1.2.0])


    PKG_CHECK_MODULES macro defines set of [lib]png_* variables,
    specially [lib]png_CFLAGS and [lib]png_LIBS, which can be used
    in Makefile[.am] by this way:

    pngnq_CFLAGS = ... $(png_CFLAGS) ..
    pngnq_LDADD = ... $(png_LIBS) ..

    (I'm unsure if ones are png_* or libpng_*, please
    consult `config.log').

    As an alternative, the command:

    $ libpng-config --libs
    -lpng16

    can be added to the command line; linked libraries should
    be the last argument.

    I believe it makes a sense,
    FH
    --
    F. Hroch <[email protected]>, Masaryk University,
    Dept. of theor. physics and astrophysics, Brno, Moravia, CZ

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Tille@21:1/5 to All on Tue Mar 8 08:10:01 2022
    Am Mon, Mar 07, 2022 at 11:08:11PM +0100 schrieb Filip Hroch:

    PKG_CHECK_MODULES macro defines set of [lib]png_* variables,
    specially [lib]png_CFLAGS and [lib]png_LIBS, which can be used
    in Makefile[.am] by this way:

    pngnq_CFLAGS = ... $(png_CFLAGS) ..
    pngnq_LDADD = ... $(png_LIBS) ..

    (I'm unsure if ones are png_* or libpng_*, please
    consult `config.log').

    Its $(PNG_LIBS) and the build works that way.

    Thanks for your helpful hint

    Andreas.

    --
    http://fam-tille.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)