mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-04-06 15:00:40 +08:00
Add cross compiling warnings and errors.
Now require --enable-x-compile if cross compiling. Add tests for threadsafe/reentrant functions. Add tests for setconcurrency functions.
This commit is contained in:
parent
275d82352d
commit
c230adae6b
45
configure.in
45
configure.in
@ -30,6 +30,8 @@ OL_ARG_ENABLE(cache,[ --enable-cache enable caching], yes)dnl
|
||||
OL_ARG_ENABLE(dns,[ --enable-dns enable dns support], no)dnl
|
||||
OL_ARG_ENABLE(referrals,[ --enable-referrals enable referrals], yes)dnl
|
||||
OL_ARG_ENABLE(cldap,[ --enable-cldap enable connectionless ldap], no)dnl
|
||||
OL_ARG_ENABLE(x_compile,[ --enable-x-compile enable cross compiling],
|
||||
no, [yes no])dnl
|
||||
|
||||
dnl General "with" options
|
||||
OL_ARG_WITH(kerberos,[ --with-kerberos use Kerberos],
|
||||
@ -200,9 +202,23 @@ AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)
|
||||
|
||||
dnl Checks the compiler and UNIX Variants
|
||||
AC_PROG_CC
|
||||
|
||||
if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
|
||||
AC_WARN([cross compiling.... go for it])
|
||||
|
||||
elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
|
||||
AC_WARN([programs compiled here do run here...])
|
||||
AC_ERROR([ if not cross compiling, use --disable-x-compile.])
|
||||
|
||||
elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
|
||||
AC_WARN([programs compiled here do not run here...])
|
||||
AC_ERROR([ if cross compiling, add --enable-x-compile.])
|
||||
fi
|
||||
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_PROG_CPP
|
||||
|
||||
|
||||
AC_AIX
|
||||
AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
@ -386,12 +402,18 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
|
||||
|
||||
dnl Check functions for compatibility
|
||||
AC_CHECK_FUNCS(pthread_kill)
|
||||
dnl AC_CHECK_FUNCS(
|
||||
dnl AC_CHECK_FUNCS( \
|
||||
dnl pthread_attr_create pthread_attr_init \
|
||||
dnl pthread_attr_destroy pthread_attr_delete \
|
||||
dnl pthread_attr_setdetachstate pthread_attr_setdetach_np \
|
||||
dnl )
|
||||
|
||||
dnl Check for setconcurreny functions
|
||||
AC_CHECK_FUNCS( \
|
||||
pthread_setconcurrency \
|
||||
thr_setconcurrency \
|
||||
)
|
||||
|
||||
dnl Check PREEMPTIVE Implementation
|
||||
if test $ol_with_preemptive = auto ; then
|
||||
AC_MSG_CHECKING([for preemptive Pthread implementation])
|
||||
@ -424,6 +446,14 @@ main(argc, argv)
|
||||
int argc; char **argv;
|
||||
{
|
||||
pthread_t t;
|
||||
|
||||
#ifdef HAVE_PTHREAD_SETCONCURRENCY
|
||||
(void) pthread_setconcurrency(2);
|
||||
#elif HAVE_THR_SETCONCURRENCY
|
||||
/* Set Solaris LWP concurrency to 2 */
|
||||
thr_setconcurrency(2);
|
||||
#endif
|
||||
|
||||
pthread_create(&t, NULL, (void *) task, NULL);
|
||||
|
||||
#if HAVE_SCHED_YIELD
|
||||
@ -445,6 +475,17 @@ int argc; char **argv;
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl check for reentrant/threadsafe functions
|
||||
AC_CHECK_FUNCS( \
|
||||
feof_unlocked \
|
||||
unlocked_feof \
|
||||
ftrylockfile \
|
||||
flockfile \
|
||||
putc_unlocked \
|
||||
gmtime_r \
|
||||
strtok_r \
|
||||
)
|
||||
|
||||
dnl restore DEFS/LIBS
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
@ -919,7 +960,7 @@ if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
|
||||
fi
|
||||
|
||||
if test $ol_enable_ldapd != no ; then
|
||||
BUILD_SLURPD=yes
|
||||
BUILD_LDAPD=yes
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
|
@ -236,9 +236,18 @@ is provided ``as is'' without express or implied warranty.
|
||||
/* Define if you have the bcopy function. */
|
||||
#undef HAVE_BCOPY
|
||||
|
||||
/* Define if you have the feof_unlocked function. */
|
||||
#undef HAVE_FEOF_UNLOCKED
|
||||
|
||||
/* Define if you have the flock function. */
|
||||
#undef HAVE_FLOCK
|
||||
|
||||
/* Define if you have the flockfile function. */
|
||||
#undef HAVE_FLOCKFILE
|
||||
|
||||
/* Define if you have the ftrylockfile function. */
|
||||
#undef HAVE_FTRYLOCKFILE
|
||||
|
||||
/* Define if you have the getdtablesize function. */
|
||||
#undef HAVE_GETDTABLESIZE
|
||||
|
||||
@ -251,6 +260,9 @@ is provided ``as is'' without express or implied warranty.
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the gmtime_r function. */
|
||||
#undef HAVE_GMTIME_R
|
||||
|
||||
/* Define if you have the lockf function. */
|
||||
#undef HAVE_LOCKF
|
||||
|
||||
@ -269,9 +281,15 @@ is provided ``as is'' without express or implied warranty.
|
||||
/* Define if you have the pthread_kill function. */
|
||||
#undef HAVE_PTHREAD_KILL
|
||||
|
||||
/* Define if you have the pthread_setconcurrency function. */
|
||||
#undef HAVE_PTHREAD_SETCONCURRENCY
|
||||
|
||||
/* Define if you have the pthread_yield function. */
|
||||
#undef HAVE_PTHREAD_YIELD
|
||||
|
||||
/* Define if you have the putc_unlocked function. */
|
||||
#undef HAVE_PUTC_UNLOCKED
|
||||
|
||||
/* Define if you have the sched_yield function. */
|
||||
#undef HAVE_SCHED_YIELD
|
||||
|
||||
@ -314,6 +332,9 @@ is provided ``as is'' without express or implied warranty.
|
||||
/* Define if you have the strtod function. */
|
||||
#undef HAVE_STRTOD
|
||||
|
||||
/* Define if you have the strtok_r function. */
|
||||
#undef HAVE_STRTOK_R
|
||||
|
||||
/* Define if you have the strtol function. */
|
||||
#undef HAVE_STRTOL
|
||||
|
||||
@ -326,6 +347,12 @@ is provided ``as is'' without express or implied warranty.
|
||||
/* Define if you have the tempnam function. */
|
||||
#undef HAVE_TEMPNAM
|
||||
|
||||
/* Define if you have the thr_setconcurrency function. */
|
||||
#undef HAVE_THR_SETCONCURRENCY
|
||||
|
||||
/* Define if you have the unlocked_feof function. */
|
||||
#undef HAVE_UNLOCKED_FEOF
|
||||
|
||||
/* Define if you have the vsnprintf function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user