git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH] autoconf: Use autoconf to check for some types and library functions

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 29, 2006, 13:36 UTC
Message-ID
<200606291536.18667.jnareb@gmail.com>
In-Reply-To
<200606291359.43640.jnareb@gmail.com>
./configure script checks now for existence of the following types
and structure members:
 * dirent.d_ino  in dirent.h (NO_D_INO_IN_DIRENT)
 * dirent.d_type in dirent.h (NO_D_TYPE_IN_DIRENT)
 * 'struct sockaddr_storage' in netinet/in.h (NO_SOCKADDR_STORAGE)
./configure script checks now for the following library functions:
 * strcasestr (NO_STRCASESTR)
 * strlcpy (NO_STRLCPY)
 * setenv (NO_SETENV)
in default C library and in libraries which have AC_CHECK_LIB done for
them (crypto, curl, expat).
NOTE: not all checks are implemented!
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---

This patch needs review by someone better versed in compiling git on different platforms, namely AC_CHECK_MEMBER and AC_CHECK_TYPE needs checking if all header files where git search for specified structure member or specified type.

I don't know (yet) how to implement checking for NEEDS_SSL_WITH_CRYPTO (probably also checlking for crypto library needs correction), NEEDS_LIBICONV, NEEDS_SOCKET, NO_IPV6, NO_ICONV, Python < 2.3 and Python == 2.3, if to check for NO_MMAP, and for NO_ACCURATE_DIFF.

This patch is to be considered preliminary!
 configure.ac |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 55d7a9b..fbd46e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,17 +14,41 @@ AC_CONFIG_SRCDIR([git.c])
 AC_DEFUN([MY_APPEND_LINE],
 [[echo "$1" >> config.mak.append]])# AC_APPEND_LINE
 
+
 # Checks for libraries.
-AC_MSG_NOTICE(CHECKS for libraries)
+AC_MSG_NOTICE([CHECKS for libraries])
 AC_CHECK_LIB([crypto], [SHA1_Init],,MY_APPEND_LINE(NO_OPENSSL=YesPlease))
 AC_CHECK_LIB([curl], [curl_easy_setopt],,MY_APPEND_LINE(NO_CURL=YesPlease))
 AC_CHECK_LIB([expat], [XML_ParserCreate],,MY_APPEND_LINE(NO_EXPAT=YesPlease))
 
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])
+
+AC_CHECK_MEMBER(struct dirent.d_ino,,
+MY_APPEND_LINE(NO_D_INO_IN_DIRENT=YesPlease),
+[#include <dirent.h>])
+AC_CHECK_MEMBER(struct dirent.d_type,,
+MY_APPEND_LINE(NO_D_TYPE_IN_DIRENT=YesPlease),
+[#include <dirent.h>])
+
+AC_CHECK_TYPE(struct sockaddr_storage,,
+MY_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease),
+[#include <netinet/in.h>])
+
+
+# Checks for library functions.
+AC_MSG_NOTICE([CHECKS for library functions])
+AC_CHECK_FUNC(strcasestr,,MY_APPEND_LINE(NO_STRCASESTR=YesPlease))
+AC_CHECK_FUNC(strlcpy,,MY_APPEND_LINE(NO_STRLCPY=YesPlease))
+AC_CHECK_FUNC(setenv,,MY_APPEND_LINE(NO_SETENV=YesPlease))
+
+
 # Output files
 AC_CONFIG_FILES([config.mak:config.mak.in:config.mak.append], 
 [rm -f config.mak.append], 
-- 
1.4.0
Previous: Jakub NarebskiNext: Jakub Narebski
Message 4 of 30 in “autoconf: Use autoconf to write installation directories to config.mak”
  1. autoconf: Use autoconf to write installation directories to config.makJakub Narebski, Jun 29, 2006
  2. Uwe ZeisbergerJun 29, 2006
  3. autoconf: Use autoconf to check for libraries: openssl/crypto, curl, expatJakub Narebski, Jun 29, 2006
  4. autoconf: Use autoconf to check for some types and library functionsJakub Narebski, Jun 29, 2006
  5. autoconf: Cleanup generation of config.mak.append by ./configureJakub Narebski, Jun 29, 2006
  6. Allow INSTALL, bindir, mandir to be set in main MakefileJakub Narebski, Jun 29, 2006
  7. autoconf: Set mandir in config.mak.in and export variables not in MakefileJakub Narebski, Jun 29, 2006
  8. autoconf: configure.ac uses variables to set in, out and temp filesJakub Narebski, Jun 30, 2006
  9. autoconf: ./configure script outputs to config.mac.autoJakub Narebski, Jun 30, 2006
  10. autoconf: Cleanup generation of temporary "append" fileJakub Narebski, Jun 30, 2006
  11. autoconf: Write how to use ./configure generated file in git build processJakub Narebski, Jun 30, 2006
  12. autoconf: Rename ./configure output file to config.mak.autogenJakub Narebski, Jun 30, 2006
  13. Revert "autoconf: Write how to use ./configure generated file in git build process"Jakub Narebski, Jun 30, 2006
  14. autoconf: Append '-include config.mak.autogen' to config.mak if it is not presentJakub Narebski, Jun 30, 2006
  15. Jakub NarebskiJun 30, 2006
  16. autoconf: Added --with/--without for openssl, curl, expat to ./configureJakub Narebski, Jun 30, 2006
  17. Pavel RoskinJun 30, 2006
  18. Jakub NarebskiJun 30, 2006
  19. Jakub NarebskiJun 30, 2006
  20. Junio C HamanoJun 29, 2006
  21. Jakub NarebskiJun 29, 2006
  22. Matthias LederhoferJun 29, 2006
  23. Jakub NarebskiJun 29, 2006
  24. Andreas EricssonJun 30, 2006
  25. Jakub NarebskiJun 30, 2006
  26. Jakub NarebskiJul 1, 2006
  27. Junio C HamanoJun 29, 2006
  28. Jakub NarebskiJul 1, 2006
  29. Pavel RoskinJul 8, 2006
  30. Jakub NarebskiJul 1, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.