File: configure.in

package info (click to toggle)
slmon 0.5.13-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 504 kB
  • ctags: 210
  • sloc: sh: 2,883; ansic: 1,800; makefile: 60
file content (107 lines) | stat: -rw-r--r-- 2,520 bytes parent folder | download | duplicates (3)
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(slmon.c)

dnl AC_MSG_WARN([
dnl ********************************************************
dnl * The configure script in this release may be broken.  *
dnl * In case of any problems either wait for next version *
dnl * or try to compile manualy.                           *
dnl ********************************************************
dnl ])
AM_INIT_AUTOMAKE(slmon, 0.5.13)

AM_MAINTAINER_MODE
dnl AM_ACLOCAL_INCLUDE(macros)

dnl Checks for programs.
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_INSTALL
AC_PROG_LN_S

AC_ARG_WITH(libgtop,
	[  --with-libgtop          build with libgtop support (default=yes)],
	, with_gtop="yes"
)

AC_ARG_ENABLE(debug,
	[  --enable-debug          compile with debugging information],
	if test x$enableval = xyes
	then
		use_cc_g_flag=yes
	fi
)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/file.h unistd.h)

dnl Manual check for LibGTop, so we don't depend on gnome.

AC_CHECK_PROG(pkgconfig, pkg-config, "yes", "no")
AC_CHECK_PROG(libgtopconfig, libgtop-config, "yes", "no")

AC_MSG_CHECKING("looking for LibGTop")
if test x$pkgconfig = xyes
then
	dnl found pkg-config so maybe libgtop2 is installed
	pkg-config --exists libgtop-2.0
	if test ! $? -eq 0
	then
		pkgconfig="no"
	else
		AC_MSG_RESULT("found version 2")
		LIBGTOPLIBS=`pkg-config libgtop-2.0 --libs | tr '\n' ' '`
		AC_SUBST(LIBGTOPLIBS)
		INCLUDES=`pkg-config libgtop-2.0 --cflags | tr '\n' ' '`
		AC_SUBST(INCLUDES)
		
	fi
fi

if test x$libgtopconfig = xyes -a x$pkgconfig = xno
then
	AC_MSG_RESULT("found version 1")
	LIBGTOPLIBS=`libgtop-config --libs | tr '\n' ' '`
	AC_SUBST(LIBGTOPLIBS)
	INCLUDES=`libgtop-config --cflags`
	AC_SUBST(INCLUDES)
fi

if test x$pkgconfig = xno -a x$libgtopconfig = xno
then
	AC_MSG_RESULT("found version 99")
fi

AC_CHECK_LIB(slang, SLang_init_tty, slang_found="yes")
if test x$slang_found = xyes
then
	AC_CHECK_HEADERS(slang.h, slang_h_found="yes")
fi
if test x$slang_h_found = xyes
then
	LIBS="$LIBS -lslang"
	AC_DEFINE(HAVE_SLANG)
else
	AC_CHECK_HEADERS(slang/slang.h, slang_h_found="yes")
	if test x$slang_h_found = xyes
	then
		AC_DEFINE(HAVE_SLANG)
		LIBS="$LIBS -lslang"
	else
		AC_MSG_WARN("Slang not found")
	fi
fi

AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG))

dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TM

dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNC(setutent, AC_DEFINE(HAVE_UTMP))
AC_CHECK_FUNCS(uname)

AC_OUTPUT([Makefile])