[bug #65908] Make fails with 'Makefile:3857: *** missing 'endif'. Stop.

2024-06-23 Thread KO Myung-Hun
Follow-up Comment #3, bug #65908 (group make):

Then, it would be better that make provides the infos about that line not
mis-matched `endif'.



___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65908] Make fails with 'Makefile:3857: *** missing 'endif'. Stop.

2024-06-22 Thread KO Myung-Hun
URL:
  <https://savannah.gnu.org/bugs/?65908>

 Summary: Make fails with 'Makefile:3857: *** missing 'endif'.
 Stop.
   Group: make
   Submitter: lvzuufx
   Submitted: Sat 22 Jun 2024 01:44:50 PM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: SCM
Operating System: Any
   Fixed Release: None
   Triage Status: None


___

Follow-up Comments:


---
Date: Sat 22 Jun 2024 01:44:50 PM UTC By: KO Myung-Hun 
Hi/2.

While I'm working on git, make failed like :

Makefile:3857: *** missing 'endif'.  Stop.

Used make is 'GNU Make v4.4.90' from git repo whose head is commit e3f938, and
I'm working on OS/2.

v4.4.1 works fine.

I attach the testcase.






___
File Attachments:


---
Name: endif-testcase.zip  Size: 45KiB
<https://file.savannah.gnu.org/file/endif-testcase.zip?file_id=56183>

AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-3cd0d2c94962908e0e7c31b0cfb957af29c7d567.tar.gz

___

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65908>

___
Message sent via Savannah
https://savannah.gnu.org/




[PATCH] Fix jobserver does not work on OS/2

2023-12-13 Thread KO Myung-Hun
mkfifo() on OS/2 is a dummy, even it returns a wrong value on error.

Do not use it on OS/2.

* src/makeint.h (JOBSERVER_USE_FIFO): Do not define on OS/2.
---
 src/makeint.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/makeint.h b/src/makeint.h
index d55ccb6f..a50cf548 100644
--- a/src/makeint.h
+++ b/src/makeint.h
@@ -769,8 +769,8 @@ extern unsigned int no_intermediates;
 
 #if HAVE_MKFIFO
 /* It seems that mkfifo() is not working correctly, or at least not the way
-   GNU make wants it to work, on GNU/Hurd and Cygwin so don't use it there.  */
-# if !defined(JOBSERVER_USE_FIFO) && !MK_OS_HURD && !MK_OS_CYGWIN
+   GNU make wants it to work, on GNU/Hurd, Cygwin and EMX so don't use it 
there.  */
+# if !defined(JOBSERVER_USE_FIFO) && !MK_OS_HURD && !MK_OS_CYGWIN && 
!defined(__EMX__)
 #  define JOBSERVER_USE_FIFO 1
 # endif
 #endif
-- 
2.42.0




Re: [PATCH] Implement ttyname() for OS/2

2023-01-17 Thread KO Myung-Hun
Hi/2.

KO Myung-Hun wrote:
> OS/2 kLIBC has a declaration, but has not implemented.
> 

...

> +  if (type == HANDTYPE_DEVICE)
> +{
> +  if ((attr & 3) == 3)
> +return (char *) "/dev/con";
> +
> +  if ((attr & 4) == 4)
> +return (char *) "/dev/nul";
> +
> +  if ((attr & 8) == 8)
> +return (char *) "/dev/clock$";
> +}

I'm sorry I've modified this.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/

From 8d998c8f7cf1940635a61c1c50f93b8fd1b6f838 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Tue, 17 Jan 2023 20:47:15 +0900
Subject: [PATCH v2] Implement ttyname() for OS/2

OS/2 kLIBC has a declaration, but has not implemented.

* Makefile.am [OS/2]: define OS2ENV.
* configure.ac [OS/2]: define os2_SRCS.
* src/os2_ttyname.c: Implement ttyname() for OS/2.
---
 Makefile.am   |  6 ++
 configure.ac  |  9 
 src/os2_ttyname.c | 53 +++
 3 files changed, 68 insertions(+)
 create mode 100644 src/os2_ttyname.c

diff --git a/Makefile.am b/Makefile.am
index 686851ff..e8570985 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,6 +51,8 @@ vms_SRCS =	src/vms_exit.c src/vms_export_symbol.c src/vms_progname.c \
 
 amiga_SRCS =	src/amiga.c src/amiga.h
 
+os2_SRCS =	src/os2_ttyname.c
+
 glob_SRCS =	lib/fnmatch.c lib/fnmatch.h lib/glob.c lib/glob.h
 
 alloca_SRCS =	lib/alloca.c
@@ -90,6 +92,10 @@ else
   make_SOURCES += src/posixos.c
 endif
 
+if OS2ENV
+  make_SOURCES += $(os2_SRCS)
+endif
+
 if USE_CUSTOMS
   make_SOURCES += src/remote-cstms.c
 else
diff --git a/configure.ac b/configure.ac
index f5781853..e0eca7e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -449,6 +449,15 @@ AS_CASE([$host],
 AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
   ])
 
+os2_target_env=no
+AM_CONDITIONAL([OS2ENV], [false])
+
+AS_CASE([$host],
+  [*-*-os2*],
+   [AM_CONDITIONAL([OS2ENV], [true])
+os2_target_env=yes
+  ])
+
 AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
 [Define to the character that separates directories in PATH.])
 
diff --git a/src/os2_ttyname.c b/src/os2_ttyname.c
new file mode 100644
index ..6fde4af7
--- /dev/null
+++ b/src/os2_ttyname.c
@@ -0,0 +1,53 @@
+/* ttyname() implementation for OS/2
+
+Copyright (C) 2023 Free Software Foundation, Inc.
+This file is part of GNU Make.
+
+GNU Make is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include "makeint.h"
+
+#define INCL_DOS
+#include 
+
+#include 
+
+/* OS/2 kLIBC has a declaration for ttyname(), but has not implemented.  */
+char *ttyname (int fd)
+{
+  ULONG type;
+  ULONG attr;
+  ULONG rc;
+
+  rc = DosQueryHType (fd, , );
+  if (rc)
+{
+  errno = EBADF;
+  return NULL;
+}
+
+  if (type == HANDTYPE_DEVICE)
+{
+  if (attr & 3) /* 1 = KBD$, 2 = SCREEN$ */
+return (char *) "/dev/con";
+
+  if (attr & 4) /* 4 = NUL */
+return (char *) "/dev/nul";
+
+  if (attr & 8) /* 8 = CLOCK$ */
+return (char *) "/dev/clock$";
+}
+
+  errno = ENOTTY;
+  return NULL;
+}
-- 
2.30.0



[PATCH] Implement ttyname() for OS/2

2023-01-17 Thread KO Myung-Hun
OS/2 kLIBC has a declaration, but has not implemented.

* Makefile.am [OS/2]: define OS2ENV.
* configure.ac [OS/2]: define os2_SRCS.
* src/os2_ttyname.c: Implement ttyname() for OS/2.
---
 Makefile.am   |  6 ++
 configure.ac  |  9 
 src/os2_ttyname.c | 53 +++
 3 files changed, 68 insertions(+)
 create mode 100644 src/os2_ttyname.c

diff --git a/Makefile.am b/Makefile.am
index 686851ff..e8570985 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,6 +51,8 @@ vms_SRCS =src/vms_exit.c src/vms_export_symbol.c 
src/vms_progname.c \
 
 amiga_SRCS =   src/amiga.c src/amiga.h
 
+os2_SRCS = src/os2_ttyname.c
+
 glob_SRCS =lib/fnmatch.c lib/fnmatch.h lib/glob.c lib/glob.h
 
 alloca_SRCS =  lib/alloca.c
@@ -90,6 +92,10 @@ else
   make_SOURCES += src/posixos.c
 endif
 
+if OS2ENV
+  make_SOURCES += $(os2_SRCS)
+endif
+
 if USE_CUSTOMS
   make_SOURCES += src/remote-cstms.c
 else
diff --git a/configure.ac b/configure.ac
index f5781853..e0eca7e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -449,6 +449,15 @@ AS_CASE([$host],
 AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
   ])
 
+os2_target_env=no
+AM_CONDITIONAL([OS2ENV], [false])
+
+AS_CASE([$host],
+  [*-*-os2*],
+   [AM_CONDITIONAL([OS2ENV], [true])
+os2_target_env=yes
+  ])
+
 AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
 [Define to the character that separates directories in PATH.])
 
diff --git a/src/os2_ttyname.c b/src/os2_ttyname.c
new file mode 100644
index ..36a79599
--- /dev/null
+++ b/src/os2_ttyname.c
@@ -0,0 +1,53 @@
+/* ttyname() implementation for OS/2
+
+Copyright (C) 2023 Free Software Foundation, Inc.
+This file is part of GNU Make.
+
+GNU Make is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 3 of the License, or (at your option) any later
+version.
+
+GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program.  If not, see .  */
+
+#include "makeint.h"
+
+#define INCL_DOS
+#include 
+
+#include 
+
+/* OS/2 kLIBC has a declaration for ttyname(), but has not implemented.  */
+char *ttyname (int fd)
+{
+  ULONG type;
+  ULONG attr;
+  ULONG rc;
+
+  rc = DosQueryHType (fd, , );
+  if (rc)
+{
+  errno = EBADF;
+  return NULL;
+}
+
+  if (type == HANDTYPE_DEVICE)
+{
+  if ((attr & 3) == 3)
+return (char *) "/dev/con";
+
+  if ((attr & 4) == 4)
+return (char *) "/dev/nul";
+
+  if ((attr & 8) == 8)
+return (char *) "/dev/clock$";
+}
+
+  errno = ENOTTY;
+  return NULL;
+}
-- 
2.30.0




Re: [PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-17 Thread KO Myung-Hun



Paul Smith wrote:
> On Tue, 2023-01-17 at 01:38 +0900, KO Myung-Hun wrote:
>> What I meant is checking the existence of a rule for a target not a
>> real file built for a target.
> 
> But how do you check for a "rule for a target"?
> 
> What if the pattern rule is "%e" not "%.exe"?  That will still match of
> course.  Or "%xe" or whatever?  Or even "%o.exe"?  Are we going to
> check to find any possible pattern rule that might match a ".exe" and
> behave differently if we find one, even if it has nothing to do with
> actually creating a .exe file?

GNU Make stops if it cannot find a target like:

make: *** No rule to make target 'foo.exe'.  Stop.

I think, it's possible to use this logic in order to find a `foo.exe'
target. And if it fails, check a `foo.exe' file in `foo' target.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: [PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-16 Thread KO Myung-Hun
Hi/2.

Paul Smith wrote:
> On Mon, 2023-01-16 at 22:14 +0900, KO Myung-Hun wrote:
>>> But this does not seem like an easy thing to accomplish, at all. 
>>> What if there is a "%.exe" pattern rule, not an explicit rule for
>>> "foo.exe"?
>>
>> I think, it's possible to do so by finding a target as GNU Make finds
>> dependencies.
> 
> GNU Make doesn't try to resolve all the targets including all implicit
> targets first, then after they're all done try to build them.
> 
> Instead, it tries to build every target as it is needed.  So if you try
> to build "foo.exe" first and it finds an implicit target "%.exe" then
> you try to build "foo" second, it will see that the target "foo.exe"
> already exists.
> 
> But if you try to build "foo" first before "foo.exe", then there will
> be no target "foo.exe" yet because you haven't tried to build it, and
> it won't be found.  Note here the "foo.exe" has to be intermediate of
> course, otherwise it will be known to make even using an implicit rule.

What I meant is checking the existence of a rule for a target not a real
file built for a target.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: [PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-16 Thread KO Myung-Hun
Hi/2.

Paul Smith wrote:
> On Mon, 2023-01-16 at 00:15 +0900, KO Myung-Hun wrote:
>> Then, this patch is acceptable? Or MSYS is a special case ?
> 
> I don't think this patch is a good idea.  I said in my initial email:
> 
>> I don't think I like this change.  I understand its usefulness but in
>> general make never tries to manipulate the target names like this.
> 
> And I haven't changed my mind.
> 
> Also I asked:
> 
>> What do you do in situations where there are targets for BOTH "foo"
>> and "foo.exe" in the makefile?  Then when you want to build "foo" it
>> may decide that it's up to date, because it sees the "foo.exe" file
>> instead.
> 
> and you replied:
> 
>> In this case, Make should not find "foo.exe" for "foo" target.
> 
> But this does not seem like an easy thing to accomplish, at all.  What
> if there is a "%.exe" pattern rule, not an explicit rule for "foo.exe"?

I think, it's possible to do so by finding a target as GNU Make finds
dependencies.

> It seems like this behavior would be very confusing for users, where
> sometimes you would get one behavior and sometimes another, based on
> what other rules did or didn't exist.
> 
> The real problem here is that GCC is behaving in an unusual way, where
> you ask it to generate an output file with one name and instead it
> generates an output file with a different name.  My opinion is that
> this is a problem or an issue for GCC, and that we should not attempt
> to paper over that issue by making changes in GNU Make.

Ok, and thanks for your explanation!

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: [PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-15 Thread KO Myung-Hun
Hi/2.

Eli Zaretskii wrote:
>> Date: Sun, 15 Jan 2023 00:57:56 +0900
>> From: KO Myung-Hun 
>> CC: bug-make@gnu.org
>>
>>> How do you mean "make of mingw does not require $(EXEEXT)"?  AFAICT,
>>> if the Makefile defines a target FOO, and there's a file FOO.exe that
>>> is up to date wrt its dependencies, the MinGW Make will recompile
>>> anyway, because it doesn't understand that linking FOO produces
>>> FOO.exe.
>>>
>>> So I think MinGW and OS/2 are in the same wagon here.
>>
>> I've tested make v3.81 for i686-pc-msys shipped with msys.
> 
> You are right about MSYS Make, but MSYS is not MinGW, and AFAIK the
> patches to Make done by the (now defunct) MSYS team were not
> contributed upstream, so we don't know what they changed.
> 
> Note, however, that MSYS Make has other goals than MinGW: MSYS is
> supposed to emulate Unix enough to allow use of unaltered Unix
> Makefile's to build MinGW ports.  So the issue that you are talking
> about is an explicit goal for MSYS, more-or-less its raison d'ĂȘtre.
> Thus, it is not surprising that MSYS does this.

Then, this patch is acceptable? Or MSYS is a special case ?

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: [PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-14 Thread KO Myung-Hun
Hi/2.

Eli Zaretskii wrote:
>> Date: Sat, 14 Jan 2023 23:40:57 +0900
>> From: KO Myung-Hun 
>> CC: bug-make@gnu.org
>>
>>> Please describe the use case in detail.  This situation exists on
>>> other platforms, not just of OS/2, and we don't do anything like that
>>> for those other targets, AFAIK.  Instead, the Makefile should use
>>> $(EXEEXT) or somesuch to account for the issue.  I don't see why OS/2
>>> should be handled differently.  But maybe I'm missing something.
>>>
>>
>> Yes, I appended $(EXEEXT) if necessary for libiconv, coreutils, and so
>> on. BTW, I had a question while doing that. Because only OS/2 required
>> $(EXEEXT). Windows platform such as mingw also requires it, but until I
>> appended, it had not been there. In practice, make of mingw does not
>> require $(EXEEXT).
> 
> How do you mean "make of mingw does not require $(EXEEXT)"?  AFAICT,
> if the Makefile defines a target FOO, and there's a file FOO.exe that
> is up to date wrt its dependencies, the MinGW Make will recompile
> anyway, because it doesn't understand that linking FOO produces
> FOO.exe.
> 
> So I think MinGW and OS/2 are in the same wagon here.

I've tested make v3.81 for i686-pc-msys shipped with msys.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: [PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-14 Thread KO Myung-Hun
Hi/2.

Paul Smith wrote:
> On Fri, 2023-01-13 at 22:27 +0900, KO Myung-Hun wrote:
>> This pattern is usually used on UNIX. However, on OS/2, gcc creates
>> foo.exe not foo when an extension is not present, and Make check foo
>> only. Therefore Make tries to build foo whenever called.
> 
> I don't think I like this change.  I understand its usefulness but in
> general make never tries to manipulate the target names like this.  If
> users want to create a file named "foo.exe" they should use that as the
> target name.
> 
> I get that it's super-annoying that when you ask GCC to build a file
> named "foo" via "-o $@" it will actually create a file named "foo.exe"
> instead, but I think that's something that makefile authors will have
> to deal with, rather than make.
> 

I agree. But as you said, it's true that it's far less burden to porters.

> What do you do in situations where there are targets for BOTH "foo" and
> "foo.exe" in the makefile?  Then when you want to build "foo" it may
> decide that it's up to date, because it sees the "foo.exe" file
> instead.

In this case, Make should not find "foo.exe" for "foo" target. I willing
to modify my patch for this.

Thanks!

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: [PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-14 Thread KO Myung-Hun
Hi/2.

Eli Zaretskii wrote:
>> From: KO Myung-Hun 
>> Date: Fri, 13 Jan 2023 22:27:43 +0900
>>
>> For example,
>>
>> foo: foo.c
>> gcc $@ $<
>>
>> This pattern is usually used on UNIX. However, on OS/2, gcc creates
>> foo.exe not foo when an extension is not present, and Make check foo
>> only. Therefore Make tries to build foo whenever called.
> 
> Please describe the use case in detail.  This situation exists on
> other platforms, not just of OS/2, and we don't do anything like that
> for those other targets, AFAIK.  Instead, the Makefile should use
> $(EXEEXT) or somesuch to account for the issue.  I don't see why OS/2
> should be handled differently.  But maybe I'm missing something.
> 

Yes, I appended $(EXEEXT) if necessary for libiconv, coreutils, and so
on. BTW, I had a question while doing that. Because only OS/2 required
$(EXEEXT). Windows platform such as mingw also requires it, but until I
appended, it had not been there. In practice, make of mingw does not
require $(EXEEXT).

So I made this patch.

> In general, settling for 'foo.exe' when the target is 'foo' can easily
> cause false positives, so such a change should IMO not be introduced
> without a serious discussion of the possible downsides and
> regressions.

I agree.

Thanks!

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




[PATCH] Check .exe as well when a target does not exist on OS/2

2023-01-13 Thread KO Myung-Hun
For example,

foo: foo.c
gcc $@ $<

This pattern is usually used on UNIX. However, on OS/2, gcc creates
foo.exe not foo when an extension is not present, and Make check foo
only. Therefore Make tries to build foo whenever called.

* src/remake.c (f_mtime) [EMX]: Check a target again by appending .exe.
---
 src/remake.c | 29 +
 1 file changed, 29 insertions(+)

diff --git a/src/remake.c b/src/remake.c
index 62b3d791..99285498 100644
--- a/src/remake.c
+++ b/src/remake.c
@@ -1409,6 +1409,12 @@ f_mtime (struct file *file, int search)
   else
 #endif
 {
+#ifdef __EMX__
+  const char *saved_name = file->name;
+  size_t fname_len;
+
+try_again_with_dot_exe:
+#endif
   mtime = name_mtime (file->name);
 
   if (mtime == NONEXISTENT_MTIME && search && !file->ignore_vpath)
@@ -1452,6 +1458,29 @@ f_mtime (struct file *file, int search)
 mtime = name_mtime (name);
 }
 }
+#ifdef __EMX__
+  if (mtime == NONEXISTENT_MTIME)
+{
+  if (stricmp (_getext2 (file->name), ".exe"))
+{
+  fname_len = strlen (file->name);
+
+  file->name = alloca (fname_len + 4/*.exe*/ + 1);
+  memcpy ((char *)file->name, saved_name, fname_len);
+  memcpy ((char *)file->name + fname_len, ".exe", 4 + 1);
+
+  goto try_again_with_dot_exe;
+}
+}
+
+  fname_len = strlen (saved_name);
+
+  /* If found in VPATH, use it. Otherwise restore file->name. */
+  if (strlen (file->name) == fname_len + 4
+  && !strnicmp (file->name, saved_name, fname_len)
+  && !stricmp (file->name + fname_len, ".exe"))
+file->name = saved_name;
+#endif
 }
 
   /* Files can have bogus timestamps that nothing newly made will be
-- 
2.30.0




Re: [PATCH 0/8] Fix compilation on OS/2

2023-01-12 Thread KO Myung-Hun
Hi/2.

Paul Smith wrote:
> On Sun, 2022-11-20 at 23:42 +0900, KO Myung-Hun wrote:
>> These patches fix compilation on OS/2.
> 
> I have applied some of these patches as-is, and modified others, but I
> believe all the changes needed have been pushed to Git.

I've confirmed that all changes have been applied.

Thanks!

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: bootstrap fails due to certification expiration

2022-11-20 Thread KO Myung-Hun



Paul Smith wrote:
> On Fri, 2022-11-18 at 20:34 +0900, KO Myung-Hun wrote:
>> Downloaded: 10 files, 546K in 1.9s (283 KB/s)
>> ./bootstrap: autopull.sh failed.
>> -
>>
>> Any idea?
> 
> I'm not sure why it fails but looking at the script it seems you can
> run:
> 
>   ./autopull.sh --skip-po
> 
> to skip the downloading of the PO files.  Maybe that will help?
> 

In this case, make complains like:

-
make[1]: Entering directory 'F:/lang/work/make/m.git/po'
test ! -f ./make.pot || \
  test -z "be.gmo bg.gmo cs.gmo da.gmo de.gmo es.gmo fi.gmo fr.gmo
ga.gmo gl.gmo he.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo lt.gmo nl.gmo
pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo
zh_CN.gmo zh_TW.gmo" || F:/usr/local/bin/make.exe be.gmo bg.gmo cs.gmo
da.gmo de.gmo es.gmo fi.gmo fr.gmo ga.gmo gl.gmo he.gmo hr.gmo id.gmo
it.gmo ja.gmo ko.gmo lt.gmo nl.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo
sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo zh_CN.gmo zh_TW.gmo
make[2]: Entering directory 'F:/lang/work/make/m.git/po'
make[3]: Entering directory 'F:/lang/work/make/m.git/po'
File be.po does not exist. If you are a translator, you can create it
through 'msginit'.
make[3]: *** [Makefile:540: be.po-create] Error 1
make[3]: Leaving directory 'F:/lang/work/make/m.git/po'
make[2]: *** [Makefile:341: be.po] Error 2
make[2]: Leaving directory 'F:/lang/work/make/m.git/po'
make[1]: *** [Makefile:256: stamp-po] Error 2
make[1]: Leaving directory 'F:/lang/work/make/m.git/po'
-

If I copy .po files from po/.reference to po, I can avoid this problem.
But I want to do this automatically and cleanly.

> The best thing to do is to figure out what's wrong with your local root
> certificates that's causing this problem; it's likely only going to get
> worse going forward if you don't update your certificates and continue
> to use older ones.  But, I can't really help you with that.

Fortunately, I've fixed my root certificates problem.

Thanks!

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




[PATCH 6/8] Fix [-Werror=incompatible-pointer-types] on OS/2

2022-11-20 Thread KO Myung-Hun
* src/main.c (main) [__EMX__]: Type cast explicitly.
---
 src/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index eec93656..af3ce702 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2782,7 +2782,7 @@ main (int argc, char **argv, char **envp)
 child.output.syncout = 0;
 child.environment = environ;
 
-pid = child_execute_job (, 1, nargv);
+pid = child_execute_job (, 1, (char **)nargv);
 
 /* is this loop really necessary? */
 do {
-- 
2.30.0




[PATCH 7/8] Fix [-Werror=shadow] on OS/2

2022-11-20 Thread KO Myung-Hun
* src/job.c (construct_command_argv_internal) [__EMX__]: Just reuse
variables.
---
 src/job.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/job.c b/src/job.c
index 9f1e4a3b..800f3b30 100644
--- a/src/job.c
+++ b/src/job.c
@@ -3553,9 +3553,9 @@ construct_command_argv_internal (char *line, char 
**restp, const char *shell,
 /* new_line is local, must not be freed therefore
We use line here instead of new_line because we run the shell
manually.  */
-size_t line_len = strlen (line);
-char *p = new_line;
 char *q = new_line;
+line_len = strlen (line);
+p = new_line;
 memcpy (new_line, line, line_len + 1);
 /* Replace all backslash-newline combination and also following tabs.
Important: stop at the first '\n' because that's what the loop above
-- 
2.30.0




[PATCH 3/8] Fix assignment of read-only location error on OS/2

2022-11-20 Thread KO Myung-Hun
* src/job.c (construct_command_argv_internal) [__EMX__]: Use a buffer
allocated in a stack.
---
 src/job.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/job.c b/src/job.c
index b78f279c..aa848f0e 100644
--- a/src/job.c
+++ b/src/job.c
@@ -3226,7 +3226,11 @@ construct_command_argv_internal (char *line, char 
**restp, const char *shell,
 
 # ifdef __EMX__ /* is this necessary? */
 if (!unixy_shell && shellflags)
-  shellflags[0] = '/'; /* "/c" */
+  {
+char *shflags = strdupa (shellflags);
+shflags[0] = '/'; /* "/c" */
+shellflags = shflags;
+  }
 # endif
 
 /* In .ONESHELL mode we are allowed to throw the entire current
-- 
2.30.0




[PATCH 2/8] Define a HAVE___STRCHRNUL macro properly

2022-11-20 Thread KO Myung-Hun
lib/fnmatch.c tests a HAVE___STRCHRNUL macro to implement an alternative
__strchrnul().

Without this, compilation fails on OS/2 kLIBC due to duplicated
declarations of __strchrnul() like this:

-
gcc -DHAVE_CONFIG_H -I. -I../src   -D__ST_MT_ERRNO__  -Wno-cast-qual 
-Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef 
-Wno-unused-function -Wno-unused-parameter -Wno-float-conversion 
-Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits 
-Wno-unsuffixed-float-constants -O2 -Zomf -Zmt -MT libgnu_a-fnmatch.o -MD -MP 
-MF .deps/libgnu_a-fnmatch.Tpo -c -o libgnu_a-fnmatch.o `test -f 'fnmatch.c' || 
echo './'`fnmatch.c
fnmatch.c:135:1: error: static declaration of '__strchrnul' follows non-static 
declaration
  135 | __strchrnul (s, c)
  | ^~~
In file included from fnmatch.c:34:
f:/lang/gcc/usr/include/string.h:198:10: note: previous declaration of 
'__strchrnul' was here
  198 | char*__strchrnul(const char *, int);
  |  ^~~
-

* configure.ac: Check __strchrnul().
---
 configure.ac | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 9f688971..17291d4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,9 @@ AC_FUNC_CLOSEDIR_VOID
 # dir.c and our glob.c use dirent.d_type if available
 AC_STRUCT_DIRENT_D_TYPE
 
+# fnmatch.c uses __strchrnul()
+AC_CHECK_FUNCS([__strchrnul])
+
 # See if the user wants to add (or not) GNU Guile support
 AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
 [Support GNU Guile for embedded scripting])])
-- 
2.30.0




[PATCH 5/8] Fix [-Werror=discarded-qualifiers] on OS/2

2022-11-20 Thread KO Myung-Hun
* src/dir.c (dir_contents_file_exists_p) [__EMX__]: Use a buffer
allocated in a stack.
* src/job.c (exec_command) [__EMX__]: Type cast explicitly.
---
 src/dir.c | 6 +-
 src/job.c | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/dir.c b/src/dir.c
index b47e94fe..deecf622 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -658,7 +658,11 @@ dir_contents_file_exists_p (struct directory_contents *dir,
 
 #ifdef __EMX__
   if (filename != 0)
-_fnlwr (filename); /* lower case for FAT drives */
+{
+  char *fname = strdupa (filename);
+  _fnlwr (fname); /* lower case for FAT drives */
+  filename = fname;
+}
 #endif
   if (filename != 0)
 {
diff --git a/src/job.c b/src/job.c
index aa848f0e..9f1e4a3b 100644
--- a/src/job.c
+++ b/src/job.c
@@ -2600,7 +2600,7 @@ exec_command (char **argv, char **envp)
 # ifdef __EMX__
 if (!unixy_shell)
   {
-new_argv[1] = "/c";
+new_argv[1] = (char *)"/c";
 ++i;
 --argc;
   }
-- 
2.30.0




[PATCH 4/8] Fix [-Werror=unused-variable] on OS/2

2022-11-20 Thread KO Myung-Hun
* src/getopt.c (_getopt_initialize): Use statements without any effect.
* src/posixos.c (set_blocking): Declare parameters with UNUSED.
* src/remake.c (f_mtime) [__EMX__]: Declare adjustment with UNUSED.
---
 src/getopt.c  | 3 +++
 src/posixos.c | 2 +-
 src/remake.c  | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/getopt.c b/src/getopt.c
index 9f31a70d..fc7cead4 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -436,6 +436,9 @@ _getopt_initialize (int argc, char *const *argv, const char 
*optstring)
 nonoption_flags_len = 0;
 #endif
 
+  /* Make compiler happy.  */
+  (void)argc; (void)argv;
+
   return optstring;
 }
 
diff --git a/src/posixos.c b/src/posixos.c
index 44aeb346..0a737521 100644
--- a/src/posixos.c
+++ b/src/posixos.c
@@ -118,7 +118,7 @@ make_job_rfd ()
 }
 
 static void
-set_blocking (int fd, int blocking)
+set_blocking (int fd UNUSED, int blocking UNUSED)
 {
   /* If we're not using pselect() don't change the blocking.  */
 #ifdef HAVE_PSELECT
diff --git a/src/remake.c b/src/remake.c
index 4ce3d2a3..2851c773 100644
--- a/src/remake.c
+++ b/src/remake.c
@@ -1470,6 +1470,7 @@ f_mtime (struct file *file, int search)
   /* FAT filesystems round time to the nearest even second!
  Allow for any file (NTFS or FAT) to perhaps suffer from this
  brain damage.  */
+  UNUSED
   FILE_TIMESTAMP adjustment = (((FILE_TIMESTAMP_S (adjusted_mtime) & 1) == 0
  && FILE_TIMESTAMP_NS (adjusted_mtime) == 0)
 ? (FILE_TIMESTAMP) 1 << FILE_TIMESTAMP_LO_BITS
-- 
2.30.0




[PATCH 0/8] Fix compilation on OS/2

2022-11-20 Thread KO Myung-Hun
Hi/2.

These patches fix compilation on OS/2.

And these are based on git repo.

Review, please...





[PATCH 8/8] Fix [-Werror=dangling-else] on OS/2

2022-11-20 Thread KO Myung-Hun
* src/getopt.c (_getopt_internal): Insert explicit braces.
---
 src/getopt.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/getopt.c b/src/getopt.c
index fc7cead4..1535a3d5 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -680,16 +680,18 @@ _getopt_internal (int argc, char *const *argv, const char 
*optstring,
  else
{
  if (opterr)
-  if (argv[optind - 1][1] == '-')
-   /* --option */
-   fprintf (stderr,
-_("%s: option '--%s' doesn't allow an argument\n"),
-argv[0], pfound->name);
-  else
-   /* +option or -option */
-   fprintf (stderr,
-_("%s: option '%c%s' doesn't allow an argument\n"),
-argv[0], argv[optind - 1][0], pfound->name);
+   {
+ if (argv[optind - 1][1] == '-')
+   /* --option */
+   fprintf (stderr,
+_("%s: option '--%s' doesn't allow an argument\n"),
+argv[0], pfound->name);
+ else
+   /* +option or -option */
+   fprintf (stderr,
+_("%s: option '%c%s' doesn't allow an argument\n"),
+argv[0], argv[optind - 1][0], pfound->name);
+   }
 
  nextchar += strlen (nextchar);
 
-- 
2.30.0




[PATCH 1/8] Update README.OS2

2022-11-20 Thread KO Myung-Hun
* README.OS2: Apply the latest environment.
---
 README.OS2 | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.OS2 b/README.OS2
index 82f496e0..e9be44a5 100644
--- a/README.OS2
+++ b/README.OS2
@@ -73,7 +73,7 @@ III. * COMPILATION AND INSTALLATION *
 To recreate the configuration files use:
 
   export EMXSHELL=ksh
-  aclocal -I config
+  aclocal -I m4
   automake
   autoconf
   autoheader
@@ -93,7 +93,7 @@ Recommended environment variables and installation options:
 export CFLAGS="-O2 -Zomf -Zmt"
 export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 
0x6000"
 export RANLIB="echo"
-./configure --prefix=x:/usr --infodir=x:/usr/share/info 
--mandir=x:/usr/share/man --without-included-gettext
+./configure --prefix=x:/usr --infodir=x:/usr/share/info 
--mandir=x:/usr/share/man
 make AR=emxomfar
 make install
 
@@ -102,6 +102,8 @@ Note: If you use gcc 2.9.x I recommend to set also 
LIBS="-lgcc"
 Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
   See section I. for details.
 
+Note: If you use Open Watcom Linker instead of IBM Linker, remove
+  '-Zlinker /exepack:2' from LDFLAGS.
 
 IV. * NLS support *
 
-- 
2.30.0




Re: bootstrap fails due to certification expiration

2022-11-18 Thread KO Myung-Hun
Hi/2.

Paul Smith wrote:
> On Mon, 2022-11-14 at 13:29 +0900, KO Myung-Hun wrote:
>> ./autopull.sh: getting translations into po/.reference for make...
>> ERROR: cannot verify translationproject.org's certificate, issued by
>> 'CN=R3,O=Let\'s Encrypt,C=US':
>>   Issued certificate has expired.
>> To connect to translationproject.org insecurely, use
>> `--no-check-certificate'.
> 
> I have checked and the translationproject.org's certificate has not
> expired.  When I see this issue it usually means that your local system
> has an incorrect root certificate installed.  See for example:
> 
> https://stackoverflow.com/questions/62107565/wget-and-curl-stopped-working-with-https-wrongly-complain-about-an-expired-cert
> 
> (obviously this is on Ubuntu so it's not exactly your problem, but it's
> probably something like that).
> 
> Unfortunately it doesn't appear there's any command-line way to modify
> the options provided to wget in the autopull.sh script.
> 
> If you're not able to figure out how to fix your root certificates I
> guess you'll have to modify the bootstrap-funclib.sh file and change
> these lines:
> 
>   po_download_command_format=\
>   "wget --mirror --level=1 -nd -nv -A.po -P '%s' \
>https://translationproject.org/latest/%s/;
> 
> to add in the --no-check-certificates option as suggested by the error
> output.

I've tried, and got the following result:

-
./bootstrap: Bootstrapping from checked-out make sources...
Already on 'stable-202207'
Your branch is up to date with 'origin/stable-202207'.
./autopull.sh: consider installing git-merge-changelog from gnulib
./autopull.sh: getting translations into po/.reference for make...
WARNING: cannot verify translationproject.org's certificate, issued by
'CN=R3,O=Let\'s Encrypt,C=US':
  Issued certificate has expired.
Last-modified header missing -- time-stamps turned off.
2022-11-18 20:31:16 URL:https://translationproject.org/latest/make/
[6427/6427] -> "po/.reference/index.html.tmp" [1]
https://translationproject.org/robots.txt:
2022-11-18 20:31:16 ERROR 404: Not Found.
po/.reference/index.html?C=N;O=D.tmp: Bad file number
Cannot write to 'po/.reference/index.html?C=N;O=D.tmp' (Error 0).
WARNING: cannot verify translationproject.org's certificate, issued by
'CN=R3,O=Let\'s Encrypt,C=US':
  Issued certificate has expired.
po/.reference/index.html?C=M;O=A.tmp: Bad file number
Cannot write to 'po/.reference/index.html?C=M;O=A.tmp' (Error 0).
WARNING: cannot verify translationproject.org's certificate, issued by
'CN=R3,O=Let\'s Encrypt,C=US':
  Issued certificate has expired.
po/.reference/index.html?C=S;O=A.tmp: Bad file number
Cannot write to 'po/.reference/index.html?C=S;O=A.tmp' (Error 0).
WARNING: cannot verify translationproject.org's certificate, issued by
'CN=R3,O=Let\'s Encrypt,C=US':
  Issued certificate has expired.
po/.reference/index.html?C=D;O=A.tmp: Bad file number
Cannot write to 'po/.reference/index.html?C=D;O=A.tmp' (Error 0).
WARNING: cannot verify translationproject.org's certificate, issued by
'CN=R3,O=Let\'s Encrypt,C=US':
  Issued certificate has expired.
Last-modified header missing -- time-stamps turned off.
2022-11-18 20:31:22 URL:https://translationproject.org/latest/ [30430]
-> "po/.reference/index.html.tmp" [1]
2022-11-18 20:31:23 URL:https://translationproject.org/latest/make/de.po
[66817/66817] -> "po/.reference/de.po" [1]
2022-11-18 20:31:25 URL:https://translationproject.org/latest/make/gl.po
[57031/57031] -> "po/.reference/gl.po" [1]
2022-11-18 20:31:25 URL:https://translationproject.org/latest/make/he.po
[42054/42054] -> "po/.reference/he.po" [1]
2022-11-18 20:31:26 URL:https://translationproject.org/latest/make/id.po
[62153/62153] -> "po/.reference/id.po" [1]
2022-11-18 20:31:27 URL:https://translationproject.org/latest/make/ja.po
[74715/74715] -> "po/.reference/ja.po" [1]
2022-11-18 20:31:30 URL:https://translationproject.org/latest/make/sr.po
[74975/74975] -> "po/.reference/sr.po" [1]
2022-11-18 20:31:31 URL:https://translationproject.org/latest/make/uk.po
[79629/79629] -> "po/.reference/uk.po" [1]
2022-11-18 20:31:31 URL:https://translationproject.org/latest/make/vi.po
[64663/64663] -> "po/.reference/vi.po" [1]
FINISHED --2022-11-18 20:31:32--
Total wall clock time: 18s
Downloaded: 10 files, 546K in 1.9s (283 KB/s)
./bootstrap: autopull.sh failed.
-

Any idea?

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




bootstrap fails due to certification expiration

2022-11-14 Thread KO Myung-Hun
Hi/2.

I'm trying to build GNU Make of git repo on OS/2. However, I've
encountered a problem at bootstrap step like this:

-
./bootstrap: Bootstrapping from checked-out make sources...
Already on 'stable-202207'
Your branch is up to date with 'origin/stable-202207'.
./autopull.sh: consider installing git-merge-changelog from gnulib
./autopull.sh: getting translations into po/.reference for make...
ERROR: cannot verify translationproject.org's certificate, issued by
'CN=R3,O=Let\'s Encrypt,C=US':
  Issued certificate has expired.
To connect to translationproject.org insecurely, use
`--no-check-certificate'.
./bootstrap: autopull.sh failed.
-

What should I do?

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: [PATCH 1/2] Fix duplicated __strchrnul() declaration error on OS/2 kLIBC

2022-11-14 Thread KO Myung-Hun
Hi/2.

Paul Smith wrote:
> On Wed, 2022-11-09 at 22:45 +0900, KO Myung-Hun wrote:
>> OS/2 kLIBC has __strchrnul(). But HAVE___STRCHRNUL is undefined.
>> 'static' declarion of __strchrnul() causes an error with gcc4 because
>> OS/2 kLIBC declares __strchrnul() as public.
> 
> I assume kLIBC is a libc implementation for OS/2?
> 

Yes. kLIBC is a successor of EMX.

> I'm not sure I like this solution, mainly because fnmatch.c and glob.c
> are "inherited" from gnulib and I don't like to change them (although
> they are very far divorced from upstream at this point).
> 
> My understanding of the problem is that we are missing a
> HAVE__STRCHRNUL.  Wouldn't it make more sense to add that to the
> config.h?
> 

Ok, I've attached a new patch.

> But, I don't quite understand how the configure works on OS/2.  Can you
> clarify whether the steps in the README.OS2 document are still correct?
> Do you indeed run the configure script etc. and is there enough support
> on OS/2 for that to work?
> 
> Maybe the first thing that needs to be done is to review the contents
> of the README.OS2 and verify that it still is all valid, and if not
> submit changes to make it correct.
> 

I've updated README.OS2 in according to the latest environment.

Ah, the patches are based on 4.4 tar ball release.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/

From 370d6bad0131d05f97377cbbace590d2d8d90355 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Tue, 8 Nov 2022 21:16:39 +0900
Subject: [PATCH] Define a HAVE___STRCHRNUL macro properly

lib/fnmatch.c tests a HAVE___STRCHRNUL macro to implement an alternative
__strchrnul().

Without this, compilation fails on OS/2 kLIBC due to duplicated
declarations of __strchrnul() like this:

-
gcc -DHAVE_CONFIG_H -I. -I../src   -D__ST_MT_ERRNO__  -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -O2 -Zomf -Zmt -MT libgnu_a-fnmatch.o -MD -MP -MF .deps/libgnu_a-fnmatch.Tpo -c -o libgnu_a-fnmatch.o `test -f 'fnmatch.c' || echo './'`fnmatch.c
fnmatch.c:135:1: error: static declaration of '__strchrnul' follows non-static declaration
  135 | __strchrnul (s, c)
  | ^~~
In file included from fnmatch.c:34:
f:/lang/gcc/usr/include/string.h:198:10: note: previous declaration of '__strchrnul' was here
  198 | char*__strchrnul(const char *, int);
  |  ^~~
-

* configure.ac: Check __strchrnul().
---
 configure.ac | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 9f68897..17291d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,9 @@ AC_FUNC_CLOSEDIR_VOID
 # dir.c and our glob.c use dirent.d_type if available
 AC_STRUCT_DIRENT_D_TYPE
 
+# fnmatch.c uses __strchrnul()
+AC_CHECK_FUNCS([__strchrnul])
+
 # See if the user wants to add (or not) GNU Guile support
 AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
 [Support GNU Guile for embedded scripting])])
-- 
2.30.0

From 8acca57b1b28d866f4c13bbf390b9fecb87e5c05 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun 
Date: Mon, 14 Nov 2022 13:11:11 +0900
Subject: [PATCH] Update README.OS2

* README.OS2: Apply the latest environment.
---
 README.OS2 | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.OS2 b/README.OS2
index 82f496e..8f1105e 100644
--- a/README.OS2
+++ b/README.OS2
@@ -73,7 +73,7 @@ III. * COMPILATION AND INSTALLATION *
 To recreate the configuration files use:
 
   export EMXSHELL=ksh
-  aclocal -I config
+  aclocal -I m4
   automake
   autoconf
   autoheader
@@ -93,7 +93,7 @@ Recommended environment variables and installation options:
 export CFLAGS="-O2 -Zomf -Zmt"
 export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
 export RANLIB="echo"
-./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man --without-included-gettext
+./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man
 make AR=emxomfar
 make install
 
@@ -102,6 +102,8 @@ Note: If you use gcc 2.9.x I recommend to set also LIBS="-lgcc"
 Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
   See section I. for details.
 
+Note: If you use a Open Watcom Linker instead of a IBM Linker, remove
+  '-Zlinker /exepack:2 -Zlinker /pm:vio' from LDFLAGS.
 
 IV. * NLS support *
 
-- 
2.30.0



[PATCH 1/2] Fix duplicated __strchrnul() declaration error on OS/2 kLIBC

2022-11-09 Thread KO Myung-Hun
OS/2 kLIBC has __strchrnul(). But HAVE___STRCHRNUL is undefined.
'static' declarion of __strchrnul() causes an error with gcc4 because
OS/2 kLIBC declares __strchrnul() as public.

-
gcc -DHAVE_CONFIG_H -I. -I../src   -D__ST_MT_ERRNO__  -Wno-cast-qual 
-Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef 
-Wno-unused-function -Wno-unused-parameter -Wno-float-conversion 
-Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits 
-Wno-unsuffixed-float-constants -O2 -Zomf -Zmt -MT libgnu_a-fnmatch.o -MD -MP 
-MF .deps/libgnu_a-fnmatch.Tpo -c -o libgnu_a-fnmatch.o `test -f 'fnmatch.c' || 
echo './'`fnmatch.c
fnmatch.c:135:1: error: static declaration of '__strchrnul' follows non-static 
declaration
  135 | __strchrnul (s, c)
  | ^~~
In file included from fnmatch.c:34:
f:/lang/gcc/usr/include/string.h:198:10: note: previous declaration of 
'__strchrnul' was here
  198 | char*__strchrnul(const char *, int);
  |  ^~~
-
---
 lib/fnmatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/fnmatch.c b/lib/fnmatch.c
index 4da8c5f..decfe7a 100644
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -130,7 +130,7 @@ extern int errno;
 
 /* This function doesn't exist on most systems.  */
 
-# if !defined HAVE___STRCHRNUL && !defined _LIBC
+# if !defined HAVE___STRCHRNUL && !defined _LIBC && !defined __KLIBC__
 static char *
 __strchrnul (s, c)
  const char *s;
-- 
2.30.0




[PATCH 2/2] Fix assignment of read-only location error OS/2

2022-11-09 Thread KO Myung-Hun
-
gcc -DHAVE_CONFIG_H   -Isrc -I./src -Ilib -I./lib 
-DLIBDIR=\"/usr/local/lib\" -DLOCALEDIR=\"/usr/local/share/locale\"   
-D__ST_MT_ERRNO__  -O2 -Zomf -Zmt -MT src/job.o -MD -MP -MF $depbase.Tpo -c -o 
src/job.o src/job.c &&\
mv -f $depbase.Tpo $depbase.Po
src/job.c: In function 'construct_command_argv_internal':
src/job.c:3229:21: error: assignment of read-only location '*shellflags'
 3229 |   shellflags[0] = '/'; /* "/c" */
  | ^
-
---
 src/job.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/job.c b/src/job.c
index b78f279..22b4a82 100644
--- a/src/job.c
+++ b/src/job.c
@@ -3226,7 +3226,13 @@ construct_command_argv_internal (char *line, char 
**restp, const char *shell,
 
 # ifdef __EMX__ /* is this necessary? */
 if (!unixy_shell && shellflags)
-  shellflags[0] = '/'; /* "/c" */
+  {
+int n = strlen (shellflags) + 1;
+char *flags = alloca (n);
+memcpy (flags, shellflags, n);
+flags[0] = '/'; /* "/c" */
+shellflags = flags;
+  }
 # endif
 
 /* In .ONESHELL mode we are allowed to throw the entire current
-- 
2.30.0




Re: GNU Make 4.4 released!

2022-11-08 Thread KO Myung-Hun
Hi/2.

Paul Smith wrote:
> On Mon, 2022-11-07 at 20:40 +0900, KO Myung-Hun wrote:
>> May I take over OS/2 port maintenance ?
>> For this, what should I do ?
> 
>1. Subscribe to this mailing list and announce your intention to
>   work on this (to prevent possible duplication of effort).

Already done.

>2. Download the latest release (currently GNU Make 4.4).
>3. Get it to compile on OS/2 and, if possible, run the regression
>   test suite (if you have Perl on OS/2).
>4. If you can't run the regression test suite, then generate your
>   own set of tests (for example some other software that you can
>   use GNU Make to build, especially software that makes use of GNU
>   Make features).

I've built successfully with a little changes. I'll try to run
regression test suite later.

>5. Once you're satisfied that it works properly, post a patch or set
>   of patches for the changes you needed to make to get it working,
>   to this mailing list.
>6. Likely there will need to be a conversation about the best way to
>   address various issues so be prepared to rework your changes if
>   necessary.

Ok, I'll post later.

>7. If your changes are at all extensive, you will need to fill out
>   paperwork to assign copyright for your changes to the FSF, and
>   your employer (if they have rights to your work which most do)
>   will need to approve this as well. Contact me to get the needed
>   paperwork.

I have this already for GNU Make.

>8. Commit to testing and updating the port when new prereleases of
>   GNU Make are announced.
> 
> That's pretty much it.
> 
> You should consider carefully whether it's really worthwhile to make
> this effort. Presumably there is already some version of GNU Make that
> works on OS/2 and can be used there which satisfies all current needs.
> That version obviously will continue to be available: no one is
> suggesting changing published versions.
> 

I know. And I'm already maintaining GNU Make v3.81 for OS/2 at
https://github.com/komh/make-os2. I'll try to merge the patches in there.

> Most of the new features available in GNU Make, such as Guile support,
> dynamic object loading, jobserver, output sync, etc. almost certainly
> can't be made to work on OS/2 and so will just need to be disabled. So
> the question is, is keeping this port up-to-date a good use of
> resources?
> 

I think so. And if some projects requires newer GNU Make, working on GNU
Make at that time needs more resources.

> Of course, only the OS/2 users can answer this question.
> 
> If you decide it is worthwhile, and you have the bandwidth and ability
> to do it, then welcome aboard!

I willing to do.

Thanks!

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/




Re: GNU Make 4.4 released!

2022-11-07 Thread KO Myung-Hun
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi/2.

Paul Smith wrote:
> 
>
>
> 
GNU make is a tool which controls the generation of executables and
> other non-source files of a program from the program's source 
> files.
> 
> You can learn more at: https://www.gnu.org/software/make/ 
> 
>
>
> 
The next stable release of GNU make, 4.4, is available now for
> download:
> 
> 5da8b0fcc500de9c254ca59e58558b27  make-4.4.tar.lz 
> d7575a26a94ee8427130e9db23cdaa78  make-4.4.tar.gz
> 
> You can obtain a copy from: https://ftp.gnu.org/gnu/make/?C=M;O=D
> You can choose a nearby mirror:
> https://ftpmirror.gnu.org/make/ A list of mirror sites is
> available:  https://www.gnu.org/order/ftp.html
> 
> - NEWS 
> 
>
>
> 
Version 4.4 (31 Oct 2022)
> 
> A complete list of bugs fixed in this version is available here:
> 
> https://sv.gnu.org/bugs/index.php?group=make_id=111_release_id=109=custom
>
>
> 
* WARNING: Deprecation! The following systems are deprecated in
> this release: - OS/2 (EMX) - AmigaOS - Xenix - Cray In the NEXT 
> release of GNU Make, support for these systems will be removed. If 
> you want to see them continue to be supported, contact 
> .
> 

May I take over OS/2 port maintenance ?

For this, what should I do ?

- -- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.40 on Intel Core i7-3615QM 2.30GHz with 12GB RAM

Korean OS/2 User Community : http://www.os2.kr/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (OS/2)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFjaO6mE9YstvghgroRAkVsAJ9ouiaxfYrwo0AKwdrfA+mfEzbSZwCgsJyA
8paDaNaM5KXAEQxh49e2BYQ=
=2AJ7
-END PGP SIGNATURE-