From 53482bb2c760cf32ef9ae9b0c1d87609f45ee95f Mon Sep 17 00:00:00 2001 From: nishi Date: Thu, 15 Feb 2024 05:57:38 +0000 Subject: [PATCH] changed m4 git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@226 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/Makefile | 10 +--------- Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++---- W3Version.h.m4 | 24 ++++++++++++++++++++++++ W3Version.h.p | 16 ---------------- 4 files changed, 67 insertions(+), 29 deletions(-) create mode 100644 W3Version.h.m4 delete mode 100644 W3Version.h.p diff --git a/Library/Makefile b/Library/Makefile index 0427271..7ee0d3d 100644 --- a/Library/Makefile +++ b/Library/Makefile @@ -11,43 +11,35 @@ endif ifeq ($(SSL),YES) ifneq ($(GEMINI),NO) OBJS += ./Gemini.o -FLAGS += -DGEMINI_SUPPORT endif endif ifneq ($(HTTP),NO) OBJS += ./HTTP.o -FLAGS += -DHTTP_SUPPORT endif ifneq ($(GOPHER),NO) OBJS += ./Gopher.o -FLAGS += -DGOPHER_SUPPORT endif ifneq ($(POP3),NO) OBJS += ./POP3.o -FLAGS += -DPOP3_SUPPORT endif ifneq ($(FINGER),NO) OBJS += ./Finger.o -FLAGS += -DFINGER_SUPPORT endif ifneq ($(FILE),NO) OBJS += ./File.o -FLAGS += -DFILE_SUPPORT endif ifneq ($(NEX),NO) OBJS += ./Nex.o -FLAGS += -DNEX_SUPPORT endif ifneq ($(FTP),NO) OBJS += ./FTP.o -FLAGS += -DFTP_SUPPORT endif ifeq ($(WINDOWS),YES) @@ -62,7 +54,7 @@ else endif ./%.o: ./%.c W3%.h - $(CC) $(CFLAGS) $(FLAGS) -I../openssl/include -c -o $@ $< + $(CC) $(CFLAGS) -I../openssl/include -c -o $@ $< clean: rm -f *.o *.so *.core *~ *.dll *.lib *.a *.res diff --git a/Makefile b/Makefile index 9775f47..e8adc3c 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ else include cache.mk endif +include ./Library/protocol.mk + ifeq ($(shell uname -s),SunOS) GREP = ggrep else @@ -45,6 +47,42 @@ CFLAGS += -DSSL_SUPPORT LIBS += -lssl -lcrypto endif +ifeq ($(SSL),YES) +ifneq ($(GEMINI),NO) +FLAGS += -DGEMINI_SUPPORT +endif +endif + +ifneq ($(HTTP),NO) +FLAGS += -DHTTP_SUPPORT +endif + +ifneq ($(GOPHER),NO) +FLAGS += -DGOPHER_SUPPORT +endif + +ifneq ($(POP3),NO) +FLAGS += -DPOP3_SUPPORT +endif + +ifneq ($(FINGER),NO) +FLAGS += -DFINGER_SUPPORT +endif + +ifneq ($(FILE),NO) +FLAGS += -DFILE_SUPPORT +endif + +ifneq ($(NEX),NO) +FLAGS += -DNEX_SUPPORT +endif + +ifneq ($(FTP),NO) +FLAGS += -DFTP_SUPPORT +endif + +CFLAGS += $(FLAGS) + ifeq ($(WIN32),YES) CC := i686-w64-mingw32-gcc WINDRES := i686-w64-mingw32-windres @@ -91,8 +129,8 @@ all: ./Library/W3Version.h ./w3.pc $(ALL) ./Example: ./Library/w3.dll $(MAKE) -C ./Example CC=$(CC) TCL=$(TCL) TCL_LIBS="$(TCL_LIBS)" TCL_CFLAGS="$(TCL_CFLAGS)" examples SUFFIX=.exe -./Library/W3Version.h: - m4 -DSUFFIX=\"W\" ./W3Version.h.p > $@ +./Library/W3Version.h: ./W3Version.h.m4 + m4 -DSUFFIX=\"W\" $(FLAGS) $< > $@ else @@ -111,8 +149,8 @@ all: ./Library/W3Version.h ./w3.pc $(ALL) ./Example: ./Library/libw3.so $(MAKE) -C ./Example CC=$(CC) TCL_LIBS="$(TCL_LIBS)" TCL_CFLAGS="$(TCL_CFLAGS)" TCL=$(TCL) examples -./Library/W3Version.h: - m4 -DSUFFIX=\"\" ./W3Version.h.p > $@ +./Library/W3Version.h: ./W3Version.h.m4 + m4 -DSUFFIX=\"\" $(FLAGS) $< > $@ endif diff --git a/W3Version.h.m4 b/W3Version.h.m4 new file mode 100644 index 0000000..61c20f8 --- /dev/null +++ b/W3Version.h.m4 @@ -0,0 +1,24 @@ +/* $Id$ */ +#ifndef __W3VERSION_H__ +#define __W3VERSION_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define LIBW3_VERSION "2.13" \ +SUFFIX + +ifdef(`HTTP_SUPPORT', `#define LIBW3_HTTP_SUPPORT', `') +ifdef(`FTP_SUPPORT', `#define LIBW3_FTP_SUPPORT', `') +ifdef(`GOPHER_SUPPORT', `#define LIBW3_GOPHER_SUPPORT', `') +ifdef(`GEMINI_SUPPORT', `#define LIBW3_GEMINI_SUPPORT', `') +ifdef(`FINGER_SUPPORT', `#define LIBW3_FINGER_SUPPORT', `') +ifdef(`NEX_SUPPORT', `#define LIBW3_NEX_SUPPORT', `') +ifdef(`FILE_SUPPORT', `#define LIBW3_FILE_SUPPORT', `') + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/W3Version.h.p b/W3Version.h.p deleted file mode 100644 index 9119059..0000000 --- a/W3Version.h.p +++ /dev/null @@ -1,16 +0,0 @@ -/* $Id$ */ -#ifndef __W3VERSION_H__ -#define __W3VERSION_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define LIBW3_VERSION "2.13" \ -SUFFIX - -#ifdef __cplusplus -} -#endif - -#endif -- 2.43.0