/[monit]/monit/configure.ac
ViewVC logotype

Diff of /monit/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by rory, Wed Aug 13 00:45:15 2003 UTC revision 1.38 by chopp, Wed Aug 13 22:18:42 2003 UTC
# Line 13  AC_INIT([monit], [4.0], [monit-general@n Line 13  AC_INIT([monit], [4.0], [monit-general@n
13  AC_REVISION([$Revision$])  AC_REVISION([$Revision$])
14  AC_CONFIG_SRCDIR([monitor.c])  AC_CONFIG_SRCDIR([monitor.c])
15    
16  # Check for programs  # ------------------------------------------------------------------------
17    # Programs
18    # ------------------------------------------------------------------------
19    
20  AC_PROG_CC  AC_PROG_CC
21  AC_PROG_GCC_TRADITIONAL  AC_PROG_GCC_TRADITIONAL
22  AC_PROG_INSTALL  AC_PROG_INSTALL
# Line 24  AC_PROG_LEX Line 27  AC_PROG_LEX
27          fi          fi
28  AC_PROG_YACC  AC_PROG_YACC
29    
30    # ------------------------------------------------------------------------
31    # Libraries
32    # ------------------------------------------------------------------------
33    
34  # Check for libraries  # Check for libraries
35  AC_CHECK_LIB([socket], [socket])  AC_CHECK_LIB([socket], [socket])
36  AC_CHECK_LIB([inet], [socket])  AC_CHECK_LIB([inet], [socket])
# Line 43  then Line 50  then
50          LIBS="$pthread_libs $LIBS"          LIBS="$pthread_libs $LIBS"
51  fi  fi
52    
53    # ------------------------------------------------------------------------
54    # Header files
55    # ------------------------------------------------------------------------
56    
57  # Checks for header files.  # Checks for header files.
58  AC_HEADER_STDC  AC_HEADER_STDC
59  AC_HEADER_SYS_WAIT  AC_HEADER_SYS_WAIT
60  AC_HEADER_STAT  AC_HEADER_STAT
61  AC_HEADER_TIME  AC_HEADER_TIME
62  AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h string.h strings.h sys/ioctl.h unistd.h sys/socket.h syslog.h sys/loadavg.h asm/param.h limits.h stropts.h getopt.h sys/filio.h string.h sys/time.h errno.h sys/vfs.h sys/statvfs.h mntent.h sys/mnttab.h sys/param.h sys/mount.h sys/types.h])  AC_CHECK_HEADERS([ \
63            arpa/inet.h \
64            asm/page.h \
65            asm/param.h \
66            ctype.h \
67            errno.h \
68            fcntl.h \
69            getopt.h \
70            glob.h \
71            grp.h \
72            limits.h \
73            limits.h \
74            loadavg.h \
75            locale.h \
76            machine/pmap.h \
77            machine/vmparam.h \
78            memory.h \
79            mntent.h \
80            netdb.h \
81            net/if.h \
82            netinet/in.h \
83            procfs.h \
84            procinfo.h \
85            pthread.h \
86            pwd.h \
87            setjmp.h \
88            signal.h \
89            stdarg.h \
90            stdio.h \
91            string.h \
92            string.h \
93            strings.h \
94            stropts.h \
95            sys/filio.h \
96            sys/ioctl.h \
97            sys/loadavg.h \
98            sys/lock.h \
99            sys/mnttab.h \
100            sys/mount.h \
101            sys/nlist.h \
102            sys/param.h \
103            sys/proc.h \
104            sys/pstat.h \
105            sys/resource.h \
106            sys/resourcevar.h \
107            sys/socket.h \
108            sys/statvfs.h \
109            sys/sysctl.h \
110            sys/time.h \
111            sys/types.h \
112            sys/un.h \
113            sys/user.h \
114            sys/vmmeter.h \
115            sys/vfs.h \
116            syslog.h \
117            unistd.h \
118            uvm/uvm.h \
119            uvm/uvm_object.h \
120            uvm/uvm_map.h \
121            uvm/uvm_pmap.h \
122            vm/pmap.h \
123            vm/vm.h \
124            vm/vm_object.h \
125            vm/vm_map.h \
126            ])
127    
128  # Check for types.  # Check for types.
129  AC_TYPE_MODE_T  AC_TYPE_MODE_T
# Line 61  AC_TYPE_SIGNAL Line 136  AC_TYPE_SIGNAL
136  AC_STRUCT_TM  AC_STRUCT_TM
137  AC_CHECK_MEMBERS([struct tm.tm_gmtoff])  AC_CHECK_MEMBERS([struct tm.tm_gmtoff])
138    
139    # ------------------------------------------------------------------------
140    # Compiler
141    # ------------------------------------------------------------------------
142    
143  # Compiler characteristics  # Compiler characteristics
144  AC_C_CONST  AC_C_CONST
145  AC_C_BIGENDIAN  AC_C_BIGENDIAN
# Line 80  fi Line 159  fi
159  AC_FUNC_ERROR_AT_LINE  AC_FUNC_ERROR_AT_LINE
160  AC_FUNC_FORK  AC_FUNC_FORK
161  AC_FUNC_MALLOC  AC_FUNC_MALLOC
162    AC_FUNC_GETLOADAVG
163  AC_FUNC_STAT  AC_FUNC_STAT
164  AC_FUNC_STRFTIME  AC_FUNC_STRFTIME
165  AC_CHECK_FUNCS(statfs)  AC_CHECK_FUNCS(statfs)
166  AC_CHECK_FUNCS(statvfs)  AC_CHECK_FUNCS(statvfs)
167    AC_CHECK_FUNCS(setlocale)
168    
169    # ------------------------------------------------------------------------
170    # Paths
171    # ------------------------------------------------------------------------
172    
173  # Find the right directory to put the root-mode PID file in  # Find the right directory to put the root-mode PID file in
174  AC_MSG_CHECKING([pid file location])  AC_MSG_CHECKING([pid file location])
# Line 107  elif test -f "/etc/mnttab"; then Line 192  elif test -f "/etc/mnttab"; then
192    AC_DEFINE([HAVE_MNTTAB], 1, [Define to 1 if you have /etc/mnttab])    AC_DEFINE([HAVE_MNTTAB], 1, [Define to 1 if you have /etc/mnttab])
193  fi  fi
194    
195    # ------------------------------------------------------------------------
196    # Architecture/OS detection
197    # ------------------------------------------------------------------------
198    
199  # Backward compatibility until we get ride of arch settings  # Backward compatibility until we get ride of arch settings
200  if test `uname` = "SunOS"  if test `uname` = "SunOS"
201  then  then
# Line 147  else Line 236  else
236  fi  fi
237  AC_SUBST(ARCH)  AC_SUBST(ARCH)
238    
239    # ------------------------------------------------------------------------
240    # Resource code
241    # ------------------------------------------------------------------------
242    
243  # Check if we want to have resource support  # Check if we want to have resource support
244  AC_MSG_CHECKING([for resource support])  AC_MSG_CHECKING([for resource support])
245  AC_ARG_WITH(resource,  AC_ARG_WITH(resource,
# Line 169  AC_ARG_WITH(resource, Line 262  AC_ARG_WITH(resource,
262  )  )
263    
264  # Settings for resource support  # Settings for resource support
265  if test "$use_resource"; then  if test "$use_resource" = 1; then
266          # Test for kvm libs          # Test for kvm libs
267          kvm_libs=""          kvm_libs=""
268          if test "$test_kvm"; then          if test "$test_kvm"; then
# Line 188  fi Line 281  fi
281    
282  AC_SUBST(PROCARCH)  AC_SUBST(PROCARCH)
283    
284  # Check for ssl (take from the stunnel project)  # ------------------------------------------------------------------------
285  checkssldir() { :  # SSL Code
286    # ------------------------------------------------------------------------
287    
288    # Check for ssl includes (take from the stunnel project)
289    checksslincldir() { :
290      if test -f "$1/include/openssl/ssl.h"; then      if test -f "$1/include/openssl/ssl.h"; then
291          AC_DEFINE([HAVE_OPENSSL], 1, [Define to 1 if you have openssl])          sslincldir="$1"
         ssldir="$1"  
292          return 0          return 0
293      fi      fi
294      if test -f "$1/include/ssl.h"; then      return 1
295          ssldir="$1"  }
296    
297    # Check for ssl libraries
298    checkssllibdir() { :
299        if test "(" -f "$1/libcrypto.so" -o -f "$1/libcrypto.a" ")"  -a \
300                "(" -f "$1/libssl.so"    -o -f "$1/libssl.a" ")" ; then
301            ssllibdir="$1"
302          return 0          return 0
303      fi      fi
304      return 1      return 1
# Line 219  AC_ARG_WITH(ssl, Line 321  AC_ARG_WITH(ssl,
321      ],      ],
322      [      [
323          use_ssl=1          use_ssl=1
324            AC_MSG_RESULT([enabled])
325      ]      ]
326  )  )
327    
328    
329  # Check for SSL directory (take from the stunnel project)  # Check for SSL directory (take from the stunnel project)
330  if test "$use_ssl" = "1"; then  if test "$use_ssl" = "1"; then
     AC_MSG_CHECKING([for SSL directory])  
331      AC_ARG_WITH(ssl-dir,      AC_ARG_WITH(ssl-dir,
332          [  --with-ssl-dir=DIR      location of installed SSL libraries/include files],          [  --with-ssl-dir=DIR       location of SSL installation],
333            [
334                dnl Check the specified location only
335    
336                checksslincldir "$withval"
337                checkssllibdir "$withval"
338            ]
339        )
340    
341        AC_MSG_CHECKING([for SSL include directory])
342    
343        AC_ARG_WITH(ssl-incl-dir,
344            [  --with-ssl-incl-dir=DIR  location of installed SSL include files],
345          [          [
346              dnl Check the specified location only              dnl Check the specified location only
347              checkssldir "$withval"              checksslincldir "$withval"
348          ],          ],
349          [          [
350              dnl Search default locations of SSL library              dnl Search default locations of SSL includes
351              for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do              for maindir in /usr /usr/local /usr/lib /usr/pkg /var /opt; do
352                  for dir in $maindir $maindir/openssl $maindir/ssl; do                  for dir in $maindir $maindir/openssl $maindir/ssl; do
353                      checkssldir $dir && break 2                      checksslincldir $dir && break 2
354                    done
355                done
356            ]
357        )
358    
359        if test -z "$sslincldir"; then
360            AC_MSG_RESULT([Not found])
361            echo
362            echo "Couldn't find your SSL header files."
363            echo "Use --with-ssl-incl-dir option to fix this problem or disable"
364            echo "the SSL support with --without-ssl"
365            echo
366            exit 1
367        fi
368    
369        AC_MSG_RESULT([$sslincldir])
370    
371        AC_MSG_CHECKING([for SSL library directory])
372    
373        AC_ARG_WITH(ssl-lib-dir,
374            [  --with-ssl-lib-dir=DIR   location of installed SSL library files],
375            [
376                dnl Check the specified location only
377                checkssllibdir "$withval"
378            ],
379            [
380                dnl Search default locations of SSL libraries
381                for maindir in /usr /usr/local /usr/pkg /var /opt; do
382                    for dir in $maindir $maindir/openssl $maindir/ssl \
383                               $maindir/lib $maindir/lib/openssl \
384                               $maindir/lib/ssl; do
385                        checkssllibdir $dir && break 2
386                  done                  done
387              done              done
388          ]          ]
389      )      )
390            
391      if test -z "$ssldir"; then  
392        if test -z "$ssllibdir"; then
393          AC_MSG_RESULT([Not found])          AC_MSG_RESULT([Not found])
394          echo          echo
395          echo "Couldn't find your SSL library installation dir."          echo "Couldn't find your SSL library files."
396          echo "Use --with-ssl-dir option to fix this problem or disable the"          echo "Use --with-ssl-lib-dir option to fix this problem or disable the"
397          echo "SSL support with --without-ssl"          echo "SSL support with --without-ssl"
398          echo          echo
399          exit 1          exit 1
400      fi      fi
401      AC_MSG_RESULT([$ssldir])      
402      AC_SUBST(ssldir)      AC_MSG_RESULT([$ssllibdir])
 fi  
403    
404  #AC_DEFINE_UNQUOTED([ssldir], "$ssldir")      AC_DEFINE([HAVE_OPENSSL], 1, [Define to 1 if you have openssl])
405        AC_SUBST(sslincldir)
406        AC_SUBST(ssllibdir)
407    fi
408    
409  # Add SSL includes and libraries  # Add SSL includes and libraries
410  if test "$ssldir"  if test "$sslincldir" -a "$ssllibdir"
411  then  then
412      CFLAGS="$CFLAGS -I$ssldir/include"      CFLAGS="$CFLAGS -I$sslincldir/include"
413      LIBS="$LIBS -L$ssldir/lib -lssl -lcrypto"        LIBS="$LIBS -L$ssllibdir -lssl -lcrypto"    
414      # Redhat 9 compilation fix:      # Redhat 9 compilation fix:
415      if test -f "/usr/kerberos/include/krb5.h"      if test -f "/usr/kerberos/include/krb5.h"
416      then      then
# Line 269  then Line 418  then
418      fi      fi
419  fi  fi
420    
421    # ------------------------------------------------------------------------
422  # Outputs  # Outputs
423    # ------------------------------------------------------------------------
424    
425  AC_CONFIG_HEADER([config.h])  AC_CONFIG_HEADER([config.h])
426  AC_CONFIG_FILES([Makefile])  AC_CONFIG_FILES([Makefile])
427  AC_OUTPUT  AC_OUTPUT
# Line 280  echo "monit has been configured with the Line 432  echo "monit has been configured with the
432  echo "                Architecture: ${ARCH}"  echo "                Architecture: ${ARCH}"
433  if test "$use_ssl" = "1"; then  if test "$use_ssl" = "1"; then
434      echo "                 SSL support: enabled"      echo "                 SSL support: enabled"
435      echo "               SSL directory: ${ssldir}"      echo "       SSL include directory: ${sslincldir}/include/openssl"
436        echo "       SSL library directory: ${ssllibdir}"
437  else  else
438      echo "                 SSL support: disabled"      echo "                 SSL support: disabled"
439  fi  fi
440  if test "$use_resource" = "1"; then  if test "$use_resource" = "1"; then
441      echo "         resource monitoring: enabled"        echo "         resource monitoring: enabled"  
     echo "               resource code: sysdep_$ARCH.c"  
442  else  else
443      echo "         resource monitoring: disabled"      echo "         resource monitoring: disabled"
     echo "               resource code: sysdep_UNKNOWN.c"  
444  fi  fi
445    echo "               resource code: sysdep_$PROCARCH.c"
446  echo "              Compiler flags: ${CFLAGS}"  echo "              Compiler flags: ${CFLAGS}"
447  echo "                Linker flags: ${LIBS}"  echo "                Linker flags: ${LIBS}"
448  echo "           pid file location: ${piddir}"  echo "           pid file location: ${piddir}"

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26