X Tutup
Skip to content

Commit bb4bbf7

Browse files
ferrous26gitster
authored andcommitted
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>
1 parent 0e6ce21 commit bb4bbf7

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,6 @@ lib = lib
282282
# DESTDIR=
283283
pathsep = :
284284

285-
# JavaScript/CSS minifier invocation that can function as filter
286-
JSMIN =
287-
CSSMIN =
288-
289285
export prefix bindir sharedir sysconfdir
290286

291287
CC = gcc

configure.ac

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,26 @@ fi],
179179
AC_MSG_NOTICE([Will try -pthread then -lpthread to enable POSIX Threads.])
180180
])
181181

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+
182202
## Site configuration (override autodetection)
183203
## --with-PACKAGE[=ARG] and --without-PACKAGE
184204
AC_MSG_NOTICE([CHECKS for site configuration])

gitweb/Makefile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ prefix ?= $(HOME)
1414
bindir ?= $(prefix)/bin
1515
RM ?= rm -f
1616

17-
# JavaScript/CSS minifier invocation that can function as filter
18-
JSMIN ?=
19-
CSSMIN ?=
20-
2117
# default configuration for gitweb
2218
GITWEB_CONFIG = gitweb_config.perl
2319
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
@@ -30,18 +26,10 @@ GITWEB_STRICT_EXPORT =
3026
GITWEB_BASE_URL =
3127
GITWEB_LIST =
3228
GITWEB_HOMETEXT = indextext.html
33-
ifdef CSSMIN
34-
GITWEB_CSS = gitweb.min.css
35-
else
3629
GITWEB_CSS = gitweb.css
37-
endif
3830
GITWEB_LOGO = git-logo.png
3931
GITWEB_FAVICON = git-favicon.png
40-
ifdef JSMIN
41-
GITWEB_JS = gitweb.min.js
42-
else
4332
GITWEB_JS = gitweb.js
44-
endif
4533
GITWEB_SITE_HEADER =
4634
GITWEB_SITE_FOOTER =
4735

@@ -95,9 +83,11 @@ all:: gitweb.cgi
9583
FILES = gitweb.cgi
9684
ifdef JSMIN
9785
FILES += gitweb.min.js
86+
GITWEB_JS = gitweb.min.js
9887
endif
9988
ifdef CSSMIN
10089
FILES += gitweb.min.css
90+
GITWEB_CSS = gitweb.min.css
10191
endif
10292
gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
10393

0 commit comments

Comments
 (0)
X Tutup