You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ([2.57])
  3. AC_INIT([tigervnc], [1.0.90], [http://www.tigervnc.org])
  4. AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
  5. AC_CONFIG_SUBDIRS([common/jpeg common/zlib])
  6. AC_CONFIG_HEADERS([config.h])
  7. dnl Checks for programs.
  8. AC_PROG_CC
  9. AC_PROG_CXX
  10. AC_PROG_LIBTOOL
  11. AC_LANG([C++])
  12. AM_GNU_GETTEXT([external])
  13. AM_GNU_GETTEXT_VERSION([0.14.1])
  14. case "`(uname -sr) 2>/dev/null`" in
  15. "SunOS 5"*)
  16. SOLARIS=yes
  17. USE_MITSHM=yes
  18. USE_SUN_OVL=yes
  19. ;;
  20. "IRIX 6"*)
  21. LDFLAGS="-L/usr/lib32 $LDFLAGS"
  22. USE_MITSHM=yes
  23. USE_READDISPLAY=yes
  24. ;;
  25. "LynxOS 2"*)
  26. SJLJ_EXCEPTIONS=yes
  27. ;;
  28. esac
  29. BUILD_WIN=
  30. case "$host_os" in
  31. mingw*)
  32. CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_IE=0x0500"
  33. CXXFLAGS="$CXXFLAGS -mthreads"
  34. BUILD_WIN=yes
  35. AC_CHECK_TOOL([WINDRES], windres, [AC_MSG_ERROR(windres not found)])
  36. ;;
  37. esac
  38. AM_CONDITIONAL([BUILD_WIN], [test "x$BUILD_WIN" = xyes])
  39. dnl FIXME: Check for MIT-SHM properly, add a corresponding --with option.
  40. if test "$USE_MITSHM" = yes; then
  41. MITSHM_DEFINE="-DHAVE_MITSHM"
  42. fi
  43. AC_SUBST(MITSHM_DEFINE)
  44. if test "$GCC" = yes; then
  45. CFLAGS="$CFLAGS -Wall"
  46. if test "$SOLARIS" = yes; then
  47. CFLAGS="$CFLAGS -Wno-unknown-pragmas -Wno-implicit-int"
  48. fi
  49. fi
  50. if test "$GXX" = yes; then
  51. CXXFLAGS="$CXXFLAGS -Wall"
  52. if test "$SOLARIS" = yes; then
  53. CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas -fpermissive"
  54. fi
  55. if test "$SJLJ_EXCEPTIONS" = yes; then
  56. CXXFLAGS="$CXXFLAGS -fsjlj-exceptions"
  57. fi
  58. fi
  59. AC_PATH_XTRA
  60. VNCCONFIG_DIR='vncconfig'
  61. AC_ARG_ENABLE([vncconfig],
  62. AS_HELP_STRING([--enable-vncconfig],
  63. [build the vncconfig utility (default yes)]),
  64. [if test "$enableval" = no; then VNCCONFIG_DIR=; fi ], [])
  65. AC_SUBST(VNCCONFIG_DIR)
  66. dnl Check for the XTest X11 extension library.
  67. AC_CHECK_LIB(Xtst,XTestGrabControl,USE_XTEST=yes,USE_XTEST=,
  68. ["$X_LIBS" -lXext -lX11])
  69. if test "$USE_XTEST" = yes; then
  70. XTEST_DEFINE='-DHAVE_XTEST'
  71. XTEST_LIB=-lXtst
  72. else
  73. echo Warning: No XTest extension, building x0vncserver view-only
  74. XTEST_DEFINE=
  75. XTEST_LIB=
  76. fi
  77. AC_SUBST(XTEST_DEFINE)
  78. AC_SUBST(XTEST_LIB)
  79. dnl Support for READDISPLAY (Irix) and SUN_OVL (Solaris) extensions
  80. dnl FIXME: Implement corresponding --with options.
  81. if test "$USE_READDISPLAY" = yes; then
  82. READDISPLAY_DEFINE='-DHAVE_READDISPLAY'
  83. elif test "$USE_SUN_OVL" = yes; then
  84. READDISPLAY_DEFINE='-DHAVE_SUN_OVL'
  85. else
  86. READDISPLAY_DEFINE=
  87. fi
  88. AC_SUBST(READDISPLAY_DEFINE)
  89. dnl Under Lynx/OS 2.3, we have to link with -lbsd to resolve
  90. dnl gethostbyname, inet_addr, htons etc. Check if it's necessary.
  91. dnl NOTE: Did not want to use AC_SEARCH_LIBS which would add
  92. dnl -lbsd to LIBS. We set INET_LIB instead.
  93. AC_LANG_SAVE
  94. AC_LANG_C
  95. AC_CHECK_FUNC(gethostbyname,INET_LIB_REQ=,INET_LIB_REQ=yes)
  96. if test "$INET_LIB_REQ" = yes; then
  97. AC_CHECK_LIB(bsd,gethostbyname,INET_LIB=-lbsd,INET_LIB=)
  98. fi
  99. AC_LANG_RESTORE
  100. AC_SUBST(INET_LIB)
  101. dnl Check for zlib library
  102. INCLUDED_ZLIB=no
  103. AC_ARG_WITH([included-zlib],
  104. AS_HELP_STRING([--with-included-zlib],
  105. [use libz which is distributed with VNC]),
  106. [INCLUDED_ZLIB=yes],
  107. [AC_SEARCH_LIBS([inflateEnd], [z], [], [INCLUDED_ZLIB=yes])])
  108. AM_CONDITIONAL([INCLUDED_ZLIB], [ test "x$INCLUDED_ZLIB" = xyes ])
  109. AC_CONFIG_SUBDIRS([zlib])
  110. dnl Check for libjpeg library
  111. INCLUDED_JPEG=yes
  112. AC_ARG_WITH([system-jpeg],
  113. AS_HELP_STRING([--with-system-jpeg],
  114. [use libjpeg which is distributed with the O/S]),
  115. [AC_SEARCH_LIBS([jpeg_destroy_compress], [jpeg],
  116. [INCLUDED_JPEG=no], [])],
  117. [])
  118. AM_CONDITIONAL([INCLUDED_JPEG], [ test "x$INCLUDED_JPEG" = xyes ])
  119. AC_CONFIG_SUBDIRS([jpeg])
  120. AC_CHECK_FUNCS([vsnprintf snprintf strcasecmp strncasecmp])
  121. # IPv6 related functions
  122. AC_CHECK_FUNCS([inet_ntop getaddrinfo])
  123. AC_CHECK_TYPES([socklen_t], [], [], [[#include <sys/socket.h>]])
  124. AC_CHECK_HEADERS([sys/select.h])
  125. AC_OUTPUT([
  126. Makefile
  127. common/Makefile
  128. common/os/Makefile
  129. common/rdr/Makefile
  130. common/network/Makefile
  131. common/Xregion/Makefile
  132. common/rfb/Makefile
  133. unix/Makefile
  134. unix/tx/Makefile
  135. unix/x0vncserver/Makefile
  136. unix/vncviewer/Makefile
  137. unix/vncconfig/Makefile
  138. unix/vncpasswd/Makefile
  139. win/Makefile
  140. win/vncviewer/Makefile
  141. win/rfb_win32/Makefile
  142. win/vncconfig/Makefile
  143. win/winvnc/Makefile
  144. po/Makefile.in
  145. ])