File: configure.in

package info (click to toggle)
scotty 2.1.9-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 9,984 kB
  • ctags: 4,313
  • sloc: ansic: 35,946; sh: 12,591; tcl: 8,122; yacc: 2,442; makefile: 898; lex: 370
file content (74 lines) | stat: -rwxr-xr-x 2,808 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
dnl	This file is an input file used by the GNU "autoconf" program to
dnl	generate the file "configure", which is run during installation
dnl	to configure the system for the local environment.
AC_INIT(ntping.c)

#----------------------------------------------------------------------------
#       Check if we should use gcc if available on this machine.
#----------------------------------------------------------------------------

AC_ARG_WITH(gcc, [  --with-gcc              use gcc for compilation],
	use_gcc=1)
if test -z "$use_gcc" ; then
    CC=${CC-cc}
else
    AC_PROG_CC
    if test "$CC" = "gcc" ; then
	CC="gcc -Wall"
    fi
fi
AC_SUBST(CC)
AC_PROG_CPP
AC_PREFIX_PROGRAM(ntping)
AC_C_BIGENDIAN

#--------------------------------------------------------------------
#       Check for the existence of various libraries.  The order here
#       is important, so that then end up in the right order in the
#       command line generated by make.  The -lsocket and -lnsl libraries
#       require a couple of special tricks:
#       1. Only use these libraries if they supply procedures that aren't
#          already present in the normal libraries.  This is because
#          IRIX 5.2 has libraries, but they aren't needed and they're
#          bogus:  they goof up name resolution if used.
#       2. On some SVR4 systems, can't use -lsocket without -lnsl too.
#          To get around this problem, first check for both libraries
#          together, and use them both if they're both needed.  If that
#          isn't the case, then check for them individually.
#--------------------------------------------------------------------

tk_both=1
AC_CHECK_FUNC(connect, tk_both=0)
AC_CHECK_FUNC(gethostbyname, tk_both=0)
tk_oldLibs=$LIBS
LIBS="$LIBS -lsocket"
AC_CHECK_LIB(nsl, main, , tk_both=0)
LIBS=$tk_oldLibs
if test "$tk_both" = 1; then
    echo "need -lsocket and -lnsl together"
    LIBS="$LIBS -lsocket -lnsl"
else
    AC_CHECK_LIB(socket, connect, [LIBS="$LIBS -lsocket"])
    AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])
fi

#----------------------------------------------------------------------------
#       Check to use dbmalloc (optional and only recommended for debugging)
#               --with-dbmalloc
#----------------------------------------------------------------------------

AC_ARG_WITH(dbmalloc, [  --with-dbmalloc         use dbmalloc library], 
	dm=1, dm=0)
if test $dm = 1 ; then
    AC_DEFINE(DBMALLOC)
    DBMALLOC_LIB="-ldbmalloc"
fi
AC_SUBST(DBMALLOC_LIB)

#----------------------------------------------------------------------------
#	Checks for various include files missing on some machines.
#----------------------------------------------------------------------------

AC_CHECK_HEADERS(stdlib.h unistd.h malloc.h sys/select.h)

AC_OUTPUT(Makefile)