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

Mentore

  • Full Member
  • ***
  • Posts: 185
  • 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: 185
  • 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: 4862
  • Karma: +103/-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: 32
  • 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: 185
  • 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: 185
  • 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: 185
  • 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

Mentore

  • Full Member
  • ***
  • Posts: 185
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #7 on: June 06, 2024, 04:07:44 pm »
Bringing up this thread with some little more information.

I'm trying to autoreconf this HP48 emulator (x48 -- HP48 CPU emulator) which, by the way, most probably won't compile because I need X and I still didn't install development files. But this is not my issue.
My problems with auto* tools still remain: if I launch


sh /usr/bin/autoreconf -sfvi


or similar invocation I get this error


aclocal: running echo 'm4_define([m4_require_silent_probe], [-])' | autom4te --l
anguage Autoconf-without-aclocal-m4  - /usr/share/aclocal-1.16/internal/ac-confi
g-macro-dirs.m4 @C:/var/temp/PW47KLolVM configure.ac
Can't open perl script "exe": No such file or directory
aclocal: error: echo failed with exit status: 2


which gives me nothing since I still can't figure out what "exe" script perl is searching for. Also, for the life of me I can't understand why the script tries to write in C:\var\temp since I set every temporary variable to D:\temp, where I develop.

attaching a log from the execution of aclocal. Most probably will be useless, since it's got no warnings at all.

Mentore


Mentore

  • Full Member
  • ***
  • Posts: 185
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #8 on: June 12, 2024, 02:03:11 pm »
Another attempt, this time after re-installing autoconf and automake: this time I receive


sh /usr/bin/autoreconf -sfvi
/usr/bin/autoreconf.: /@unixroot/usr/bin/perl: not found


Getting kind of lost here...

Mentore

KO Myung-Hun

  • Newbie
  • *
  • Posts: 32
  • Karma: +5/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #9 on: June 19, 2024, 11:07:01 am »
Still not working ? And did you install perl ?

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4862
  • Karma: +103/-1
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #10 on: June 19, 2024, 05:16:42 pm »
And what shell are you using?

Mentore

  • Full Member
  • ***
  • Posts: 185
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #11 on: June 20, 2024, 07:53:25 am »
And what shell are you using?

KO, Dave, thanks.

Perl installed and I'm using sh as default shell.
The really really strange thing is that everything used to work until someday this happened.
And I really can't understand why  :o

I wonder if this has something to do with a certain clean.exe software I installed in lieu of the already present one in /usr/bin, but I don't know what the correlation may be.
I'll try something this morning changing che autotools with the latest version provided by KO and report back.

The toolchain works, by the way - I was able to recreate an OS/2 version of ZesarUX (https://github.com/chernandezba/zesarux), a really interesting multi machines emulator under SDL. It seems OS/2 finally has his Sinclair QL emulator  8)

Thanks again!
Mentore

Mentore

  • Full Member
  • ***
  • Posts: 185
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #12 on: June 20, 2024, 01:05:55 pm »
And what shell are you using?

KO, Dave, thanks.

Perl installed and I'm using sh as default shell.
The really really strange thing is that everything used to work until someday this happened.
And I really can't understand why  :o

I wonder if this has something to do with a certain clean.exe software I installed in lieu of the already present one in /usr/bin, but I don't know what the correlation may be.
I'll try something this morning changing che autotools with the latest version provided by KO and report back.

The toolchain works, by the way - I was able to recreate an OS/2 version of ZesarUX (https://github.com/chernandezba/zesarux), a really interesting multi machines emulator under SDL. It seems OS/2 finally has his Sinclair QL emulator  8)

Thanks again!
Mentore

Re-quoting myself.
I am still in the midst of this... I edited libtoolize, aclocal, autoconf, autoreconf and some other files to remove every instance of the string "/@unixroot" since it seemed to cause troubles.
Trying to run autoconf, autoreconf and aclocal from scripts and command line I always receive the same error in aclocal:

From ksh

Running aclocal
Can't open perl script "exe": No such file or directory
aclocal: error: echo failed with exit status: 2
Error: aclocal failed


Similar error occur if I try from sh or ash. I'm starting to get frustrated, since everything worked great before...

Maybe a complete system reinstallation would be needed. I'll think about that.
Mentore

KO Myung-Hun

  • Newbie
  • *
  • Posts: 32
  • Karma: +5/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #13 on: June 20, 2024, 02:48:42 pm »
Which drive are you working on ?

And what does UNIXROOT env var set to ?

How did you install your auto-tools ?

Where is your `sh' from ?

Mentore

  • Full Member
  • ***
  • Posts: 185
  • Karma: +6/-0
    • View Profile
Re: Strange autoconf / autoreconf / configure behavior
« Reply #14 on: June 21, 2024, 09:06:19 am »
Which drive are you working on ?

And what does UNIXROOT env var set to ?

How did you install your auto-tools ?

Where is your `sh' from ?

Hello mate,
UNIXROOT points to D: drive where I put usr/ directory and every relevant subdirectory.
auto-tools installed via ANPM and worked fine until this suddendly happened.

Also, sh, ash and ksh come with the standard development tools gotten via ANPM.

Can't get a clue of what's changed, but one day a configure script was perfect, the next day this error pops up from the very same script. Since then, no success in generating makefiles.

Mind you, CMake works, make works, so if I can arrange or modify an existing makefile I'm fine and everything works well (doesn't mean I get a really useful executable 100% of the times, but this is normal in porting software).

So I'm guessing a system reinstall may be useful...

Mentore