Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

build: use external preprocessor cpp32 when building with Borland C

  • Loading branch information...
commit 42f5e8a0f1729b17547acfc6625e58e583811e8d 1 parent c5d9cd5
yangtse yangtse authored
73 lib/Makefile.b32
@@ -4,22 +4,25 @@
4 4 #
5 5 # 'lib' directory
6 6 #
  7 +# 'BCCDIR' has to be set up to point to the base directory
  8 +# of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55
  9 +#
7 10 # Written by Jaepil Kim, pit@paradise.net.nz
8 11 ############################################################
9 12
10   -# Check if BCCDIR is set and guess if not set.
11   -!ifndef BCCDIR
12   -BCCDIR = $(MAKEDIR)/..
  13 +# Check if BCCDIR is set.
  14 +!if !$d(BCCDIR)
  15 +!error BCCDIR not defined
13 16 !endif
14 17
15 18 # Edit the path below to point to the base of your Zlib sources.
16 19 !ifndef ZLIB_PATH
17   -ZLIB_PATH = ../../zlib-1.2.5
  20 +ZLIB_PATH = ..\..\zlib-1.2.5
18 21 !endif
19 22
20 23 # Edit the path below to point to the base of your OpenSSL package.
21 24 !ifndef OPENSSL_PATH
22   -OPENSSL_PATH = ../../openssl-0.9.8q
  25 +OPENSSL_PATH = ..\..\openssl-0.9.8q
23 26 !endif
24 27
25 28 # Set libcurl static lib, dll and import lib
@@ -28,69 +31,83 @@ LIBCURL_DLL = libcurl.dll
28 31 LIBCURL_IMPLIB = libcurl_imp.lib
29 32
30 33 # Setup environment
31   -CXX = bcc32
  34 +PP_CMD = cpp32 -q -P-
  35 +CC_CMD = bcc32 -q -c
32 36 LD = bcc32
33   -CP = copy 2>NUL
34   -RM = del /q /f 2>NUL
  37 +RM = del
  38 +MKDIR = mkdir
  39 +RMDIR = rmdir /s /q
35 40 LIB = tlib
36 41 IMPLIB = implib
37 42
38   -CXXFLAGS = -q -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu -w-pro -tWM
  43 +CC_FLAGS = -5 -O2 -tWM -w -w-aus -w-ccc -w-dup -w-prc -w-pro -w-rch -w-sig -w-spa -Dinline=__inline
39 44 LIBFLAGS = /C /P32
40 45 LDFLAGS = -q -lq -laa -tWD
41 46
42   -INCDIRS = -I.;../include
43   -LINKLIB = $(BCCDIR)/lib/cw32mt.lib
44   -
45   -DEFINES = -DNDEBUG -DWIN32 -D_CONSOLE -D_MBCS -DBUILDING_LIBCURL
  47 +SRCDIR = .
  48 +OBJDIR = .\objs
  49 +INCDIRS = -I.;..\include
  50 +LINKLIB = $(BCCDIR)\lib\cw32mt.lib
  51 +DEFINES = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL
46 52
47   -# By default we disable LDAP support here since BCC headers are insufficient.
  53 +# By default LDAP support is disabled for BCC
48 54 !ifndef WITH_LDAP
49 55 DEFINES = $(DEFINES) -DCURL_DISABLE_LDAP
50 56 !endif
51 57
52   -# If you build with ZLIB support, set WITH_ZLIB=1
  58 +# ZLIB support is enabled setting WITH_ZLIB=1
53 59 !ifdef WITH_ZLIB
54 60 DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
55 61 INCDIRS = $(INCDIRS);$(ZLIB_PATH)
56   -LINKLIB = $(LINKLIB) $(ZLIB_PATH)/zlib.lib
  62 +LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
57 63 !endif
58 64
59   -# If you build with SSL support, set WITH_SSL=1
  65 +# SSL support is enabled setting WITH_SSL=1
60 66 !ifdef WITH_SSL
61 67 DEFINES = $(DEFINES) -DUSE_SSLEAY
62   -INCDIRS = $(INCDIRS);$(OPENSSL_PATH)/inc32;$(OPENSSL_PATH)/inc32/openssl
63   -LINKLIB = $(LINKLIB) $(OPENSSL_PATH)/out32/ssleay32.lib $(OPENSSL_PATH)/out32/libeay32.lib
  68 +INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
  69 +LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
64 70 !endif
65 71
66 72 .autodepend
67 73
  74 +.path.c = $(SRCDIR)
  75 +.path.obj = $(OBJDIR)
  76 +
68 77 # Makefile.inc provides the CSOURCES and HHEADERS defines
69 78 !include Makefile.inc
70 79
71 80 OBJECTS = $(CSOURCES:.c=.obj)
72 81
73 82 .c.obj:
74   - $(CXX) -c $(INCDIRS) $(CXXFLAGS) $(DEFINES) $<
  83 + @-$(RM) $(@R).int >NUL 2>&1
  84 + $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
  85 + $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
75 86
76   -all: $(LIBCURL_LIB) $(LIBCURL_DLL)
  87 +all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL)
77 88
78 89 clean:
79   - -$(RM) $(LIBCURL_LIB)
80   - -$(RM) $(LIBCURL_IMPLIB)
81   - -$(RM) libcurl.tds
82   - -$(RM) *.obj
  90 + @-$(RMDIR) $(OBJDIR) >NUL 2>&1
  91 + @-$(RM) $(LIBCURL_LIB) >NUL 2>&1
  92 + @-$(RM) $(LIBCURL_IMPLIB) >NUL 2>&1
  93 + @-$(RM) libcurl.tds >NUL 2>&1
  94 +
  95 +$(OBJDIR):
  96 + @-$(RMDIR) $(OBJDIR) >NUL 2>&1
  97 + @-$(MKDIR) $(OBJDIR)
83 98
84 99 $(LIBCURL_LIB): $(OBJECTS)
85   - @-$(RM) $@
  100 + @-$(RM) $(LIBCURL_LIB) >NUL 2>&1
86 101 $(LIB) $(LIBFLAGS) $@ @&&!
87 102 +$(**: = &^
88 103 +)
89 104 !
90 105
91 106 $(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
92   - @-$(RM) $(LIBCURL_DLL)
93   - @-$(RM) $(LIBCURL_IMPLIB)
  107 + @-$(RM) $(LIBCURL_DLL) >NUL 2>&1
  108 + @-$(RM) $(LIBCURL_IMPLIB) >NUL 2>&1
94 109 $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) $**
95 110 $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
96 111
  112 +
  113 +# End of Makefile.b32
2  lib/config-win32.h
@@ -357,7 +357,7 @@
357 357 /* ---------------------------------------------------------------- */
358 358
359 359 /* Define this if you have struct sockaddr_storage */
360   -#if !(defined(__SALFORDC__) || defined(__BORLANDC__))
  360 +#if !defined(__SALFORDC__) && !defined(__BORLANDC__)
361 361 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
362 362 #endif
363 363
75 src/Makefile.b32
@@ -4,88 +4,99 @@
4 4 #
5 5 # 'src' directory
6 6 #
  7 +# 'BCCDIR' has to be set up to point to the base directory
  8 +# of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55
  9 +#
7 10 # Written by Jaepil Kim, pit@paradise.net.nz
8 11 ############################################################
9 12
10   -# Check if BCCDIR is set and guess if not set.
11   -!ifndef BCCDIR
12   -BCCDIR = $(MAKEDIR)/..
  13 +# Check if BCCDIR is set.
  14 +!if !$d(BCCDIR)
  15 +!error BCCDIR not defined
13 16 !endif
14 17
15 18 # Edit the path below to point to the base of your Zlib sources.
16 19 !ifndef ZLIB_PATH
17   -ZLIB_PATH = ../../zlib-1.2.5
  20 +ZLIB_PATH = ..\..\zlib-1.2.5
18 21 !endif
19 22
20 23 # Edit the path below to point to the base of your OpenSSL package.
21 24 !ifndef OPENSSL_PATH
22   -OPENSSL_PATH = ../../openssl-0.9.8q
  25 +OPENSSL_PATH = ..\..\openssl-0.9.8q
23 26 !endif
24 27
25 28 # Set program's name
26 29 PROGNAME = curl.exe
27 30
28 31 # Setup environment
29   -CXX = bcc32
  32 +PP_CMD = cpp32 -q -P-
  33 +CC_CMD = bcc32 -q -c
30 34 LD = bcc32
31   -CP = copy 2>NUL
32   -RM = del /q /f 2>NUL
33   -LIB = tlib
  35 +RM = del
  36 +MKDIR = mkdir
  37 +RMDIR = rmdir /s /q
34 38
35   -CXXFLAGS = -q -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu -w-pro -tWM
  39 +CC_FLAGS = -5 -O2 -tWM -w -w-aus -w-ccc -w-dup -w-prc -w-pro -w-rch -w-sig -w-spa -Dinline=__inline
36 40 LDFLAGS = -q -lq -lap
37 41
38   -INCDIRS = -I.;../include;../lib
39   -LINKLIB = $(BCCDIR)/lib/cw32mt.lib
40   -
  42 +SRCDIRS = .;..\lib
  43 +OBJDIR = .\objs
  44 +INCDIRS = -I.;..\include;..\lib
  45 +LINKLIB = $(BCCDIR)\lib\cw32mt.lib
41 46 DEFINES = -DNDEBUG -DWIN32
42 47
43 48 !ifdef DYNAMIC
44   -LIBCURL_LIB = ../lib/libcurl_imp.lib
  49 +LIBCURL_LIB = ..\lib\libcurl_imp.lib
45 50 !else
46   -LIBCURL_LIB = ../lib/libcurl.lib
  51 +LIBCURL_LIB = ..\lib\libcurl.lib
47 52 DEFINES = $(DEFINES) -DCURL_STATICLIB
48 53 !endif
49 54
50   -# If you build with ZLIB support, set WITH_ZLIB=1
  55 +# ZLIB support is enabled setting WITH_ZLIB=1
51 56 !ifdef WITH_ZLIB
52 57 DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
53 58 INCDIRS = $(INCDIRS);$(ZLIB_PATH)
54   -LINKLIB = $(LINKLIB) $(ZLIB_PATH)/zlib.lib
  59 +LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
55 60 !endif
56 61
57   -# If you build with SSL support, set WITH_SSL=1
  62 +# SSL support is enabled setting WITH_SSL=1
58 63 !ifdef WITH_SSL
59 64 DEFINES = $(DEFINES) -DUSE_SSLEAY
60   -INCDIRS = $(INCDIRS);$(OPENSSL_PATH)/inc32;$(OPENSSL_PATH)/inc32/openssl
61   -LINKLIB = $(LINKLIB) $(OPENSSL_PATH)/out32/ssleay32.lib $(OPENSSL_PATH)/out32/libeay32.lib
  65 +INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
  66 +LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
62 67 !endif
63 68
64 69 .autodepend
65 70
  71 +.path.c = $(SRCDIRS)
  72 +.path.obj = $(OBJDIR)
  73 +
66 74 # Makefile.inc provides the CSOURCES and HHEADERS defines
67   -top_srcdir = ..
  75 +!undef top_srcdir
68 76 !include Makefile.inc
69 77
70   -CSOURCES = $(CURL_CFILES) $(CURLX_ONES)
  78 +CSOURCES = $(CURL_CFILES) $(CURLX_ONES:/lib/=)
71 79 OBJECTS = $(CSOURCES:.c=.obj)
72 80
73 81 .c.obj:
74   - $(CXX) -c $(INCDIRS) $(CXXFLAGS) $(DEFINES) $<
  82 + @-$(RM) $(@R).int >NUL 2>&1
  83 + $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
  84 + $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
75 85
76   -all: $(PROGNAME)
  86 +all: $(OBJDIR) $(PROGNAME)
77 87
78 88 clean:
79   - -$(RM) $(PROGNAME)
80   - -$(RM) *.obj
81   - -$(RM) hugehelp.c
  89 + @-$(RMDIR) $(OBJDIR) >NUL 2>&1
  90 + @-$(RM) $(PROGNAME) >NUL 2>&1
  91 + @-$(RM) curl.tds >NUL 2>&1
  92 +
  93 +$(OBJDIR):
  94 + @-$(RMDIR) $(OBJDIR) >NUL 2>&1
  95 + @-$(MKDIR) $(OBJDIR)
82 96
83 97 $(PROGNAME): $(OBJECTS) $(LIBCURL_LIB) $(LINKLIB)
84   - @-$(RM) $@
  98 + @-$(RM) $(PROGNAME) >NUL 2>&1
85 99 $(LD) $(LDFLAGS) -e$@ $**
86 100
87   -hugehelp.c: hugehelp.c.cvs
88   - @echo Creating $@
89   - @$(CP) $** $@
90   -
91 101
  102 +# End of Makefile.b32
2  src/config-win32.h
@@ -228,7 +228,7 @@
228 228 /* ---------------------------------------------------------------- */
229 229
230 230 /* Define this if you have struct sockaddr_storage */
231   -#if !(defined(__SALFORDC__) || defined(__BORLANDC__))
  231 +#if !defined(__SALFORDC__) && !defined(__BORLANDC__)
232 232 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
233 233 #endif
234 234

0 comments on commit 42f5e8a

Please sign in to comment.
Something went wrong with that request. Please try again.