1
1
# -*- Autoconf -*-
2
2
# Process this file with autoconf to produce a configure script.
3
3
4
- # # Definitions of macros
4
+ # # Definitions of private macros.
5
+
5
6
# GIT_CONF_APPEND_LINE(LINE)
6
7
# --------------------------
7
8
# Append LINE to file ${config_append}
8
9
AC_DEFUN ( [ GIT_CONF_APPEND_LINE] ,
9
- [ echo "$1 " >> "${config_append}"] ) # GIT_CONF_APPEND_LINE
10
- #
10
+ [ echo "$1 " >> "${config_append}"] )
11
+
11
12
# GIT_ARG_SET_PATH(PROGRAM)
12
13
# -------------------------
13
14
# Provide --with-PROGRAM=PATH option to set PATH to PROGRAM
14
15
# Optional second argument allows setting NO_PROGRAM=YesPlease if
15
16
# --without-PROGRAM version used.
16
17
AC_DEFUN ( [ GIT_ARG_SET_PATH] ,
17
- [ AC_ARG_WITH ( [ $1 ] ,
18
- [ AS_HELP_STRING ( [ --with-$1 =PATH] ,
19
- [ provide PATH to $1 ] ) ] ,
20
- [ GIT_CONF_APPEND_PATH($1 , $2 )] ,[ ] )
21
- ] ) # GIT_ARG_SET_PATH
22
- #
18
+ [ AC_ARG_WITH ( [ $1 ] ,
19
+ [ AS_HELP_STRING ( [ --with-$1 =PATH] ,
20
+ [ provide PATH to $1 ] ) ] ,
21
+ [ GIT_CONF_APPEND_PATH([ $1 ] , [ $2 ] )] ,
22
+ [ ] ) ] )
23
+
23
24
# GIT_CONF_APPEND_PATH(PROGRAM)
24
- # ------------------------------
25
+ # -----------------------------
25
26
# Parse --with-PROGRAM=PATH option to set PROGRAM_PATH=PATH
26
27
# Used by GIT_ARG_SET_PATH(PROGRAM)
27
28
# Optional second argument allows setting NO_PROGRAM=YesPlease if
28
29
# --without-PROGRAM is used.
29
30
AC_DEFUN ( [ GIT_CONF_APPEND_PATH] ,
30
- [ m4_pushdef ( [ GIT_UC_PROGRAM] , m4_toupper ( [ $1 ] ) ) dnl
31
- PROGRAM=GIT_UC_PROGRAM; \
32
- if test "$withval" = "no"; then \
33
- if test -n "$2 "; then \
34
- GIT_UC_PROGRAM[ ] _PATH=$withval; \
35
- AC_MSG_NOTICE ( [ Disabling use of ${PROGRAM}] ) ; \
36
- GIT_CONF_APPEND_LINE(NO_${PROGRAM}=YesPlease); \
37
- GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=); \
38
- else \
39
- AC_MSG_ERROR ( [ You cannot use git without $1 ] ) ; \
40
- fi; \
41
- else \
42
- if test "$withval" = "yes"; then \
43
- AC_MSG_WARN ( [ You should provide path for --with-$1 =PATH] ) ; \
44
- else \
45
- GIT_UC_PROGRAM[ ] _PATH=$withval; \
46
- AC_MSG_NOTICE ( [ Setting GIT_UC_PROGRAM[ ] _PATH to $withval] ) ; \
47
- GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval); \
48
- fi; \
49
- fi; \
50
- m4_popdef ( [ GIT_UC_PROGRAM] ) ] ) # GIT_CONF_APPEND_PATH
51
- #
31
+ [ m4_pushdef ( [ GIT_UC_PROGRAM] , m4_toupper ( [ $1 ] ) ) dnl
32
+ PROGRAM=GIT_UC_PROGRAM
33
+ if test "$withval" = "no"; then
34
+ if test -n "$2 "; then
35
+ GIT_UC_PROGRAM[ ] _PATH=$withval
36
+ AC_MSG_NOTICE ( [ Disabling use of ${PROGRAM}] )
37
+ GIT_CONF_APPEND_LINE(NO_${PROGRAM}=YesPlease)
38
+ GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=)
39
+ else
40
+ AC_MSG_ERROR ( [ You cannot use git without $1 ] )
41
+ fi
42
+ else
43
+ if test "$withval" = "yes"; then
44
+ AC_MSG_WARN ( [ You should provide path for --with-$1 =PATH] )
45
+ else
46
+ GIT_UC_PROGRAM[ ] _PATH=$withval
47
+ AC_MSG_NOTICE ( [ Setting GIT_UC_PROGRAM[ ] _PATH to $withval] )
48
+ GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval)
49
+ fi
50
+ fi
51
+ m4_popdef ( [ GIT_UC_PROGRAM] ) ] )
52
+
52
53
# GIT_PARSE_WITH(PACKAGE)
53
54
# -----------------------
54
55
# For use in AC_ARG_WITH action-if-found, for packages default ON.
55
56
# * Set NO_PACKAGE=YesPlease for --without-PACKAGE
56
57
# * Set PACKAGEDIR=PATH for --with-PACKAGE=PATH
57
58
# * Unset NO_PACKAGE for --with-PACKAGE without ARG
58
59
AC_DEFUN ( [ GIT_PARSE_WITH] ,
59
- [ m4_pushdef ( [ GIT_UC_PACKAGE] , m4_toupper ( [ $1 ] ) ) dnl
60
- PACKAGE=GIT_UC_PACKAGE; \
61
- if test "$withval" = "no"; then \
62
- NO_[ ] GIT_UC_PACKAGE=YesPlease; \
63
- elif test "$withval" = "yes"; then \
64
- NO_[ ] GIT_UC_PACKAGE=; \
65
- else \
66
- NO_[ ] GIT_UC_PACKAGE=; \
67
- GIT_UC_PACKAGE[ ] DIR=$withval; \
68
- AC_MSG_NOTICE ( [ Setting GIT_UC_PACKAGE[ ] DIR to $withval] ) ; \
69
- GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \
70
- fi \
71
- m4_popdef ( [ GIT_UC_PACKAGE] ) ] ) # GIT_PARSE_WITH
72
- #
60
+ [ m4_pushdef ( [ GIT_UC_PACKAGE] , m4_toupper ( [ $1 ] ) ) dnl
61
+ PACKAGE=GIT_UC_PACKAGE
62
+ if test "$withval" = "no"; then
63
+ NO_[ ] GIT_UC_PACKAGE=YesPlease
64
+ elif test "$withval" = "yes"; then
65
+ NO_[ ] GIT_UC_PACKAGE=
66
+ else
67
+ NO_[ ] GIT_UC_PACKAGE=
68
+ GIT_UC_PACKAGE[ ] DIR=$withval
69
+ AC_MSG_NOTICE ( [ Setting GIT_UC_PACKAGE[ ] DIR to $withval] )
70
+ GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval)
71
+ fi
72
+ m4_popdef ( [ GIT_UC_PACKAGE] ) ] )
73
+
73
74
# GIT_PARSE_WITH_SET_MAKE_VAR(WITHNAME, VAR, HELP_TEXT)
74
- # ---------------------
75
+ # -----------------------------------------------------
75
76
# Set VAR to the value specied by --with-WITHNAME.
76
77
# No verification of arguments is performed, but warnings are issued
77
78
# if either 'yes' or 'no' is specified.
@@ -80,33 +81,32 @@ m4_popdef([GIT_UC_PACKAGE])]) # GIT_PARSE_WITH
80
81
AC_DEFUN ( [ GIT_PARSE_WITH_SET_MAKE_VAR] ,
81
82
[ AC_ARG_WITH ( [ $1 ] ,
82
83
[ AS_HELP_STRING ( [ --with-$1 =VALUE] , $3 ) ] ,
83
- if test - n "$withval"; then \
84
- if test "$withval" = "yes" - o "$withval" = "no"; then \
84
+ if test - n "$withval"; then
85
+ if test "$withval" = "yes" - o "$withval" = "no"; then
85
86
AC_MSG_WARN ( [ You likely do not want either 'yes' or 'no' as]
86
- [ a value for $1 ($2 ). Maybe you do...?] ) ; \
87
- fi; \
88
- \
89
- AC_MSG_NOTICE ( [ Setting $2 to $withval] ) ; \
90
- GIT_CONF_APPEND_LINE ( $2 = $withval ) ; \
87
+ [ a value for $1 ($2 ). Maybe you do...?] )
88
+ fi
89
+ AC_MSG_NOTICE ( [ Setting $2 to $withval] )
90
+ GIT_CONF_APPEND_LINE ( $2 = $withval )
91
91
fi ) ] ) # GIT_PARSE_WITH_SET_MAKE_VAR
92
92
93
- dnl
94
- dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE)
95
- dnl -----------------------------------------
96
- dnl Similar to AC_CHECK_FUNC, but on systems that do not generate
97
- dnl warnings for missing prototypes (e.g. FreeBSD when compiling without
98
- dnl -Wall), it does not work. By looking for function definition in
99
- dnl libraries, this problem can be worked around.
93
+ #
94
+ # GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE)
95
+ # -----------------------------------------
96
+ # Similar to AC_CHECK_FUNC, but on systems that do not generate
97
+ # warnings for missing prototypes (e.g. FreeBSD when compiling without
98
+ # -Wall), it does not work. By looking for function definition in
99
+ # libraries, this problem can be worked around.
100
100
AC_DEFUN ( [ GIT_CHECK_FUNC] ,[ AC_CHECK_FUNC ( [ $1 ] ,[
101
101
AC_SEARCH_LIBS ( [ $1 ] ,,
102
102
[ $2 ] ,[ $3 ] )
103
103
] ,[ $3 ] ) ] )
104
104
105
- dnl
106
- dnl GIT_STASH_FLAGS(BASEPATH_VAR)
107
- dnl -----------------------------
108
- dnl Allow for easy stashing of LDFLAGS and CPPFLAGS before running
109
- dnl tests that may want to take user settings into account.
105
+ #
106
+ # GIT_STASH_FLAGS(BASEPATH_VAR)
107
+ # -----------------------------
108
+ # Allow for easy stashing of LDFLAGS and CPPFLAGS before running
109
+ # tests that may want to take user settings into account.
110
110
AC_DEFUN ( [ GIT_STASH_FLAGS] ,[
111
111
if test -n "$1 "; then
112
112
old_CPPFLAGS="$CPPFLAGS"
@@ -164,14 +164,13 @@ AC_ARG_WITH([sane-tool-path],
164
164
AC_ARG_WITH ( [ lib] ,
165
165
[ AS_HELP_STRING ( [ --with-lib=ARG] ,
166
166
[ ARG specifies alternative name for lib directory] ) ] ,
167
- [ if test "$withval" = "no" || test "$withval" = "yes"; then \
168
- AC_MSG_WARN ( [ You should provide name for --with-lib=ARG] ) ; \
169
- else \
170
- lib=$withval; \
171
- AC_MSG_NOTICE ( [ Setting lib to '$lib'] ) ; \
172
- GIT_CONF_APPEND_LINE(lib=$withval); \
173
- fi; \
174
- ] ,[ ] )
167
+ [ if test "$withval" = "no" || test "$withval" = "yes"; then
168
+ AC_MSG_WARN ( [ You should provide name for --with-lib=ARG] )
169
+ else
170
+ lib=$withval
171
+ AC_MSG_NOTICE ( [ Setting lib to '$lib'] )
172
+ GIT_CONF_APPEND_LINE(lib=$withval)
173
+ fi] )
175
174
176
175
if test -z "$lib"; then
177
176
AC_MSG_NOTICE ( [ Setting lib to 'lib' (the default)] )
@@ -237,9 +236,9 @@ AC_MSG_NOTICE([CHECKS for site configuration])
237
236
# /foo/bar/include and /foo/bar/lib directories.
238
237
AC_ARG_WITH ( openssl ,
239
238
AS_HELP_STRING ( [ --with-openssl] ,[ use OpenSSL library (default is YES)] )
240
- AS_HELP_STRING ( [ ] , [ ARG can be prefix for openssl library and headers] ) ,\
241
- GIT_PARSE_WITH ( openssl ))
242
- #
239
+ AS_HELP_STRING ( [ ] , [ ARG can be prefix for openssl library and headers] ) ,
240
+ GIT_PARSE_WITH ( [ openssl] ))
241
+
243
242
# Define USE_LIBPCRE if you have and want to use libpcre. git-grep will be
244
243
# able to use Perl-compatible regular expressions.
245
244
#
@@ -249,17 +248,16 @@ GIT_PARSE_WITH(openssl))
249
248
AC_ARG_WITH ( libpcre ,
250
249
AS_HELP_STRING ( [ --with-libpcre] ,[ support Perl-compatible regexes (default is NO)] )
251
250
AS_HELP_STRING ( [ ] , [ ARG can be also prefix for libpcre library and headers] ) ,
252
- if test "$withval" = "no"; then \
253
- USE_LIBPCRE=; \
254
- elif test "$withval" = "yes"; then \
255
- USE_LIBPCRE=YesPlease; \
256
- else
257
- USE_LIBPCRE=YesPlease; \
258
- LIBPCREDIR=$withval; \
259
- AC_MSG_NOTICE ( [ Setting LIBPCREDIR to $withval] ) ; \
260
- GIT_CONF_APPEND_LINE ( LIBPCREDIR=$withval ) ; \
261
- fi \
262
- )
251
+ if test "$withval" = "no"; then
252
+ USE_LIBPCRE=
253
+ elif test "$withval" = "yes"; then
254
+ USE_LIBPCRE=YesPlease
255
+ else
256
+ USE_LIBPCRE=YesPlease
257
+ LIBPCREDIR=$withval
258
+ AC_MSG_NOTICE ( [ Setting LIBPCREDIR to $withval] )
259
+ GIT_CONF_APPEND_LINE ( LIBPCREDIR=$withval )
260
+ fi )
263
261
#
264
262
# Define NO_CURL if you do not have curl installed. git-http-pull and
265
263
# git-http-push are not built, and you cannot use http:// and https://
@@ -367,7 +365,7 @@ AC_ARG_WITH(tcltk,
367
365
AS_HELP_STRING ( [ --with-tcltk] ,[ use Tcl/Tk GUI (default is YES)] )
368
366
AS_HELP_STRING ( [ ] ,[ ARG is the full path to the Tcl/Tk interpreter.] )
369
367
AS_HELP_STRING ( [ ] ,[ Bare --with-tcltk will make the GUI part only if] )
370
- AS_HELP_STRING ( [ ] ,[ Tcl/Tk interpreter will be found in a system.] ) ,\
368
+ AS_HELP_STRING ( [ ] ,[ Tcl/Tk interpreter will be found in a system.] ) ,
371
369
GIT_PARSE_WITH ( tcltk ))
372
370
#
373
371
0 commit comments