git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv5 3/6] Gitweb: add autoconfigure support for minifiers

From
Mark Rada <marada@uwaterloo.ca>
Date
Apr 1, 2010, 05:36 UTC
Message-ID
<4BB430D9.1090900@mailservices.uwaterloo.ca>

This will allow users to set a JavaScript/CSS minifier when/if they run the autoconfigure script while building git. This is much more convenient than editing Makefile and gitweb/Makefile manually.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
	No changes since the previous version.
 Makefile        |    4 ----
 configure.ac    |   20 ++++++++++++++++++++
 gitweb/Makefile |   14 ++------------
 3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
index 450e4df..ef1a232 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/configure.ac b/configure.ac
index 914ae57..bf36c72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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=ARG],
+   [ARG is the value to pass to make to enable JavaScript minification.])],
+ [
+   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=ARG],
+   [ARG is the value to pass to make to enable CSS minification.])],
+ [
+   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])
diff --git a/gitweb/Makefile b/gitweb/Makefile
index fffe700..ffee4bd 100644
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
@@ -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
@@ -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 =
 
@@ -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)
 
-- 
1.7.0.3.436.g45b2d
Next: Jakub Narebski
Message 1 of 4 in “[PATCHv5 3/6] Gitweb: add autoconfigure support for minifiers”
  1. Mark RadaApr 1, 2010
  2. Jakub NarebskiApr 1, 2010
  3. Mark RadaApr 2, 2010
  4. Jakub NarebskiApr 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.