@@ -65,7 +65,17 @@ else \
65
65
fi \
66
66
] ) # GIT_PARSE_WITH
67
67
68
-
68
+ dnl
69
+ dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE)
70
+ dnl -----------------------------------------
71
+ dnl Similar to AC_CHECK_FUNC, but on systems that do not generate
72
+ dnl warnings for missing prototypes (e.g. FreeBSD when compiling without
73
+ dnl -Wall), it does not work. By looking for function definition in
74
+ dnl libraries, this problem can be worked around.
75
+ AC_DEFUN ( [ GIT_CHECK_FUNC] ,[ AC_CHECK_FUNC ( [ $1 ] ,[
76
+ AC_SEARCH_LIBS ( [ $1 ] ,,
77
+ [ $2 ] ,[ $3 ] )
78
+ ] ,[ $3 ] ) ] )
69
79
# # Site configuration related to programs (before tests)
70
80
# # --with-PACKAGE[=ARG] and --without-PACKAGE
71
81
#
@@ -325,7 +335,7 @@ AC_SUBST(NO_SOCKADDR_STORAGE)
325
335
#
326
336
# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
327
337
AC_CHECK_TYPE ( [ struct addrinfo] ,[
328
- AC_CHECK_FUNC ( [ getaddrinfo] ,
338
+ GIT_CHECK_FUNC ([ getaddrinfo] ,
329
339
[ NO_IPV6=] ,
330
340
[ NO_IPV6=YesPlease] )
331
341
] ,[ NO_IPV6=YesPlease] ,[
@@ -419,43 +429,43 @@ AC_SUBST(SNPRINTF_RETURNS_BOGUS)
419
429
AC_MSG_NOTICE ( [ CHECKS for library functions] )
420
430
#
421
431
# Define NO_STRCASESTR if you don't have strcasestr.
422
- AC_CHECK_FUNC ( strcasestr ,
432
+ GIT_CHECK_FUNC (strcasestr,
423
433
[ NO_STRCASESTR=] ,
424
434
[ NO_STRCASESTR=YesPlease] )
425
435
AC_SUBST ( NO_STRCASESTR )
426
436
#
427
437
# Define NO_MEMMEM if you don't have memmem.
428
- AC_CHECK_FUNC ( memmem ,
438
+ GIT_CHECK_FUNC (memmem,
429
439
[ NO_MEMMEM=] ,
430
440
[ NO_MEMMEM=YesPlease] )
431
441
AC_SUBST ( NO_MEMMEM )
432
442
#
433
443
# Define NO_STRLCPY if you don't have strlcpy.
434
- AC_CHECK_FUNC ( strlcpy ,
444
+ GIT_CHECK_FUNC (strlcpy,
435
445
[ NO_STRLCPY=] ,
436
446
[ NO_STRLCPY=YesPlease] )
437
447
AC_SUBST ( NO_STRLCPY )
438
448
#
439
449
# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
440
- AC_CHECK_FUNC ( strtoumax ,
450
+ GIT_CHECK_FUNC (strtoumax,
441
451
[ NO_STRTOUMAX=] ,
442
452
[ NO_STRTOUMAX=YesPlease] )
443
453
AC_SUBST ( NO_STRTOUMAX )
444
454
#
445
455
# Define NO_SETENV if you don't have setenv in the C library.
446
- AC_CHECK_FUNC ( setenv ,
456
+ GIT_CHECK_FUNC (setenv,
447
457
[ NO_SETENV=] ,
448
458
[ NO_SETENV=YesPlease] )
449
459
AC_SUBST ( NO_SETENV )
450
460
#
451
461
# Define NO_UNSETENV if you don't have unsetenv in the C library.
452
- AC_CHECK_FUNC ( unsetenv ,
462
+ GIT_CHECK_FUNC (unsetenv,
453
463
[ NO_UNSETENV=] ,
454
464
[ NO_UNSETENV=YesPlease] )
455
465
AC_SUBST ( NO_UNSETENV )
456
466
#
457
467
# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
458
- AC_CHECK_FUNC ( mkdtemp ,
468
+ GIT_CHECK_FUNC (mkdtemp,
459
469
[ NO_MKDTEMP=] ,
460
470
[ NO_MKDTEMP=YesPlease] )
461
471
AC_SUBST ( NO_MKDTEMP )
0 commit comments