# # Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved. # Contact: http://philzimmermann.com # For licensing and other legal details, see the file zrtp_legal.c. # # Viktor Krikun # AC_INIT() 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 AM_INIT_AUTOMAKE([libzrtp], [0.91]) AX_PREFIX_CONFIG_H(../../include/zrtp_config_unix.h,ZRTP,config/config.h) CFLAGS="$CFLAGS -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1" # Configuring external libraries echo "========================= configuring bnlib ==============================" cd ./../../third_party/bnlib ./configure CFLAGS="$CFLAGS" cd ../../projects/gnu echo "================================ done ===================================" # Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB # Apply configure options AC_ARG_ENABLE(enterprise, [ --enable-enterprise enable building of enterprise components).], enable_enterprise=$enableval,enable_enterprise="no") AM_CONDITIONAL(ZRTP_BUILD_ENTERPRISE, [test "x$enable_enterprise" = "xyes"]) # 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]) AC_CHECK_LIB([pthread], [main], [LIB_PTHREAD="-lpthread"], [echo " Couldn't find library pthread";]) # 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]) if test "x$enable_enterprise" = "xyes" ; then AC_DEFINE(ENABLE_EC,1,Enterprise) CFLAGS="$CFLAGS -DZRTP_ENABLE_EC=1" fi AC_SUBST(ENABLE_EC) # Genearte Makefiles AC_OUTPUT([Makefile build/Makefile build/test/Makefile])