mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-16 22:38:38 +00:00
add wrapper code to fully encapsulate apr, apr-utils, pcre, and sqlite. fully use switch_ namespace in modules, create our own format and type defines. follow up commit for unix autotools coming soon after this. PLEASE NOTE: you will NEED to do a make megaclean and run configure again after this update (and the following commit) or it will not build.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4494 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
2d78da120a
commit
42e78242a3
46 files changed
+4026
-2066
No files matched your search
+136
-2
@@ -6,7 +6,8 @@ AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
|
||||
AC_CONFIG_AUX_DIR(build/config)
|
||||
AM_INIT_AUTOMAKE(libfreeswitch,0.1)
|
||||
AC_CONFIG_SRCDIR([src/switch.c])
|
||||
AC_CONFIG_HEADER([src/include/switch_am_config.h])
|
||||
AC_CONFIG_HEADER([src/include/switch_private.h])
|
||||
|
||||
|
||||
AC_PREFIX_DEFAULT(/usr/local/freeswitch)
|
||||
|
||||
@@ -134,12 +135,145 @@ AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep])
|
||||
|
||||
AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
|
||||
|
||||
# Checks for integer size
|
||||
AC_CHECK_SIZEOF(char, 1)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
AC_CHECK_SIZEOF(long, 4)
|
||||
AC_CHECK_SIZEOF(short, 2)
|
||||
AC_CHECK_SIZEOF(long long, 8)
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_TYPE(ssize_t, int)
|
||||
|
||||
# Checks for pointer size
|
||||
AC_CHECK_SIZEOF(void*, 4)
|
||||
|
||||
if test "x$ac_cv_sizeof_voidp" != "x"; then
|
||||
voidp_size=$ac_cv_sizeof_voidp
|
||||
else
|
||||
AC_ERROR([Cannot determine size of void*])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_sizeof_short" = "2"; then
|
||||
short_value=short
|
||||
fi
|
||||
if test "$ac_cv_sizeof_int" = "4"; then
|
||||
int_value=int
|
||||
fi
|
||||
|
||||
if test "$ac_cv_sizeof_int" = "8"; then
|
||||
int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
|
||||
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
|
||||
int64_value="int"
|
||||
long_value=int
|
||||
elif test "$ac_cv_sizeof_long" = "8"; then
|
||||
int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
|
||||
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
|
||||
int64_value="long"
|
||||
long_value=long
|
||||
elif test "$ac_cv_sizeof_long_long" = "8"; then
|
||||
int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
|
||||
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
|
||||
int64_value="long long"
|
||||
long_value="long long"
|
||||
elif test "$ac_cv_sizeof_longlong" = "8"; then
|
||||
int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
|
||||
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
|
||||
int64_value="__int64"
|
||||
long_value="__int64"
|
||||
else
|
||||
AC_ERROR([could not detect a 64-bit integer type])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_type_size_t" = "yes"; then
|
||||
size_t_value="size_t"
|
||||
else
|
||||
size_t_value="switch_int32_t"
|
||||
fi
|
||||
|
||||
if test "$ac_cv_type_ssize_t" = "yes"; then
|
||||
ssize_t_value="ssize_t"
|
||||
else
|
||||
ssize_t_value="switch_int32_t"
|
||||
fi
|
||||
|
||||
APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
|
||||
|
||||
if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
|
||||
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
|
||||
elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
|
||||
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
|
||||
else
|
||||
ssize_t_fmt='#error Can not determine the proper size for ssize_t'
|
||||
fi
|
||||
|
||||
APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
|
||||
|
||||
if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
|
||||
size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
|
||||
elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
|
||||
size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
|
||||
else
|
||||
size_t_fmt='#error Can not determine the proper size for size_t'
|
||||
fi
|
||||
|
||||
# Basically, we have tried to figure out the correct format strings
|
||||
# for SWITCH types which vary between platforms, but we don't always get
|
||||
# it right. If you find that we don't get it right for your platform,
|
||||
# you can override our decision below.
|
||||
# NOTE: borrowed much of this logic from apr.
|
||||
case $host in
|
||||
s390*linux*)
|
||||
# uniquely, the 31-bit Linux/s390 uses "unsigned long int"
|
||||
# for size_t rather than "unsigned int":
|
||||
size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
|
||||
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
|
||||
;;
|
||||
*-os2*)
|
||||
size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
|
||||
;;
|
||||
*aix4*|*aix5*)
|
||||
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
|
||||
size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
|
||||
;;
|
||||
*beos*)
|
||||
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
|
||||
size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
|
||||
;;
|
||||
*apple-darwin*)
|
||||
osver=`uname -r`
|
||||
case $osver in
|
||||
[0-7].*)
|
||||
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
|
||||
;;
|
||||
*)
|
||||
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
|
||||
;;
|
||||
esac
|
||||
size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(voidp_size)
|
||||
AC_SUBST(short_value)
|
||||
AC_SUBST(int_value)
|
||||
AC_SUBST(long_value)
|
||||
AC_SUBST(int64_value)
|
||||
AC_SUBST(size_t_value)
|
||||
AC_SUBST(ssize_t_value)
|
||||
AC_SUBST(int64_t_fmt)
|
||||
AC_SUBST(uint64_t_fmt)
|
||||
AC_SUBST(ssize_t_fmt)
|
||||
AC_SUBST(size_t_fmt)
|
||||
|
||||
|
||||
|
||||
AC_ARG_ENABLE(crash-protection,
|
||||
[ --enable-crash-protection Compile with CRASH Protection],,[enable_crash_prot="no"])
|
||||
|
||||
AM_CONDITIONAL([CRASHPROT],[test "x$enable_crash_prot" != "xno"])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/include/switch_am_config.h])
|
||||
|
||||
AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
|
||||
AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
|
||||
|
||||
Reference in new issue
Block a user