Browse Source

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)
pull/1094/head
Hamish Coleman 1 year ago
parent
commit
1accc76ad3
  1. 1
      include/n2n_typedefs.h
  2. 4
      scripts/hack_fakeautoconf.sh
  3. 8
      tools/Makefile
  4. 6
      win32/Makefile

1
include/n2n_typedefs.h

@ -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__) */

4
scripts/hack_fakeautoconf.sh

@ -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

8
tools/Makefile

@ -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..

6
win32/Makefile

@ -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

Loading…
Cancel
Save