author | Lars Hjemli <hjemli@gmail.com> | 2008-12-05 18:13:32 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-12-05 18:13:32 (UTC) |
commit | d2592a2cb5ca202d9825d8f1ca6f4a712ea8fe2b (patch) (side-by-side diff) | |
tree | 93198341d83438fce50ffeda19b2510138b7b2e5 | |
parent | a1b01b2513510f8f93f7f8ca39969002cd496a19 (diff) | |
parent | 14b4e108a73b09ce9b6df2c7f2e417305ad68cf4 (diff) | |
download | cgit-d2592a2cb5ca202d9825d8f1ca6f4a712ea8fe2b.zip cgit-d2592a2cb5ca202d9825d8f1ca6f4a712ea8fe2b.tar.gz cgit-d2592a2cb5ca202d9825d8f1ca6f4a712ea8fe2b.tar.bz2 |
Merge branch 'rj/buildtweaks' into stable
-rw-r--r-- | Makefile | 23 | ||||
-rw-r--r-- | cgit.h | 6 | ||||
-rw-r--r-- | parsing.c | 4 | ||||
-rw-r--r-- | ui-repolist.c | 4 |
4 files changed, 31 insertions, 6 deletions
@@ -9,2 +9,22 @@ GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 +# Define NO_STRCASESTR if you don't have strcasestr. +# +# Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). +# + +#-include config.mak + +# +# Platform specific tweaks +# + +uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') +uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') +uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') + +ifeq ($(uname_O),Cygwin) + NO_STRCASESTR = YesPlease + NEEDS_LIBICONV = YesPlease +endif + # @@ -98,2 +118,5 @@ ifdef NO_ICONV endif +ifdef NO_STRCASESTR + CFLAGS += -DNO_STRCASESTR +endif @@ -235,8 +235,2 @@ extern int cgit_parse_snapshots_mask(const char *str); -/* libgit.a either links against or compiles its own implementation of - * strcasestr(), and we'd like to reuse it. Simply re-declaring it - * seems to do the trick. - */ -extern char *strcasestr(const char *haystack, const char *needle); - @@ -98,2 +98,5 @@ char *parse_user(char *t, char **name, char **email, unsigned long *date) +#ifdef NO_ICONV +#define reencode(a, b, c) +#else const char *reencode(char **txt, const char *src_enc, const char *dst_enc) @@ -112,2 +115,3 @@ const char *reencode(char **txt, const char *src_enc, const char *dst_enc) } +#endif diff --git a/ui-repolist.c b/ui-repolist.c index c23232c..2324273 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -8,2 +8,6 @@ +/* This is needed for strcasestr to be defined by <string.h> */ +#define _GNU_SOURCE 1 +#include <string.h> + #include <time.h> |