mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Lots more autoconf stuff
1. src/net tests abstracted into XIPH_NET macro. We should do the same for src/thread, but it's a little more complicated - it will have to interact with the caller (eg some apps may want --disable-threads) 2. uintxx_t, socklen_t tests encapsulated, moved to xiph_types.m4 3. solaris fixes for socket func, nanosleep detection 4. added $LIBS to SHOUT_LIBS for *-config scripts. Good or bad idea? We'll definitely need a libshout beta 2. svn path=/trunk/m4/; revision=5005
This commit is contained in:
parent
eac72054f9
commit
4dacf00422
17
m4/xiph_net.m4
Normal file
17
m4/xiph_net.m4
Normal file
@ -0,0 +1,17 @@
|
||||
# XIPH_NET
|
||||
# Perform tests required by the net module
|
||||
AC_DEFUN([XIPH_NET],
|
||||
[dnl
|
||||
AC_REQUIRE([XIPH_TYPE_SOCKLEN_T])
|
||||
AC_REQUIRE([XIPH_FUNC_VA_COPY])
|
||||
AC_CHECK_HEADERS([sys/select.h sys/uio.h])
|
||||
|
||||
# These tests are ordered based on solaris 8 tests
|
||||
AC_SEARCH_LIBS([sethostent], [nsl],
|
||||
[AC_DEFINE([HAVE_SETHOSTENT], [1],
|
||||
[Define if you have the sethostent function])])
|
||||
AC_SEARCH_LIBS([getnameinfo], [socket],
|
||||
[AC_DEFINE([HAVE_GETNAMEINFO], [1],
|
||||
[Define if you have the inet_pton function])])
|
||||
AC_CHECK_FUNCS([endhostent getaddrinfo inet_aton inet_pton])
|
||||
])
|
59
m4/xiph_types.m4
Normal file
59
m4/xiph_types.m4
Normal file
@ -0,0 +1,59 @@
|
||||
dnl xiph_types.m4
|
||||
dnl macros for type checks not covered by autoconf
|
||||
|
||||
dnl XIPH_C99_INTTYPES
|
||||
dnl Brendan Cully
|
||||
dnl
|
||||
# XIPH_C99_INTTYPES
|
||||
# Check for C99 integer type definitions, or define if missing
|
||||
AC_DEFUN([XIPH_C99_INTTYPES],
|
||||
[dnl
|
||||
AC_CHECK_HEADERS([inttypes.h])
|
||||
AC_CHECK_TYPE([uint32_t],
|
||||
[AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
|
||||
[AC_CHECK_SIZEOF(short)
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(long long)])
|
||||
AH_VERBATIM([X_HAVE_C99_INTTYPES],
|
||||
[#ifndef HAVE_C99_INTTYPES
|
||||
# if SIZEOF_SHORT == 4
|
||||
typedef unsigned short uint32_t;
|
||||
# elif SIZEOF_INT == 4
|
||||
typedef unsigned int uint32_t;
|
||||
# elif SIZEOF_LONG == 4
|
||||
typedef unsigned long uint32_t;
|
||||
# endif
|
||||
# if SIZEOF_INT == 8
|
||||
typedef unsigned int uint64_t;
|
||||
# elif SIZEOF_LONG == 8
|
||||
typedef unsigned long uint64_t;
|
||||
# elif SIZEOF_LONG_LONG == 8
|
||||
typedef unsigned long long uint64_t;
|
||||
# endif
|
||||
#endif
|
||||
])
|
||||
])
|
||||
|
||||
dnl XIPH_TYPE_SOCKLEN_T
|
||||
dnl Brendan Cully
|
||||
dnl
|
||||
# XIPH_TYPE_SOCKLEN_T
|
||||
# Check for socklen_t, or define as int if missing
|
||||
AC_DEFUN([XIPH_TYPE_SOCKLEN_T],
|
||||
[dnl
|
||||
AC_CHECK_HEADERS([sys/socket.h])
|
||||
AC_CHECK_TYPES([socklen_t],,,
|
||||
[#if HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
])
|
||||
AH_VERBATIM([X_HAVE_SOCKLEN_T],
|
||||
[#ifndef HAVE_SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
])
|
||||
])
|
Loading…
x
Reference in New Issue
Block a user