Merge pull request #48 from Thog/cygwin

Cygwin support
This commit is contained in:
profi200
2017-05-20 22:27:07 +02:00
committed by GitHub
5 changed files with 33 additions and 27 deletions
+14 -14
View File
@@ -8,25 +8,25 @@ CXXFLAGS = -I.
CFLAGS = -O2 -Wall -Wno-unused-variable -Wno-unused-result -I. -std=c99
CC = gcc
CXX = g++
ifeq ($(OS),Windows_NT)
SYS := $(shell gcc -dumpmachine)
ifneq (, $(findstring linux, $(SYS)))
# Linux
CFLAGS += -Wno-unused-but-set-variable
else ifneq(, $(findstring cygwin, $(SYS)))
# Cygwin
CFLAGS += -Wno-unused-but-set-variable -DUSE_FILE32API
LIBS += -liconv
else ifneq(, $(findstring darwin, $(SYS)))
# OS X
LIBS += -liconv
else
#Windows Build CFG
CFLAGS += -Wno-unused-but-set-variable
LIBS += -static-libgcc -static-libstdc++
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
# OS X
CFLAGS +=
LIBS += -liconv
else
# Linux
CFLAGS += -Wno-unused-but-set-variable
LIBS +=
endif
LIBS += -static-libgcc
endif
main: $(OBJS)
$(CXX) -o $(OUTPUT) $(LIBS) $(OBJS)
$(CXX) -o $(OUTPUT) $(OBJS) $(LIBS)
clean:
rm -rf $(OUTPUT) $(OBJS)
+2
View File
@@ -1,6 +1,8 @@
#include <stdlib.h>
#ifndef _WIN32
#ifndef __CYGWIN__
#define LIBICONV_PLUG
#endif
#include <iconv.h>
#endif
#include "oschar.h"
+1 -1
View File
@@ -46,7 +46,7 @@ inline int fseeko64(FILE *__stream, long long __off, int __whence)
{
return _fseeki64(__stream, __off, __whence);
}
#elif __APPLE__
#elif __APPLE__ || __CYGWIN__
#define fseeko64 fseek // OS X file I/O is 64bit
#elif __linux__
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
+14 -12
View File
@@ -5,22 +5,24 @@ OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c)))
# Compiler Settings
CFLAGS = --std=gnu99 -O2 -Wall -Wno-unused-value -Wno-unused-result -I.
CC = gcc
ifeq ($(OS),Windows_NT)
SYS := $(shell gcc -dumpmachine)
ifneq (, $(findstring linux, $(SYS)))
# Linux
CFLAGS += -Wno-unused-but-set-variable
else ifneq(, $(findstring cygwin, $(SYS)))
# Cygwin
CFLAGS += -Wno-unused-but-set-variable
LIBS += -liconv
else ifneq(, $(findstring darwin, $(SYS)))
# OS X
LIBS += -liconv
else
#Windows Build CFG
CFLAGS += -Wno-unused-but-set-variable
LIBS += -static-libgcc
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
# OS X
LIBS += -liconv
else
# Linux
CFLAGS += -Wno-unused-but-set-variable
endif
endif
# MAKEROM Build Settings
OUTPUT = makerom
@@ -29,7 +31,7 @@ main: build
rebuild: clean build
build: $(OBJS)
$(CC) -o $(OUTPUT) $(LIBS) $(OBJS)
$(CC) -o $(OUTPUT) $(OBJS) $(LIBS)
clean:
rm -rf $(OUTPUT) $(OBJS)
+2
View File
@@ -1,6 +1,8 @@
#include <stdlib.h>
#ifndef _WIN32
#ifndef __CYGWIN__
#define LIBICONV_PLUG
#endif
#include <iconv.h>
#endif
#include "oschar.h"