From 657b062dbab2e17c750050d76de3e76ea28e603e Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Thu, 3 Aug 2006 00:38:11 +0200 Subject: [PATCH 01/17] autoconf: Add support for setting SHELL_PATH and PERL_PATH This patch adds support for setting SHELL_PATH and PERL_PATH to autoconf generated ./configure script via --with-shell=PATH and --with-perl=PATH options. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c1f7751e6..1669e40e2 100644 --- a/configure.ac +++ b/configure.ac @@ -19,17 +19,47 @@ echo "# ${config_append}. Generated by configure." > "${config_append}" # Append LINE to file ${config_append} AC_DEFUN([GIT_CONF_APPEND_LINE], [echo "$1" >> "${config_append}"])# GIT_CONF_APPEND_LINE +# +# GIT_ARG_SET_PATH(PROGRAM) +# ------------------------- +# Provide --with-PROGRAM=PATH option to set PATH to PROGRAM +AC_DEFUN([GIT_ARG_SET_PATH], +[AC_ARG_WITH([$1], + [AS_HELP_STRING([--with-$1=PATH], + [provide PATH to $1])], + [GIT_CONF_APPEND_PATH($1)],[]) +])# GIT_ARG_SET_PATH +# +# GIT_CONF_APPEND_PATH(PROGRAM) +# ------------------------------ +# Parse --with-PROGRAM=PATH option to set PROGRAM_PATH=PATH +# Used by GIT_ARG_SET_PATH(PROGRAM) +AC_DEFUN([GIT_CONF_APPEND_PATH], +[PROGRAM=m4_toupper($1); \ +if test "$withval" = "no"; then \ + AC_MSG_WARN([You cannot use git without $1]); \ +else \ + if test "$withval" = "yes"; then \ + AC_MSG_WARN([You should provide path for --with-$1=PATH]); \ + else \ + GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval); \ + fi; \ +fi; \ +]) # GIT_CONF_APPEND_PATH ## Checks for programs. AC_MSG_NOTICE([CHECKS for programs]) # +GIT_ARG_SET_PATH(shell) +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_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. ## Checks for libraries. @@ -127,6 +157,7 @@ AC_CHECK_FUNC(setenv,[], ## Site configuration ## --with-PACKAGE[=ARG] and --without-PACKAGE +# # Define NO_SVN_TESTS if you want to skip time-consuming SVN interopability # 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. From c4b1b1401cedefe480e32ceccd4ed678f9409e89 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Thu, 3 Aug 2006 00:38:56 +0200 Subject: [PATCH 02/17] autoconf: Move site configuration section earlier in configure.ac Move site configuration section, i.e. --with-PACKAGE[=ARG] and --without-PACKAGE, --enable-FEATURE[=ARG] and --disable-FEATURE options to the beginning of configure.ac file, just after definitions of macros. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 100 +++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/configure.ac b/configure.ac index 1669e40e2..cfd1d4a0b 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,56 @@ fi; \ ]) # GIT_CONF_APPEND_PATH +## Site configuration +## --with-PACKAGE[=ARG] and --without-PACKAGE +# +# Define NO_SVN_TESTS if you want to skip time-consuming SVN interopability +# 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. +# +# Define MOZILLA_SHA1 environment variable when running make to make use of +# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast +# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default +# choice) has very fast version optimized for i586. +# +# Define PPC_SHA1 environment variable when running make to make use of +# a bundled SHA1 routine optimized for PowerPC. +# +# Define ARM_SHA1 environment variable when running make to make use of +# a bundled SHA1 routine optimized for ARM. +# +# Define NO_OPENSSL environment variable if you do not have OpenSSL. +# This also implies MOZILLA_SHA1. +# +# Define NO_CURL if you do not have curl installed. git-http-pull and +# git-http-push are not built, and you cannot use http:// and https:// +# transports. +# +# Define CURLDIR=/foo/bar if your curl header and library files are in +# /foo/bar/include and /foo/bar/lib directories. +# +# 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_MMAP if you want to avoid mmap. +# +# Define NO_PYTHON if you want to loose all benefits of the recursive merge. +# +## --enable-FEATURE[=ARG] and --disable-FEATURE +# Define COLLISION_CHECK below if you believe that SHA1's +# 1461501637330902918203684832716283019655932542976 hashes do not give you +# sufficient guarantee that no collisions between objects will ever happen. +# +# Define USE_NSEC below if you want git to care about sub-second file mtimes +# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and +# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely +# randomly break unless your underlying filesystem supports those sub-second +# times (my ext3 doesn't). +# +# Define USE_STDEV below if you want git to care about the underlying device +# change being considered an inode change from the update-cache perspective. + + ## Checks for programs. AC_MSG_NOTICE([CHECKS for programs]) # @@ -155,56 +205,6 @@ AC_CHECK_FUNC(setenv,[], # a missing newline at the end of the file. -## Site configuration -## --with-PACKAGE[=ARG] and --without-PACKAGE -# -# Define NO_SVN_TESTS if you want to skip time-consuming SVN interopability -# 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. -# -# Define MOZILLA_SHA1 environment variable when running make to make use of -# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast -# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default -# choice) has very fast version optimized for i586. -# -# Define PPC_SHA1 environment variable when running make to make use of -# a bundled SHA1 routine optimized for PowerPC. -# -# Define ARM_SHA1 environment variable when running make to make use of -# a bundled SHA1 routine optimized for ARM. -# -# Define NO_OPENSSL environment variable if you do not have OpenSSL. -# This also implies MOZILLA_SHA1. -# -# Define NO_CURL if you do not have curl installed. git-http-pull and -# git-http-push are not built, and you cannot use http:// and https:// -# transports. -# -# Define CURLDIR=/foo/bar if your curl header and library files are in -# /foo/bar/include and /foo/bar/lib directories. -# -# 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_MMAP if you want to avoid mmap. -# -# Define NO_PYTHON if you want to loose all benefits of the recursive merge. -# -## --enable-FEATURE[=ARG] and --disable-FEATURE -# Define COLLISION_CHECK below if you believe that SHA1's -# 1461501637330902918203684832716283019655932542976 hashes do not give you -# sufficient guarantee that no collisions between objects will ever happen. -# -# Define USE_NSEC below if you want git to care about sub-second file mtimes -# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and -# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely -# randomly break unless your underlying filesystem supports those sub-second -# times (my ext3 doesn't). -# -# Define USE_STDEV below if you want git to care about the underlying device -# change being considered an inode change from the update-cache perspective. - - ## Output files AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"]) AC_OUTPUT From eb858c56cb9dcced05d61d47c0351b4f8768d379 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Thu, 3 Aug 2006 00:40:40 +0200 Subject: [PATCH 03/17] autoconf: Add support for setting PYTHON_PATH or NO_PYTHON This patch adds support for setting either PYTHON_PATH or NO_PYTHON to autoconf generated ./configure script via --with-python=PATH (sets PYTHON_PATH) or --without-python (sets NO_PYTHON). Autodetect PYTHON_PATH via AC_PATH_PROGS. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/configure.ac b/configure.ac index cfd1d4a0b..0a54b4493 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,18 @@ 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. @@ -110,6 +122,16 @@ 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]) +if test -z "$NO_PYTHON"; then + AC_PATH_PROGS(PYTHON_PATH, [python2.4 python2.3 python2 python]) + if test -n "$PYTHON_PATH"; then + GIT_CONF_APPEND_LINE([PYTHON_PATH=@PYTHON_PATH@]) + else + GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@]) + fi +else + GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@]) +fi ## Checks for libraries. From 656517b9ef5cf443f72110dcd56b15825bc7f1ef Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 4 Aug 2006 17:55:57 +0200 Subject: [PATCH 04/17] 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 0a54b4493..a4becf8fa 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 05/17] 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 700c77f56..ae4c0f2d9 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 a4becf8fa..cc6b3cd5f 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 06/17] 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 cc6b3cd5f..9ce00e952 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 07/17] 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 9ce00e952..fea18b69b 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 08/17] 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 fea18b69b..33ddee212 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 09/17] 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 33ddee212..74c271098 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. From d5c31a1ccfa1195cff160bbad995c68037180570 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 4 Aug 2006 23:43:59 +0200 Subject: [PATCH 10/17] autoconf: Unset NO_STH and NEED_STH when it is detected not needed When configure detects some NO_XXX or NEEDS_XXX is unneeded, unset this variable (actually set it to empty string). This allow autodetection to override the default set in Makefile. [jc: while at it fixed a thinko in IPv6 detection.] Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 74c271098..3c56cc51a 100644 --- a/configure.ac +++ b/configure.ac @@ -154,31 +154,36 @@ 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([crypto], [SHA1_Init],[], +AC_CHECK_LIB([crypto], [SHA1_Init], +[GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)], [AC_CHECK_LIB([ssl], [SHA1_Init], - [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)], + [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease) + GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)], [GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])]) # # Define NO_CURL if you do not have curl installed. git-http-pull and # git-http-push are not built, and you cannot use http:// and https:// # transports. -AC_CHECK_LIB([curl], [curl_global_init],[], +AC_CHECK_LIB([curl], [curl_global_init], +[GIT_CONF_APPEND_LINE(NO_CURL=)], [GIT_CONF_APPEND_LINE(NO_CURL=YesPlease)]) # # 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. -AC_CHECK_LIB([expat], [XML_ParserCreate],[], +AC_CHECK_LIB([expat], [XML_ParserCreate], +[GIT_CONF_APPEND_LINE(NO_EXPAT=)], [GIT_CONF_APPEND_LINE(NO_EXPAT=YesPlease)]) # # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). -AC_CHECK_LIB([c], [iconv],[], +AC_CHECK_LIB([c], [iconv], +[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=)], [GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)]) # # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, # Patrick Mauritz). -AC_CHECK_LIB([c], [socket],[], -[AC_CHECK_LIB([socket],[socket], - [GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)],[])]) +AC_CHECK_LIB([c], [socket], +[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=)], +[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)]) ## Checks for header files. @@ -188,25 +193,30 @@ AC_CHECK_LIB([c], [socket],[], AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics]) # # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. -AC_CHECK_MEMBER(struct dirent.d_ino,[], +AC_CHECK_MEMBER(struct dirent.d_ino, +[GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=)], [GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=YesPlease)], [#include ]) # # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks # d_type in struct dirent (latest Cygwin -- will be fixed soonish). -AC_CHECK_MEMBER(struct dirent.d_type,[], +AC_CHECK_MEMBER(struct dirent.d_type, +[GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=)], [GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=YesPlease)], [#include ]) # # Define NO_SOCKADDR_STORAGE if your platform does not have struct # sockaddr_storage. -AC_CHECK_TYPE(struct sockaddr_storage,[], +AC_CHECK_TYPE(struct sockaddr_storage, +[GIT_CONF_APPEND_LINE(NO_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)])],[],[ + AC_CHECK_FUNC([getaddrinfo], + [GIT_CONF_APPEND_LINE(NO_IPV6=)], + [GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)]) +],[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)],[ #include #include #include @@ -231,6 +241,8 @@ AC_RUN_IFELSE( ]) if test $ac_cv_c_c99_format = no; then GIT_CONF_APPEND_LINE(NO_C99_FORMAT=YesPlease) +else + GIT_CONF_APPEND_LINE(NO_C99_FORMAT=) fi @@ -239,15 +251,18 @@ fi AC_MSG_NOTICE([CHECKS for library functions]) # # Define NO_STRCASESTR if you don't have strcasestr. -AC_CHECK_FUNC(strcasestr,[], +AC_CHECK_FUNC(strcasestr, +[GIT_CONF_APPEND_LINE(NO_STRCASESTR=)], [GIT_CONF_APPEND_LINE(NO_STRCASESTR=YesPlease)]) # # Define NO_STRLCPY if you don't have strlcpy. -AC_CHECK_FUNC(strlcpy,[], +AC_CHECK_FUNC(strlcpy, +[GIT_CONF_APPEND_LINE(NO_STRLCPY=)], [GIT_CONF_APPEND_LINE(NO_STRLCPY=YesPlease)]) # # Define NO_SETENV if you don't have setenv in the C library. -AC_CHECK_FUNC(setenv,[], +AC_CHECK_FUNC(setenv, +[GIT_CONF_APPEND_LINE(NO_SETENV=)], [GIT_CONF_APPEND_LINE(NO_SETENV=YesPlease)]) # # Define NO_MMAP if you want to avoid mmap. From 3900145ed72bf1dfd656af6a5b31034e818b425f Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Tue, 8 Aug 2006 18:35:23 +0200 Subject: [PATCH 11/17] autoconf: Add configure target to main Makefile While at it fill git version information in configure.ac configure target needs autoconf, of course. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- INSTALL | 2 +- Makefile | 7 +++++++ configure.ac | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index ba9778cd4..fa9bf74a2 100644 --- a/INSTALL +++ b/INSTALL @@ -16,7 +16,7 @@ install" would not work. Alternatively you can use autoconf generated ./configure script to set up install paths (via config.mak.autogen), so you can write instead - $ autoconf ;# as yourself if ./configure doesn't exist yet + $ make configure ;# as yourself $ ./configure --prefix=/usr ;# as yourself $ make all doc ;# as yourself # make install install-doc ;# as root diff --git a/Makefile b/Makefile index ae4c0f2d9..d8cc83507 100644 --- a/Makefile +++ b/Makefile @@ -595,6 +595,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css chmod +x $@+ mv $@+ $@ +configure: configure.ac + rm -f $@ $<+ + sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ + $< > $<+ + autoconf -o $@ $<+ + rm -f $<+ + # These can record GIT_VERSION git$X git.spec \ $(patsubst %.sh,%,$(SCRIPT_SH)) \ diff --git a/configure.ac b/configure.ac index 3c56cc51a..e2da89114 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([git], [1.4.1], [git@vger.kernel.org]) +AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org]) AC_CONFIG_SRCDIR([git.c]) From b52b1d433b47888d79a73a514aa3430257cba863 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Tue, 8 Aug 2006 18:36:21 +0200 Subject: [PATCH 12/17] autoconf: Error out on --without-shell and --without-perl Error out on --without-shell/--with-shell=no and --without-perl/--with-perl=no instead of just warning and continuing. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e2da89114..c2ddd9b6e 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ AC_DEFUN([GIT_ARG_SET_PATH], AC_DEFUN([GIT_CONF_APPEND_PATH], [PROGRAM=m4_toupper($1); \ if test "$withval" = "no"; then \ - AC_MSG_WARN([You cannot use git without $1]); \ + AC_MSG_ERROR([You cannot use git without $1]); \ else \ if test "$withval" = "yes"; then \ AC_MSG_WARN([You should provide path for --with-$1=PATH]); \ From af6058cc2bf309631fc7f5cd44fb39b567286506 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Tue, 8 Aug 2006 18:38:06 +0200 Subject: [PATCH 13/17] autoconf: Improvements in NO_PYTHON/PYTHON_PATH handling Unset NO_PYTHON for --with-python without arguments, and when PYTHON_PATH is set. Do not check for PYTHON_PATH if it is set via --with-python=PYTHON_PATH. Prefer "python" over version specific names such as "python2.4". Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index c2ddd9b6e..c27a994da 100644 --- a/configure.ac +++ b/configure.ac @@ -105,7 +105,10 @@ 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 \ + elif test "$withval" = "yes"; then \ + NO_PYTHON=; \ + else \ + NO_PYTHON=; \ PYTHON_PATH=$withval; \ fi; \ ]) @@ -138,15 +141,15 @@ 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 -z "$PYTHON_PATH"; then + AC_PATH_PROGS(PYTHON_PATH, [python python2.4 python2.3 python2]) + fi if test -n "$PYTHON_PATH"; then GIT_CONF_APPEND_LINE([PYTHON_PATH=@PYTHON_PATH@]) - else - GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@]) + NO_PYTHON="" fi -else - GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@]) fi +GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@]) ## Checks for libraries. From 424adc50b73f269ac3f3bd0195f9e7fea935109f Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Tue, 8 Aug 2006 18:39:06 +0200 Subject: [PATCH 14/17] autoconf: Move variables which we always set to config.mak.in Move detected NO_STH and NEED_STH variables, which we always output, either setting or unsetting (setting to empty string) to config.mak.in and use setting appropriately named variables and doing AC_SUBST instead of adding them via GIT_CONF_APPEND_LINE macro and config.mak.append temporary file. Variables which might and might not be set are still added via config.mak.append; this include all STH_PATH variables. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- config.mak.in | 16 +++++++++++ configure.ac | 75 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 60 insertions(+), 31 deletions(-) diff --git a/config.mak.in b/config.mak.in index 04f508ab9..369e6116e 100644 --- a/config.mak.in +++ b/config.mak.in @@ -22,3 +22,19 @@ VPATH = @srcdir@ export exec_prefix mandir export srcdir VPATH +NO_PYTHON=@NO_PYTHON@ +NEEDS_SSL_WITH_CRYPTO=@NEEDS_SSL_WITH_CRYPTO@ +NO_OPENSSL=@NO_OPENSSL@ +NO_CURL=@NO_CURL@ +NO_EXPAT=@NO_EXPAT@ +NEEDS_LIBICONV=@NEEDS_LIBICONV@ +NEEDS_SOCKET=@NEEDS_SOCKET@ +NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@ +NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT@ +NO_SOCKADDR_STORAGE=@NO_SOCKADDR_STORAGE@ +NO_IPV6=@NO_IPV6@ +NO_C99_FORMAT=@NO_C99_FORMAT@ +NO_STRCASESTR=@NO_STRCASESTR@ +NO_STRLCPY=@NO_STRLCPY@ +NO_SETENV=@NO_SETENV@ + diff --git a/configure.ac b/configure.ac index c27a994da..bc2824bb8 100644 --- a/configure.ac +++ b/configure.ac @@ -149,7 +149,6 @@ if test -z "$NO_PYTHON"; then NO_PYTHON="" fi fi -GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@]) ## Checks for libraries. @@ -158,35 +157,41 @@ 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([crypto], [SHA1_Init], -[GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)], +[NEEDS_SSL_WITH_CRYPTO=], [AC_CHECK_LIB([ssl], [SHA1_Init], - [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease) - GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)], - [GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])]) + [NEEDS_SSL_WITH_CRYPTO=YesPlease + NEEDS_SSL_WITH_CRYPTO=], + [NO_OPENSSL=YesPlease])]) +AC_SUBST(NEEDS_SSL_WITH_CRYPTO) +AC_SUBST(NO_OPENSSL) # # Define NO_CURL if you do not have curl installed. git-http-pull and # git-http-push are not built, and you cannot use http:// and https:// # transports. AC_CHECK_LIB([curl], [curl_global_init], -[GIT_CONF_APPEND_LINE(NO_CURL=)], -[GIT_CONF_APPEND_LINE(NO_CURL=YesPlease)]) +[NO_CURL=], +[NO_CURL=YesPlease]) +AC_SUBST(NO_CURL) # # 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. AC_CHECK_LIB([expat], [XML_ParserCreate], -[GIT_CONF_APPEND_LINE(NO_EXPAT=)], -[GIT_CONF_APPEND_LINE(NO_EXPAT=YesPlease)]) +[NO_EXPAT=], +[NO_EXPAT=YesPlease]) +AC_SUBST(NO_EXPAT) # # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). AC_CHECK_LIB([c], [iconv], -[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=)], -[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)]) +[NEEDS_LIBICONV=], +[NEEDS_LIBICONV=YesPlease]) +AC_SUBST(NEEDS_LIBICONV) # # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, # Patrick Mauritz). AC_CHECK_LIB([c], [socket], -[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=)], -[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)]) +[NEEDS_SOCKET=], +[NEEDS_SOCKET=YesPlease]) +AC_SUBST(NEEDS_SOCKET) ## Checks for header files. @@ -197,33 +202,38 @@ AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics]) # # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. AC_CHECK_MEMBER(struct dirent.d_ino, -[GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=)], -[GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=YesPlease)], +[NO_D_INO_IN_DIRENT=], +[NO_D_INO_IN_DIRENT=YesPlease], [#include ]) +AC_SUBST(NO_D_INO_IN_DIRENT) # # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks # d_type in struct dirent (latest Cygwin -- will be fixed soonish). AC_CHECK_MEMBER(struct dirent.d_type, -[GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=)], -[GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=YesPlease)], +[NO_D_TYPE_IN_DIRENT=], +[NO_D_TYPE_IN_DIRENT=YesPlease], [#include ]) +AC_SUBST(NO_D_TYPE_IN_DIRENT) # # Define NO_SOCKADDR_STORAGE if your platform does not have struct # sockaddr_storage. AC_CHECK_TYPE(struct sockaddr_storage, -[GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=)], -[GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease)], +[NO_SOCKADDR_STORAGE=], +[NO_SOCKADDR_STORAGE=YesPlease], [#include ]) +AC_SUBST(NO_SOCKADDR_STORAGE) +# # 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=)], - [GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)]) -],[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)],[ + [NO_IPV6=], + [NO_IPV6=YesPlease]) +],[NO_IPV6=YesPlease],[ #include #include #include ]) +AC_SUBST(NO_IPV6) # # 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, @@ -243,11 +253,11 @@ AC_RUN_IFELSE( [ac_cv_c_c99_format=no]) ]) if test $ac_cv_c_c99_format = no; then - GIT_CONF_APPEND_LINE(NO_C99_FORMAT=YesPlease) + NO_C99_FORMAT=YesPlease else - GIT_CONF_APPEND_LINE(NO_C99_FORMAT=) + NO_C99_FORMAT= fi - +AC_SUBST(NO_C99_FORMAT) ## Checks for library functions. ## (in default C library and libraries checked by AC_CHECK_LIB) @@ -255,18 +265,21 @@ AC_MSG_NOTICE([CHECKS for library functions]) # # Define NO_STRCASESTR if you don't have strcasestr. AC_CHECK_FUNC(strcasestr, -[GIT_CONF_APPEND_LINE(NO_STRCASESTR=)], -[GIT_CONF_APPEND_LINE(NO_STRCASESTR=YesPlease)]) +[NO_STRCASESTR=], +[NO_STRCASESTR=YesPlease]) +AC_SUBST(NO_STRCASESTR) # # Define NO_STRLCPY if you don't have strlcpy. AC_CHECK_FUNC(strlcpy, -[GIT_CONF_APPEND_LINE(NO_STRLCPY=)], -[GIT_CONF_APPEND_LINE(NO_STRLCPY=YesPlease)]) +[NO_STRLCPY=], +[NO_STRLCPY=YesPlease]) +AC_SUBST(NO_STRLCPY) # # Define NO_SETENV if you don't have setenv in the C library. AC_CHECK_FUNC(setenv, -[GIT_CONF_APPEND_LINE(NO_SETENV=)], -[GIT_CONF_APPEND_LINE(NO_SETENV=YesPlease)]) +[NO_SETENV=], +[NO_SETENV=YesPlease]) +AC_SUBST(NO_SETENV) # # Define NO_MMAP if you want to avoid mmap. # From 1b1b678e3c4eebe0302455c248941e5627ce2b5b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 8 Aug 2006 13:42:35 -0700 Subject: [PATCH 15/17] autoconf: clean temporary file mak.append When configure is interrupted in the middle it leaves config.mak.append behind. Add it to .gitignore and make sure $(MAKE) clean removes it. Also earlier .gitignore listed config.mak.in which is a tracked file. Fix it. Signed-off-by: Junio C Hamano --- .gitignore | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fb0fa3f16..6e973b3d4 100644 --- a/.gitignore +++ b/.gitignore @@ -140,7 +140,7 @@ config.mak autom4te.cache config.log config.status -config.mak.in config.mak.autogen +config.mak.append configure git-blame diff --git a/Makefile b/Makefile index d8cc83507..d4297c27c 100644 --- a/Makefile +++ b/Makefile @@ -793,7 +793,7 @@ clean: rm -f $(ALL_PROGRAMS) $(BUILT_INS) git$X rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags rm -rf autom4te.cache - rm -f config.log config.mak.autogen configure config.status config.cache + rm -f configure config.log config.mak.autogen config.mak.append config.status config.cache rm -rf $(GIT_TARNAME) .doc-tmp-dir rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz rm -f $(htmldocs).tar.gz $(manpages).tar.gz From 7b1e9d3d854f0c0df58b88809793c1b114a45b90 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Wed, 9 Aug 2006 02:19:22 +0200 Subject: [PATCH 16/17] autoconf: It is --without-python, not --no-python Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bc2824bb8..3fd3d55e4 100644 --- a/configure.ac +++ b/configure.ac @@ -102,7 +102,7 @@ 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])], +AS_HELP_STRING([--without-python], [don't use python scripts])], [if test "$withval" = "no"; then \ NO_PYTHON=YesPlease; \ elif test "$withval" = "yes"; then \ From a20b4d899ae75e075641d7bfe9462a239c8b9236 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Wed, 9 Aug 2006 02:15:10 +0200 Subject: [PATCH 17/17] autoconf: Add support for setting CURLDIR, OPENSSLDIR, EXPATDIR Add support for --with-openssl=PATH and --without-openssl, --with-curl=PATH and --without-curl, --with-expat=PATH and --without-expat ./configure options, each setting or unsetting appropriate NO_PACKAGE and if called with argument also PACKAGEDIR (of which only CURLDIR is documented in Makefile) All above options are supported as override to autodetection; more to come in the same style (override to autodetection), so moved the bulk of comments for site configuration down. Needs review by someone well versed in autoconf and m4. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- configure.ac | 158 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 101 insertions(+), 57 deletions(-) diff --git a/configure.ac b/configure.ac index 3fd3d55e4..e890131c4 100644 --- a/configure.ac +++ b/configure.ac @@ -46,53 +46,29 @@ else \ fi; \ fi; \ ]) # GIT_CONF_APPEND_PATH +# +# GIT_PARSE_WITH(PACKAGE) +# ----------------------- +# For use in AC_ARG_WITH action-if-found, for packages default ON. +# * Set NO_PACKAGE=YesPlease for --without-PACKAGE +# * Set PACKAGEDIR=PATH for --with-PACKAGE=PATH +# * Unset NO_PACKAGE for --with-PACKAGE without ARG +AC_DEFUN([GIT_PARSE_WITH], +[PACKAGE=m4_toupper($1); \ +if test "$withval" = "no"; then \ + m4_toupper(NO_$1)=YesPlease; \ +elif test "$withval" = "yes"; then \ + m4_toupper(NO_$1)=; \ +else \ + m4_toupper(NO_$1)=; \ + GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \ +fi \ +])# GIT_PARSE_WITH -## Site configuration +## Site configuration related to programs (before tests) ## --with-PACKAGE[=ARG] and --without-PACKAGE # -# 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. -# -# Define MOZILLA_SHA1 environment variable when running make to make use of -# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast -# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default -# choice) has very fast version optimized for i586. -# -# Define PPC_SHA1 environment variable when running make to make use of -# a bundled SHA1 routine optimized for PowerPC. -# -# Define ARM_SHA1 environment variable when running make to make use of -# a bundled SHA1 routine optimized for ARM. -# -# Define NO_OPENSSL environment variable if you do not have OpenSSL. -# This also implies MOZILLA_SHA1. -# -# Define NO_CURL if you do not have curl installed. git-http-pull and -# git-http-push are not built, and you cannot use http:// and https:// -# transports. -# -# Define CURLDIR=/foo/bar if your curl header and library files are in -# /foo/bar/include and /foo/bar/lib directories. -# -# 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. GIT_ARG_SET_PATH(shell) # @@ -114,20 +90,6 @@ AS_HELP_STRING([--without-python], [don't use python scripts])], ]) AC_SUBST(NO_PYTHON) AC_SUBST(PYTHON_PATH) -# -## --enable-FEATURE[=ARG] and --disable-FEATURE -# Define COLLISION_CHECK below if you believe that SHA1's -# 1461501637330902918203684832716283019655932542976 hashes do not give you -# sufficient guarantee that no collisions between objects will ever happen. -# -# Define USE_NSEC below if you want git to care about sub-second file mtimes -# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and -# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely -# randomly break unless your underlying filesystem supports those sub-second -# times (my ext3 doesn't). -# -# Define USE_STDEV below if you want git to care about the underlying device -# change being considered an inode change from the update-cache perspective. ## Checks for programs. @@ -259,6 +221,7 @@ else fi AC_SUBST(NO_C99_FORMAT) + ## Checks for library functions. ## (in default C library and libraries checked by AC_CHECK_LIB) AC_MSG_NOTICE([CHECKS for library functions]) @@ -299,6 +262,87 @@ AC_SUBST(NO_SETENV) # a missing newline at the end of the file. +## Site configuration (override autodetection) +## --with-PACKAGE[=ARG] and --without-PACKAGE +AC_MSG_NOTICE([CHECKS for site configuration]) +# +# 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. +# +# Define MOZILLA_SHA1 environment variable when running make to make use of +# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast +# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default +# choice) has very fast version optimized for i586. +# +# Define PPC_SHA1 environment variable when running make to make use of +# a bundled SHA1 routine optimized for PowerPC. +# +# Define ARM_SHA1 environment variable when running make to make use of +# a bundled SHA1 routine optimized for ARM. +# +# Define NO_OPENSSL environment variable if you do not have OpenSSL. +# This also implies MOZILLA_SHA1. +# +# Define OPENSSLDIR=/foo/bar if your openssl header and library files are in +# /foo/bar/include and /foo/bar/lib directories. +AC_ARG_WITH(openssl, +AS_HELP_STRING([--with-openssl],[use OpenSSL library (default is YES)]) +AS_HELP_STRING([], [ARG can be prefix for openssl library and headers]),\ +GIT_PARSE_WITH(openssl)) +# +# Define NO_CURL if you do not have curl installed. git-http-pull and +# git-http-push are not built, and you cannot use http:// and https:// +# transports. +# +# Define CURLDIR=/foo/bar if your curl header and library files are in +# /foo/bar/include and /foo/bar/lib directories. +AC_ARG_WITH(curl, +AS_HELP_STRING([--with-curl],[support http(s):// transports (default is YES)]) +AS_HELP_STRING([], [ARG can be also prefix for curl library and headers]), +GIT_PARSE_WITH(curl)) +# +# 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 EXPATDIR=/foo/bar if your expat header and library files are in +# /foo/bar/include and /foo/bar/lib directories. +AC_ARG_WITH(expat, +AS_HELP_STRING([--with-expat], +[support git-push using http:// and https:// transports via WebDAV (default is YES)]) +AS_HELP_STRING([], [ARG can be also prefix for expat library and headers]), +GIT_PARSE_WITH(expat)) +# +# 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. + +## --enable-FEATURE[=ARG] and --disable-FEATURE +# +# Define COLLISION_CHECK below if you believe that SHA1's +# 1461501637330902918203684832716283019655932542976 hashes do not give you +# sufficient guarantee that no collisions between objects will ever happen. +# +# Define USE_NSEC below if you want git to care about sub-second file mtimes +# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and +# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely +# randomly break unless your underlying filesystem supports those sub-second +# times (my ext3 doesn't). +# +# Define USE_STDEV below if you want git to care about the underlying device +# change being considered an inode change from the update-cache perspective. + + ## Output files AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"]) AC_OUTPUT