Fixed --enabled-debug on Windows MSYS2
This fixes the prior logic that relies on the (*)curses library
and header existing in compiler-derived default locations
such as /usr/include, and /usr/lib. However, if the package manager
happens to not install them there, then they will not be found
and the check will fail.
Four scenarios:
1. `./configure` or `./configure --enable-debug=no` produce:
(no mention of debugger; configure continues)
2. `./configure --enable-debug=wrong` produces:
configure: error: --enable-debug=wrong was requested but the value "wrong" is invalid
(terminates with exit code 1)
3. `./configure --enable-debug` produces:
config.h:
defines C_DEBUG 1
With only ncurses library installed:
configure: debugger was requested, finding curses library ...
checking for NCURSES... yes
configure: debugger enabled using the ncurses library
Makefile:
CPPFLAGS = ... -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/local/ncurses ...
LIBS = ... -L/usr/local/ncurses -lncurses -ltinfo ...
With only ncursesw installed:
configure: debugger was requested, finding curses library ...
checking for NCURSES... no
checking for NCURSESW... yes
configure: debugger enabled using the ncursesw library
Makefile:
CPPFLAGS = ... -I/opt/ncursesw ...
LIBS = ... -L/opt/ncursesw -lncursesw ...
With only pdcurses isntalled:
configure: debugger was requested, finding curses library ...
checking for NCURSES... no
checking for NCURSESW... no
checking for PDCURSES... yes
configure: debugger enabled using the pdcurses library
Makefile:
CPPFLAGS = ... -I/usr/local/pdcurses ...
LIBS = ... -L/usr/local/pdcurses -lpdcurses -ltinfo ...
Without any curses library installed:
configure: debugger was requested, finding curses library ...
checking for NCURSES... no
checking for NCURSESW... no
checking for PDCURSES... no
configure: error: Package requirements were not met:
<pkg-info prints info about missing package>
(terminates with exit code 1)
4. `./configure --enable-debug=heavy` produces same as above, but:
config.h:
defines C_DEBUG 1
defines C_HEAVY_DEBUG 1
The configure message mentions heavy, for example:
configure: debugger was requested, finding curses library ...
checking for NCURSES... yes
configure: debugger with heavy debugging enabled using the ncurses library
This commit is contained in:
parent
5cc7e300e5
commit
12ee84cfd4
4 changed files with 53 additions and 44 deletions
5
.github/scripts/shrink-msys2.sh
vendored
5
.github/scripts/shrink-msys2.sh
vendored
|
|
@ -37,8 +37,9 @@ for dir in /usr /mingw32 /mingw64; do
|
|||
| xargs -0 ./bin/strip.exe --strip-unneeded
|
||||
done
|
||||
|
||||
# Delete MinGW's share directories
|
||||
rm -rf /mingw*/share
|
||||
# Delete documentation directories
|
||||
rm -rf /mingw*/share/man
|
||||
rm -rf /mingw*/share/doc
|
||||
|
||||
# This entire script is best-effort, so always return success
|
||||
exit 0
|
||||
|
|
|
|||
18
.github/workflows/config.yml
vendored
18
.github/workflows/config.yml
vendored
|
|
@ -20,11 +20,9 @@ jobs:
|
|||
- name: Linux
|
||||
os: ubuntu-latest
|
||||
compiler: gcc
|
||||
|
||||
# Disabled temporarily due to https://github.com/dreamer/dosbox-staging/issues/86
|
||||
# - configure_flags: --enable-debug
|
||||
# - configure_flags: --enable-debug-heavy
|
||||
conf:
|
||||
- configure_flags: --enable-debug
|
||||
- configure_flags: --enable-debug=heavy
|
||||
- configure_flags: --enable-alsa-midi
|
||||
- configure_flags: --disable-core-inline
|
||||
- configure_flags: --disable-dynamic-x86
|
||||
|
|
@ -56,7 +54,7 @@ jobs:
|
|||
id: cache-msys2
|
||||
with:
|
||||
path: 'C:/tools/msys64'
|
||||
key: msys2-GCC-64-${{ steps.get-date.outputs.date }}-1
|
||||
key: msys2-GCC-64-${{ steps.get-date.outputs.date }}-2
|
||||
|
||||
- name: Install MSYS2 (Windows)
|
||||
if: matrix.system.name == 'Windows' && steps.cache-msys2.outputs.cache-hit != 'true'
|
||||
|
|
@ -84,6 +82,12 @@ jobs:
|
|||
shell: python scripts\msys-bash.py {0}
|
||||
run: scripts/build.sh -c ${{ matrix.system.compiler }} -t debug --bin-path /mingw64/bin ${{ matrix.conf.configure_flags }}
|
||||
|
||||
- name: Build ${{ matrix.conf.configure_flags }} (non-Windows)
|
||||
if: matrix.system.name != 'Windows'
|
||||
- name: Build ${{ matrix.conf.configure_flags }} (macOS)
|
||||
if: matrix.system.name == 'macOS'
|
||||
run: |
|
||||
export PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
./scripts/build.sh -c ${{ matrix.system.compiler }} -t debug ${{ matrix.conf.configure_flags }}
|
||||
|
||||
- name: Build ${{ matrix.conf.configure_flags }} (Linux)
|
||||
if: matrix.system.name == 'Linux'
|
||||
run: ./scripts/build.sh -c ${{ matrix.system.compiler }} -t debug ${{ matrix.conf.configure_flags }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue