Fix the building the win32 subdir.

It looks like the github windows build environment is not correctly
inheriting environment variables.  Which is strange, as that has not
been changed with the recent updates.  Include the vars directly as a
workaround (and plan to refactor later)
This commit is contained in:
Hamish Coleman 2023-04-30 19:44:38 -05:00
parent 9de98c2bb0
commit 1accc76ad3
4 changed files with 15 additions and 4 deletions

View File

@ -51,6 +51,7 @@ typedef int ssize_t;
typedef unsigned long in_addr_t;
#include "n2n_win32.h"
// FIXME - the above include is from a different subdir
#endif /* #if defined(_MSC_VER) || defined(__MINGW32__) */

View File

@ -6,8 +6,8 @@
cat >config.mak <<EOF
CC=gcc
AR=ar
CFLAGS=$CFLAGS
LDFLAGS=$LDFLAGS
CFLAGS=$CFLAGS -g -O2 -I./include
LDFLAGS=$LDFLAGS -L.
N2N_LIBS_EXTRA=$LDLIBS
EOF

View File

@ -2,14 +2,20 @@
# This is not a standalone makefile, it must be called from the toplevel
# makefile to inherit the correct environment
# The vars included here should be part of the environment.
# TODO - refactor this and debug why they need to be included for windows
include ../config.mak
DEBUG?=-g3
HEADERS=$(wildcard include/*.h)
CFLAGS+=-I../include
LDLIBS+=-ln2n
ifeq ($(CONFIG_TARGET),mingw)
CFLAGS+=-I../win32
LDLIBS+=-lnetapi32
LDLIBS+=$(abspath ../win32/n2n_win32.a)
LDLIBS+=-lnetapi32 -lws2_32 -liphlpapi
endif
CFLAGS+=$(DEBUG)
LDFLAGS+=-L..

View File

@ -2,7 +2,11 @@
# This is not a standalone makefile, it must be called from the toplevel
# makefile to inherit the correct environment
CFLAGS+=-I../include
# The vars included here should be part of the environment.
# TODO - refactor this and debug why they need to be included for windows
include ../config.mak
CFLAGS+=-I../include -I.
LDFLAGS+=-L..
.PHONY: all clean install