Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | AC_INIT(rdr/InStream.h) |
| 3 | |
| 4 | dnl dirty hack to prevent use of -g in CFLAGS and CXXFLAGS |
| 5 | ac_cv_prog_cc_g=no |
| 6 | ac_cv_prog_cxx_g=no |
| 7 | |
| 8 | dnl Checks for programs. |
| 9 | AC_PROG_CC |
| 10 | AC_PROG_CXX |
| 11 | AC_PROG_RANLIB |
| 12 | AC_PROG_MAKE_SET |
| 13 | AC_LANG_CPLUSPLUS |
| 14 | |
| 15 | case "`(uname -sr) 2>/dev/null`" in |
| 16 | "SunOS 5"*) |
| 17 | SOLARIS=yes |
| 18 | USE_MITSHM=yes |
| 19 | ;; |
| 20 | "Linux"*) |
| 21 | LINUX=yes |
| 22 | USE_MITSHM=yes |
| 23 | ;; |
| 24 | esac |
| 25 | |
| 26 | if test "$USE_MITSHM" = yes; then |
| 27 | MITSHM_CPPFLAGS="-DMITSHM" |
| 28 | fi |
| 29 | AC_SUBST(MITSHM_CPPFLAGS) |
| 30 | |
| 31 | if test "$GCC" = yes; then |
| 32 | CFLAGS="$CFLAGS -Wall" |
| 33 | if test "$SOLARIS" = yes; then |
| 34 | CFLAGS="$CFLAGS -Wno-unknown-pragmas -Wno-implicit-int" |
| 35 | fi |
| 36 | fi |
| 37 | if test "$GXX" = yes; then |
| 38 | CXXFLAGS="$CXXFLAGS -Wall" |
| 39 | if test "$SOLARIS" = yes; then |
| 40 | CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas -Wno-implicit-int -fpermissive" |
| 41 | fi |
| 42 | fi |
| 43 | |
| 44 | AC_PATH_XTRA |
| 45 | |
| 46 | AC_ARG_WITH(installed-zlib, |
| 47 | [ --with-installed-zlib use the version of zlib which is installed on the |
| 48 | system instead of the one distributed with VNC]) |
| 49 | |
| 50 | if test "$with_installed_zlib" = yes; then |
| 51 | echo "using installed zlib" |
| 52 | ZLIB_LIB=-lz |
| 53 | else |
| 54 | ZLIB_DIR=zlib |
| 55 | ZLIB_INCLUDE='-I$(top_srcdir)/zlib' |
| 56 | ZLIB_LIB='$(top_srcdir)/zlib/libz.a' |
| 57 | echo "configuring zlib..." |
| 58 | (cd zlib; ./configure) |
| 59 | echo "...done configuring zlib" |
| 60 | fi |
| 61 | |
| 62 | AC_SUBST(ZLIB_DIR) |
| 63 | AC_SUBST(ZLIB_INCLUDE) |
| 64 | AC_SUBST(ZLIB_LIB) |
| 65 | |
| 66 | AC_CHECK_FUNC(vsnprintf,VSNPRINTF_DEFINE='-DHAVE_VSNPRINTF',VSNPRINTF_DEFINE=) |
| 67 | AC_SUBST(VSNPRINTF_DEFINE) |
| 68 | |
| 69 | AC_MSG_CHECKING(for socklen_t) |
| 70 | AC_TRY_COMPILE( |
| 71 | [#include <sys/types.h> |
| 72 | #include <sys/socket.h>], |
| 73 | [socklen_t x; |
| 74 | accept(0, 0, &x);], |
| 75 | AC_MSG_RESULT(yes) |
| 76 | SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=socklen_t', |
| 77 | AC_MSG_RESULT(using int) |
| 78 | SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=int') |
| 79 | AC_SUBST(SOCKLEN_T_DEFINE) |
| 80 | |
| 81 | BOILERPLATE=boilerplate.mk |
| 82 | |
| 83 | if (sh -c "make --version" 2>/dev/null | grep GNU 2>&1 >/dev/null); then |
| 84 | if sh -c "vncmkdepend" >/dev/null 2>&1; then |
| 85 | BOILERPLATE="$BOILERPLATE:depend.mk" |
| 86 | fi |
| 87 | fi |
| 88 | |
| 89 | AC_OUTPUT(Makefile:Makefile.in:$BOILERPLATE \ |
| 90 | rdr/Makefile:rdr/Makefile.in:$BOILERPLATE \ |
| 91 | network/Makefile:network/Makefile.in:$BOILERPLATE \ |
| 92 | Xregion/Makefile:Xregion/Makefile.in:$BOILERPLATE \ |
| 93 | rfb/Makefile:rfb/Makefile.in:$BOILERPLATE \ |
| 94 | tx/Makefile:tx/Makefile.in:$BOILERPLATE \ |
| 95 | x0vncserver/Makefile:x0vncserver/Makefile.in:$BOILERPLATE \ |
Peter Åstrand | 89d5c71 | 2004-11-16 13:15:54 +0000 | [diff] [blame] | 96 | vncviewer/Makefile:vncviewer_unix/Makefile.in:$BOILERPLATE \ |
| 97 | vncconfig/Makefile:vncconfig_unix/Makefile.in:$BOILERPLATE \ |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 98 | vncpasswd/Makefile:vncpasswd/Makefile.in:$BOILERPLATE \ |
| 99 | ) |