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 2 years 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; typedef unsigned long in_addr_t;
#include "n2n_win32.h" #include "n2n_win32.h"
// FIXME - the above include is from a different subdir
#endif /* #if defined(_MSC_VER) || defined(__MINGW32__) */ #endif /* #if defined(_MSC_VER) || defined(__MINGW32__) */

4
scripts/hack_fakeautoconf.sh

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

8
tools/Makefile

@ -2,14 +2,20 @@
# This is not a standalone makefile, it must be called from the toplevel # This is not a standalone makefile, it must be called from the toplevel
# makefile to inherit the correct environment # 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 DEBUG?=-g3
HEADERS=$(wildcard include/*.h) HEADERS=$(wildcard include/*.h)
CFLAGS+=-I../include CFLAGS+=-I../include
LDLIBS+=-ln2n LDLIBS+=-ln2n
ifeq ($(CONFIG_TARGET),mingw) ifeq ($(CONFIG_TARGET),mingw)
CFLAGS+=-I../win32 CFLAGS+=-I../win32
LDLIBS+=-lnetapi32 LDLIBS+=$(abspath ../win32/n2n_win32.a)
LDLIBS+=-lnetapi32 -lws2_32 -liphlpapi
endif endif
CFLAGS+=$(DEBUG) CFLAGS+=$(DEBUG)
LDFLAGS+=-L.. LDFLAGS+=-L..

6
win32/Makefile

@ -2,7 +2,11 @@
# This is not a standalone makefile, it must be called from the toplevel # This is not a standalone makefile, it must be called from the toplevel
# makefile to inherit the correct environment # 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.. LDFLAGS+=-L..
.PHONY: all clean install .PHONY: all clean install

Loading…
Cancel
Save