From 656517b9ef5cf443f72110dcd56b15825bc7f1ef Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 4 Aug 2006 17:55:57 +0200 Subject: [PATCH 1/6] autoconf: Check for ll hh j z t size specifiers introduced by C99 Add custom test for checking whether formatted IO functions (printf/scanf et.al.) support 'size specifiers' introduced by C99, namely ll, hh, j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index 0a54b44939..a4becf8fa5 100644 --- a/configure.ac +++ b/configure.ac @@ -189,6 +189,27 @@ AC_CHECK_MEMBER(struct dirent.d_type,[], AC_CHECK_TYPE(struct sockaddr_storage,[], [GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease)], [#include ]) +# +# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) +# do not support the 'size specifiers' introduced by C99, namely ll, hh, +# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). +# some C compilers supported these specifiers prior to C99 as an extension. +AC_CACHE_CHECK(whether IO functions support %ll %hh %j %z %t size specifiers, + ac_cv_c_c99_format, +[# Actually git uses only %z (%zu) in alloc.c, and %t (%td) in mktag.c +AC_RUN_IFELSE( + [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], + [[char buf[64]; + if (sprintf(buf, "%lld%hhd%jd%zd%td", (long long int)1, (char)2, (intmax_t)3, (size_t)4, (ptrdiff_t)5) != 5) + exit(1); + else if (strcmp(buf, "12345")) + exit(2);]])], + [ac_cv_c_c99_format=yes], + [ac_cv_c_c99_format=no]) +]) +if test $ac_cv_c_c99_format = no; then + GIT_CONF_APPEND_LINE(NO_C99_FORMAT=YesPlease) +fi ## Checks for library functions. From 465e649d0c62847fd5cca212766e1a01183baeef Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 4 Aug 2006 17:55:58 +0200 Subject: [PATCH 2/6] autoconf: Typo cleanup, reordering etc. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- Makefile | 2 +- configure.ac | 43 +++++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 700c77f564..ae4c0f2d90 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ all: # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) # do not support the 'size specifiers' introduced by C99, namely ll, hh, # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). -# some c compilers supported these specifiers prior to C99 as an extension. +# some C compilers supported these specifiers prior to C99 as an extension. # # Define NO_STRCASESTR if you don't have strcasestr. # diff --git a/configure.ac b/configure.ac index a4becf8fa5..cc6b3cd5fb 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ fi; \ ## Site configuration ## --with-PACKAGE[=ARG] and --without-PACKAGE # -# Define NO_SVN_TESTS if you want to skip time-consuming SVN interopability +# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability # tests. These tests take up a significant amount of the total test time # but are not needed unless you plan to talk to SVN repos. # @@ -81,7 +81,24 @@ fi; \ # # Define NO_MMAP if you want to avoid mmap. # -# Define NO_PYTHON if you want to loose all benefits of the recursive merge. +# Define SHELL_PATH to provide path to shell. +GIT_ARG_SET_PATH(shell) +# +# Define PERL_PATH to provide path to Perl. +GIT_ARG_SET_PATH(perl) +# +# Define NO_PYTHON if you want to lose all benefits of the recursive merge. +# Define PYTHON_PATH to provide path to Python. +AC_ARG_WITH(python,[AS_HELP_STRING([--with-python=PATH], [provide PATH to python]) +AS_HELP_STRING([--no-python], [don't use python scripts])], + [if test "$withval" = "no"; then \ + NO_PYTHON=YesPlease; \ + elif test "$withval" != "yes"; then \ + PYTHON_PATH=$withval; \ + fi; \ + ]) +AC_SUBST(NO_PYTHON) +AC_SUBST(PYTHON_PATH) # ## --enable-FEATURE[=ARG] and --disable-FEATURE # Define COLLISION_CHECK below if you believe that SHA1's @@ -101,27 +118,13 @@ fi; \ ## Checks for programs. AC_MSG_NOTICE([CHECKS for programs]) # -GIT_ARG_SET_PATH(shell) -GIT_ARG_SET_PATH(perl) -AC_ARG_WITH(python,[AS_HELP_STRING([--with-python=PATH], [provide PATH to python]) -AS_HELP_STRING([--no-python], [don't use python scripts])], - [if test "$withval" = "no"; then \ - NO_PYTHON=YesPlease; \ - elif test "$withval" != "yes"; then \ - PYTHON_PATH=$withval; \ - fi; \ - ]) -AC_SUBST(NO_PYTHON) -AC_SUBST(PYTHON_PATH) - - -# -# Define NO_PYTHON if you want to lose all benefits of the recursive merge. -# Define PYTHON_PATH to provide path to Python. AC_PROG_CC #AC_PROG_INSTALL # needs install-sh or install.sh in sources AC_CHECK_TOOL(AR, ar, :) AC_CHECK_PROGS(TAR, [gtar tar]) +# +# Define NO_PYTHON if you want to lose all benefits of the recursive merge. +# Define PYTHON_PATH to provide path to Python. if test -z "$NO_PYTHON"; then AC_PATH_PROGS(PYTHON_PATH, [python2.4 python2.3 python2 python]) if test -n "$PYTHON_PATH"; then @@ -194,7 +197,7 @@ AC_CHECK_TYPE(struct sockaddr_storage,[], # do not support the 'size specifiers' introduced by C99, namely ll, hh, # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). # some C compilers supported these specifiers prior to C99 as an extension. -AC_CACHE_CHECK(whether IO functions support %ll %hh %j %z %t size specifiers, +AC_CACHE_CHECK(whether formatted IO functions support C99 size specifiers, ac_cv_c_c99_format, [# Actually git uses only %z (%zu) in alloc.c, and %t (%td) in mktag.c AC_RUN_IFELSE( From 34d4a67f47bb8954475077e91d513f445713c534 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 4 Aug 2006 17:55:59 +0200 Subject: [PATCH 3/6] Copy description of new build configuration variables to configure.ac Copy description of new build configuration variables from the commentary in the top Makefile, namely NO_FINK and NO_DARWIN_PORTS configuration variables, putting them in site configuration section. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index cc6b3cd5fb..9ce00e9522 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,18 @@ fi; \ # Define NO_EXPAT if you do not have expat installed. git-http-push is # not built, and you cannot push using http:// and https:// transports. # +# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink +# installed in /sw, but don't want GIT to link against any libraries +# installed there. If defined you may specify your own (or Fink's) +# include directories and library directories by defining CFLAGS +# and LDFLAGS appropriately. +# +# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, +# have DarwinPorts installed in /opt/local, but don't want GIT to +# link against any libraries installed there. If defined you may +# specify your own (or DarwinPort's) include directories and +# library directories by defining CFLAGS and LDFLAGS appropriately. +# # Define NO_MMAP if you want to avoid mmap. # # Define SHELL_PATH to provide path to shell. From 3068f6c47d8ece84c7daba243d3f60492bd0611e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 4 Aug 2006 16:33:18 -0700 Subject: [PATCH 4/6] autoconf: fix NEEDS_SSL_WITH_CRYPTO NEEDS_SSL_WITH_CRYPTO means you cannot just say "-lcrypto" to use SHA1 stuff, but need to say "-lcrypto -lssl". Signed-off-by: Junio C Hamano --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9ce00e9522..fea18b69b4 100644 --- a/configure.ac +++ b/configure.ac @@ -154,8 +154,8 @@ AC_MSG_NOTICE([CHECKS for libraries]) # # Define NO_OPENSSL environment variable if you do not have OpenSSL. # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). -AC_CHECK_LIB([ssl], [SHA1_Init],[], -[AC_CHECK_LIB([crypto], [SHA1_INIT], +AC_CHECK_LIB([crypto], [SHA1_Init],[], +[AC_CHECK_LIB([ssl], [SHA1_Init], [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)], [GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])]) # From f7b5e8d03a97e7d4a6e543d5f9972d1285947908 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 4 Aug 2006 23:28:11 +0200 Subject: [PATCH 5/6] autoconf: Set NEEDS_LIBICONV unconditionally if there is no iconv in libc Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index fea18b69b4..33ddee2120 100644 --- a/configure.ac +++ b/configure.ac @@ -172,8 +172,7 @@ AC_CHECK_LIB([expat], [XML_ParserCreate],[], # # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). AC_CHECK_LIB([c], [iconv],[], -[AC_CHECK_LIB([iconv],[iconv], - [GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)],[])]) +[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)]) # # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, # Patrick Mauritz). From 8c6ab35efe635b2f70cdd471903cd80886ec6eec Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 4 Aug 2006 16:46:16 -0700 Subject: [PATCH 6/6] autoconf: NO_IPV6 We would need both "struct addrinfo" and getaddrinfo() available. Check them and set NO_IPV6 otherwise. Signed-off-by: Junio C Hamano --- configure.ac | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 33ddee2120..74c271098c 100644 --- a/configure.ac +++ b/configure.ac @@ -203,6 +203,14 @@ AC_CHECK_MEMBER(struct dirent.d_type,[], AC_CHECK_TYPE(struct sockaddr_storage,[], [GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease)], [#include ]) +# Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). +AC_CHECK_TYPE([struct addrinfo],[ +AC_CHECK_FUNC([getaddrinfo],[], +[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)])],[],[ +#include +#include +#include +]) # # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) # do not support the 'size specifiers' introduced by C99, namely ll, hh, @@ -244,8 +252,6 @@ AC_CHECK_FUNC(setenv,[], # # Define NO_MMAP if you want to avoid mmap. # -# Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). -# # Define NO_ICONV if your libc does not properly support iconv.