Skip to content

Commit

Permalink
Merge branch 'ds/autoconf'
Browse files Browse the repository at this point in the history
* ds/autoconf:
  autoconf: Add link tests to each AC_CHECK_FUNC() test
  • Loading branch information
Junio C Hamano committed Nov 9, 2008
2 parents 1e2bba9 + 1689c5d commit 5fe9cd0
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ else \
fi \
])# GIT_PARSE_WITH


dnl
dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE)
dnl -----------------------------------------
dnl Similar to AC_CHECK_FUNC, but on systems that do not generate
dnl warnings for missing prototypes (e.g. FreeBSD when compiling without
dnl -Wall), it does not work. By looking for function definition in
dnl libraries, this problem can be worked around.
AC_DEFUN([GIT_CHECK_FUNC],[AC_CHECK_FUNC([$1],[
AC_SEARCH_LIBS([$1],,
[$2],[$3])
],[$3])])
## Site configuration related to programs (before tests)
## --with-PACKAGE[=ARG] and --without-PACKAGE
#
Expand Down Expand Up @@ -325,7 +335,7 @@ 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_CHECK_FUNC([getaddrinfo],
[NO_IPV6=],
[NO_IPV6=YesPlease])
],[NO_IPV6=YesPlease],[
Expand Down Expand Up @@ -419,43 +429,43 @@ AC_SUBST(SNPRINTF_RETURNS_BOGUS)
AC_MSG_NOTICE([CHECKS for library functions])
#
# Define NO_STRCASESTR if you don't have strcasestr.
AC_CHECK_FUNC(strcasestr,
GIT_CHECK_FUNC(strcasestr,
[NO_STRCASESTR=],
[NO_STRCASESTR=YesPlease])
AC_SUBST(NO_STRCASESTR)
#
# Define NO_MEMMEM if you don't have memmem.
AC_CHECK_FUNC(memmem,
GIT_CHECK_FUNC(memmem,
[NO_MEMMEM=],
[NO_MEMMEM=YesPlease])
AC_SUBST(NO_MEMMEM)
#
# Define NO_STRLCPY if you don't have strlcpy.
AC_CHECK_FUNC(strlcpy,
GIT_CHECK_FUNC(strlcpy,
[NO_STRLCPY=],
[NO_STRLCPY=YesPlease])
AC_SUBST(NO_STRLCPY)
#
# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
AC_CHECK_FUNC(strtoumax,
GIT_CHECK_FUNC(strtoumax,
[NO_STRTOUMAX=],
[NO_STRTOUMAX=YesPlease])
AC_SUBST(NO_STRTOUMAX)
#
# Define NO_SETENV if you don't have setenv in the C library.
AC_CHECK_FUNC(setenv,
GIT_CHECK_FUNC(setenv,
[NO_SETENV=],
[NO_SETENV=YesPlease])
AC_SUBST(NO_SETENV)
#
# Define NO_UNSETENV if you don't have unsetenv in the C library.
AC_CHECK_FUNC(unsetenv,
GIT_CHECK_FUNC(unsetenv,
[NO_UNSETENV=],
[NO_UNSETENV=YesPlease])
AC_SUBST(NO_UNSETENV)
#
# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
AC_CHECK_FUNC(mkdtemp,
GIT_CHECK_FUNC(mkdtemp,
[NO_MKDTEMP=],
[NO_MKDTEMP=YesPlease])
AC_SUBST(NO_MKDTEMP)
Expand Down

0 comments on commit 5fe9cd0

Please sign in to comment.