• Bug#1066410: More help needed to finally fix autoconf in ncftp

    From Joost van =?utf-8?Q?Baal-Ili=C4=87?@21:1/5 to All on Sat Feb 15 15:40:01 2025
    Hi,

    On Sat, Feb 15, 2025 at 03:02:57PM +0100, Joost van Baal-Ilić wrote:
    On Sat, Feb 15, 2025 at 11:44:37AM +0100, Alexandre Detiste wrote:

    In my previous attempts, I was post-editing config.h with sed.
    I know it's horrible ... but it get things done.

    I was later stuck by the other problems solved by наб

    Alexandre

    Le sam. 15 févr. 2025 à 10:53, Andreas Tille <andreas@an3as.eu> a écrit :

    Hi,

    thanks to the help of наб[1] most issues in ncftp where fixed in Git[2].
    The only remaining issue is that the binary
    /usr/bin/ncftpbookmarks
    is not build which is IMHO due to a problem in detecting the ncurses library inside the M4 code. The configure.in snippet[3] is seeking for the variable wi_LIB_CURSES which is actually set in aclocal[4] but something seems to go wrong here. Any help to fix this code would be welcome to make sure ncftpbookmarks will be built.

    Kind regards
    Andreas.

    [1] https://salsa.debian.org/debian/ncftp/-/merge_requests/1
    [2] https://salsa.debian.org/debian/ncftp
    [3] https://salsa.debian.org/debian/ncftp/-/blob/master/configure.in?ref_type=heads#L100-106
    [4] https://salsa.debian.org/debian/ncftp/-/blob/master/autoconf_local/aclocal.m4?ref_type=heads#L5128


    I gave it a shot. I did:

    (sid)joostvb@agni:~/git/build-area/ncftp-3.2.7% ./configure

    .../build-area/ncftp-3.2.7% less config.log

    shows:

    configure:6364: checking for sys/ioctl.h
    configure:6453: checking for curses library
    configure:6491: gcc -o conftest -D_REENTRANT -D_LARGEFILE64_SOURCE -O2 -W -Wall -Wno-format-y2k conftest.c -lresolv -lncursesw 1>&5
    configure: In function 'main':
    configure:6484:21: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
    6484 | if (strcmp("jimmy", "floyd") == 0)
    | ^~~~~~
    configure:6477:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    6476 | # include <ncurses.h>
    +++ |+#include <string.h>
    6477 | #else
    configure:6486:17: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    6486 | exit(0);
    | ^~~~
    configure:6477:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    6476 | # include <ncurses.h>
    +++ |+#include <stdlib.h>
    6477 | #else
    configure:6486:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    6486 | exit(0);
    | ^~~~
    configure:6486:17: note: include '<stdlib.h>' or provide a declaration of 'exit'
    configure: failed program was:

    I guess patching the testing C code in autoconf_local/aclocal.m4 around these lines:

    5127 /* function body */
    5128 if (strcmp("jimmy", "floyd") == 0)
    5129 initscr();
    5130 exit(0);

    could work? I am guessing the C code is not modern enough and therefore fails.

    Don't have time to investigate more now, but anyway: HTH!

    Hrm, or in vis/Makefile.in , change

    CURSESLIBS=@LIBCURSES@

    into

    CURSESLIBS=-lncurses

    . Another evil way to hack around it; it just might work...

    Bye,

    Joost

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Tille@21:1/5 to All on Sat Feb 15 17:40:01 2025
    Hi Joost,

    Am Sat, Feb 15, 2025 at 03:26:43PM +0100 schrieb Joost van Baal-Ilić:
    Hi,

    On Sat, Feb 15, 2025 at 03:02:57PM +0100, Joost van Baal-Ilić wrote:
    I gave it a shot. I did:

    (sid)joostvb@agni:~/git/build-area/ncftp-3.2.7% ./configure

    .../build-area/ncftp-3.2.7% less config.log

    lines:

    5127 /* function body */
    5128 if (strcmp("jimmy", "floyd") == 0)
    5129 initscr();
    5130 exit(0);

    could work? I am guessing the C code is not modern enough and therefore fails.

    Adding the missing includes does not seem to be sufficient.

    Don't have time to investigate more now, but anyway: HTH!

    Hrm, or in vis/Makefile.in , change

    CURSESLIBS=@LIBCURSES@

    into

    CURSESLIBS=-lncurses

    Unfortunately also this does not seem to work.

    Thank you for your investigation anyway
    Andreas.

    --
    https://fam-tille.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From itd@21:1/5 to joostvb-debian@mdcc.cx on Sat Feb 15 18:40:01 2025
    Hi,

    Joost van Baal-Ilić <joostvb-debian@mdcc.cx> writes:

    I guess patching the testing C code in autoconf_local/aclocal.m4 around these lines:

    5127 /* function body */
    5128 if (strcmp("jimmy", "floyd") == 0)
    5129 initscr();
    5130 exit(0);

    yes, there is a `#include <string.h>` missing
    (-Wimplicit-function-declaration) and `main` needs a return value (-Wimplicit-int). Something like [0] seems to work [1].

    [0]: https://salsa.debian.org/itd/ncftp/-/commit/600b2ea2d4f2c2ed9d9b34f7267de82c8513e08e
    [1]: https://salsa.debian.org/itd/ncftp/-/jobs/7094979#L1914

    Best regards
    itd

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Tille@21:1/5 to All on Sat Feb 15 22:20:01 2025
    Hi Joost,

    Am Sat, Feb 15, 2025 at 07:27:25PM +0100 schrieb Joost van Baal-Ilić:
    [0]: https://salsa.debian.org/itd/ncftp/-/commit/600b2ea2d4f2c2ed9d9b34f7267de82c8513e08e
    [1]: https://salsa.debian.org/itd/ncftp/-/jobs/7094979#L1914

    The patch there is beautiful, it should get in imnsho. However, I'm
    afraid I don't have the time to prepare another upload...

    Yes, the patch is very nice and I asked for an MR to make sure the
    commit belongs to the person who created it. I admit I'm not motivated
    to stop the delayed upload but I guess there will be other reasons to
    upload (there are quite a number of open bugs remaining, thought - more
    MRs more than welcome ;-) )

    Kind regards
    Andreas.

    --
    https://fam-tille.de

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