mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-02 16:59:03 +00:00
Cygwin support
This commit is contained in:
+14
-14
@@ -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)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <stdlib.h>
|
||||
#ifndef _WIN32
|
||||
#ifndef __CYGWIN__
|
||||
#define LIBICONV_PLUG
|
||||
#endif
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
#include "oschar.h"
|
||||
|
||||
+1
-1
@@ -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
@@ -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)
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <stdlib.h>
|
||||
#ifndef _WIN32
|
||||
#ifndef __CYGWIN__
|
||||
#define LIBICONV_PLUG
|
||||
#endif
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
#include "oschar.h"
|
||||
|
||||
Reference in New Issue
Block a user