[go: up one dir, main page]

File: configure.ac

package info (click to toggle)
lwatch 0.4.1-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 716 kB
  • ctags: 346
  • sloc: sh: 3,376; ansic: 912; lex: 312; makefile: 97
file content (178 lines) | stat: -rw-r--r-- 5,213 bytes parent folder | download | duplicates (2)
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# autoconf source file
# $Id: configure.ac,v 1.48 2004/08/14 19:01:05 arturcz Exp $
# $Source: /cvsroot/lwatch/files/configure.ac,v $

#Initializing
AC_PREREQ(2.57)
AC_INIT([lwatch], [0.4.1])
AC_REVISION($Revision: 1.48 $)
AC_CONFIG_SRCDIR(src/lwatch.c)

AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE([dist-bzip2])

CFLAGS="-Wall ${CFLAGS}"

dnl if test "$cache_file" = /dev/null; then
dnl         cache_file="config.cache"
dnl fi
dnl AC_CACHE_LOAD

AC_PREFIX_DEFAULT(/usr/local)
test x"$prefix" = xNONE && prefix="$ac_default_prefix"

AM_CONFIG_HEADER(src/config.h)

AH_TEMPLATE([DEBUG],
	[Define to 1 if you want to compile with debug support.])

AH_TEMPLATE([SYSCONFDIR],
	[Directory where configuration file is placed])

AH_TEMPLATE([INPUTFILE],
	[Default input file])

AH_TEMPLATE([RESIZE],
	[Define to 1 if you want to compile with resize support.])

AC_MSG_CHECKING(for platform dependent directories)
case $target in
    *-*-*bsd*)
        CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
	LDFLAGS="${LDFLAGS} -L/usr/local/lib"
	AC_MSG_RESULT(add /usr/local)
	;;
    *)
    	AC_MSG_RESULT(none)
	;;
esac

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_LEX
AC_PATH_PROG(SED,[sed],[no])
if test "$SED" = "no"; then
    AC_MSG_ERROR([sed not found])
fi

dnl AC_PATH_PROG(dbook2man,[docbook-to-man],[no])
dnl if test "$dbook2man" = "no"; then
dnl     unset ac_cv_path_dbook2man
dnl     AC_PATH_PROG(dbook2man,[docbook2man],[no])
dnl     if test "$dbook2man" = "no"; then
dnl         AC_MSG_WARN([docbook-to-man not found, using lwatch.1.in stub])
dnl     else
dnl         dbook2man_out=""
dnl         dbook2man_out_in="&& mv -f lwatch.1 lwatch.1.in"
dnl 	AC_MSG_WARN([you could have bad formatted manual page, see README for details])
dnl 	sleep 5
dnl     fi
dnl else
dnl   dbook2man_out="> lwatch.1"
dnl   dbook2man_out_in="> lwatch.1.in"
dnl fi
dnl AC_SUBST(dbook2man_out)
dnl AC_SUBST(dbook2man_out_in)
dnl if test "$dbook2man" != "no"; then
dnl   AC_MSG_NOTICE([sgml->man: ${dbook2man} lwatch.sgml ${dbook2man_out}])
dnl fi

AC_PATH_PROG(dbook2man,[docbook-to-man],[no])
if test "$dbook2man" = "no"; then
    AC_MSG_WARN([docbook-to-man not found, using lwatch.1.in stub if possible])
else
    dbook2man_out=">"
fi
AC_SUBST(dbook2man_out)
if test "$dbook2man" != "no"; then
    AC_MSG_NOTICE([sgml->man: ${dbook2man} file.sgml ${dbook2man_out} file.man])
fi


AC_MSG_CHECKING(for directory with libpcre)
AC_ARG_WITH(libpcre,AC_HELP_STRING([--with-libpcre=DIR],[directory with libpcre]),,[withval="yes"])
if test "$withval" = "no"; then
    AC_MSG_RESULT(no)
    AC_MSG_ERROR([Hey! We _want_ to use libpcre!])
else
    if test "$withval" = "yes"; then
        AC_MSG_RESULT(yes)
    else 
        AC_MSG_RESULT([yes, $withval])
	AC_CHECK_FILE($withval/include,CPPFLAGS="${CPPFLAGS} -I${withval}/include",AC_MSG_ERROR([$withval/include does not exist]))
	AC_CHECK_FILE($withval/lib,LDFLAGS="${LDFLAGS} -L${withval}/lib",AC_MSG_ERROR([$withval/lib does not exist]))
    fi
fi

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h fcntl.h getopt.h pcre.h signal.h stdarg.h stddef.h stdio.h stdlib.h string.h sys/param.h sys/poll.h sys/stat.h sys/types.h unistd.h])

dnl Checks for libraries.
AC_CHECK_LIB([pcre], [pcre_version],, AC_MSG_ERROR([Error: libpcre not installed. Install first. ]))

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

dnl Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([memset strcasecmp strchr])

AC_CHECK_FUNC([getopt_long])
if test "$ac_cv_func_getopt_long" = "no"; then
  AC_CHECK_LIB([gnugetopt],[getopt_long],LIBS="${LIBS} -lgnugetopt",AC_MSG_ERROR([Error: getopt_long unavailable]))
fi

dnl Define autoheader templates
dnl Checks for user options
AC_MSG_CHECKING(for compile with diagnostic messages)
AC_ARG_ENABLE(debug,
	AC_HELP_STRING([--enable-debug],[Compile with diagnostic messages]), ,
	[enable_debug="no"])
AC_MSG_RESULT($enable_debug)
if test "$enable_debug" = "yes"; then
    AC_DEFINE(DEBUG)
fi

AC_MSG_CHECKING(for compile with terminal resizing support)
AC_ARG_ENABLE(resize,
	AC_HELP_STRING([--enable-resize],[Compile with terminal resizing support (broken, use on your own risk)]), ,
	[enable_resize="no"])
AC_MSG_RESULT($enable_resize)
if test "$enable_resize" = "yes"; then
    AC_DEFINE(RESIZE)
dnl    LDFLAGS="${LDFLAGS} -lcurses"
fi


arc_sysconfdir=`eval echo $sysconfdir`
AC_DEFINE_UNQUOTED(SYSCONFDIR,"$arc_sysconfdir")

AM_CONDITIONAL(HAVE_D2M, test "$dbook2man" != "no")

arc_localstatedir=`eval echo $localstatedir`
AC_MSG_CHECKING(for default input file)
AC_ARG_ENABLE(input,
	AC_HELP_STRING([--enable-input=file],[Specify default input file other than ${localstatedir}/lib/syslog.fifo]), ,[enable_input="yes"])
if test "$enable_input" = "no"; then
  enable_input=${arc_localstatedir}/lib/syslog.fifo
fi
if test "$enable_input" = "yes"; then
  enable_input=${arc_localstatedir}/lib/syslog.fifo
fi
AC_MSG_RESULT($enable_input);
INPUTFILE=$enable_input
AC_SUBST(INPUTFILE)
AC_DEFINE_UNQUOTED(INPUTFILE,"${INPUTFILE}")

dnl Epilog
AC_CONFIG_FILES([src/Makefile doc/Makefile Makefile])
AC_OUTPUT