System call ioperm is non-portable, so check for its existence in autoconf.

(Closes issue #13863)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-11-25 04:50:00 +00:00
parent c7dcb086dd
commit 929c14e432
4 changed files with 19 additions and 5 deletions

View File

@@ -273,7 +273,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <sys/time.h> #include <sys/time.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef HAVE_SYS_IO_H
#include <sys/io.h> #include <sys/io.h>
#endif
#include <sys/vfs.h> #include <sys/vfs.h>
#include <math.h> #include <math.h>
#include <netinet/in.h> #include <netinet/in.h>
@@ -3362,6 +3364,7 @@ struct dahdi_params par;
{ {
res = set_ic706(myrpt); res = set_ic706(myrpt);
} }
#ifdef HAVE_IOPERM
else if(!strcmp(myrpt->remote, remote_rig_rbi)) else if(!strcmp(myrpt->remote, remote_rig_rbi))
{ {
if (ioperm(myrpt->p.iobase,1,1) == -1) if (ioperm(myrpt->p.iobase,1,1) == -1)
@@ -3372,6 +3375,7 @@ struct dahdi_params par;
} }
else res = setrbi(myrpt); else res = setrbi(myrpt);
} }
#endif
else if(!strcmp(myrpt->remote, remote_rig_kenwood)) else if(!strcmp(myrpt->remote, remote_rig_kenwood))
{ {
res = setkenwood(myrpt); res = setkenwood(myrpt);
@@ -10987,6 +10991,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
} }
rpt_mutex_lock(&myrpt->lock); rpt_mutex_lock(&myrpt->lock);
} }
#ifdef HAVE_IOPERM
if ((!strcmp(myrpt->remote, remote_rig_rbi)) && if ((!strcmp(myrpt->remote, remote_rig_rbi)) &&
(ioperm(myrpt->p.iobase,1,1) == -1)) (ioperm(myrpt->p.iobase,1,1) == -1))
{ {
@@ -10994,6 +10999,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Cant get io permission on IO port %x hex\n",myrpt->p.iobase); ast_log(LOG_WARNING, "Cant get io permission on IO port %x hex\n",myrpt->p.iobase);
return -1; return -1;
} }
#endif
myrpt->remoteon = 1; myrpt->remoteon = 1;
#ifdef OLD_ASTERISK #ifdef OLD_ASTERISK
LOCAL_USER_ADD(u); LOCAL_USER_ADD(u);

8
configure vendored
View File

@@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# From configure.ac Revision: 150557 . # From configure.ac Revision: 151241 .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.4. # Generated by GNU Autoconf 2.61 for asterisk 1.4.
# #
@@ -9767,7 +9767,8 @@ fi
for ac_header in arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h
for ac_header in arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h sys/io.h
do do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -14475,7 +14476,8 @@ done
for ac_func in asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf
for ac_func in asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm
do do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5 { echo "$as_me:$LINENO: checking for $ac_func" >&5

View File

@@ -223,7 +223,7 @@ AC_FUNC_ALLOCA
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h]) AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h sys/io.h])
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
@@ -265,7 +265,7 @@ AC_FUNC_STRNLEN
AC_FUNC_STRTOD AC_FUNC_STRTOD
AC_FUNC_UTIME_NULL AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf]) AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm])
# some systems already have gethostbyname_r so we don't need to build ours in main/utils.c # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
AC_SEARCH_LIBS(gethostbyname_r, [socket nsl]) AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])

View File

@@ -178,6 +178,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
/* Define to 1 if you have the `ioperm' function. */
#undef HAVE_IOPERM
/* Define to 1 if your system has PMTU discovery on UDP sockets. */ /* Define to 1 if your system has PMTU discovery on UDP sockets. */
#undef HAVE_IP_MTU_DISCOVER #undef HAVE_IP_MTU_DISCOVER
@@ -461,6 +464,9 @@
/* Define to 1 if you have the <sys/ioctl.h> header file. */ /* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H #undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/io.h> header file. */
#undef HAVE_SYS_IO_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/ */
#undef HAVE_SYS_NDIR_H #undef HAVE_SYS_NDIR_H