2010-02-20 13:51:54 -05:00
|
|
|
#
|
2011-07-06 19:39:18 -04:00
|
|
|
# Copyright (c) 2006-2011 Philip R. Zimmermann. All rights reserved.
|
2010-02-20 13:51:54 -05:00
|
|
|
# Contact: http://philzimmermann.com
|
|
|
|
# For licensing and other legal details, see the file zrtp_legal.c.
|
|
|
|
#
|
|
|
|
# Viktor Krikun <v.krikun at zfoneproject.com>
|
|
|
|
#
|
|
|
|
|
2012-06-22 23:04:31 -04:00
|
|
|
AC_INIT([libzrtp], [1.2.0])
|
2010-02-20 13:51:54 -05:00
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR(config)
|
|
|
|
AC_CONFIG_HEADER(config/config.h)
|
|
|
|
|
|
|
|
# Checks for target OS
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
|
|
|
case $target_os in
|
|
|
|
aix*) ;;
|
|
|
|
*mingw* | *cygw* | *win32* | *w32* )
|
|
|
|
echo "------- START libzrtp configuration for Windows platform ------------"
|
|
|
|
;;
|
|
|
|
*darwin*)
|
|
|
|
echo "------- START libzrtp configuration for Darwin platform ------------"
|
|
|
|
;;
|
|
|
|
*freebsd2* | *freebsd* | *netbsd* | *openbsd* | *osf[12]*)
|
|
|
|
echo "------- START libzrtp configuration for BSD platform ------------"
|
|
|
|
AC_DEFINE(PLATFORM,ZP_BSD,BSD platform)
|
|
|
|
;;
|
|
|
|
hpux* | irix* | linuxaout* | linux* | osf* | solaris2* | sunos4*)
|
|
|
|
echo "------- START libzrtp configuration for Linux platform ------------"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2012-06-22 23:04:31 -04:00
|
|
|
AM_INIT_AUTOMAKE
|
2012-06-26 13:58:07 -04:00
|
|
|
AX_PREFIX_CONFIG_H(include/zrtp_config_unix.h,ZRTP,config/config.h)
|
2010-02-20 13:51:54 -05:00
|
|
|
|
2012-07-07 14:59:23 -04:00
|
|
|
CFLAGS="$CFLAGS -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1"
|
2010-02-20 13:51:54 -05:00
|
|
|
|
|
|
|
# Configuring external libraries
|
|
|
|
echo "========================= configuring bnlib =============================="
|
2012-06-26 13:58:07 -04:00
|
|
|
cd third_party/bnlib
|
2010-02-20 13:51:54 -05:00
|
|
|
./configure CFLAGS="$CFLAGS"
|
2012-06-26 13:58:07 -04:00
|
|
|
cd ../..
|
2010-02-20 13:51:54 -05:00
|
|
|
echo "================================ done ==================================="
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS([linux/version.h endian.h])
|
|
|
|
AC_CHECK_HEADERS([errno.h])
|
|
|
|
AC_CHECK_HEADERS([asm/types.h])
|
|
|
|
AC_CHECK_HEADERS([stdlib.h stdint.h stdarg.h])
|
|
|
|
AC_CHECK_HEADERS([string.h strings.h])
|
|
|
|
AC_CHECK_HEADERS([stdio.h unistd.h])
|
|
|
|
AC_CHECK_HEADERS([inttypes.h sys/inttypes.h sys/types.h machine/types.h])
|
|
|
|
AC_CHECK_HEADERS([pthread.h semaphore.h sys/time.h fcntl.h])
|
|
|
|
|
|
|
|
AC_CHECK_TYPES([int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,uint64_t,int64_t])
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_CHECK_FUNCS([memset memcpy malloc free])
|
|
|
|
AC_CHECK_FUNCS([usleep])
|
|
|
|
AC_CHECK_FUNCS([fopen fread])
|
|
|
|
AC_CHECK_FUNCS([pthread_mutex_lock pthread_mutex_unlock pthread_mutex_init pthread_mutex_destroy])
|
|
|
|
AC_CHECK_FUNCS([pthread_attr_init pthread_attr_setdetachstate pthread_create])
|
|
|
|
AC_CHECK_FUNCS([sem_wait sem_trywait sem_post sem_unlink sem_destroy sem_open sem_init])
|
|
|
|
|
2012-06-25 13:09:37 -04:00
|
|
|
AC_CHECK_LIB([pthread], [main], [LIBS="-lpthread $LIBS"], [echo " Couldn't find library pthread";])
|
2010-02-20 13:51:54 -05:00
|
|
|
|
|
|
|
# Other
|
|
|
|
AC_DEFINE(PRAGMA_PACK_PUSH,[#pragma pack(push, 1)],[Define pragma pack(push) for your platform])
|
|
|
|
AC_DEFINE(PRAGMA_PACK_POP,[#pragma pack(pop)],[Define pragma pack(pop) for your platform])
|
|
|
|
AC_DEFINE(INLINE,[static inline],[Define inline construction for your platform])
|
|
|
|
|
2012-06-22 23:03:09 -04:00
|
|
|
#
|
|
|
|
# Documentation
|
|
|
|
#
|
|
|
|
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
|
|
|
if test -z "$DOXYGEN";
|
|
|
|
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_DOXYGEN],
|
|
|
|
[test -n "$DOXYGEN"])AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
|
|
|
|
|
|
|
|
#
|
2010-02-20 13:51:54 -05:00
|
|
|
# Genearte Makefiles
|
2012-07-06 19:18:59 -04:00
|
|
|
AC_OUTPUT([Makefile])
|