-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> |