From: nishi Date: Sun, 7 Apr 2024 14:36:46 +0000 (+0000) Subject: add static lib X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2960deb6b2fc89db2a3b09a7f8b2e7955e13cfe6;p=libw3.git add static lib git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@293 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Library/DNS.c b/Library/DNS.c index 6e7fdee..355d22f 100644 --- a/Library/DNS.c +++ b/Library/DNS.c @@ -38,8 +38,8 @@ #include #ifdef __MINGW32__ -#include #include +#include #include #include #else diff --git a/Library/Makefile b/Library/Makefile index efd8490..4e28606 100644 --- a/Library/Makefile +++ b/Library/Makefile @@ -57,12 +57,13 @@ endif ifeq ($(WINDOWS),YES) ./w3.dll: $(OBJS) $(CC) $(LDFLAGS) -fstack-protector -L../openssl/lib/mingw/$(WINARCH) -L . -shared -Wl,--out-implib,./w3.lib -o $@ $^ $(LIBS) +./w3.a: $(OBJS) + $(AR) rcs $@ $^ else - ./libw3.so: $(OBJS) $(CC) $(LDFLAGS) -shared -o $@ $^ $(LIBS) ./libw3.a: $(OBJS) - ar rcs $@ $^ + $(AR) rcs $@ $^ endif ./%.o: ./%.c W3%.h diff --git a/Makefile b/Makefile index 116469d..3143eb1 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ endif endif CC := cc +CC := ar CFLAGS := -g -std=c99 -fPIC -D_XOPEN_SOURCE=600 $(TCL_CFLAGS) LDFLAGS := LIBS := $(TCL_LIBS) @@ -98,6 +99,7 @@ CFLAGS += $(FLAGS) ifeq ($(WIN32),YES) CC := i686-w64-mingw32-gcc WINDRES := i686-w64-mingw32-windres +AR := i686-w64-mingw32-ar WINDOWS := YES WINARCH := x86 MINGW := i686-w64-mingw32 @@ -106,6 +108,7 @@ endif ifeq ($(WIN64),YES) CC := x86_64-w64-mingw32-gcc WINDRES := x86_64-w64-mingw32-windres +AR := x86_64-w64-mingw32-ar WINDOWS := YES WINARCH := x64 MINGW := x86_64-w64-mingw32 @@ -133,12 +136,15 @@ endif ifeq ($(WINDOWS),YES) .PHONY: all clean ./Library/w3.dll ./Example format src-archive archive replace -ALL := ./Library/w3.dll ./Example +ALL := ./Library/w3.dll ./Library/w3.a ./Example all: ./Library/W3Version.h ./w3.pc $(ALL) ./Library/w3.dll:: - $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" WINDOWS=YES WINARCH=$(WINARCH) TCL=$(TCL) SSL=$(SSL) + $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" WINDOWS=YES WINARCH=$(WINARCH) TCL=$(TCL) SSL=$(SSL) ./w3.dll + +./Library/w3.a:: + $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" WINDOWS=YES WINARCH=$(WINARCH) TCL=$(TCL) SSL=$(SSL) ./w3.a ./Example: ./Library/w3.dll $(MAKE) -C ./Example CC=$(CC) TCL=$(TCL) TCL_LIBS="$(TCL_LIBS)" TCL_CFLAGS="$(TCL_CFLAGS)" HTTPD=$(HTTPD) examples SUFFIX=.exe diff --git a/W3Version.h.m4 b/W3Version.h.m4 index dc0e6c7..45f5408 100644 --- a/W3Version.h.m4 +++ b/W3Version.h.m4 @@ -60,7 +60,7 @@ const char* W3_Get_Version(void); * @note W3_Get_Version を使用することを検討してください。 * */ -#define LIBW3_VERSION "2.22E" \ +#define LIBW3_VERSION "2.22F" \ SUFFIX ifdef({{HTTP_SUPPORT}}, {{/**