Skip to content

Commit

Permalink
pcireg: Add cp437 conversion to Windows target
Browse files Browse the repository at this point in the history
  • Loading branch information
richardg867 committed Oct 23, 2024
1 parent 73faeb9 commit 86cc9b3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ jobs:
cd ${{ github.workspace }}/pcireg
wmake
make -f Makefile.uefi ARCH=x86_64
make -f Makefile.gcc clean all CC=i686-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 DEST=pciregw
make -f Makefile.gcc clean all CC=x86_64-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 DEST=pciregw64
make -f Makefile.gcc clean all CC=i686-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 CP437_CONV=y DEST=pciregw
make -f Makefile.gcc clean all CC=x86_64-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 CP437_CONV=y DEST=pciregw64
make -f Makefile.gcc clean all CC=i686-linux-gnu-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static
python3 pciids.py
- name: Build `usblgoff`
Expand Down
2 changes: 2 additions & 0 deletions clib/clib_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# include <uefi.h>
#else
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
#endif
#include "clib_pci.h"
#ifdef PCI_LIB_VERSION
Expand Down
2 changes: 1 addition & 1 deletion clib/clib_term.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void
term_unbuffer_stdout()
{
#ifdef _WIN32
SetConsoleOutputCP(65001);
SetConsoleOutputCP(437);
#endif
}

Expand Down
6 changes: 6 additions & 0 deletions clib/gcc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ CC ?= "gcc"
all: $(DEST)

%.o: %.c $(HEADERS)
ifeq "$(CP437_CONV)" "y"
../cp437/cp437 $<
$(CC) -I../clib $(CFLAGS) -x c -c $<_cp437 -o $@
-rm -f $<_cp437
else
$(CC) -I../clib $(CFLAGS) -c $< -o $@
endif

$(DEST): $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) $(LDAPPEND) -o $@
Expand Down
4 changes: 2 additions & 2 deletions pcireg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Building
make CROSS_COMPILE=i686-w64-mingw32- HOST=i586-windows ZLIB=no DNS=no SHARED=no IDSDIR=""
sudo make install-lib PREFIX=/usr/i686-w64-mingw32
cd ..
make -f Makefile.gcc CC=i686-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 DEST=pciregw
make -f Makefile.gcc CC=i686-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 CP437_CONV=y DEST=pciregw
```
* 64-bit:
```
Expand All @@ -62,7 +62,7 @@ Building
make CROSS_COMPILE=x86_64-w64-mingw32- HOST=x86_64-windows ZLIB=no DNS=no SHARED=no IDSDIR=""
sudo make install-lib PREFIX=/usr/x86_64-w64-mingw32
cd ..
make -f Makefile.gcc CC=x86_64-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 DEST=pciregw64
make -f Makefile.gcc CC=x86_64-w64-mingw32-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static LDAPPEND=-lcfgmgr32 CP437_CONV=y DEST=pciregw64
```

### Linux target
Expand Down

0 comments on commit 86cc9b3

Please sign in to comment.