]> git.ipfire.org Git - thirdparty/git.git/blame - configure.ac
Merge branch 'maint'
[thirdparty/git.git] / configure.ac
CommitLineData
55667714
JN
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
3900145e 5AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])
55667714
JN
6
7AC_CONFIG_SRCDIR([git.c])
8
9config_file=config.mak.autogen
d3a6db98 10config_append=config.mak.append
55667714
JN
11config_in=config.mak.in
12
d3a6db98
JN
13echo "# ${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}
20AC_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
26AC_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)
37AC_DEFUN([GIT_CONF_APPEND_PATH],
38[PROGRAM=m4_toupper($1); \
39if test "$withval" = "no"; then \
b52b1d43 40 AC_MSG_ERROR([You cannot use git without $1]); \
657b062d
JN
41else \
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; \
47fi; \
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
56AC_DEFUN([GIT_PARSE_WITH],
57[PACKAGE=m4_toupper($1); \
58if test "$withval" = "no"; then \
59 m4_toupper(NO_$1)=YesPlease; \
60elif test "$withval" = "yes"; then \
61 m4_toupper(NO_$1)=; \
62else \
63 m4_toupper(NO_$1)=; \
64 GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \
65fi \
66])# GIT_PARSE_WITH
d3a6db98 67
1689c5de
DS
68dnl
69dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE)
70dnl -----------------------------------------
71dnl Similar to AC_CHECK_FUNC, but on systems that do not generate
72dnl warnings for missing prototypes (e.g. FreeBSD when compiling without
73dnl -Wall), it does not work. By looking for function definition in
74dnl libraries, this problem can be worked around.
75AC_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)
83AC_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]); \
88else \
89 GIT_CONF_APPEND_LINE(lib=$withval); \
90fi; \
91],[])
92#
465e649d
JN
93# Define SHELL_PATH to provide path to shell.
94GIT_ARG_SET_PATH(shell)
95#
96# Define PERL_PATH to provide path to Perl.
97GIT_ARG_SET_PATH(perl)
98#
bef19da9
RS
99# Define ZLIB_PATH to provide path to zlib.
100GIT_ARG_SET_PATH(zlib)
101#
81b63c70
ER
102# Declare the with-tcltk/without-tcltk options.
103AC_ARG_WITH(tcltk,
104AS_HELP_STRING([--with-tcltk],[use Tcl/Tk GUI (default is YES)])
105AS_HELP_STRING([],[ARG is the full path to the Tcl/Tk interpreter.])
106AS_HELP_STRING([],[Bare --with-tcltk will make the GUI part only if])
107AS_HELP_STRING([],[Tcl/Tk interpreter will be found in a system.]),\
108GIT_PARSE_WITH(tcltk))
109#
c4b1b140
JN
110
111
633b4239 112## Checks for programs.
fd22c027 113AC_MSG_NOTICE([CHECKS for programs])
f6719572 114#
60a144f2 115AC_PROG_CC([cc gcc])
798a9450
GF
116# which switch to pass runtime path to dynamic libraries to the linker
117AC_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])
123if test "$ld_dashr" = "yes"; then
124 AC_SUBST(CC_LD_DYNPATH, [-R])
125else
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
147fi
fd22c027 148#AC_PROG_INSTALL # needs install-sh or install.sh in sources
96e24abc 149AC_CHECK_TOOLS(AR, [gar ar], :)
fd22c027 150AC_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.
153if 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
166fi
923db42e
JN
167AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
168if 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
185fi
186AC_SUBST(ASCIIDOC8)
187
633b4239
JN
188
189## Checks for libraries.
ebdf5321 190AC_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 194AC_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])])
200AC_SUBST(NEEDS_SSL_WITH_CRYPTO)
201AC_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 206AC_CHECK_LIB([curl], [curl_global_init],
424adc50
JN
207[NO_CURL=],
208[NO_CURL=YesPlease])
209AC_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 213AC_CHECK_LIB([expat], [XML_ParserCreate],
424adc50
JN
214[NO_EXPAT=],
215[NO_EXPAT=YesPlease])
216AC_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
221AC_DEFUN([ICONVTEST_SRC], [
222#include <iconv.h>
223
224int main(void)
225{
226 iconv_open("", "");
227 return 0;
228}
229])
230AC_MSG_CHECKING([for iconv in -lc])
231AC_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 244AC_SUBST(NEEDS_LIBICONV)
baf1219a 245AC_SUBST(NO_ICONV)
825b045f 246test -n "$NEEDS_LIBICONV" && LIBS="$LIBS -liconv"
f6719572 247#
609a2289
DS
248# Define NO_DEFLATE_BOUND if deflateBound is missing from zlib.
249AC_DEFUN([ZLIBTEST_SRC], [
250#include <zlib.h>
251
252int main(void)
253{
254 deflateBound(0, 0);
255 return 0;
256}
257])
258AC_MSG_CHECKING([for deflateBound in -lz])
259old_LIBS="$LIBS"
260LIBS="$LIBS -lz"
261AC_LINK_IFELSE(ZLIBTEST_SRC,
262 [AC_MSG_RESULT([yes])],
263 [AC_MSG_RESULT([no])
264 NO_DEFLATE_BOUND=yes])
265LIBS="$old_LIBS"
266AC_SUBST(NO_DEFLATE_BOUND)
267#
633b4239
JN
268# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
269# Patrick Mauritz).
d5c31a1c 270AC_CHECK_LIB([c], [socket],
424adc50
JN
271[NEEDS_SOCKET=],
272[NEEDS_SOCKET=YesPlease])
273AC_SUBST(NEEDS_SOCKET)
d1b9944d 274test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
633b4239
JN
275
276
277## Checks for header files.
0f7a9c9b
JN
278AC_MSG_NOTICE([CHECKS for header files])
279#
3cf32374
JN
280# Define NO_SYS_SELECT_H if you don't have sys/select.h.
281AC_CHECK_HEADER([sys/select.h],
282[NO_SYS_SELECT_H=],
283[NO_SYS_SELECT_H=UnfortunatelyYes])
284AC_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 **).
288AC_DEFUN([OLDICONVTEST_SRC], [[
289#include <iconv.h>
290
291extern size_t iconv(iconv_t cd,
292 char **inbuf, size_t *inbytesleft,
293 char **outbuf, size_t *outbytesleft);
294
295int main(void)
296{
297 return 0;
298}
299]])
300AC_MSG_CHECKING([for old iconv()])
301AC_COMPILE_IFELSE(OLDICONVTEST_SRC,
302 [AC_MSG_RESULT([no])],
303 [AC_MSG_RESULT([yes])
304 OLD_ICONV=UnfortunatelyYes])
305AC_SUBST(OLD_ICONV)
633b4239
JN
306
307
308## Checks for typedefs, structures, and compiler characteristics.
eb0f255d 309AC_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 312AC_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 316AC_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 320AC_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 324AC_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 328AC_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
334AC_SUBST(NO_SOCKADDR_STORAGE)
335#
8c6ab35e
JH
336# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
337AC_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 346AC_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
352AC_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
355AC_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])
365if test $ac_cv_c_c99_format = no; then
424adc50 366 NO_C99_FORMAT=YesPlease
d5c31a1c 367else
424adc50 368 NO_C99_FORMAT=
656517b9 369fi
424adc50 370AC_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.
374AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],
375 [ac_cv_fread_reads_directories],
376[
377AC_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])
385if test $ac_cv_fread_reads_directories = yes; then
386 FREAD_READS_DIRECTORIES=UnfortunatelyYes
387else
388 FREAD_READS_DIRECTORIES=
389fi
390AC_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.
395AC_CACHE_CHECK([whether snprintf() and/or vsnprintf() return bogus value],
396 [ac_cv_snprintf_returns_bogus],
397[
398AC_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])
419if test $ac_cv_snprintf_returns_bogus = yes; then
420 SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes
421else
422 SNPRINTF_RETURNS_BOGUS=
423fi
424AC_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)
429AC_MSG_NOTICE([CHECKS for library functions])
f6719572 430#
633b4239 431# Define NO_STRCASESTR if you don't have strcasestr.
1689c5de 432GIT_CHECK_FUNC(strcasestr,
424adc50
JN
433[NO_STRCASESTR=],
434[NO_STRCASESTR=YesPlease])
435AC_SUBST(NO_STRCASESTR)
f6719572 436#
24397556 437# Define NO_MEMMEM if you don't have memmem.
1689c5de 438GIT_CHECK_FUNC(memmem,
24397556
JN
439[NO_MEMMEM=],
440[NO_MEMMEM=YesPlease])
441AC_SUBST(NO_MEMMEM)
442#
633b4239 443# Define NO_STRLCPY if you don't have strlcpy.
1689c5de 444GIT_CHECK_FUNC(strlcpy,
424adc50
JN
445[NO_STRLCPY=],
446[NO_STRLCPY=YesPlease])
447AC_SUBST(NO_STRLCPY)
f6719572 448#
0bc3e781
DS
449# Define NO_UINTMAX_T if your platform does not have uintmax_t
450AC_CHECK_TYPE(uintmax_t,
451[NO_UINTMAX_T=],
452[NO_UINTMAX_T=YesPlease],[
453#include <inttypes.h>
454])
455AC_SUBST(NO_UINTMAX_T)
456#
24397556 457# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
1689c5de 458GIT_CHECK_FUNC(strtoumax,
24397556
JN
459[NO_STRTOUMAX=],
460[NO_STRTOUMAX=YesPlease])
461AC_SUBST(NO_STRTOUMAX)
462#
633b4239 463# Define NO_SETENV if you don't have setenv in the C library.
1689c5de 464GIT_CHECK_FUNC(setenv,
424adc50
JN
465[NO_SETENV=],
466[NO_SETENV=YesPlease])
467AC_SUBST(NO_SETENV)
f6719572 468#
bfa8fccf 469# Define NO_UNSETENV if you don't have unsetenv in the C library.
1689c5de 470GIT_CHECK_FUNC(unsetenv,
bfa8fccf
JN
471[NO_UNSETENV=],
472[NO_UNSETENV=YesPlease])
473AC_SUBST(NO_UNSETENV)
474#
24397556 475# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
1689c5de 476GIT_CHECK_FUNC(mkdtemp,
24397556
JN
477[NO_MKDTEMP=],
478[NO_MKDTEMP=YesPlease])
479AC_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.
496AC_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
501if test $? -eq 0;then
502 PTHREAD_LIBS="-pthread"
503else
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
510fi
511AC_SUBST(PTHREAD_LIBS)
46059cc6 512AC_SUBST(NO_PTHREADS)
633b4239 513
a20b4d89
JN
514## Site configuration (override autodetection)
515## --with-PACKAGE[=ARG] and --without-PACKAGE
516AC_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.
538AC_ARG_WITH(openssl,
539AS_HELP_STRING([--with-openssl],[use OpenSSL library (default is YES)])
540AS_HELP_STRING([], [ARG can be prefix for openssl library and headers]),\
541GIT_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.
549AC_ARG_WITH(curl,
550AS_HELP_STRING([--with-curl],[support http(s):// transports (default is YES)])
551AS_HELP_STRING([], [ARG can be also prefix for curl library and headers]),
552GIT_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.
559AC_ARG_WITH(expat,
560AS_HELP_STRING([--with-expat],
561[support git-push using http:// and https:// transports via WebDAV (default is YES)])
562AS_HELP_STRING([], [ARG can be also prefix for expat library and headers]),
563GIT_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.
580AC_ARG_WITH(iconv,
581AS_HELP_STRING([--without-iconv],
582[if your architecture doesn't properly support iconv])
583AS_HELP_STRING([--with-iconv=PATH],
584[PATH is prefix for libiconv library and headers])
585AS_HELP_STRING([],
586[used only if you need linking with libiconv]),
587GIT_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 602AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"])
55667714 603AC_OUTPUT
d3a6db98 604
f6719572 605
d3a6db98
JN
606## Cleanup
607rm -f "${config_append}"