1dnl Process this file with autoconf to produce a configure script. 2AC_INIT([viewglob], [2.0.4]) 3AM_INIT_AUTOMAKE 4AM_CONFIG_HEADER([config.h]) 5RELEASE_DATE="April 26, 2006" 6 7AC_DEFINE_UNQUOTED([VG_RELEASE_DATE], ["$RELEASE_DATE"] , [Date of release]) 8 9CFLAGS="$CFLAGS -Wall" 10if test x"$USE_MAINTAINER_MODE" = xyes; then 11 CFLAGS="$CFLAGS -g3" 12fi 13 14dnl Optionally build only vgseer (and the other programs it needs). 15VGSEER_ONLY= 16AC_ARG_ENABLE(vgseer-only, 17 [AC_HELP_STRING( 18 [--enable-vgseer-only], 19 [Only build and install the client side of Viewglob])], 20 [VGSEER_ONLY=yep], [VGSEER_ONLY=nope]) 21AM_CONDITIONAL([FULL_BUILD], [test "$VGSEER_ONLY" = nope]) 22 23dnl Checks for programs. 24AC_PROG_CC 25AC_PROG_INSTALL 26 27dnl Checks for header files. 28AC_HEADER_STDC 29AC_HEADER_DIRENT 30AC_HEADER_SYS_WAIT 31AC_HEADER_TIOCGWINSZ 32AC_HEADER_TIME 33AC_CHECK_HEADERS([sys/time.h time.h sys/select.h]) 34AC_CHECK_HEADERS([ \ 35 fnmatch.h sys/un.h \ 36 fcntl.h errno.h stdlib.h \ 37 string.h sys/ioctl.h termios.h \ 38 unistd.h stdlib.h arpa/inet.h \ 39 netdb.h netinet/in.h sys/socket.h],, 40 AC_MSG_ERROR([Required header missing!])) 41 42dnl Checks for typedefs, structures, and compiler characteristics. 43AC_C_CONST 44AC_C_INLINE 45AC_TYPE_SIZE_T 46AC_TYPE_MODE_T 47AC_TYPE_PID_T 48AC_TYPE_SIGNAL 49AC_CHECK_TYPES([ptrdiff_t],,,) 50 51dnl Checks for functions. 52AC_FUNC_CLOSEDIR_VOID 53AC_PROG_GCC_TRADITIONAL 54AC_CHECK_FUNCS([ \ 55 stat lstat \ 56 dup2 getcwd memmove \ 57 memset pathconf select \ 58 strchr setsid socket \ 59 bind listen accept \ 60 connect setsockopt],, 61 AC_MSG_ERROR([Required function missing!])) 62 63dnl Determine whether to use getaddrinfo or gethostbyname and inet_aton. 64AC_CHECK_FUNCS([getaddrinfo],, 65 [AC_CHECK_FUNCS([gethostbyname inet_aton],, 66 [AC_MSG_ERROR([Socket interface is incomplete!])])]) 67 68dnl Determine necessary libraries for sockets. 69LIB_SOCKET_NSL 70TYPE_SOCKLEN_T 71 72AM_PATH_GLIB_2_0(2.2.0,, 73 AC_MSG_ERROR(GLib 2.2.0+ is required to build Viewglob)) 74 75dnl Test for bash. 76AC_PATH_PROG(BASH_FULL_PATH, bash, nope) 77if test "x$BASH_FULL_PATH" = xnope; then 78 AC_MSG_ERROR([Viewglob requires bash]) 79fi 80AC_SUBST(BASH_FULL_PATH) 81 82dnl Test for sed. 83AC_CHECK_PROGS(SED,[sed],no) 84if test "$SED" = "no"; then 85 AC_MSG_ERROR([Viewglob installation requires sed]) 86fi 87 88dnl ===================================================================== 89dnl The following is for pty stuff and is taken from rxvt 2.7.10. 90dnl ===================================================================== 91 92AC_CHECK_FUNCS([setpgid setpgrp isastream getpt grantpt unlockpt]) 93AC_FUNC_GETPGRP 94AC_FUNC_SETPGRP 95 96AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt, 97[AC_TRY_LINK([#define _GNU_SOURCE 98#ifdef HAVE_STDLIB_H 99# include <stdlib.h> 100#endif], 101 [(void)getpt();], 102 rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)]) 103if test x$rxvt_cv_func_getpt = xyes; then 104 AC_DEFINE(HAVE_GETPT, 1, Define if you have _GNU_SOURCE getpt() ) 105fi 106 107dnl# if we don't guess right then it's up to the user 108AC_CACHE_CHECK(for pty/tty type, rxvt_cv_ptys, 109[if test x$ac_cv_func_openpty = xyes; then 110 rxvt_cv_ptys=OPENPTY 111 else if test x$ac_cv_func__getpty = xyes; then 112 rxvt_cv_ptys=SGI4 113 else if test -c /dev/ttyp20; then 114 rxvt_cv_ptys=SCO 115 else if test -c /dev/ptym/clone; then 116 rxvt_cv_ptys=HPUX 117 else if test x$rxvt_cv_func_getpt = xyes; then 118 rxvt_cv_ptys=GLIBC 119 else if test -c /dev/ptc -a -c /dev/pts; then 120 rxvt_cv_ptys=PTC 121 else if test -c /dev/ptc -a -d /dev/pts; then 122 rxvt_cv_ptys=PTC 123 else if test -c /dev/ptmx -a -c /dev/pts/0; then 124 rxvt_cv_ptys=STREAMS 125 else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then 126dnl# catch CYGWIN 127 rxvt_cv_ptys=STREAMS 128 else 129 rxvt_cv_ptys=BSD 130fi 131fi 132fi 133fi 134fi 135fi 136fi 137fi 138fi 139]) 140 141if test x$rxvt_cv_ptys = xOPENPTY; then 142 AC_DEFINE(PTYS_ARE_OPENPTY, 1, Define for this pty type) 143fi 144if test x$rxvt_cv_ptys = xSCO; then 145 AC_DEFINE(PTYS_ARE_NUMERIC, 1, Define for this pty type) 146fi 147if test x$rxvt_cv_ptys = xSTREAMS; then 148 AC_DEFINE(PTYS_ARE_PTMX, 1, Define for this pty type) 149fi 150if test x$rxvt_cv_ptys = xPTC; then 151 AC_DEFINE(PTYS_ARE_PTC, 1, Define for this pty type) 152fi 153if test x$rxvt_cv_ptys = xSGI4; then 154 AC_DEFINE(PTYS_ARE__GETPTY, 1, Define for this pty type) 155fi 156if test x$rxvt_cv_ptys = xCONVEX; then 157 AC_DEFINE(PTYS_ARE_GETPTY, 1, Define for this pty type) 158fi 159if test x$rxvt_cv_ptys = xGLIBC; then 160 AC_DEFINE(PTYS_ARE_GETPT, 1, Define for this pty type) 161fi 162if test x$rxvt_cv_ptys = xHPUX; then 163 AC_DEFINE(PTYS_ARE_CLONE, 1, Define for this pty type) 164fi 165if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then 166 AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type) 167fi 168 169AC_CHECKING(for pty ranges) 170ptys=`echo /dev/pty??` 171pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` 172pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` 173if test x$pch1 != x; then 174 AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX) 175fi 176if test x$pch2 != x; then 177 AC_DEFINE_UNQUOTED(PTYCHAR2, "$pch2", Define for second char in devptyXX) 178fi 179 180dnl ===================================================================== 181dnl End of pty stuff. 182dnl ===================================================================== 183 184dnl Output release stuff so the shell scripts can get to it. 185AC_SUBST(PACKAGE_NAME) 186AC_SUBST(PACKAGE_VERSION) 187AC_SUBST(RELEASE_DATE) 188 189if test "$VGSEER_ONLY" = nope; then 190 191 dnl This stuff is specific to vgd and the displays. 192 193 AC_CHECK_HEADERS([syslog.h],, 194 AC_MSG_ERROR([Required header missing!])) 195 AC_CHECK_FUNCS([strtoul],, 196 AC_MSG_ERROR([Required function missing!])) 197 198 dnl For advanced Xlib stuff 199 AC_PATH_XTRA 200 201 dnl The displays require GTK+ 2.4.0. 202 AM_PATH_GTK_2_0(2.4.0,, 203 AC_MSG_ERROR(GTK+ 2.4.0+ is required to build Viewglob)) 204fi 205 206AC_CONFIG_FILES([ \ 207 Makefile vgseer/Makefile vgd/Makefile \ 208 vgdisplay/Makefile vgexpand/Makefile vgping/Makefile \ 209 shell/Makefile common/Makefile]) 210 211AC_OUTPUT 212 213