Skip to content

Commit

Permalink
* handle INTERIX differences in the configure.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.kannel.org/gateway/trunk@4902 a7d65f57-29cd-40c9-b71e-ebca51ad1b1d
  • Loading branch information
amalysh committed Apr 18, 2011
1 parent 846be2b commit da23a58
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,3 +1,6 @@
2011-04-18 Alexander Malysh <amalysh at kannel.org>
* handle INTERIX differences in the configure.

2011-04-18 Alexander Malysh <amalysh at kannel.org>
* removed INTERIX check from gwlib source and put it into configure.

Expand Down
6 changes: 3 additions & 3 deletions configure
Expand Up @@ -6411,7 +6411,7 @@ _ACEOF



for ac_func in gettimeofday select socket strdup getopt_long localtime_r gmtime_r backtrace srandom
for ac_func in gettimeofday select socket strdup getopt_long localtime_r gmtime_r backtrace srandom initgroups strtoll strtoq
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
Expand Down Expand Up @@ -6742,19 +6742,19 @@ int
main ()
{
#ifndef __INTERIX
#ifdef __INTERIX
/*
* interix has experimental spinlock support and this doesn't work very well
* therefore disable it for now
*/
pthread_spinlock_t_failed lock;
#else
pthread_spinlock_t lock;
#endif
pthread_spin_init(&lock, 0);
pthread_spin_lock(&lock);
pthread_spin_unlock(&lock);
pthread_spin_destroy(&lock);
#endif
;
return 0;
Expand Down
4 changes: 2 additions & 2 deletions configure.in
Expand Up @@ -252,7 +252,7 @@ AM_ICONV

dnl Checks for library functions.

AC_CHECK_FUNCS(gettimeofday select socket strdup getopt_long localtime_r gmtime_r backtrace srandom)
AC_CHECK_FUNCS(gettimeofday select socket strdup getopt_long localtime_r gmtime_r backtrace srandom initgroups strtoll strtoq)
AC_CHECK_FUNC(getopt, [], [AC_LIBOBJ([utils/attgetopt])])

dnl Check if we have reentrant gethostbyname and which one
Expand Down Expand Up @@ -350,11 +350,11 @@ AC_TRY_COMPILE([#include <pthread.h>], [
pthread_spinlock_t_failed lock;
#else
pthread_spinlock_t lock;
#endif
pthread_spin_init(&lock, 0);
pthread_spin_lock(&lock);
pthread_spin_unlock(&lock);
pthread_spin_destroy(&lock);
#endif
], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PTHREAD_SPINLOCK_T)], AC_MSG_RESULT(no))

dnl checking pthread_rwlock support
Expand Down
9 changes: 9 additions & 0 deletions gw-config.h.in
Expand Up @@ -133,6 +133,15 @@
/* Define if you have the srandom function. */
#undef HAVE_SRANDOM

/* Define if you have the initgroups function. */
#undef HAVE_INITGROUPS

/* Define if you have the strtoll function. */
#undef HAVE_STRTOLL

/* Define if you have the strtoq function. */
#undef HAVE_STRTOQ

/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H

Expand Down
6 changes: 4 additions & 2 deletions gwlib/gwlib.h
Expand Up @@ -112,9 +112,11 @@ void gwlib_shutdown(void);
#define gwlib_assert_init() ((void) 0)
#endif

#ifdef __INTERIX
#ifndef HAVE_STRTOLL
#undef strtoll
#define strtoll(A,B,C) strtoq((A),(B),(C))
#ifdef HAVE_STRTOQ
#define strtoll(A,B,C) strtoq((A),(B),(C))
#endif
#endif

#endif
2 changes: 1 addition & 1 deletion gwlib/gwthread.h
Expand Up @@ -69,7 +69,7 @@
#define GWTHREAD_H

#include "gw-config.h"
#ifndef __INTERIX
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion gwlib/utils.c
Expand Up @@ -386,7 +386,7 @@ static int change_user(const char *user)
return -1;
}

#ifndef __INTERIX
#ifdef HAVE_INITGROUPS
if (initgroups(user, -1) == -1) {
error(errno, "Could not set supplementary group ID's.");
}
Expand Down

0 comments on commit da23a58

Please sign in to comment.