Skip to content

Commit

Permalink
added support for Cygwin. Closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
gpakosz committed Feb 6, 2017
1 parent a19c753 commit 523c28a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions _gnu-make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ ifeq ($(platform),)
override platform := freebsd
override architecture := $(__uname_m)
endif
ifeq ($(findstring cygwin,$(__uname_s)),cygwin)
override platform := cygwin
override architecture := $(__uname_m)
endif
endif
ifeq ($(architecture),)
override architecture := unknown-architecture
Expand Down Expand Up @@ -56,6 +60,11 @@ ifeq ($(platform),freebsd)
CFLAGS += -fpic
CXXFLAGS += -fpic
endif
ifeq ($(platform),cygwin)
LDFLAGS += -ldl
CFLAGS += -D_XOPEN_SOURCE=500 -fpic
CXXFLAGS += -fpic
endif

ifeq ($(platform),mac)
libsuffix := .dylib
Expand All @@ -69,6 +78,9 @@ endif
ifeq ($(platform),freebsd)
libsuffix := .so
endif
ifeq ($(platform),cygwin)
libsuffix := .dll
endif

.PHONY: build-executable
build: build-executable
Expand Down
2 changes: 1 addition & 1 deletion src/whereami.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
return length;
}

#elif defined(__linux__)
#elif defined(__linux__) || defined(__CYGWIN__)

#include <stdio.h>
#include <stdlib.h>
Expand Down

0 comments on commit 523c28a

Please sign in to comment.