mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +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
|
CFLAGS = -O2 -Wall -Wno-unused-variable -Wno-unused-result -I. -std=c99
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
ifeq ($(OS),Windows_NT)
|
SYS := $(shell gcc -dumpmachine)
|
||||||
#Windows Build CFG
|
ifneq (, $(findstring linux, $(SYS)))
|
||||||
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
|
# Linux
|
||||||
CFLAGS += -Wno-unused-but-set-variable
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
LIBS +=
|
else ifneq(, $(findstring cygwin, $(SYS)))
|
||||||
endif
|
# 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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
main: $(OBJS)
|
main: $(OBJS)
|
||||||
$(CXX) -o $(OUTPUT) $(LIBS) $(OBJS)
|
$(CXX) -o $(OUTPUT) $(OBJS) $(LIBS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(OUTPUT) $(OBJS)
|
rm -rf $(OUTPUT) $(OBJS)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#ifndef __CYGWIN__
|
||||||
#define LIBICONV_PLUG
|
#define LIBICONV_PLUG
|
||||||
|
#endif
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
#endif
|
#endif
|
||||||
#include "oschar.h"
|
#include "oschar.h"
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ inline int fseeko64(FILE *__stream, long long __off, int __whence)
|
|||||||
{
|
{
|
||||||
return _fseeki64(__stream, __off, __whence);
|
return _fseeki64(__stream, __off, __whence);
|
||||||
}
|
}
|
||||||
#elif __APPLE__
|
#elif __APPLE__ || __CYGWIN__
|
||||||
#define fseeko64 fseek // OS X file I/O is 64bit
|
#define fseeko64 fseek // OS X file I/O is 64bit
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
|
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
|
||||||
|
|||||||
+12
-10
@@ -5,21 +5,23 @@ OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c)))
|
|||||||
# Compiler Settings
|
# Compiler Settings
|
||||||
CFLAGS = --std=gnu99 -O2 -Wall -Wno-unused-value -Wno-unused-result -I.
|
CFLAGS = --std=gnu99 -O2 -Wall -Wno-unused-value -Wno-unused-result -I.
|
||||||
CC = gcc
|
CC = gcc
|
||||||
ifeq ($(OS),Windows_NT)
|
|
||||||
#Windows Build CFG
|
SYS := $(shell gcc -dumpmachine)
|
||||||
|
ifneq (, $(findstring linux, $(SYS)))
|
||||||
|
# Linux
|
||||||
CFLAGS += -Wno-unused-but-set-variable
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
LIBS += -static-libgcc
|
else ifneq(, $(findstring cygwin, $(SYS)))
|
||||||
else
|
# Cygwin
|
||||||
UNAME_S := $(shell uname -s)
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
ifeq ($(UNAME_S),Darwin)
|
LIBS += -liconv
|
||||||
|
else ifneq(, $(findstring darwin, $(SYS)))
|
||||||
# OS X
|
# OS X
|
||||||
LIBS += -liconv
|
LIBS += -liconv
|
||||||
else
|
else
|
||||||
# Linux
|
#Windows Build CFG
|
||||||
CFLAGS += -Wno-unused-but-set-variable
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
|
LIBS += -static-libgcc
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# MAKEROM Build Settings
|
# MAKEROM Build Settings
|
||||||
OUTPUT = makerom
|
OUTPUT = makerom
|
||||||
@@ -29,7 +31,7 @@ main: build
|
|||||||
rebuild: clean build
|
rebuild: clean build
|
||||||
|
|
||||||
build: $(OBJS)
|
build: $(OBJS)
|
||||||
$(CC) -o $(OUTPUT) $(LIBS) $(OBJS)
|
$(CC) -o $(OUTPUT) $(OBJS) $(LIBS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(OUTPUT) $(OBJS)
|
rm -rf $(OUTPUT) $(OBJS)
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#ifndef __CYGWIN__
|
||||||
#define LIBICONV_PLUG
|
#define LIBICONV_PLUG
|
||||||
|
#endif
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
#endif
|
#endif
|
||||||
#include "oschar.h"
|
#include "oschar.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user