@matheusbsbs / matheus-bagliano / commits / bb4bbf7582
Fork 0

Gitweb: add autoconfigure support for minifiers

This will allow users to set a JavaScript/CSS minifier when/if they run the autoconfigure script while building git. Signed-off-by: Mark Rada <marada@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mark Rada committed Apr 2, 2010 at 20:35 UTC bb4bbf75829d1a6c021e34943ff4e942f064bb55
3 files changed +22 -16
Makefile
-4
@@ -282,10 +282,6 @@ lib = lib
282 # DESTDIR=
283 pathsep = :
284
285 -# JavaScript/CSS minifier invocation that can function as filter
286 -JSMIN =
287 -CSSMIN =
288 -
285 export prefix bindir sharedir sysconfdir
286
287 CC = gcc
configure.ac
+20
@@ -179,6 +179,26 @@ fi],
179 AC_MSG_NOTICE([Will try -pthread then -lpthread to enable POSIX Threads.])
180 ])
181
182 +# Define option to enable JavaScript minification
183 +AC_ARG_ENABLE([jsmin],
184 +[AS_HELP_STRING([--enable-jsmin=PATH],
185 + [PATH is the name of a JavaScript minifier or the absolute path to one.])],
186 +[
187 + JSMIN=$enableval;
188 + AC_MSG_NOTICE([Setting JSMIN to '$JSMIN' to enable JavaScript minifying])
189 + GIT_CONF_APPEND_LINE(JSMIN=$enableval);
190 +])
191 +
192 +# Define option to enable CSS minification
193 +AC_ARG_ENABLE([cssmin],
194 +[AS_HELP_STRING([--enable-cssmin=PATH],
195 + [PATH is the name of a CSS minifier or the absolute path to one.])],
196 +[
197 + CSSMIN=$enableval;
198 + AC_MSG_NOTICE([Setting CSSMIN to '$CSSMIN' to enable CSS minifying])
199 + GIT_CONF_APPEND_LINE(CSSMIN=$enableval);
200 +])
201 +
202 ## Site configuration (override autodetection)
203 ## --with-PACKAGE[=ARG] and --without-PACKAGE
204 AC_MSG_NOTICE([CHECKS for site configuration])
gitweb/Makefile
+2 -12
@@ -14,10 +14,6 @@ prefix ?= $(HOME)
14 bindir ?= $(prefix)/bin
15 RM ?= rm -f
16
17 -# JavaScript/CSS minifier invocation that can function as filter
18 -JSMIN ?=
19 -CSSMIN ?=
20 -
17 # default configuration for gitweb
18 GITWEB_CONFIG = gitweb_config.perl
19 GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
@@ -30,18 +26,10 @@ GITWEB_STRICT_EXPORT =
26 GITWEB_BASE_URL =
27 GITWEB_LIST =
28 GITWEB_HOMETEXT = indextext.html
33 -ifdef CSSMIN
34 -GITWEB_CSS = gitweb.min.css
35 -else
29 GITWEB_CSS = gitweb.css
37 -endif
30 GITWEB_LOGO = git-logo.png
31 GITWEB_FAVICON = git-favicon.png
40 -ifdef JSMIN
41 -GITWEB_JS = gitweb.min.js
42 -else
32 GITWEB_JS = gitweb.js
44 -endif
33 GITWEB_SITE_HEADER =
34 GITWEB_SITE_FOOTER =
35
@@ -95,9 +83,11 @@ all:: gitweb.cgi
83 FILES = gitweb.cgi
84 ifdef JSMIN
85 FILES += gitweb.min.js
86 +GITWEB_JS = gitweb.min.js
87 endif
88 ifdef CSSMIN
89 FILES += gitweb.min.css
90 +GITWEB_CSS = gitweb.min.css
91 endif
92 gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
93