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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jakub Narebski 2006-08-08 18:39:06 +02:00 committed by Junio C Hamano
parent af6058cc2b
commit 424adc50b7
2 changed files with 60 additions and 31 deletions

View File

@ -22,3 +22,19 @@ VPATH = @srcdir@
export exec_prefix mandir export exec_prefix mandir
export srcdir VPATH 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@

View File

@ -149,7 +149,6 @@ if test -z "$NO_PYTHON"; then
NO_PYTHON="" NO_PYTHON=""
fi fi
fi fi
GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@])
## Checks for libraries. ## 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 NO_OPENSSL environment variable if you do not have OpenSSL.
# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). # 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=)], [NEEDS_SSL_WITH_CRYPTO=],
[AC_CHECK_LIB([ssl], [SHA1_Init], [AC_CHECK_LIB([ssl], [SHA1_Init],
[GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease) [NEEDS_SSL_WITH_CRYPTO=YesPlease
GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)], NEEDS_SSL_WITH_CRYPTO=],
[GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])]) [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 # 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:// # git-http-push are not built, and you cannot use http:// and https://
# transports. # transports.
AC_CHECK_LIB([curl], [curl_global_init], AC_CHECK_LIB([curl], [curl_global_init],
[GIT_CONF_APPEND_LINE(NO_CURL=)], [NO_CURL=],
[GIT_CONF_APPEND_LINE(NO_CURL=YesPlease)]) [NO_CURL=YesPlease])
AC_SUBST(NO_CURL)
# #
# Define NO_EXPAT if you do not have expat installed. git-http-push is # 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. # 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=)], [NO_EXPAT=],
[GIT_CONF_APPEND_LINE(NO_EXPAT=YesPlease)]) [NO_EXPAT=YesPlease])
AC_SUBST(NO_EXPAT)
# #
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). # 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=)], [NEEDS_LIBICONV=],
[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)]) [NEEDS_LIBICONV=YesPlease])
AC_SUBST(NEEDS_LIBICONV)
# #
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS, # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
# Patrick Mauritz). # Patrick Mauritz).
AC_CHECK_LIB([c], [socket], AC_CHECK_LIB([c], [socket],
[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=)], [NEEDS_SOCKET=],
[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)]) [NEEDS_SOCKET=YesPlease])
AC_SUBST(NEEDS_SOCKET)
## Checks for header files. ## 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. # 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=)], [NO_D_INO_IN_DIRENT=],
[GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=YesPlease)], [NO_D_INO_IN_DIRENT=YesPlease],
[#include <dirent.h>]) [#include <dirent.h>])
AC_SUBST(NO_D_INO_IN_DIRENT)
# #
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks # 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). # 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=)], [NO_D_TYPE_IN_DIRENT=],
[GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=YesPlease)], [NO_D_TYPE_IN_DIRENT=YesPlease],
[#include <dirent.h>]) [#include <dirent.h>])
AC_SUBST(NO_D_TYPE_IN_DIRENT)
# #
# Define NO_SOCKADDR_STORAGE if your platform does not have struct # Define NO_SOCKADDR_STORAGE if your platform does not have struct
# sockaddr_storage. # sockaddr_storage.
AC_CHECK_TYPE(struct sockaddr_storage, AC_CHECK_TYPE(struct sockaddr_storage,
[GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=)], [NO_SOCKADDR_STORAGE=],
[GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease)], [NO_SOCKADDR_STORAGE=YesPlease],
[#include <netinet/in.h>]) [#include <netinet/in.h>])
AC_SUBST(NO_SOCKADDR_STORAGE)
#
# Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). # Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
AC_CHECK_TYPE([struct addrinfo],[ AC_CHECK_TYPE([struct addrinfo],[
AC_CHECK_FUNC([getaddrinfo], AC_CHECK_FUNC([getaddrinfo],
[GIT_CONF_APPEND_LINE(NO_IPV6=)], [NO_IPV6=],
[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)]) [NO_IPV6=YesPlease])
],[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)],[ ],[NO_IPV6=YesPlease],[
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
]) ])
AC_SUBST(NO_IPV6)
# #
# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) # 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, # 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]) [ac_cv_c_c99_format=no])
]) ])
if test $ac_cv_c_c99_format = no; then if test $ac_cv_c_c99_format = no; then
GIT_CONF_APPEND_LINE(NO_C99_FORMAT=YesPlease) NO_C99_FORMAT=YesPlease
else else
GIT_CONF_APPEND_LINE(NO_C99_FORMAT=) NO_C99_FORMAT=
fi fi
AC_SUBST(NO_C99_FORMAT)
## Checks for library functions. ## Checks for library functions.
## (in default C library and libraries checked by AC_CHECK_LIB) ## (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. # Define NO_STRCASESTR if you don't have strcasestr.
AC_CHECK_FUNC(strcasestr, AC_CHECK_FUNC(strcasestr,
[GIT_CONF_APPEND_LINE(NO_STRCASESTR=)], [NO_STRCASESTR=],
[GIT_CONF_APPEND_LINE(NO_STRCASESTR=YesPlease)]) [NO_STRCASESTR=YesPlease])
AC_SUBST(NO_STRCASESTR)
# #
# Define NO_STRLCPY if you don't have strlcpy. # Define NO_STRLCPY if you don't have strlcpy.
AC_CHECK_FUNC(strlcpy, AC_CHECK_FUNC(strlcpy,
[GIT_CONF_APPEND_LINE(NO_STRLCPY=)], [NO_STRLCPY=],
[GIT_CONF_APPEND_LINE(NO_STRLCPY=YesPlease)]) [NO_STRLCPY=YesPlease])
AC_SUBST(NO_STRLCPY)
# #
# Define NO_SETENV if you don't have setenv in the C library. # 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=)], [NO_SETENV=],
[GIT_CONF_APPEND_LINE(NO_SETENV=YesPlease)]) [NO_SETENV=YesPlease])
AC_SUBST(NO_SETENV)
# #
# Define NO_MMAP if you want to avoid mmap. # Define NO_MMAP if you want to avoid mmap.
# #