[xiph-cvs] cvs commit: libshout/m4 xiph_net.m4 xiph_types.m4
Brendan
brendan at xiph.org
Tue Jun 24 14:35:45 PDT 2003
brendan 03/06/24 17:35:44
Modified: . Makefile.am configure.in
Added: m4 xiph_net.m4 xiph_types.m4
Log:
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.
Revision Changes Path
1.17 +2 -1 libshout/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/libshout/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -u -r1.16 -r1.17
--- Makefile.am 24 Jun 2003 00:58:10 -0000 1.16
+++ Makefile.am 24 Jun 2003 21:35:44 -0000 1.17
@@ -6,7 +6,8 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include src examples
EXTRA_DIST = INSTALL shout.m4 m4/ac_config_libconfig_in.m4 m4/acx_pthread.m4 \
- m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4
+ m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4 m4/xiph_net.m4 \
+ m4/xiph_types.m4
docdir = $(datadir)/doc/$(PACKAGE)
doc_DATA = COPYING README examples/example.c
<p><p>1.52 +12 -60 libshout/configure.in
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/libshout/configure.in,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -p -u -r1.51 -r1.52
--- configure.in 24 Jun 2003 01:09:58 -0000 1.51
+++ configure.in 24 Jun 2003 21:35:44 -0000 1.52
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
-# $Id: configure.in,v 1.51 2003/06/24 01:09:58 brendan Exp $
+# $Id: configure.in,v 1.52 2003/06/24 21:35:44 brendan Exp $
m4_define(libshout_major, 2)
m4_define(libshout_minor, 0)
@@ -70,70 +70,21 @@ dnl Checks for programs.
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([inttypes.h strings.h sys/select.h sys/socket.h sys/uio.h])
+AC_CHECK_HEADERS([strings.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
-
-dnl Check for types
-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])
-
-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])
-
-AC_MSG_CHECKING([how to copy va_list])
-AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
- AC_MSG_RESULT([va_copy]),
- [ AH_TEMPLATE([va_copy], [define if va_copy is not available])
- AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
- [ AC_DEFINE([va_copy], [__va_copy])
- AC_MSG_RESULT([__va_copy])],
- [ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
- AC_MSG_RESULT([memcpy])]
- )
- ])
+XIPH_C99_INTTYPES
dnl Checks for library functions.
-AC_CHECK_FUNCS(nanosleep)
-AC_CHECK_FUNCS(sethostent endhostent)
-AC_SEARCH_LIBS([inet_pton], [socket],
- [AC_DEFINE([HAVE_INET_PTON], [1], [Define if you have the inet_pton function])],
- [], [-lnsl])
-AC_CHECK_FUNCS(getnameinfo getaddrinfo inet_aton)
+AC_SEARCH_LIBS([nanosleep], [rt],
+ [AC_DEFINE([HAVE_NANOSLEEP], [1],
+ [Define if you have the nanosleep function])])
-dnl Extra dependencies
+dnl Module checks
+XIPH_NET
+dnl Extra dependencies
AC_ARG_ENABLE([pthread],
AC_HELP_STRING([--disable-pthread],[do not link with pthread even if it is available]))
@@ -177,8 +128,9 @@ AM_CONDITIONAL([HAVE_PKGCONFIG], [test "
# Build shout-config, shout.pc
SHOUT_VERSION="$VERSION"
SHOUT_LIBS="-lshout"
-XIPH_CLEAN_CCFLAGS([$VORBIS_LIBS $PTHREAD_LIBS], [SHOUT_LIBDEPS])
-XIPH_CLEAN_CCFLAGS([$VORBIS_CFLAGS $PTHREAD_CFLAGS $PTHREAD_CPPFLAGS], [SHOUT_CFLAGS])
+XIPH_CLEAN_CCFLAGS([$VORBIS_LIBS $PTHREAD_LIBS $LIBS], [SHOUT_LIBDEPS])
+XIPH_CLEAN_CCFLAGS([$VORBIS_CFLAGS $PTHREAD_CFLAGS $PTHREAD_CPPFLAGS],
+ [SHOUT_CFLAGS])
AC_SUBST(SHOUT_LIBDEPS)
AC_SUBST(SHOUT_CFLAGS)
AC_CONFIG_LIBCONFIG_IN_STATIC
<p><p>1.1 libshout/m4/xiph_net.m4
Index: xiph_net.m4
===================================================================
# 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])
])
<p><p>1.1 libshout/m4/xiph_types.m4
Index: xiph_types.m4
===================================================================
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
])
])
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list