Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add DJGPP #789

Merged
merged 49 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5b64b47
try to bring up djgpp build
bradh352 Jun 17, 2024
2d5b67b
fix
bradh352 Jun 17, 2024
8efbb96
fix
bradh352 Jun 17, 2024
d2df05e
fix
bradh352 Jun 17, 2024
c7406ba
fix
bradh352 Jun 17, 2024
b924e10
fix
bradh352 Jun 17, 2024
7991286
debug
bradh352 Jun 17, 2024
16970f9
debug
bradh352 Jun 17, 2024
c886a50
debug
bradh352 Jun 17, 2024
36cdbff
debug
bradh352 Jun 17, 2024
d528945
debug
bradh352 Jun 17, 2024
56e8d0f
workaround
bradh352 Jun 17, 2024
12e52cb
workaround
bradh352 Jun 17, 2024
9894e53
workaround
bradh352 Jun 17, 2024
8808d48
workaround
bradh352 Jun 17, 2024
c9e8e8e
workaround
bradh352 Jun 17, 2024
fa9fc5e
workaround
bradh352 Jun 17, 2024
a14f2a6
workaround
bradh352 Jun 17, 2024
3c360e0
workaround
bradh352 Jun 17, 2024
c710b28
workaround
bradh352 Jun 17, 2024
554be41
workaround
bradh352 Jun 17, 2024
9e54cc4
workaround
bradh352 Jun 17, 2024
fd9caaf
workaround
bradh352 Jun 17, 2024
e80b5cb
workaround
bradh352 Jun 17, 2024
8a462e5
workaround
bradh352 Jun 17, 2024
e741d08
workaround
bradh352 Jun 17, 2024
88cadc5
workaround
bradh352 Jun 17, 2024
682f82b
workaround
bradh352 Jun 17, 2024
3df7589
workaround
bradh352 Jun 17, 2024
9b7fb08
workaround
bradh352 Jun 17, 2024
3290e27
workaround
bradh352 Jun 17, 2024
9d52173
attempt fix
bradh352 Jun 17, 2024
97df57c
attempt fix
bradh352 Jun 17, 2024
2a1dbc4
attempt fix
bradh352 Jun 17, 2024
2aafa04
fix
bradh352 Jun 17, 2024
9593039
fix
bradh352 Jun 17, 2024
b6d0cbe
fix
bradh352 Jun 17, 2024
f12d783
fix
bradh352 Jun 17, 2024
445e11c
fix
bradh352 Jun 17, 2024
afaeb1c
fix
bradh352 Jun 17, 2024
e6a6f21
simplify
bradh352 Jun 17, 2024
d31a2de
fix
bradh352 Jun 17, 2024
5960161
corrections
bradh352 Jun 17, 2024
6be3944
fixes
bradh352 Jun 17, 2024
4656113
fix some watt32 stuff
bradh352 Jun 17, 2024
65684cb
warnings
bradh352 Jun 17, 2024
7996fdb
try to get rid of warnings
bradh352 Jun 17, 2024
d87b43b
fix
bradh352 Jun 17, 2024
18ca1b2
fix watt32
bradh352 Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/djgpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
name: DJGPP
on:
push:
pull_request:

jobs:
build:
runs-on: windows-latest
steps:
- name: Install GNU Make
run: |
choco install --yes make
- name: Checkout c-ares
uses: actions/checkout@v4
- name: Checkout Watt-32
uses: actions/checkout@v4
with:
repository: gvanem/Watt-32
path: watt-32
- name: Fetch DJGPP
run: |
Invoke-WebRequest https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-mingw-gcc1220-standalone.zip -OutFile djgpp-mingw-gcc1220-standalone.zip
Expand-Archive -Path djgpp-mingw-gcc1220-standalone.zip -DestinationPath .
- name: Set DJGPP_PATH environment variable
run: |
$PWD=Get-Location
$DJGPP_PATH="$PWD/djgpp".Replace('\', '/')
Add-Content -Path $Env:GITHUB_ENV -Value "DJGPP_PATH=$DJGPP_PATH"
- name: Set WATT_ROOT Environment variable
run: |
$PWD=Get-Location
$WATT_ROOT="$PWD/watt-32".Replace('\', '/')
Add-Content -Path $Env:GITHUB_ENV -Value "WATT_ROOT=$WATT_ROOT"
- name: Build Watt-32
run: |
cd watt-32\src
& .\configur.bat djgpp
echo "Configured"
make -f djgpp.mak
env:
DJGPP_PREFIX: "${{ env.DJGPP_PATH }}/bin/i586-pc-msdosdjgpp"
# Powershell doesn't preserve environment variables set by configur.bat
MKMAKE: ..\util\win32\mkmake.exe
MKDEP: ..\util\win32\mkdep.exe
HC_ERR: ..\util\win32\hc_err.exe
WC_ERR: ..\util\win32\wc_err.exe
BCC_ERR: ..\util\win32\bcc_err.exe
W32_BIN2C: ..\util\win32\bin2c.exe
W32_BIN2C_: ../util/win32/bin2c.exe
W32_NASM: ..\util\win32\nasm.exe
W32_NASM_: ../util/win32/nasm.exe
DJ_ERR: ..\util\win32\dj_err.exe
- name: Build c-ares
run: |
Copy-Item "include\ares_build.h.dist" -Destination "include\ares_build.h"
make -f Makefile.dj
env:
DJ_PREFIX: "${{ env.DJGPP_PATH }}/bin/i586-pc-msdosdjgpp-"



39 changes: 38 additions & 1 deletion Makefile.dj
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,47 @@ WATT32_LIB = $(WATT32_ROOT)/lib/libwatt.a
OBJ_DIR = djgpp

CFLAGS = -g -O2 -I./include -I./src/lib \
-I$(WATT32_ROOT)/inc -Wall \
-I$(WATT32_ROOT)/inc \
-Wall \
-Wextra \
-Wcast-align \
-Wconversion \
-Wdeclaration-after-statement \
-Wdouble-promotion \
-Wfloat-equal \
-Winit-self \
-Wjump-misses-init \
-Wlogical-op \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-format-attribute \
-Wmissing-include-dirs \
-Wmissing-prototypes \
-Wnested-externs \
-Wno-coverage-mismatch \
-Wold-style-definition \
-Wpacked \
-Wpointer-arith \
-Wshadow \
-Wsign-conversion \
-Wstrict-overflow \
-Wstrict-prototypes \
-Wtrampolines \
-Wundef \
-Wunused \
-Wvariadic-macros \
-Wvla \
-Wwrite-strings \
-Werror=implicit-int \
-Werror=implicit-function-declaration \
-DWATT32 -DHAVE_CONFIG_H \
-D_REENTRANT \
-DCARES_NO_DEPRECATED \
-Dselect=select_s

# Can't enable -Wredundant-decls due to WATT32 issues


LDFLAGS = -s

ifeq ($(OS),Windows_NT)
Expand Down
2 changes: 1 addition & 1 deletion Makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ RT_ERROR_CHECKING = /RTCsu

CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2
CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi $(RT_ERROR_CHECKING)
CC_CFLAGS = $(CFLAGS) /I.\src\lib /I.\include /W3 /EHsc /FD
CC_CFLAGS = $(CFLAGS) /D_REENTRANT /I.\src\lib /I.\include /W3 /EHsc /FD

RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"
Expand Down
3 changes: 3 additions & 0 deletions src/lib/ares__iface_ips.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif

#include "ares.h"
#include "ares_private.h"
Expand Down
5 changes: 0 additions & 5 deletions src/lib/ares_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
# include <netinet/in.h>
#endif

#ifdef WATT32
# include <tcp.h>
# include <sys/ioctl.h>
#endif

#define DEFAULT_TIMEOUT 2000 /* milliseconds */
#define DEFAULT_TRIES 3
#ifndef INADDR_NONE
Expand Down
49 changes: 25 additions & 24 deletions src/lib/config-dos.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define HAVE_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_WRITEV 1
#define HAVE_STAT 1

#define NEED_MALLOC_H 1

Expand Down Expand Up @@ -73,7 +74,7 @@
# define HAVE_VARIADIC_MACROS_GCC 1

/* Because djgpp <= 2.03 doesn't have snprintf() etc. */
# if (DJGPP_MINOR < 4)
# if defined(DJGPP_MINOR) && DJGPP_MINOR < 4
# define _MPRINTF_REPLACE
# endif

Expand All @@ -85,30 +86,30 @@
# define strerror(e) strerror_s_((e))
#endif

/* This seems odd, can DOS build without WATT32? */
#ifdef WATT32
# define HAVE_AF_INET6 1
# define HAVE_ARPA_INET_H 1
# define HAVE_ARPA_NAMESER_H 1
# define HAVE_CLOSE_S 1
# define HAVE_GETHOSTNAME 1
# define HAVE_NETDB_H 1
# define HAVE_NETINET_IN_H 1
# define HAVE_NETINET_TCP_H 1
# define HAVE_PF_INET6 1
# define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
# define HAVE_STRUCT_ADDRINFO 1
# define HAVE_STRUCT_IN6_ADDR 1
# define HAVE_STRUCT_SOCKADDR_IN6 1
# define HAVE_SYS_SOCKET_H 1
# define HAVE_SYS_UIO_H 1
# define NS_INADDRSZ 4
# define HAVE_STRUCT_SOCKADDR_IN6 1

# define HAVE_GETSERVBYPORT_R 1
# define GETSERVBYPORT_R_ARGS 5
# define HAVE_AF_INET6 1
# define HAVE_ARPA_INET_H 1
# define HAVE_ARPA_NAMESER_H 1
# define HAVE_CLOSE_S 1
# define HAVE_GETHOSTNAME 1
# define HAVE_NETDB_H 1
# define HAVE_NETINET_IN_H 1
# define HAVE_NETINET_TCP_H 1
# define HAVE_PF_INET6 1
# define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1
# define HAVE_STRUCT_ADDRINFO 1
# define HAVE_STRUCT_IN6_ADDR 1
# define HAVE_STRUCT_SOCKADDR_IN6 1
# define HAVE_SYS_SOCKET_H 1
# define HAVE_SYS_IOCTL_H 1
# define HAVE_SYS_UIO_H 1
# define NS_INADDRSZ 4
# define HAVE_GETSERVBYPORT_R 1
# define GETSERVBYPORT_R_ARGS 6
# define HAVE_WRITEV 1
# define HAVE_IF_NAMETOINDEX 1
# define HAVE_IF_INDEXTONAME 1
#endif

#undef word
#undef byte

#endif /* HEADER_CONFIG_DOS_H */
5 changes: 5 additions & 0 deletions src/lib/config-win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,17 @@
# define HAVE_NETDB_H 1
# define HAVE_NETINET_IN_H 1
# define HAVE_SYS_SOCKET_H 1
# define HAVE_SYS_IOCTL_H 1
# define HAVE_NETINET_TCP_H 1
# define HAVE_AF_INET6 1
# define HAVE_PF_INET6 1
# define HAVE_STRUCT_IN6_ADDR 1
# define HAVE_STRUCT_SOCKADDR_IN6 1
# define HAVE_WRITEV 1
# define HAVE_IF_NAMETOINDEX 1
# define HAVE_IF_INDEXTONAME 1
# define HAVE_GETSERVBYPORT_R 1
# define GETSERVBYPORT_R_ARGS 6
# undef HAVE_WINSOCK_H
# undef HAVE_WINSOCK2_H
# undef HAVE_WS2TCPIP_H
Expand Down