Author Topic: Strange autoconf / autoreconf / configure behavior  (Read 409 times)

Mentore

  • Full Member
  • ***
  • Posts: 175
  • Karma: +6/-0
    • View Profile
Strange autoconf / autoreconf / configure behavior
« on: May 21, 2024, 10:04:28 am »
Hi all, this is something I never saw before.

I was recently trying to port some other SDL / un*x software on OS/2, mostly emulators. Gone through an HP 48 emulator which works under SDL, but has no configure script - just configure.ac ready to be used with autoconf. But this is what I have after running it:


[D:\Sviluppo\Sorgenti\tmp\x48-master>]sh /usr/bin/autoreconf -sfvi
autoreconf.: Entering directory `.'
autoreconf.: configure.ac: not using Gettext
autoreconf.: running: aclocal  --output=aclocal.m4t
Can't open perl script "exe": No such file or directory
aclocal: error: echo failed with exit status: 2
autoreconf.: failed to run aclocal: SYS0193=0xc1: %1 non può essere eseguito in
una sessione OS/2

[D:\Sviluppo\Sorgenti\tmp\x48-master>]sh /usr/bin/autoconf
Can't open perl script "exe": No such file or directory

[D:\Sviluppo\Sorgenti\tmp\x48-master>]


I took a look at the auto* scripts and tried changing /@unixroot/usr occurrences to /usr, but no results. Of course it was a stupid attempt but the results didn't change.

Trying to port the latest version of SOX I get this at the end of the configure script:


configure.: creating ./config.status
config.status: creating Makefile
Usage: gawk [POSIX or GNU style options] -f progfile [--] file ...
Usage: gawk [POSIX or GNU style options] [--] 'program' file ...
POSIX options:          GNU long options: (standard)
        -f progfile             --file=progfile
        -F fs                   --field-separator=fs
        -v var=val              --assign=var=val
Short options:          GNU long options: (extensions)
        -b                      --characters-as-bytes
        -c                      --traditional
        -C                      --copyright
        -d[file]                --dump-variables[=file]
        -e 'program-text'       --source='program-text'
        -E file                 --exec=file
        -g                      --gen-pot
        -h                      --help
        -L [fatal]              --lint[=fatal]
        -n                      --non-decimal-data
        -N                      --use-lc-numeric
        -O                      --optimize
        -p[file]                --profile[=file]
        -P                      --posix
        -r                      --re-interval
        -S                      --sandbox
        -t                      --lint-old
        -V                      --version

To report bugs, see node `Bugs' in `gawk.info', which is
section `Reporting Problems and Bugs' in the printed version.

gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.

Examples:
        gawk '{ sum += $1 }; END { print sum }' file
        gawk -F: '{ print $1 }' /etc/passwd
sed: couldn't write 34 items to stdout: Invalid argument
config.status: error: could not create Makefile


Another project - FUSE 1.6 for SDL. I'd really love to get one of the best ZX Spectrum emulators under OS/2, but I get the same result.
I already ported some other programs simply tweaking their makefile, so I am rather sure GCC and its companions work well. I can't for the life of me figure what happened, since I didn't tamper with /usr/bin (I seem to remember substituting clean.exe with another exe, but can't remember when).

Is there anyone who can hint me on what to do? Upgrading the auto* tools would be a good idea, can I find them on ANPM?

Thanks in advance,
Mentore


Mentore

  • Full Member
  • ***
  • Posts: 175
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #1 on: May 21, 2024, 11:11:13 am »
Replying to myself - I almost forgot what I'm using to set up my dev environment:


set LDFLAGS=-Zomf -Zhigh-mem -Zmap -Zbin-files -Zargs-wild -Zargs-resp
set CFLAGS=-O2 -g
set CXXFLAGS=-O2 -g
set LIBS=-lcx
set CC=gcc
set CXX=g++
set CPP=cpp
set CXXCPP=cpp
set LD=emxomfld
REM set AR=ar
set SED=sed
set GREP=grep
set AWK=awk
set exeext=.exe
set SH=sh.exe
set SHELL=sh.exe
set CONFIG_SHELL=sh.exe
set POSIX_SHELL=sh.exe
set MAKESHELL=sh.exe
REM set EMXSHELL=sh.exe
set PREFERABLY_POSIX_SHELL=\usr\bin\mksh
set PATH=%UNIXROOT%/usr/libexec/bin;%PATH%
mode co80,72

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4831
  • Karma: +101/-1
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #2 on: May 21, 2024, 05:28:43 pm »
Have you looked at the resulting config.log? Have you double checked that your environment is correctly setup? Seems some of that stuff should be quoted and set exeext doesn't work due to the small case.
Code: [Select]
[W:\]set exeext=.exe

[W:\]set exeext=

[W:\]

Perhaps convert to sh as config.site,
Code: [Select]
export 'LDFLAGS=-Zomf -Zhigh-mem -Zmap -Zbin-files -Zargs-wild -Zargs-resp'
etc.
config.site goes in %PREFIX%\share, usually \usr\local\share\config.site

KO Myung-Hun

  • Newbie
  • *
  • Posts: 25
  • Karma: +5/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #3 on: May 21, 2024, 05:48:56 pm »
Hi/2.

How about trying `-c' option like:

Code: [Select]
sh -c /usr/bin/autoreconf -sfvi

or

Code: [Select]
sh -c "/usr/bin/autoreconf -sfvi"

Auto tools scripts are not shell scripts but perl scripts in many cases.

KO Myung-Hun

Mentore

  • Full Member
  • ***
  • Posts: 175
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #4 on: May 22, 2024, 08:22:17 am »
Hi/2.

How about trying `-c' option like:

Code: [Select]
sh -c /usr/bin/autoreconf -sfvi

or

Code: [Select]
sh -c "/usr/bin/autoreconf -sfvi"

Auto tools scripts are not shell scripts but perl scripts in many cases.

KO Myung-Hun

Thanks for this help KO. I'll check everything asap. What puzzles me is that this behavior just started occurring on every project, suddendly, while days ago autoreconf and the other perl scripts worked correctly.

Will update asap.

Mentore

Mentore

  • Full Member
  • ***
  • Posts: 175
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #5 on: May 22, 2024, 09:02:15 am »
Hi/2.

How about trying `-c' option like:

Code: [Select]
sh -c /usr/bin/autoreconf -sfvi

or

Code: [Select]
sh -c "/usr/bin/autoreconf -sfvi"

Auto tools scripts are not shell scripts but perl scripts in many cases.

KO Myung-Hun

Thanks for this help KO. I'll check everything asap. What puzzles me is that this behavior just started occurring on every project, suddendly, while days ago autoreconf and the other perl scripts worked correctly.

Will update asap.

Mentore

Quoting myself:

after creating a config.site file and slightly modifying my CMD settings file the result is the same - error on gawk while running config.status.

Also, if I issue autoreconf, the result is this


[D:\Sviluppo\sorgenti\tmp\cscope-15.9>]sh -c /usr/bin/autoreconf -sfvi
Can't open perl script "exe": No such file or directory


which points me really nowhere. Have to check something, or maybe the best solution is to reinstall everything.

Mentore

Mentore

  • Full Member
  • ***
  • Posts: 175
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #6 on: May 22, 2024, 11:16:10 am »
Hi/2.

How about trying `-c' option like:

Code: [Select]
sh -c /usr/bin/autoreconf -sfvi

or

Code: [Select]
sh -c "/usr/bin/autoreconf -sfvi"

Auto tools scripts are not shell scripts but perl scripts in many cases.

KO Myung-Hun

Thanks for this help KO. I'll check everything asap. What puzzles me is that this behavior just started occurring on every project, suddendly, while days ago autoreconf and the other perl scripts worked correctly.

Will update asap.

Mentore

Quoting myself:

after creating a config.site file and slightly modifying my CMD settings file the result is the same - error on gawk while running config.status.

Also, if I issue autoreconf, the result is this


[D:\Sviluppo\sorgenti\tmp\cscope-15.9>]sh -c /usr/bin/autoreconf -sfvi
Can't open perl script "exe": No such file or directory


which points me really nowhere. Have to check something, or maybe the best solution is to reinstall everything.

Mentore

Bit of update: correcting SED=sed in configuration made configure work again.
It seems I need to work a little more to make autoreconf / autoconf work correctly.

Mentore