Author Topic: Autoconf and OS/2  (Read 7053 times)

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Autoconf and OS/2
« on: December 18, 2021, 09:43:43 am »
I'm getting on and off in problems with the generated files by autoconf.
My recent case is SDL2. I have cloned BWW's version and tried to upgrade it to mainstream SDL 2.0.14.
I did the merge on my iMac, because it was so much easier with an IDE.
Now, I see consistently the following problem with the generated Makefile:
Code: [Select]
/SDL_test_assert.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_assert.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_common.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_common.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_compare.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_compare.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_crc32.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_crc32.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_font.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_font.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_fuzzer.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_fuzzer.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_harness.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_harness.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_imageBlit.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_imageBlit.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_imageBlitBlend.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_imageBlitBlend.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_imageFace.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_imageFace.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_imagePrimitives.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_imagePrimitives.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_imagePrimitivesBlend.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_imagePrimitivesBlend.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_log.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_log.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_md5.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_md5.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_memory.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_memory.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ /SDL_test_random.lo: D:/WORK/sdl2/SDL2-os2/src/test/SDL_test_random.c $(objects)/.created $(RUN_CMD_CC)$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
This is all on one line and $(objects) is missing before all compile targets, e.g. "/SDL_test_assert.lo:"
Now, when I checkout the commit before the merge commit on the machine without any other changes, I have no problem with the generated Makefile.
For me, it is clear, that line ends are not generated and $(objects) is not expanded.

My question: Does anyone has some pointers, where the problem lies?

Laurence Pithie

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +1/-0
    • View Profile
Re: Autoconf and OS/2
« Reply #1 on: December 18, 2021, 02:45:30 pm »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Autoconf and OS/2
« Reply #2 on: December 18, 2021, 05:30:19 pm »
Most of the OS/2 tools shouldn't care about line endings,with the exception of *cmd files, though it does look like a line ending issue. Best to look with a hex editor.
Have you tried doing a hard reset on OS/2? Or at least a git status?

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Autoconf and OS/2
« Reply #3 on: December 18, 2021, 05:41:43 pm »
Well, Makefile.in has only LF and not CRLF in both versions.
As I said, I have no problems with the BWW version. With my merge, I get the problems. It's possible, that something is wrong with my installation.
When somebody can check, how the Makefile is created from my repo (https://github.com/josch1710/SDL2-os2), I would be grateful.


Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Autoconf and OS/2
« Reply #4 on: December 18, 2021, 07:21:51 pm »
Ran autogen.sh and then plain old configure as don;t have much time right now,
Code: [Select]
configure: error:
*** Unsupported host:  Please add to configure.ac
It was a large pull. git status shows only the 2 configure files being modified.
Having *nix line endings in the makefiles should be fine.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Autoconf and OS/2
« Reply #5 on: December 18, 2021, 07:25:07 pm »
Hmm, the ARCH=os2 section is all commented out in configure.ac

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Autoconf and OS/2
« Reply #6 on: December 18, 2021, 08:47:39 pm »
Oh yes. I committed it commented because 2.0.14 removed it and I didn‘t know whether it is still needed. Remove the comments and sh autogen.sh. Then you are good to go.

Laurence Pithie

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +1/-0
    • View Profile
Re: Autoconf and OS/2
« Reply #7 on: December 19, 2021, 03:12:14 am »
It appears to be a shell issue. When the system posix shell is Dash you get a broken makefile. setting it to bash fixed the issue.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Autoconf and OS/2
« Reply #8 on: December 19, 2021, 04:51:56 am »
Hmm, I have SHELL=w:/usr/bin/sh.exe, which IIRC is dash and never had this issue. Gave up on bash decades ago in favour of ash as ash was twice as fast.
Running configure here, I see
Code: [Select]
checking whether to install sdl2-config... yes
configure: 1: configure: objects: not found
configure: 1: configure: objects: not found
configure: 1: configure: objects: not found
configure: 1: configure: objects: not found
configure: 1: configure: objects: not found
configure: 1: configure: objects: not found
configure: 1: configure: objects: not found
configure: 1: configure: objects: not found
configure: creating ./config.status
and then running make, which does have the DOS line endings, results in
Code: [Select]
[K:\work\SDL2-os2]make
make: *** No rule to make target `build/SDL_url.lo', needed by `build/libSDL2.la'.  Stop.
I copied over the bitwise configure.ac and the compile worked until a pthread issue. I should repeat that and change the line endings in the makefile, though I'm sure I've used lots of makefiles with unix line endings. Whoever thought it was a good idea to have two official line endings including one consisting on a linefeed should be shot.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Autoconf and OS/2
« Reply #9 on: December 19, 2021, 05:08:08 am »
Changing the line endings in the makefile made no difference. Looking in build-scripts, they all seem to have unix line endings.
Rich wrote a nice little utility for changing line endings, attached. Copy to delcr.exe for the opposite effect.
Code: [Select]
W:\sys\bin>addcr.exe --help
 addcr / delcr  ::  Unix<-->OS/2 newline converter  ::  (C)2008 R.L.Walsh

   addcr [-options]  [source  [target]]   convert from Unix to OS/2
   delcr [/options]  [source  [target]]   convert from OS/2 to Unix

 With 0 arguments, reads from stdin and writes to stdout
 With 1 argument,  replaces source file with revised contents
 With 2 arguments, reads from source file and writes to target file
 Use '-' to specify stdin or stdout;  use '*' and '?' as wildcards
 Only text files are converted;  binary files are copied or ignored

 Options:  begin with '-' or '/' and group options together
 a | d - Add or Delete:  Change function without renaming .exe
 c - Ctl-chars: Allow bell bksp vtab esc & ctl-z in text files
 f - Force:     Convert files that appear to be binary
 i - Ignore:    Don't copy binary files to the target directory
 n - No-op:     Use when source starts with a '-' or '/'
 r - Replace:   Allow target files to replace unrelated files
                in the source directory - not recommended!
 s - Subdirectories:  Convert files in source's subdirectories
 v - Verbose:   Send the source & target filenames to stderr
 w - Where:     Where is the first binary character in a file
 z - ctl-Z:     Don't remove the ctl-z at the end of a file
 Rename this .exe to change its function (name must start with 'a' or 'd')

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Autoconf and OS/2
« Reply #10 on: December 19, 2021, 09:25:27 am »
It appears to be a shell issue. When the system posix shell is Dash you get a broken makefile. setting it to bash fixed the issue.
Don't think, that's the case. I used dash for the BWW version, too. I only have the problem with the new merged version.

@Dave: Thanks for the pointer to this tool.
And the missing objects bothered me, too, but I couldn't locate where the problem is, yet. At least, I'm not alone in this.
« Last Edit: December 19, 2021, 12:26:30 pm by Jochen Schäfer »

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Autoconf and OS/2
« Reply #11 on: December 19, 2021, 01:40:36 pm »
Silvan wrote a comment on Github, which I couldn't read because Github is sometimes weird.
So, I also checked configure.ac and discovered some changes, concerning line endings, I missed.
I haven't fixed all problems, yet, but I'm getting there.
Thanks Silvan for the hints.