Fossil SCM

Add fixes to classic makefile to support MinGW mostly automatically.

mistachkin 2011-11-05 22:50 UTC trunk
Commit 590cee0ec92d5392d36c5e01caf0b2992b8effd7
1 file changed +44 -4
+44 -4
--- Makefile.classic
+++ Makefile.classic
@@ -6,16 +6,16 @@
66
#
77
#### The toplevel directory of the source tree. Fossil can be built
88
# in a directory that is separate from the source tree. Just change
99
# the following to point from the build directory to the src/ folder.
1010
#
11
-SRCDIR = ./src
11
+SRCDIR = src
1212
1313
#### The directory into which object code files should be written.
1414
#
1515
#
16
-OBJDIR = ./bld
16
+OBJDIR = bld
1717
1818
#### C Compiler and options for use in building executables that
1919
# will run on the platform that is doing the build. This is used
2020
# to compile code-generator programs as part of the build process.
2121
# See TCC below for the C compiler for building the finished binary.
@@ -36,11 +36,11 @@
3636
#TCC = gcc -O6
3737
#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
3838
TCC = gcc -g -Os -Wall
3939
4040
# To add support for HTTPS
41
-TCC += -DFOSSIL_ENABLE_SSL
41
+TCC += -DFOSSIL_ENABLE_SSL=1
4242
4343
#### Extra arguments for linking the finished binary. Fossil needs
4444
# to link against the Z-Lib compression library. There are no
4545
# other dependencies. We sometimes add the -static option here
4646
# so that we can build a static executable that will run in a
@@ -47,11 +47,46 @@
4747
# chroot jail.
4848
#
4949
LIB = -lz $(LDFLAGS)
5050
5151
# If using HTTPS:
52
-LIB += -lcrypto -lssl
52
+#
53
+# NOTE: These must appear in exactly this order or MinGW will complain about
54
+# missing symbols.
55
+#
56
+LIB += -lssl -lcrypto
57
+
58
+#------------------------------------------------------------------------------
59
+# Begin MinGW Section (the following lines may all be commented out unless
60
+# building on Windows via MinGW).
61
+#------------------------------------------------------------------------------
62
+
63
+# Where is zlib (needed for MinGW builds only)?
64
+ZLIBDIR = $(SRCDIR)/../zlib-1.2.5
65
+
66
+# Where is OpenSSL (needed for MinGW builds only)?
67
+OPENSSLDIR = $(SRCDIR)/../openssl-1.0.0e
68
+
69
+# Include directory for zlib (needed for MinGW builds only)
70
+TCC.MINGW32_NT-6.1 = -I$(ZLIBDIR)
71
+
72
+# Include directory for OpenSSL (needed for MinGW builds only)
73
+TCC.MINGW32_NT-6.1 += -I$(OPENSSLDIR)/include
74
+
75
+# Library directory for zlib (needed for MinGW builds only).
76
+LIB.MINGW32_NT-6.1 = -L$(ZLIBDIR)
77
+
78
+# Library directory for OpenSSL (needed for MinGW builds only).
79
+LIB.MINGW32_NT-6.1 += -L$(OPENSSLDIR)
80
+
81
+# Add the necessary Windows libraries (needed for Windows builds only).
82
+LIB.MINGW32_NT-6.1 += -lgdi32 -lws2_32
83
+
84
+#------------------------------------------------------------------------------
85
+# End MinGW Section (the preceeding lines may all be commented out unless
86
+# building on Windows via MinGW)
87
+#------------------------------------------------------------------------------
5388
5489
#### Tcl shell for use in running the fossil testsuite. If you do not
5590
# care about testing the end result, this can be blank.
5691
#
5792
TCLSH = tclsh
@@ -60,10 +95,15 @@
6095
###############################################################################
6196
#
6297
# Automatic platform-specific options.
6398
HOST_OS_CMD = uname -s
6499
HOST_OS = $(HOST_OS_CMD:sh)
100
+
101
+# On MinGW, slightly different detection magic is required.
102
+ifeq '$(HOST_OS)' ''
103
+HOST_OS = $(shell $(HOST_OS_CMD))
104
+endif
65105
66106
LIB.SunOS= -lsocket -lnsl
67107
LIB += $(LIB.$(HOST_OS))
68108
69109
TCC.DragonFly += -DUSE_PREAD
70110
--- Makefile.classic
+++ Makefile.classic
@@ -6,16 +6,16 @@
6 #
7 #### The toplevel directory of the source tree. Fossil can be built
8 # in a directory that is separate from the source tree. Just change
9 # the following to point from the build directory to the src/ folder.
10 #
11 SRCDIR = ./src
12
13 #### The directory into which object code files should be written.
14 #
15 #
16 OBJDIR = ./bld
17
18 #### C Compiler and options for use in building executables that
19 # will run on the platform that is doing the build. This is used
20 # to compile code-generator programs as part of the build process.
21 # See TCC below for the C compiler for building the finished binary.
@@ -36,11 +36,11 @@
36 #TCC = gcc -O6
37 #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
38 TCC = gcc -g -Os -Wall
39
40 # To add support for HTTPS
41 TCC += -DFOSSIL_ENABLE_SSL
42
43 #### Extra arguments for linking the finished binary. Fossil needs
44 # to link against the Z-Lib compression library. There are no
45 # other dependencies. We sometimes add the -static option here
46 # so that we can build a static executable that will run in a
@@ -47,11 +47,46 @@
47 # chroot jail.
48 #
49 LIB = -lz $(LDFLAGS)
50
51 # If using HTTPS:
52 LIB += -lcrypto -lssl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
54 #### Tcl shell for use in running the fossil testsuite. If you do not
55 # care about testing the end result, this can be blank.
56 #
57 TCLSH = tclsh
@@ -60,10 +95,15 @@
60 ###############################################################################
61 #
62 # Automatic platform-specific options.
63 HOST_OS_CMD = uname -s
64 HOST_OS = $(HOST_OS_CMD:sh)
 
 
 
 
 
65
66 LIB.SunOS= -lsocket -lnsl
67 LIB += $(LIB.$(HOST_OS))
68
69 TCC.DragonFly += -DUSE_PREAD
70
--- Makefile.classic
+++ Makefile.classic
@@ -6,16 +6,16 @@
6 #
7 #### The toplevel directory of the source tree. Fossil can be built
8 # in a directory that is separate from the source tree. Just change
9 # the following to point from the build directory to the src/ folder.
10 #
11 SRCDIR = src
12
13 #### The directory into which object code files should be written.
14 #
15 #
16 OBJDIR = bld
17
18 #### C Compiler and options for use in building executables that
19 # will run on the platform that is doing the build. This is used
20 # to compile code-generator programs as part of the build process.
21 # See TCC below for the C compiler for building the finished binary.
@@ -36,11 +36,11 @@
36 #TCC = gcc -O6
37 #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
38 TCC = gcc -g -Os -Wall
39
40 # To add support for HTTPS
41 TCC += -DFOSSIL_ENABLE_SSL=1
42
43 #### Extra arguments for linking the finished binary. Fossil needs
44 # to link against the Z-Lib compression library. There are no
45 # other dependencies. We sometimes add the -static option here
46 # so that we can build a static executable that will run in a
@@ -47,11 +47,46 @@
47 # chroot jail.
48 #
49 LIB = -lz $(LDFLAGS)
50
51 # If using HTTPS:
52 #
53 # NOTE: These must appear in exactly this order or MinGW will complain about
54 # missing symbols.
55 #
56 LIB += -lssl -lcrypto
57
58 #------------------------------------------------------------------------------
59 # Begin MinGW Section (the following lines may all be commented out unless
60 # building on Windows via MinGW).
61 #------------------------------------------------------------------------------
62
63 # Where is zlib (needed for MinGW builds only)?
64 ZLIBDIR = $(SRCDIR)/../zlib-1.2.5
65
66 # Where is OpenSSL (needed for MinGW builds only)?
67 OPENSSLDIR = $(SRCDIR)/../openssl-1.0.0e
68
69 # Include directory for zlib (needed for MinGW builds only)
70 TCC.MINGW32_NT-6.1 = -I$(ZLIBDIR)
71
72 # Include directory for OpenSSL (needed for MinGW builds only)
73 TCC.MINGW32_NT-6.1 += -I$(OPENSSLDIR)/include
74
75 # Library directory for zlib (needed for MinGW builds only).
76 LIB.MINGW32_NT-6.1 = -L$(ZLIBDIR)
77
78 # Library directory for OpenSSL (needed for MinGW builds only).
79 LIB.MINGW32_NT-6.1 += -L$(OPENSSLDIR)
80
81 # Add the necessary Windows libraries (needed for Windows builds only).
82 LIB.MINGW32_NT-6.1 += -lgdi32 -lws2_32
83
84 #------------------------------------------------------------------------------
85 # End MinGW Section (the preceeding lines may all be commented out unless
86 # building on Windows via MinGW)
87 #------------------------------------------------------------------------------
88
89 #### Tcl shell for use in running the fossil testsuite. If you do not
90 # care about testing the end result, this can be blank.
91 #
92 TCLSH = tclsh
@@ -60,10 +95,15 @@
95 ###############################################################################
96 #
97 # Automatic platform-specific options.
98 HOST_OS_CMD = uname -s
99 HOST_OS = $(HOST_OS_CMD:sh)
100
101 # On MinGW, slightly different detection magic is required.
102 ifeq '$(HOST_OS)' ''
103 HOST_OS = $(shell $(HOST_OS_CMD))
104 endif
105
106 LIB.SunOS= -lsocket -lnsl
107 LIB += $(LIB.$(HOST_OS))
108
109 TCC.DragonFly += -DUSE_PREAD
110

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button