# Define NO_REGEX if you have no or inferior regex support in your C library.
#
# Define GETTEXT_POISON if you are debugging the choice of strings marked
-# for translation. This will turn all strings that use gettext into gibberish.
+# for translation. In a GETTEXT_POISON build, you can turn all strings marked
+# for translation into gibberish by setting the GIT_GETTEXT_POISON variable
+# (to any value) in your environment.
#
# Define JSMIN to point to JavaScript minifier that functions as
# a filter to have gitweb.js minified.
BASIC_CFLAGS += -DNO_SYMLINK_HEAD
endif
ifdef GETTEXT_POISON
+ LIB_OBJS += gettext.o
BASIC_CFLAGS += -DGETTEXT_POISON
endif
ifdef NO_STRCASESTR
--- /dev/null
+/*
+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+ */
+
+#include "git-compat-util.h"
+#include "gettext.h"
+
+int use_gettext_poison(void)
+{
+ static int poison_requested = -1;
+ if (poison_requested == -1)
+ poison_requested = getenv("GIT_GETTEXT_POISON") ? 1 : 0;
+ return poison_requested;
+}
#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
#ifdef GETTEXT_POISON
-#define use_gettext_poison() 1
+extern int use_gettext_poison(void);
#else
#define use_gettext_poison() 0
#endif
test -z "$NO_PYTHON" && test_set_prereq PYTHON
# Can we rely on git's output in the C locale?
-test -z "$GETTEXT_POISON" && test_set_prereq C_LOCALE_OUTPUT
+if test -n "$GETTEXT_POISON"
+then
+ GIT_GETTEXT_POISON=YesPlease
+ export GIT_GETTEXT_POISON
+else
+ test_set_prereq C_LOCALE_OUTPUT
+fi
# test whether the filesystem supports symbolic links
ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS