[go: up one dir, main page]

File: configure.in

package info (click to toggle)
scli 0.3.1-3.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,872 kB
  • ctags: 8,627
  • sloc: ansic: 32,657; sh: 7,388; makefile: 321
file content (134 lines) | stat: -rw-r--r-- 3,331 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
dnl Process this file with autoconf to produce a configure script.

AC_INIT(scli/scli.h)
dnl Every other copy of the package version number gets its value from here
AM_INIT_AUTOMAKE(scli, 0.3.1)

dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
AM_CONFIG_HEADER(config.h)

AC_SUBST(VERSION)
AC_SUBST(PACKAGE_VERSION)

ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)

AC_CANONICAL_HOST

dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_RANLIB
AC_CHECK_PROG(SMIDUMP, smidump, smidump)
AC_SUBST(SMIDUMP)

AC_DEFINE_UNQUOTED(SCLI_PLUGIN_PATH, "${pkglibdir}")

AC_MSG_CHECKING([whether to enable -Wall])
AC_ARG_ENABLE(warnings,
[  --enable-warnings       Enable -Wall if using gcc.],
[ if test -n "$GCC"; then 
    AC_MSG_RESULT(adding -Wall to CFLAGS.)
    CFLAGS="$CFLAGS -Wall"
  fi],AC_MSG_RESULT(no))


dnl Checks for libraries.

AM_PATH_GLIB_2_0(2.0.0, [], AC_MSG_ERROR(scli needs GLIB), gmodule)
AM_PATH_GNET_2_0(2.0.0, [], AC_MSG_ERROR(scli needs GNET))
dnl AM_PATH_GLIB(1.2.0, [], AC_MSG_ERROR(scli needs GLIB), gmodule)
dnl AM_PATH_GTK(1.2.0, [], AC_MSG_ERROR(scli needs GTK))
AM_PATH_XML2(2.0.0, [], AC_MSG_ERROR(scli needs libxml2))
PKG_CHECK_MODULES(GSNMP, gsnmp, have_gsnmp=true, have_gsnmp=false)
AC_SUBST(GSNMP_CFLAGS)
AC_SUBST(GSNMP_LIBS)
AC_CHECK_LIB(ncurses, initscr, [],
  AC_CHECK_LIB(curses, initscr, [],
    AC_MSG_ERROR([scli requires curses functions; install curses first])
  )
)
AC_CHECK_LIB(readline, readline, [],
  AC_MSG_ERROR([scli requires readline functions; install libreadline first])
)

dnl Checks for header files.

AC_HEADER_STDC

AC_CHECK_HEADERS(unistd.h sys/ioctl.h sys/time.h termios.h ncurses.h)

dnl Darwin needs sys/socket.h before net/if.h

AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([net/if.h], [], [AC_MSG_WARN(Problems including net/if.h)],
[
#include <stdio.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
])

dnl as well as net/if.h, netbsd needs netinet/in.h if we're going to use netinet/if_ether.h

AC_CHECK_HEADERS([netinet/in.h])

AC_CHECK_HEADERS([netinet/if_ether.h], [], [AC_MSG_WARN(Problems including netinet/if_ether.h)],
[
#include <stdio.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#if HAVE_NET_IF_H
# include <net/if.h>
#endif
#if HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
])

dnl AC_EGREP_HEADER(TIOCGWINSZ,sys/ioctl.h,AC_DEFINE(HAVE_TIOCGWINSZ))

dnl Checks for typedefs, structures, and compiler characteristics.

dnl defines HAVE_TM_ZONE if struct tm has tm_zone
AC_STRUCT_TIMEZONE

dnl Checks for library functions.

AC_CHECK_FUNC(gethostbyname, [], AC_CHECK_LIB(nsl, gethostbyname))

AC_CHECK_FUNC(connect, [], AC_CHECK_LIB(socket, connect))

AC_CHECK_FUNCS(resizeterm getaddrinfo ether_ntohost)
AC_CHECK_FUNCS(rl_completion_matches)

dnl Check for configure options

AC_ARG_ENABLE(dmalloc,
[  --enable-dmalloc        enable dmalloc debugging (www.dmalloc.com)],
 [
  AC_CHECK_HEADERS(dmalloc.h)
  AC_CHECK_LIB(dmalloc, malloc) 
 ]
)

dnl Create all the Makefiles we need and we are done.

AC_OUTPUT(Makefile stub/Makefile proc/Makefile scli/Makefile doc/Makefile)