mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 14:03:56 +08:00
update 2026-05-10 09:48:30
This commit is contained in:
1 parent
95ac96413e
commit
0b362674f1
6244 files changed
+2992248
No files matched your search
@@ -0,0 +1,20 @@
|
||||
diff -Naur a/include/common.h b/include/common.h
|
||||
--- a/include/common.h 2019-08-03 10:48:42.000000000 -0700
|
||||
+++ b/include/common.h 2020-03-01 19:26:14.000000000 -0800
|
||||
@@ -2,6 +2,7 @@
|
||||
#define __COMMON_H__
|
||||
|
||||
#include <stdint.h>
|
||||
+#include <endian.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
@@ -10,7 +11,7 @@
|
||||
#define DPRINTF(...)
|
||||
#endif
|
||||
|
||||
-#ifdef __BIG_ENDIAN__
|
||||
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
|
||||
static inline uint16_t BE16(uint16_t x)
|
||||
{
|
||||
@@ -0,0 +1,12 @@
|
||||
diff -Naur a/include/compat.h b/include/compat.h
|
||||
--- a/include/compat.h 2019-08-03 10:48:42.000000000 -0700
|
||||
+++ b/include/compat.h 2020-03-01 19:26:14.000000000 -0800
|
||||
@@ -57,7 +57,7 @@ typedef int socklen_t;
|
||||
|
||||
#else
|
||||
|
||||
-#include <sys/errno.h>
|
||||
+#include <errno.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
@@ -0,0 +1,114 @@
|
||||
diff -Naur a/Makefile b/Makefile
|
||||
--- a/Makefile 2019-08-03 10:48:42.000000000 -0700
|
||||
+++ b/Makefile 2020-03-01 19:26:14.000000000 -0800
|
||||
@@ -1,21 +1,17 @@
|
||||
-OS = windows
|
||||
+OS = linux
|
||||
BUILD_TYPE = release_static
|
||||
|
||||
OUTPUT := ps3netsrv
|
||||
OBJS = src/main.o src/compat.o src/File.o src/VIsoFile.o
|
||||
|
||||
-CFLAGS = -Wall -I./include -I./polarssl-1.3.2/include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
|
||||
-CPPFLAGS += -Wall -I./include -I./polarssl-1.3.2/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
|
||||
-
|
||||
-#CFLAGS += -DNOSSL
|
||||
-#CPPFLAGS +=-DNOSSL
|
||||
-
|
||||
-LDFLAGS = -L. -L./polarssl-1.3.2/library
|
||||
-LIBS = -lstdc++ -lpolarssl
|
||||
+CFLAGS = -Wall -I./include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
+CPPFLAGS = -Wall -I./include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
|
||||
+LDFLAGS = -L.
|
||||
+LIBS = -lstdc++
|
||||
|
||||
ifeq ($(OS), linux)
|
||||
-LIBS += -lpthread
|
||||
+LIBS += -lpthread -lgcc_eh
|
||||
endif
|
||||
|
||||
ifeq ($(OS), windows)
|
||||
@@ -37,28 +33,82 @@ endif
|
||||
ifeq ($(BUILD_TYPE), debug)
|
||||
CFLAGS += -O0 -g3 -DDEBUG
|
||||
CPPFLAGS += -O0 -g3 -DDEBUG
|
||||
+LIBS += -lmbedtls -lmbedx509 -lmbedcrypto
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), debug_nossl)
|
||||
+CFLAGS += -O0 -g3 -DDEBUG -DNOSSL
|
||||
+CPPFLAGS += -O0 -g3 -DDEBUG -DNOSSL
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), debug_polar)
|
||||
+CFLAGS += -O0 -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+CPPFLAGS += -O0 -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+LDFLAGS += -L./polarssl-1.3.2/library
|
||||
+LIBS += -lpolarssl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_TYPE), debug_static)
|
||||
CFLAGS += -O0 -static -g3 -DDEBUG
|
||||
CPPFLAGS += -O0 -static -g3 -DDEBUG
|
||||
+LIBS += -lmbedtls -lmbedx509 -lmbedcrypto
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), debug_static_nossl)
|
||||
+CFLAGS += -O0 -static -g3 -DDEBUG -DNOSSL
|
||||
+CPPFLAGS += -O0 -static -g3 -DDEBUG -DNOSSL
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), debug_static_polar)
|
||||
+CFLAGS += -O0 -static -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+CPPFLAGS += -O0 -static -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+LDFLAGS += -L./polarssl-1.3.2/library
|
||||
+LIBS += -lpolarssl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_TYPE), release)
|
||||
CFLAGS += -O3 -s -DNDEBUG
|
||||
CPPFLAGS += -O3 -s -DNDEBUG
|
||||
+LIBS += -lmbedtls -lmbedx509 -lmbedcrypto
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), release_nossl)
|
||||
+CFLAGS += -O3 -s -DNDEBUG -DNOSSL
|
||||
+CPPFLAGS += -O3 -s -DNDEBUG -DNOSSL
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), release_polar)
|
||||
+CFLAGS += -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+CPPFLAGS += -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+LDFLAGS += -L./polarssl-1.3.2/library
|
||||
+LIBS += -lpolarssl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_TYPE), release_static)
|
||||
CFLAGS += -static -O3 -s -DNDEBUG
|
||||
CPPFLAGS += -static -O3 -s -DNDEBUG
|
||||
+LIBS += -lmbedtls -lmbedx509 -lmbedcrypto
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), release_static_nossl)
|
||||
+CFLAGS += -static -O3 -s -DNDEBUG -DNOSSL
|
||||
+CPPFLAGS += -static -O3 -s -DNDEBUG -DNOSSL
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_TYPE), release_static_polar)
|
||||
+CFLAGS += -static -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+CPPFLAGS += -static -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL
|
||||
+LDFLAGS += -L./polarssl-1.3.2/library
|
||||
+LIBS += -lpolarssl
|
||||
endif
|
||||
|
||||
all: $(OUTPUT)
|
||||
rm -r -f src/*.o
|
||||
+ rm -r -f polarssl-1.3.2/library/*.o
|
||||
|
||||
clean:
|
||||
rm -r -f $(OUTPUT) src/*.o
|
||||
+ rm -r -f polarssl-1.3.2/library/*.o
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
$(LINK.c) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
Reference in new issue
Block a user