Skip to content

Commit

Permalink
Gitweb: add autoconfigure support for minifiers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
ferrous26 authored and gitster committed Apr 3, 2010
1 parent 0e6ce21 commit bb4bbf7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ lib = lib
# DESTDIR=
pathsep = :

# JavaScript/CSS minifier invocation that can function as filter
JSMIN =
CSSMIN =

export prefix bindir sharedir sysconfdir

CC = gcc
Expand Down
20 changes: 20 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,26 @@ fi],
AC_MSG_NOTICE([Will try -pthread then -lpthread to enable POSIX Threads.])
])

# Define option to enable JavaScript minification
AC_ARG_ENABLE([jsmin],
[AS_HELP_STRING([--enable-jsmin=PATH],
[PATH is the name of a JavaScript minifier or the absolute path to one.])],
[
JSMIN=$enableval;
AC_MSG_NOTICE([Setting JSMIN to '$JSMIN' to enable JavaScript minifying])
GIT_CONF_APPEND_LINE(JSMIN=$enableval);
])

# Define option to enable CSS minification
AC_ARG_ENABLE([cssmin],
[AS_HELP_STRING([--enable-cssmin=PATH],
[PATH is the name of a CSS minifier or the absolute path to one.])],
[
CSSMIN=$enableval;
AC_MSG_NOTICE([Setting CSSMIN to '$CSSMIN' to enable CSS minifying])
GIT_CONF_APPEND_LINE(CSSMIN=$enableval);
])

## Site configuration (override autodetection)
## --with-PACKAGE[=ARG] and --without-PACKAGE
AC_MSG_NOTICE([CHECKS for site configuration])
Expand Down
14 changes: 2 additions & 12 deletions gitweb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ prefix ?= $(HOME)
bindir ?= $(prefix)/bin
RM ?= rm -f

# JavaScript/CSS minifier invocation that can function as filter
JSMIN ?=
CSSMIN ?=

# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
Expand All @@ -30,18 +26,10 @@ GITWEB_STRICT_EXPORT =
GITWEB_BASE_URL =
GITWEB_LIST =
GITWEB_HOMETEXT = indextext.html
ifdef CSSMIN
GITWEB_CSS = gitweb.min.css
else
GITWEB_CSS = gitweb.css
endif
GITWEB_LOGO = git-logo.png
GITWEB_FAVICON = git-favicon.png
ifdef JSMIN
GITWEB_JS = gitweb.min.js
else
GITWEB_JS = gitweb.js
endif
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =

Expand Down Expand Up @@ -95,9 +83,11 @@ all:: gitweb.cgi
FILES = gitweb.cgi
ifdef JSMIN
FILES += gitweb.min.js
GITWEB_JS = gitweb.min.js
endif
ifdef CSSMIN
FILES += gitweb.min.css
GITWEB_CSS = gitweb.min.css
endif
gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)

Expand Down

0 comments on commit bb4bbf7

Please sign in to comment.