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