2
0

configure.ac 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #
  2. # Copyright (c) 2006-2011 Philip R. Zimmermann. All rights reserved.
  3. # Contact: http://philzimmermann.com
  4. # For licensing and other legal details, see the file zrtp_legal.c.
  5. #
  6. # Viktor Krikun <v.krikun at zfoneproject.com>
  7. #
  8. AC_INIT([libzrtp], [1.2.0])
  9. AC_CONFIG_AUX_DIR(config)
  10. AC_CONFIG_HEADER(config/config.h)
  11. # Checks for target OS
  12. AC_CANONICAL_TARGET
  13. case $target_os in
  14. aix*) ;;
  15. *mingw* | *cygw* | *win32* | *w32* )
  16. echo "------- START libzrtp configuration for Windows platform ------------"
  17. ;;
  18. *darwin*)
  19. echo "------- START libzrtp configuration for Darwin platform ------------"
  20. ;;
  21. *freebsd2* | *freebsd* | *netbsd* | *openbsd* | *osf[12]*)
  22. echo "------- START libzrtp configuration for BSD platform ------------"
  23. ;;
  24. hpux* | irix* | linuxaout* | linux* | osf* | solaris2* | sunos4*)
  25. echo "------- START libzrtp configuration for Linux platform ------------"
  26. ;;
  27. esac
  28. AM_INIT_AUTOMAKE
  29. AX_PREFIX_CONFIG_H(include/zrtp_config_unix.h,ZRTP,config/config.h)
  30. CFLAGS="$CFLAGS -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1"
  31. # Configuring external libraries
  32. echo "========================= configuring bnlib =============================="
  33. cd third_party/bnlib
  34. ./configure CFLAGS="$CFLAGS"
  35. cd ../..
  36. echo "================================ done ==================================="
  37. # Checks for programs.
  38. AC_PROG_CC
  39. AC_PROG_CXX
  40. AC_PROG_RANLIB
  41. AM_PROG_CC_C_O
  42. # Checks for header files.
  43. AC_HEADER_STDC
  44. AC_CHECK_HEADERS([linux/version.h endian.h])
  45. AC_CHECK_HEADERS([errno.h])
  46. AC_CHECK_HEADERS([asm/types.h])
  47. AC_CHECK_HEADERS([stdlib.h stdint.h stdarg.h])
  48. AC_CHECK_HEADERS([string.h strings.h])
  49. AC_CHECK_HEADERS([stdio.h unistd.h])
  50. AC_CHECK_HEADERS([inttypes.h sys/inttypes.h sys/types.h machine/types.h])
  51. AC_CHECK_HEADERS([pthread.h semaphore.h sys/time.h fcntl.h])
  52. AC_CHECK_TYPES([int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,uint64_t,int64_t])
  53. # Checks for typedefs, structures, and compiler characteristics.
  54. AC_C_CONST
  55. # Checks for library functions.
  56. AC_FUNC_MALLOC
  57. AC_CHECK_FUNCS([memset memcpy malloc free])
  58. AC_CHECK_FUNCS([usleep nanosleep])
  59. AC_CHECK_FUNCS([fopen fread])
  60. AC_CHECK_FUNCS([pthread_mutex_lock pthread_mutex_unlock pthread_mutex_init pthread_mutex_destroy])
  61. AC_CHECK_FUNCS([pthread_attr_init pthread_attr_setdetachstate pthread_create])
  62. AC_CHECK_FUNCS([sem_wait sem_trywait sem_post sem_unlink sem_destroy sem_open sem_init])
  63. AC_CHECK_LIB([pthread], [main], [LIBS="-lpthread $LIBS"], [echo " Couldn't find library pthread";])
  64. # Other
  65. AC_DEFINE(PRAGMA_PACK_PUSH,[#pragma pack(push, 1)],[Define pragma pack(push) for your platform])
  66. AC_DEFINE(PRAGMA_PACK_POP,[#pragma pack(pop)],[Define pragma pack(pop) for your platform])
  67. AC_DEFINE(INLINE,[static inline],[Define inline construction for your platform])
  68. #
  69. # Documentation
  70. #
  71. AM_CONDITIONAL([HAVE_DOXYGEN], [false])
  72. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  73. if test -z "$DOXYGEN"; then
  74. AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
  75. else
  76. AM_CONDITIONAL([HAVE_DOXYGEN], [true])
  77. AC_CONFIG_FILES([doc/Doxyfile])
  78. fi
  79. #
  80. # Generate Makefiles
  81. AC_OUTPUT([Makefile])