diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2009-10-29 06:39:55 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-11-08 00:23:19 (JST) |
commit | 59310ab102a448d90c337b3b138dd53681d8097e (patch) | |
tree | 6b2d1aa00ed31247bf06b87722a35b1f75ceb093 /Makefile | |
parent | 4b1fee00ddfbb7bfb48f85bef49b5aff928d0f2e (diff) | |
download | cgit-59310ab102a448d90c337b3b138dd53681d8097e.zip cgit-59310ab102a448d90c337b3b138dd53681d8097e.tar.gz |
Add NO_OPENSSL option
Linking with OpenSSL is not always desirable. Add NO_OPENSSL option
to use SHA-1 code bundled with Git.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -11,6 +11,9 @@ INSTALL = install | |||
11 | 11 | ||
12 | # Define NO_STRCASESTR if you don't have strcasestr. | 12 | # Define NO_STRCASESTR if you don't have strcasestr. |
13 | # | 13 | # |
14 | # Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1 | ||
15 | # implementation (slower). | ||
16 | # | ||
14 | # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). | 17 | # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). |
15 | # | 18 | # |
16 | 19 | ||
@@ -68,7 +71,7 @@ endif | |||
68 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< | 71 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
69 | 72 | ||
70 | 73 | ||
71 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto | 74 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz |
72 | OBJECTS = | 75 | OBJECTS = |
73 | OBJECTS += cache.o | 76 | OBJECTS += cache.o |
74 | OBJECTS += cgit.o | 77 | OBJECTS += cgit.o |
@@ -123,6 +126,12 @@ endif | |||
123 | ifdef NO_STRCASESTR | 126 | ifdef NO_STRCASESTR |
124 | CFLAGS += -DNO_STRCASESTR | 127 | CFLAGS += -DNO_STRCASESTR |
125 | endif | 128 | endif |
129 | ifdef NO_OPENSSL | ||
130 | CFLAGS += -DNO_OPENSSL | ||
131 | GIT_OPTIONS += NO_OPENSSL=1 | ||
132 | else | ||
133 | EXTLIBS += -lcrypto | ||
134 | endif | ||
126 | 135 | ||
127 | cgit: $(OBJECTS) libgit | 136 | cgit: $(OBJECTS) libgit |
128 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) | 137 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) |
@@ -132,8 +141,8 @@ cgit.o: VERSION | |||
132 | -include $(OBJECTS:.o=.d) | 141 | -include $(OBJECTS:.o=.d) |
133 | 142 | ||
134 | libgit: | 143 | libgit: |
135 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 libgit.a | 144 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a |
136 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 xdiff/lib.a | 145 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a |
137 | 146 | ||
138 | test: all | 147 | test: all |
139 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all | 148 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all |