1479
# Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments)
1480
ac_save_CXXFLAGS="$CXXFLAGS"
1481
AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
1485
# Test whether madvise() is declared in C++ code -- it is not on some
1486
# systems, such as Solaris
1487
AC_CHECK_DECLS(madvise, [], [], [#if HAVE_SYS_MMAN_H
1488
#include <sys/types.h>
1489
#include <sys/mman.h>
1492
# Do not treat warnings as errors if we are linking against other libc
1493
# this is to work around gcc not being permissive on non-system includes
1494
# with respect to ANSI C++
1495
# We also remove the -fbranch-probabilities option as this will give warnings
1496
# about not profiled code, which confuses configure
1497
# We also must remove -W and -Wcheck which on icc produces warnings that
1498
# we don't want to catch with -Werror
1500
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
1502
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
1507
#if !defined(_REENTRANT)
1510
#include <pthread.h>
1511
#include <sys/types.h>
1512
#include <sys/socket.h>
1513
#include <netinet/in.h>
1514
#include <arpa/inet.h>
1515
#include <netdb.h>],
1517
struct hostent *foo = gethostbyaddr_r((const char *) 0,
1518
0, 0, (struct hostent *) 0, (char *) NULL, 0, &skr); return (foo == 0);],
1519
mysql_cv_gethost_style=solaris, mysql_cv_gethost_style=other))
1521
CXXFLAGS="$ac_save_CXXFLAGS"
1522
if test "$mysql_cv_gethost_style" = "solaris"
1524
AC_DEFINE([HAVE_SOLARIS_STYLE_GETHOST], [1],
1525
[Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines this with 8 arguments])
1528
#---START: Used in for client configure
1530
# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
1531
ac_save_CXXFLAGS="$CXXFLAGS"
1532
AC_CACHE_CHECK([style of gethostbyname_r routines], mysql_cv_gethostbyname_style,
1535
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
1537
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
1541
#if !defined(_REENTRANT)
1544
#include <pthread.h>
1545
#include <sys/types.h>
1546
#include <sys/socket.h>
1547
#include <netinet/in.h>
1548
#include <arpa/inet.h>
1549
#include <netdb.h>],
1552
skr = gethostbyname_r((const char *) 0,
1553
(struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);],
1554
mysql_cv_gethostbyname_style=glibc2, mysql_cv_gethostbyname_style=other))
1556
CXXFLAGS="$ac_save_CXXFLAGS"
1557
if test "$mysql_cv_gethostbyname_style" = "glibc2"
1559
AC_DEFINE([HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE], [1],
1560
[Solaris define gethostbyname_r with 5 arguments. glibc2 defines this with 6 arguments])
1563
# Check 3rd argument of getthostbyname_r
1564
ac_save_CXXFLAGS="$CXXFLAGS"
1565
AC_CACHE_CHECK([3 argument to gethostbyname_r routines], mysql_cv_gethostbyname_arg,
1568
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
1570
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
1574
#if !defined(_REENTRANT)
1577
#include <pthread.h>
1578
#include <sys/types.h>
1579
#include <sys/socket.h>
1580
#include <netinet/in.h>
1581
#include <arpa/inet.h>
1582
#include <netdb.h>],
1585
skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);],
1586
mysql_cv_gethostbyname_arg=hostent_data, mysql_cv_gethostbyname_arg=char))
1588
CXXFLAGS="$ac_save_CXXFLAGS"
1589
if test "$mysql_cv_gethostbyname_arg" = "hostent_data"
1591
AC_DEFINE([HAVE_GETHOSTBYNAME_R_RETURN_INT], [1],
1592
[In OSF 4.0f the 3'd argument to gethostbyname_r is hostent_data *])
1596
1479
# Check definition of pthread_getspecific
1597
1480
AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
1598
1481
AC_TRY_COMPILE(