Fossil SCM
Add fixes to classic makefile to support MinGW mostly automatically.
Commit
590cee0ec92d5392d36c5e01caf0b2992b8effd7
Parent
24e298edd02f9b8…
1 file changed
+44
-4
+44
-4
| --- Makefile.classic | ||
| +++ Makefile.classic | ||
| @@ -6,16 +6,16 @@ | ||
| 6 | 6 | # |
| 7 | 7 | #### The toplevel directory of the source tree. Fossil can be built |
| 8 | 8 | # in a directory that is separate from the source tree. Just change |
| 9 | 9 | # the following to point from the build directory to the src/ folder. |
| 10 | 10 | # |
| 11 | -SRCDIR = ./src | |
| 11 | +SRCDIR = src | |
| 12 | 12 | |
| 13 | 13 | #### The directory into which object code files should be written. |
| 14 | 14 | # |
| 15 | 15 | # |
| 16 | -OBJDIR = ./bld | |
| 16 | +OBJDIR = bld | |
| 17 | 17 | |
| 18 | 18 | #### C Compiler and options for use in building executables that |
| 19 | 19 | # will run on the platform that is doing the build. This is used |
| 20 | 20 | # to compile code-generator programs as part of the build process. |
| 21 | 21 | # See TCC below for the C compiler for building the finished binary. |
| @@ -36,11 +36,11 @@ | ||
| 36 | 36 | #TCC = gcc -O6 |
| 37 | 37 | #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage |
| 38 | 38 | TCC = gcc -g -Os -Wall |
| 39 | 39 | |
| 40 | 40 | # To add support for HTTPS |
| 41 | -TCC += -DFOSSIL_ENABLE_SSL | |
| 41 | +TCC += -DFOSSIL_ENABLE_SSL=1 | |
| 42 | 42 | |
| 43 | 43 | #### Extra arguments for linking the finished binary. Fossil needs |
| 44 | 44 | # to link against the Z-Lib compression library. There are no |
| 45 | 45 | # other dependencies. We sometimes add the -static option here |
| 46 | 46 | # so that we can build a static executable that will run in a |
| @@ -47,11 +47,46 @@ | ||
| 47 | 47 | # chroot jail. |
| 48 | 48 | # |
| 49 | 49 | LIB = -lz $(LDFLAGS) |
| 50 | 50 | |
| 51 | 51 | # 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 | +#------------------------------------------------------------------------------ | |
| 53 | 88 | |
| 54 | 89 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 55 | 90 | # care about testing the end result, this can be blank. |
| 56 | 91 | # |
| 57 | 92 | TCLSH = tclsh |
| @@ -60,10 +95,15 @@ | ||
| 60 | 95 | ############################################################################### |
| 61 | 96 | # |
| 62 | 97 | # Automatic platform-specific options. |
| 63 | 98 | HOST_OS_CMD = uname -s |
| 64 | 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 | |
| 65 | 105 | |
| 66 | 106 | LIB.SunOS= -lsocket -lnsl |
| 67 | 107 | LIB += $(LIB.$(HOST_OS)) |
| 68 | 108 | |
| 69 | 109 | TCC.DragonFly += -DUSE_PREAD |
| 70 | 110 |
| --- 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 |