List:Commits« Previous MessageNext Message »
From:Kent Boortz Date:February 18 2009 3:46pm
Subject:Re: bzr commit into mysql-5.1-bugteam branch (staale.smedseng:2805)
Bug#31506
View as plain text  
Staale Smedseng <Staale.Smedseng@stripped> writes:
>  2805 Staale Smedseng	2009-02-18
>       Bug#31506 detection of function's availability is wrong in 
>       configure.in
>       
>       Replacing AC_CHECK_FUNC+AC_CHECK_LIB combination with 
>       AC_SEARCH_LIBS.
> modified:
>   configure.in

Approved given some changes are done discussed below.

> === modified file 'configure.in'
> --- a/configure.in	2009-02-11 13:58:50 +0000
> +++ b/configure.in	2009-02-18 14:48:50 +0000
> @@ -838,19 +838,18 @@ AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
>    AC_CHECK_LIB(nsl, gethostbyname_r))
>  AC_CHECK_FUNC(gethostbyname_r)
>  
> -AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
> -AC_CHECK_FUNC(yp_get_default_domain, ,
> -  AC_CHECK_LIB(nsl, yp_get_default_domain))
> -AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
> +AC_SEARCH_LIBS([setsockopt], [socket])
> +AC_SEARCH_LIBS([yp_get_default_domain], [nsl])
> +AC_SEARCH_LIBS([p2open], [gen])

Seems 'yp_get_default_domain' and 'p2open' are not used, i.e.
the two AC_SEARCH_LIBS lines to find them should be removed.

>  # This may get things to compile even if bind-8 is installed
> -AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
> +AC_SEARCH_LIBS([bind], [bind])
>  # Check if crypt() exists in libc or libcrypt, sets LIBS if needed
>  AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
>  # See if we need a library for address lookup.
>  AC_SEARCH_LIBS(inet_aton, [socket nsl resolv])
>  
>  # For the sched_yield() function on Solaris
> -AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield))
> +AC_SEARCH_LIBS([sched_yield], [posix4])

There is a use of HAVE_SCHED_YIELD used in our source code, but the
AC_SEARCH_LIBS call above will not set that symbol. I guess a
construct like for 'crypt' above can be used.

>  MYSQL_CHECK_ZLIB_WITH_COMPRESS
>  
> @@ -956,7 +955,7 @@ AC_MSG_RESULT([$USE_PSTACK])
>  # Check for gtty if termio.h doesn't exists
>  if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
>  then
> -  AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
> +  AC_SEARCH_LIBS([gtty], [compat])
>  fi

If you decide to apply this from 5.0 and up (not saying you should),
please rerun a find/grep to make sure

  - You define HAVE_<function> if used in our code
  - You remove AC_SEARCH_LIBS for functions not in use any longer

kent

-- 
Kent Boortz, Senior Production Engineer
Sun Microsystems Inc., the MySQL team
Office: +46 863 11 363
Mobile: +46 70 279 11 71
Thread
bzr commit into mysql-5.1-bugteam branch (staale.smedseng:2805) Bug#31506Staale Smedseng18 Feb
  • Re: bzr commit into mysql-5.1-bugteam branch (staale.smedseng:2805)Bug#31506Kent Boortz18 Feb