]>
Commit | Line | Data |
---|---|---|
55667714 JN |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | AC_PREREQ(2.59) | |
3900145e | 5 | AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org]) |
55667714 JN |
6 | |
7 | AC_CONFIG_SRCDIR([git.c]) | |
8 | ||
9 | config_file=config.mak.autogen | |
d3a6db98 | 10 | config_append=config.mak.append |
55667714 JN |
11 | config_in=config.mak.in |
12 | ||
d3a6db98 JN |
13 | echo "# ${config_append}. Generated by configure." > "${config_append}" |
14 | ||
15 | ||
16 | ## Definitions of macros | |
17 | # GIT_CONF_APPEND_LINE(LINE) | |
18 | # -------------------------- | |
19 | # Append LINE to file ${config_append} | |
20 | AC_DEFUN([GIT_CONF_APPEND_LINE], | |
21 | [echo "$1" >> "${config_append}"])# GIT_CONF_APPEND_LINE | |
657b062d JN |
22 | # |
23 | # GIT_ARG_SET_PATH(PROGRAM) | |
24 | # ------------------------- | |
25 | # Provide --with-PROGRAM=PATH option to set PATH to PROGRAM | |
26 | AC_DEFUN([GIT_ARG_SET_PATH], | |
27 | [AC_ARG_WITH([$1], | |
28 | [AS_HELP_STRING([--with-$1=PATH], | |
29 | [provide PATH to $1])], | |
30 | [GIT_CONF_APPEND_PATH($1)],[]) | |
31 | ])# GIT_ARG_SET_PATH | |
32 | # | |
33 | # GIT_CONF_APPEND_PATH(PROGRAM) | |
34 | # ------------------------------ | |
35 | # Parse --with-PROGRAM=PATH option to set PROGRAM_PATH=PATH | |
36 | # Used by GIT_ARG_SET_PATH(PROGRAM) | |
37 | AC_DEFUN([GIT_CONF_APPEND_PATH], | |
38 | [PROGRAM=m4_toupper($1); \ | |
39 | if test "$withval" = "no"; then \ | |
b52b1d43 | 40 | AC_MSG_ERROR([You cannot use git without $1]); \ |
657b062d JN |
41 | else \ |
42 | if test "$withval" = "yes"; then \ | |
43 | AC_MSG_WARN([You should provide path for --with-$1=PATH]); \ | |
44 | else \ | |
45 | GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval); \ | |
46 | fi; \ | |
47 | fi; \ | |
48 | ]) # GIT_CONF_APPEND_PATH | |
a20b4d89 JN |
49 | # |
50 | # GIT_PARSE_WITH(PACKAGE) | |
51 | # ----------------------- | |
52 | # For use in AC_ARG_WITH action-if-found, for packages default ON. | |
53 | # * Set NO_PACKAGE=YesPlease for --without-PACKAGE | |
54 | # * Set PACKAGEDIR=PATH for --with-PACKAGE=PATH | |
55 | # * Unset NO_PACKAGE for --with-PACKAGE without ARG | |
56 | AC_DEFUN([GIT_PARSE_WITH], | |
57 | [PACKAGE=m4_toupper($1); \ | |
58 | if test "$withval" = "no"; then \ | |
59 | m4_toupper(NO_$1)=YesPlease; \ | |
60 | elif test "$withval" = "yes"; then \ | |
61 | m4_toupper(NO_$1)=; \ | |
62 | else \ | |
63 | m4_toupper(NO_$1)=; \ | |
64 | GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \ | |
65 | fi \ | |
66 | ])# GIT_PARSE_WITH | |
d3a6db98 | 67 | |
1689c5de DS |
68 | dnl |
69 | dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE) | |
70 | dnl ----------------------------------------- | |
71 | dnl Similar to AC_CHECK_FUNC, but on systems that do not generate | |
72 | dnl warnings for missing prototypes (e.g. FreeBSD when compiling without | |
73 | dnl -Wall), it does not work. By looking for function definition in | |
74 | dnl libraries, this problem can be worked around. | |
75 | AC_DEFUN([GIT_CHECK_FUNC],[AC_CHECK_FUNC([$1],[ | |
76 | AC_SEARCH_LIBS([$1],, | |
77 | [$2],[$3]) | |
78 | ],[$3])]) | |
a20b4d89 | 79 | ## Site configuration related to programs (before tests) |
c4b1b140 JN |
80 | ## --with-PACKAGE[=ARG] and --without-PACKAGE |
81 | # | |
10861bea RS |
82 | # Set lib to alternative name of lib directory (e.g. lib64) |
83 | AC_ARG_WITH([lib], | |
84 | [AS_HELP_STRING([--with-lib=ARG], | |
85 | [ARG specifies alternative name for lib directory])], | |
3c307bfb | 86 | [if test "$withval" = "no" || test "$withval" = "yes"; then \ |
10861bea RS |
87 | AC_MSG_WARN([You should provide name for --with-lib=ARG]); \ |
88 | else \ | |
89 | GIT_CONF_APPEND_LINE(lib=$withval); \ | |
90 | fi; \ | |
91 | ],[]) | |
92 | # | |
465e649d JN |
93 | # Define SHELL_PATH to provide path to shell. |
94 | GIT_ARG_SET_PATH(shell) | |
95 | # | |
96 | # Define PERL_PATH to provide path to Perl. | |
97 | GIT_ARG_SET_PATH(perl) | |
98 | # | |
bef19da9 RS |
99 | # Define ZLIB_PATH to provide path to zlib. |
100 | GIT_ARG_SET_PATH(zlib) | |
101 | # | |
81b63c70 ER |
102 | # Declare the with-tcltk/without-tcltk options. |
103 | AC_ARG_WITH(tcltk, | |
104 | AS_HELP_STRING([--with-tcltk],[use Tcl/Tk GUI (default is YES)]) | |
105 | AS_HELP_STRING([],[ARG is the full path to the Tcl/Tk interpreter.]) | |
106 | AS_HELP_STRING([],[Bare --with-tcltk will make the GUI part only if]) | |
107 | AS_HELP_STRING([],[Tcl/Tk interpreter will be found in a system.]),\ | |
108 | GIT_PARSE_WITH(tcltk)) | |
109 | # | |
c4b1b140 JN |
110 | |
111 | ||
633b4239 | 112 | ## Checks for programs. |
fd22c027 | 113 | AC_MSG_NOTICE([CHECKS for programs]) |
f6719572 | 114 | # |
60a144f2 | 115 | AC_PROG_CC([cc gcc]) |
798a9450 GF |
116 | # which switch to pass runtime path to dynamic libraries to the linker |
117 | AC_CACHE_CHECK([if linker supports -R], ld_dashr, [ | |
118 | SAVE_LDFLAGS="${LDFLAGS}" | |
119 | LDFLAGS="${SAVE_LDFLAGS} -R /" | |
120 | AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_dashr=yes], [ld_dashr=no]) | |
121 | LDFLAGS="${SAVE_LDFLAGS}" | |
122 | ]) | |
123 | if test "$ld_dashr" = "yes"; then | |
124 | AC_SUBST(CC_LD_DYNPATH, [-R]) | |
125 | else | |
126 | AC_CACHE_CHECK([if linker supports -Wl,-rpath,], ld_wl_rpath, [ | |
127 | SAVE_LDFLAGS="${LDFLAGS}" | |
128 | LDFLAGS="${SAVE_LDFLAGS} -Wl,-rpath,/" | |
129 | AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_wl_rpath=yes], [ld_wl_rpath=no]) | |
50a4b352 | 130 | LDFLAGS="${SAVE_LDFLAGS}" |
798a9450 GF |
131 | ]) |
132 | if test "$ld_wl_rpath" = "yes"; then | |
133 | AC_SUBST(CC_LD_DYNPATH, [-Wl,-rpath,]) | |
134 | else | |
135 | AC_CACHE_CHECK([if linker supports -rpath], ld_rpath, [ | |
136 | SAVE_LDFLAGS="${LDFLAGS}" | |
137 | LDFLAGS="${SAVE_LDFLAGS} -rpath /" | |
138 | AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_rpath=yes], [ld_rpath=no]) | |
50a4b352 | 139 | LDFLAGS="${SAVE_LDFLAGS}" |
798a9450 GF |
140 | ]) |
141 | if test "$ld_rpath" = "yes"; then | |
142 | AC_SUBST(CC_LD_DYNPATH, [-rpath]) | |
143 | else | |
144 | AC_MSG_WARN([linker does not support runtime path to dynamic libraries]) | |
145 | fi | |
146 | fi | |
147 | fi | |
fd22c027 | 148 | #AC_PROG_INSTALL # needs install-sh or install.sh in sources |
96e24abc | 149 | AC_CHECK_TOOLS(AR, [gar ar], :) |
fd22c027 | 150 | AC_CHECK_PROGS(TAR, [gtar tar]) |
81b63c70 ER |
151 | # TCLTK_PATH will be set to some value if we want Tcl/Tk |
152 | # or will be empty otherwise. | |
153 | if test -z "$NO_TCLTK"; then | |
154 | if test "$with_tcltk" = ""; then | |
155 | # No Tcl/Tk switches given. Do not check for Tcl/Tk, use bare 'wish'. | |
156 | TCLTK_PATH=wish | |
157 | AC_SUBST(TCLTK_PATH) | |
158 | elif test "$with_tcltk" = "yes"; then | |
159 | # Tcl/Tk check requested. | |
160 | AC_CHECK_PROGS(TCLTK_PATH, [wish], ) | |
68daee08 | 161 | else |
81b63c70 ER |
162 | AC_MSG_RESULT([Using Tcl/Tk interpreter $with_tcltk]) |
163 | TCLTK_PATH="$with_tcltk" | |
164 | AC_SUBST(TCLTK_PATH) | |
81b63c70 ER |
165 | fi |
166 | fi | |
923db42e JN |
167 | AC_CHECK_PROGS(ASCIIDOC, [asciidoc]) |
168 | if test -n "$ASCIIDOC"; then | |
169 | AC_MSG_CHECKING([for asciidoc version]) | |
170 | asciidoc_version=`$ASCIIDOC --version 2>&1` | |
171 | case "${asciidoc_version}" in | |
172 | asciidoc' '8*) | |
173 | ASCIIDOC8=YesPlease | |
174 | AC_MSG_RESULT([${asciidoc_version} > 7]) | |
175 | ;; | |
176 | asciidoc' '7*) | |
177 | ASCIIDOC8= | |
178 | AC_MSG_RESULT([${asciidoc_version}]) | |
179 | ;; | |
180 | *) | |
181 | ASCIIDOC8= | |
182 | AC_MSG_RESULT([${asciidoc_version} (unknown)]) | |
183 | ;; | |
184 | esac | |
185 | fi | |
186 | AC_SUBST(ASCIIDOC8) | |
187 | ||
633b4239 JN |
188 | |
189 | ## Checks for libraries. | |
ebdf5321 | 190 | AC_MSG_NOTICE([CHECKS for libraries]) |
f6719572 | 191 | # |
633b4239 | 192 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
ebdf5321 | 193 | # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). |
d5c31a1c | 194 | AC_CHECK_LIB([crypto], [SHA1_Init], |
424adc50 | 195 | [NEEDS_SSL_WITH_CRYPTO=], |
3068f6c4 | 196 | [AC_CHECK_LIB([ssl], [SHA1_Init], |
424adc50 JN |
197 | [NEEDS_SSL_WITH_CRYPTO=YesPlease |
198 | NEEDS_SSL_WITH_CRYPTO=], | |
199 | [NO_OPENSSL=YesPlease])]) | |
200 | AC_SUBST(NEEDS_SSL_WITH_CRYPTO) | |
201 | AC_SUBST(NO_OPENSSL) | |
f6719572 | 202 | # |
8da1e212 | 203 | # Define NO_CURL if you do not have libcurl installed. git-http-pull and |
633b4239 JN |
204 | # git-http-push are not built, and you cannot use http:// and https:// |
205 | # transports. | |
d5c31a1c | 206 | AC_CHECK_LIB([curl], [curl_global_init], |
424adc50 JN |
207 | [NO_CURL=], |
208 | [NO_CURL=YesPlease]) | |
209 | AC_SUBST(NO_CURL) | |
f6719572 | 210 | # |
633b4239 JN |
211 | # Define NO_EXPAT if you do not have expat installed. git-http-push is |
212 | # not built, and you cannot push using http:// and https:// transports. | |
d5c31a1c | 213 | AC_CHECK_LIB([expat], [XML_ParserCreate], |
424adc50 JN |
214 | [NO_EXPAT=], |
215 | [NO_EXPAT=YesPlease]) | |
216 | AC_SUBST(NO_EXPAT) | |
f6719572 | 217 | # |
e63ccb84 FK |
218 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin and |
219 | # some Solaris installations). | |
6ff88de7 | 220 | # Define NO_ICONV if neither libc nor libiconv support iconv. |
e63ccb84 FK |
221 | AC_DEFUN([ICONVTEST_SRC], [ |
222 | #include <iconv.h> | |
223 | ||
224 | int main(void) | |
225 | { | |
226 | iconv_open("", ""); | |
227 | return 0; | |
228 | } | |
229 | ]) | |
230 | AC_MSG_CHECKING([for iconv in -lc]) | |
231 | AC_LINK_IFELSE(ICONVTEST_SRC, | |
232 | [AC_MSG_RESULT([yes]) | |
233 | NEEDS_LIBICONV=], | |
234 | [AC_MSG_RESULT([no]) | |
235 | old_LIBS="$LIBS" | |
236 | LIBS="$LIBS -liconv" | |
237 | AC_MSG_CHECKING([for iconv in -liconv]) | |
238 | AC_LINK_IFELSE(ICONVTEST_SRC, | |
239 | [AC_MSG_RESULT([yes]) | |
240 | NEEDS_LIBICONV=YesPlease], | |
241 | [AC_MSG_RESULT([no]) | |
242 | NO_ICONV=YesPlease]) | |
243 | LIBS="$old_LIBS"]) | |
424adc50 | 244 | AC_SUBST(NEEDS_LIBICONV) |
baf1219a | 245 | AC_SUBST(NO_ICONV) |
825b045f | 246 | test -n "$NEEDS_LIBICONV" && LIBS="$LIBS -liconv" |
f6719572 | 247 | # |
609a2289 DS |
248 | # Define NO_DEFLATE_BOUND if deflateBound is missing from zlib. |
249 | AC_DEFUN([ZLIBTEST_SRC], [ | |
250 | #include <zlib.h> | |
251 | ||
252 | int main(void) | |
253 | { | |
254 | deflateBound(0, 0); | |
255 | return 0; | |
256 | } | |
257 | ]) | |
258 | AC_MSG_CHECKING([for deflateBound in -lz]) | |
259 | old_LIBS="$LIBS" | |
260 | LIBS="$LIBS -lz" | |
261 | AC_LINK_IFELSE(ZLIBTEST_SRC, | |
262 | [AC_MSG_RESULT([yes])], | |
263 | [AC_MSG_RESULT([no]) | |
264 | NO_DEFLATE_BOUND=yes]) | |
265 | LIBS="$old_LIBS" | |
266 | AC_SUBST(NO_DEFLATE_BOUND) | |
267 | # | |
633b4239 JN |
268 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, |
269 | # Patrick Mauritz). | |
d5c31a1c | 270 | AC_CHECK_LIB([c], [socket], |
424adc50 JN |
271 | [NEEDS_SOCKET=], |
272 | [NEEDS_SOCKET=YesPlease]) | |
273 | AC_SUBST(NEEDS_SOCKET) | |
d1b9944d | 274 | test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket" |
633b4239 JN |
275 | |
276 | ||
277 | ## Checks for header files. | |
0f7a9c9b JN |
278 | AC_MSG_NOTICE([CHECKS for header files]) |
279 | # | |
3cf32374 JN |
280 | # Define NO_SYS_SELECT_H if you don't have sys/select.h. |
281 | AC_CHECK_HEADER([sys/select.h], | |
282 | [NO_SYS_SELECT_H=], | |
283 | [NO_SYS_SELECT_H=UnfortunatelyYes]) | |
284 | AC_SUBST(NO_SYS_SELECT_H) | |
285 | # | |
0f7a9c9b JN |
286 | # Define OLD_ICONV if your library has an old iconv(), where the second |
287 | # (input buffer pointer) parameter is declared with type (const char **). | |
288 | AC_DEFUN([OLDICONVTEST_SRC], [[ | |
289 | #include <iconv.h> | |
290 | ||
291 | extern size_t iconv(iconv_t cd, | |
292 | char **inbuf, size_t *inbytesleft, | |
293 | char **outbuf, size_t *outbytesleft); | |
294 | ||
295 | int main(void) | |
296 | { | |
297 | return 0; | |
298 | } | |
299 | ]]) | |
300 | AC_MSG_CHECKING([for old iconv()]) | |
301 | AC_COMPILE_IFELSE(OLDICONVTEST_SRC, | |
302 | [AC_MSG_RESULT([no])], | |
303 | [AC_MSG_RESULT([yes]) | |
304 | OLD_ICONV=UnfortunatelyYes]) | |
305 | AC_SUBST(OLD_ICONV) | |
633b4239 JN |
306 | |
307 | ||
308 | ## Checks for typedefs, structures, and compiler characteristics. | |
eb0f255d | 309 | AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics]) |
f6719572 | 310 | # |
633b4239 | 311 | # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. |
d5c31a1c | 312 | AC_CHECK_MEMBER(struct dirent.d_ino, |
424adc50 JN |
313 | [NO_D_INO_IN_DIRENT=], |
314 | [NO_D_INO_IN_DIRENT=YesPlease], | |
eb0f255d | 315 | [#include <dirent.h>]) |
424adc50 | 316 | AC_SUBST(NO_D_INO_IN_DIRENT) |
f6719572 | 317 | # |
633b4239 JN |
318 | # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks |
319 | # d_type in struct dirent (latest Cygwin -- will be fixed soonish). | |
d5c31a1c | 320 | AC_CHECK_MEMBER(struct dirent.d_type, |
424adc50 JN |
321 | [NO_D_TYPE_IN_DIRENT=], |
322 | [NO_D_TYPE_IN_DIRENT=YesPlease], | |
eb0f255d | 323 | [#include <dirent.h>]) |
424adc50 | 324 | AC_SUBST(NO_D_TYPE_IN_DIRENT) |
f6719572 | 325 | # |
633b4239 JN |
326 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
327 | # sockaddr_storage. | |
d5c31a1c | 328 | AC_CHECK_TYPE(struct sockaddr_storage, |
424adc50 | 329 | [NO_SOCKADDR_STORAGE=], |
ab5573ae DS |
330 | [NO_SOCKADDR_STORAGE=YesPlease],[ |
331 | #include <sys/types.h> | |
332 | #include <sys/socket.h> | |
333 | ]) | |
424adc50 JN |
334 | AC_SUBST(NO_SOCKADDR_STORAGE) |
335 | # | |
8c6ab35e JH |
336 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
337 | AC_CHECK_TYPE([struct addrinfo],[ | |
1689c5de | 338 | GIT_CHECK_FUNC([getaddrinfo], |
424adc50 JN |
339 | [NO_IPV6=], |
340 | [NO_IPV6=YesPlease]) | |
341 | ],[NO_IPV6=YesPlease],[ | |
8c6ab35e JH |
342 | #include <sys/types.h> |
343 | #include <sys/socket.h> | |
344 | #include <netdb.h> | |
345 | ]) | |
424adc50 | 346 | AC_SUBST(NO_IPV6) |
656517b9 JN |
347 | # |
348 | # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) | |
349 | # do not support the 'size specifiers' introduced by C99, namely ll, hh, | |
350 | # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). | |
351 | # some C compilers supported these specifiers prior to C99 as an extension. | |
f685d07d JN |
352 | AC_CACHE_CHECK([whether formatted IO functions support C99 size specifiers], |
353 | [ac_cv_c_c99_format], | |
656517b9 JN |
354 | [# Actually git uses only %z (%zu) in alloc.c, and %t (%td) in mktag.c |
355 | AC_RUN_IFELSE( | |
356 | [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], | |
357 | [[char buf[64]; | |
358 | if (sprintf(buf, "%lld%hhd%jd%zd%td", (long long int)1, (char)2, (intmax_t)3, (size_t)4, (ptrdiff_t)5) != 5) | |
3c307bfb | 359 | return 1; |
656517b9 | 360 | else if (strcmp(buf, "12345")) |
3c307bfb | 361 | return 2;]])], |
656517b9 JN |
362 | [ac_cv_c_c99_format=yes], |
363 | [ac_cv_c_c99_format=no]) | |
364 | ]) | |
365 | if test $ac_cv_c_c99_format = no; then | |
424adc50 | 366 | NO_C99_FORMAT=YesPlease |
d5c31a1c | 367 | else |
424adc50 | 368 | NO_C99_FORMAT= |
656517b9 | 369 | fi |
424adc50 | 370 | AC_SUBST(NO_C99_FORMAT) |
c4582f93 | 371 | # |
8ce1f243 MR |
372 | # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds |
373 | # when attempting to read from an fopen'ed directory. | |
374 | AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory], | |
375 | [ac_cv_fread_reads_directories], | |
376 | [ | |
377 | AC_RUN_IFELSE( | |
378 | [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], | |
379 | [[char c; | |
380 | FILE *f = fopen(".", "r"); | |
381 | return f && fread(&c, 1, 1, f)]])], | |
382 | [ac_cv_fread_reads_directories=no], | |
383 | [ac_cv_fread_reads_directories=yes]) | |
384 | ]) | |
385 | if test $ac_cv_fread_reads_directories = yes; then | |
386 | FREAD_READS_DIRECTORIES=UnfortunatelyYes | |
387 | else | |
388 | FREAD_READS_DIRECTORIES= | |
389 | fi | |
390 | AC_SUBST(FREAD_READS_DIRECTORIES) | |
391 | # | |
c4582f93 MR |
392 | # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf() |
393 | # or vsnprintf() return -1 instead of number of characters which would | |
394 | # have been written to the final string if enough space had been available. | |
395 | AC_CACHE_CHECK([whether snprintf() and/or vsnprintf() return bogus value], | |
396 | [ac_cv_snprintf_returns_bogus], | |
397 | [ | |
398 | AC_RUN_IFELSE( | |
399 | [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT | |
400 | #include "stdarg.h" | |
401 | ||
402 | int test_vsnprintf(char *str, size_t maxsize, const char *format, ...) | |
403 | { | |
404 | int ret; | |
405 | va_list ap; | |
406 | va_start(ap, format); | |
407 | ret = vsnprintf(str, maxsize, format, ap); | |
408 | va_end(ap); | |
409 | return ret; | |
410 | }], | |
411 | [[char buf[6]; | |
412 | if (test_vsnprintf(buf, 3, "%s", "12345") != 5 | |
413 | || strcmp(buf, "12")) return 1; | |
414 | if (snprintf(buf, 3, "%s", "12345") != 5 | |
415 | || strcmp(buf, "12")) return 1]])], | |
416 | [ac_cv_snprintf_returns_bogus=no], | |
417 | [ac_cv_snprintf_returns_bogus=yes]) | |
418 | ]) | |
419 | if test $ac_cv_snprintf_returns_bogus = yes; then | |
420 | SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes | |
421 | else | |
422 | SNPRINTF_RETURNS_BOGUS= | |
423 | fi | |
424 | AC_SUBST(SNPRINTF_RETURNS_BOGUS) | |
633b4239 | 425 | |
a20b4d89 | 426 | |
633b4239 | 427 | ## Checks for library functions. |
1bbbadbc JN |
428 | ## (in default C library and libraries checked by AC_CHECK_LIB) |
429 | AC_MSG_NOTICE([CHECKS for library functions]) | |
f6719572 | 430 | # |
633b4239 | 431 | # Define NO_STRCASESTR if you don't have strcasestr. |
1689c5de | 432 | GIT_CHECK_FUNC(strcasestr, |
424adc50 JN |
433 | [NO_STRCASESTR=], |
434 | [NO_STRCASESTR=YesPlease]) | |
435 | AC_SUBST(NO_STRCASESTR) | |
f6719572 | 436 | # |
24397556 | 437 | # Define NO_MEMMEM if you don't have memmem. |
1689c5de | 438 | GIT_CHECK_FUNC(memmem, |
24397556 JN |
439 | [NO_MEMMEM=], |
440 | [NO_MEMMEM=YesPlease]) | |
441 | AC_SUBST(NO_MEMMEM) | |
442 | # | |
633b4239 | 443 | # Define NO_STRLCPY if you don't have strlcpy. |
1689c5de | 444 | GIT_CHECK_FUNC(strlcpy, |
424adc50 JN |
445 | [NO_STRLCPY=], |
446 | [NO_STRLCPY=YesPlease]) | |
447 | AC_SUBST(NO_STRLCPY) | |
f6719572 | 448 | # |
0bc3e781 DS |
449 | # Define NO_UINTMAX_T if your platform does not have uintmax_t |
450 | AC_CHECK_TYPE(uintmax_t, | |
451 | [NO_UINTMAX_T=], | |
452 | [NO_UINTMAX_T=YesPlease],[ | |
453 | #include <inttypes.h> | |
454 | ]) | |
455 | AC_SUBST(NO_UINTMAX_T) | |
456 | # | |
24397556 | 457 | # Define NO_STRTOUMAX if you don't have strtoumax in the C library. |
1689c5de | 458 | GIT_CHECK_FUNC(strtoumax, |
24397556 JN |
459 | [NO_STRTOUMAX=], |
460 | [NO_STRTOUMAX=YesPlease]) | |
461 | AC_SUBST(NO_STRTOUMAX) | |
462 | # | |
633b4239 | 463 | # Define NO_SETENV if you don't have setenv in the C library. |
1689c5de | 464 | GIT_CHECK_FUNC(setenv, |
424adc50 JN |
465 | [NO_SETENV=], |
466 | [NO_SETENV=YesPlease]) | |
467 | AC_SUBST(NO_SETENV) | |
f6719572 | 468 | # |
bfa8fccf | 469 | # Define NO_UNSETENV if you don't have unsetenv in the C library. |
1689c5de | 470 | GIT_CHECK_FUNC(unsetenv, |
bfa8fccf JN |
471 | [NO_UNSETENV=], |
472 | [NO_UNSETENV=YesPlease]) | |
473 | AC_SUBST(NO_UNSETENV) | |
474 | # | |
24397556 | 475 | # Define NO_MKDTEMP if you don't have mkdtemp in the C library. |
1689c5de | 476 | GIT_CHECK_FUNC(mkdtemp, |
24397556 JN |
477 | [NO_MKDTEMP=], |
478 | [NO_MKDTEMP=YesPlease]) | |
479 | AC_SUBST(NO_MKDTEMP) | |
480 | # | |
633b4239 JN |
481 | # Define NO_MMAP if you want to avoid mmap. |
482 | # | |
633b4239 JN |
483 | # Define NO_ICONV if your libc does not properly support iconv. |
484 | ||
485 | ||
486 | ## Other checks. | |
487 | # Define USE_PIC if you need the main git objects to be built with -fPIC | |
488 | # in order to build and link perl/Git.so. x86-64 seems to need this. | |
489 | # | |
490 | # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. | |
491 | # Enable it on Windows. By default, symrefs are still used. | |
20f7a398 | 492 | # |
46059cc6 JH |
493 | # Define NO_PTHREADS if we do not have pthreads |
494 | # | |
20f7a398 DS |
495 | # Define PTHREAD_LIBS to the linker flag used for Pthread support. |
496 | AC_LANG_CONFTEST([AC_LANG_PROGRAM( | |
497 | [[#include <pthread.h>]], | |
498 | [[pthread_mutex_t test_mutex;]] | |
499 | )]) | |
500 | ${CC} -pthread conftest.c -o conftest.o > /dev/null 2>&1 | |
501 | if test $? -eq 0;then | |
502 | PTHREAD_LIBS="-pthread" | |
503 | else | |
504 | ${CC} -lpthread conftest.c -o conftest.o > /dev/null 2>&1 | |
505 | if test $? -eq 0;then | |
506 | PTHREAD_LIBS="-lpthread" | |
46059cc6 JH |
507 | else |
508 | NO_PTHREADS=UnfortunatelyYes | |
20f7a398 DS |
509 | fi |
510 | fi | |
511 | AC_SUBST(PTHREAD_LIBS) | |
46059cc6 | 512 | AC_SUBST(NO_PTHREADS) |
633b4239 | 513 | |
a20b4d89 JN |
514 | ## Site configuration (override autodetection) |
515 | ## --with-PACKAGE[=ARG] and --without-PACKAGE | |
516 | AC_MSG_NOTICE([CHECKS for site configuration]) | |
517 | # | |
518 | # Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability | |
519 | # tests. These tests take up a significant amount of the total test time | |
520 | # but are not needed unless you plan to talk to SVN repos. | |
521 | # | |
522 | # Define MOZILLA_SHA1 environment variable when running make to make use of | |
523 | # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast | |
524 | # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default | |
525 | # choice) has very fast version optimized for i586. | |
526 | # | |
527 | # Define PPC_SHA1 environment variable when running make to make use of | |
528 | # a bundled SHA1 routine optimized for PowerPC. | |
529 | # | |
530 | # Define ARM_SHA1 environment variable when running make to make use of | |
531 | # a bundled SHA1 routine optimized for ARM. | |
532 | # | |
533 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. | |
534 | # This also implies MOZILLA_SHA1. | |
535 | # | |
536 | # Define OPENSSLDIR=/foo/bar if your openssl header and library files are in | |
537 | # /foo/bar/include and /foo/bar/lib directories. | |
538 | AC_ARG_WITH(openssl, | |
539 | AS_HELP_STRING([--with-openssl],[use OpenSSL library (default is YES)]) | |
540 | AS_HELP_STRING([], [ARG can be prefix for openssl library and headers]),\ | |
541 | GIT_PARSE_WITH(openssl)) | |
542 | # | |
543 | # Define NO_CURL if you do not have curl installed. git-http-pull and | |
544 | # git-http-push are not built, and you cannot use http:// and https:// | |
545 | # transports. | |
546 | # | |
547 | # Define CURLDIR=/foo/bar if your curl header and library files are in | |
548 | # /foo/bar/include and /foo/bar/lib directories. | |
549 | AC_ARG_WITH(curl, | |
550 | AS_HELP_STRING([--with-curl],[support http(s):// transports (default is YES)]) | |
551 | AS_HELP_STRING([], [ARG can be also prefix for curl library and headers]), | |
552 | GIT_PARSE_WITH(curl)) | |
553 | # | |
554 | # Define NO_EXPAT if you do not have expat installed. git-http-push is | |
555 | # not built, and you cannot push using http:// and https:// transports. | |
556 | # | |
557 | # Define EXPATDIR=/foo/bar if your expat header and library files are in | |
558 | # /foo/bar/include and /foo/bar/lib directories. | |
559 | AC_ARG_WITH(expat, | |
560 | AS_HELP_STRING([--with-expat], | |
561 | [support git-push using http:// and https:// transports via WebDAV (default is YES)]) | |
562 | AS_HELP_STRING([], [ARG can be also prefix for expat library and headers]), | |
563 | GIT_PARSE_WITH(expat)) | |
564 | # | |
565 | # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink | |
566 | # installed in /sw, but don't want GIT to link against any libraries | |
567 | # installed there. If defined you may specify your own (or Fink's) | |
568 | # include directories and library directories by defining CFLAGS | |
569 | # and LDFLAGS appropriately. | |
570 | # | |
571 | # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, | |
572 | # have DarwinPorts installed in /opt/local, but don't want GIT to | |
573 | # link against any libraries installed there. If defined you may | |
574 | # specify your own (or DarwinPort's) include directories and | |
575 | # library directories by defining CFLAGS and LDFLAGS appropriately. | |
576 | # | |
577 | # Define NO_MMAP if you want to avoid mmap. | |
baf1219a JN |
578 | # |
579 | # Define NO_ICONV if your libc does not properly support iconv. | |
580 | AC_ARG_WITH(iconv, | |
581 | AS_HELP_STRING([--without-iconv], | |
582 | [if your architecture doesn't properly support iconv]) | |
583 | AS_HELP_STRING([--with-iconv=PATH], | |
584 | [PATH is prefix for libiconv library and headers]) | |
585 | AS_HELP_STRING([], | |
586 | [used only if you need linking with libiconv]), | |
587 | GIT_PARSE_WITH(iconv)) | |
a20b4d89 JN |
588 | |
589 | ## --enable-FEATURE[=ARG] and --disable-FEATURE | |
590 | # | |
a20b4d89 JN |
591 | # Define USE_NSEC below if you want git to care about sub-second file mtimes |
592 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and | |
593 | # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely | |
594 | # randomly break unless your underlying filesystem supports those sub-second | |
595 | # times (my ext3 doesn't). | |
596 | # | |
597 | # Define USE_STDEV below if you want git to care about the underlying device | |
10455d2a | 598 | # change being considered an inode change from the update-index perspective. |
a20b4d89 JN |
599 | |
600 | ||
633b4239 | 601 | ## Output files |
d3a6db98 | 602 | AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"]) |
55667714 | 603 | AC_OUTPUT |
d3a6db98 | 604 | |
f6719572 | 605 | |
d3a6db98 JN |
606 | ## Cleanup |
607 | rm -f "${config_append}" |