Files
MINGW-packages/mingw-w64-gputils
jhol 4187fe3ada Fix gputils build, and enable default search paths (#26578)
* gputils: Set language standard to gnu17

The latest version of GCC in the mingw tool-chain is configured to build
using C23 by default, however, gputils is not yet compatible with this
language standard.

gputils has the following issues:

  - It declares a function prototype for getenv() without arguments. In
    previous C language standards, this meant that the argument list was
    unspecified, and so calling getenv with a string argument was valid.
    This is no longer the case in C23.

  - It declares and enum: "gp_boolean", containing two values: "true"
    and "false". These names are now reserved words in C23.

This patch corrects these issues by setting the "-std=gnu17" in the
CFLAGS.

* gputils: Allow default search paths

By default, gputils disables the default search paths for includes and
libraries on Windows on the assumption that a portable build is
required.

As a result, gpasm fails to assemble simple files, for example:

  include "p18lf8723.inc"

The error can be avoided by adding a "-I" option to the gpasm command
line or with the GPUTILS_HEADER_PATH environment variable, however this
is inconvenient for users. The lack of default include path also breaks
the configure script of sdcc, which probes for device support by
attempting to assemble a file similar to the example for every device.

This patch solves the issue by adding a patch to gputils, which deduces
the installation prefix based on the executable path, and uses this to
construct HEADER_PATH (as well as LKR_PATH and LIB_PATH).

The fix can be seen by running "gpasm -h". With the fix applied, text
similar to the following will be printed:

  Default header file path C:\msys64\mingw64\share\gputils\header
2025-12-06 11:36:48 +01:00
..