]> Nishi Git Mirror - libw3.git/commitdiff
changed m4
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Thu, 15 Feb 2024 05:57:38 +0000 (05:57 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Thu, 15 Feb 2024 05:57:38 +0000 (05:57 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@226 d27a3e52-49c5-7645-884c-6793ebffc270

Library/Makefile
Makefile
W3Version.h.m4 [new file with mode: 0644]
W3Version.h.p [deleted file]

index 0427271b775713a6bae49a2c9ef867b8286d9759..7ee0d3d20afd459c553e098b4cf2fd7bc0ec57ca 100644 (file)
@@ -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
index 9775f47ab14ed3faa6c66d9d8590760431083bf7..e8adc3c316ebe04bf68131bbbe486a3194806b83 100644 (file)
--- 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 (file)
index 0000000..61c20f8
--- /dev/null
@@ -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 (file)
index 9119059..0000000
+++ /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