forked from okbob/pspg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
104 lines (81 loc) · 2.47 KB
/
configure.ac
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
AC_PREREQ([2.70])
AC_INIT([pspg],[0],[pavel.stehule@gmail.com],[pspg])
AC_LANG([C])
AC_CONFIG_SRCDIR(src)
dnl Document where we keep our .m4 file.
AC_CONFIG_MACRO_DIR([tools])
dnl Make sure aclocal actually found it!
m4_pattern_forbid([^AX_])
AC_PROG_CC
AC_CHECK_INCLUDES_DEFAULT
AC_PROG_EGREP
AC_HEADER_TIOCGWINSZ
AX_DEBUG_CFLAGS
AX_WITH_CURSES
AX_WITH_CURSES_PANEL
AX_LIB_READLINE
AX_LIB_POSTGRESQL([],[], AC_MSG_NOTICE([PostgreSQL library not found]))
case "$ax_cv_ncurses" in "no")
AC_MSG_ERROR([ncurses not found])
esac
case "$ax_cv_ncursesw" in "no")
AC_MSG_WARN([The found ncurses library does not support wide-char.])
AC_MSG_WARN([This means that pspg will not correctly render UTF-8.])
esac
AC_CHECK_LIB([m],[roundl])
AC_SEARCH_LIBS([clock_gettime], [rt posix4],
[],
[AC_MSG_ERROR([Function clock_gettime not available.])]
)
AC_SUBST(enable_debug)
AC_SUBST(CURSES_LIBS)
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LDFLAGS)
AC_SUBST(COMPILE_MENU)
AC_SUBST(POSTGRESQL_CFLAGS)
AC_SUBST(POSTGRESQL_LDFLAGS)
AC_SUBST([POSTGRESQL_VERSION])
AC_SUBST([POSTGRESQL_CPPFLAGS])
AC_SUBST([POSTGRESQL_LDFLAGS])
AC_SUBST([POSTGRESQL_LIBS])
AC_CONFIG_FILES([config.make])
AC_ARG_WITH([menu],
AS_HELP_STRING([--without-menu]),
[compile_menu=no],
[compile_menu=yes])
if test "x$compile_menu" != "xyes"; then
COMPILE_MENU=0
else
if test "$ax_cv_panel" != yes; then
AC_MSG_ERROR([ncurses panel library not found])
fi
AC_MSG_NOTICE([pspg will be compiled with menu])
CFLAGS="$CFLAGS -DCOMPILE_MENU"
COMPILE_MENU=1
fi
# supply -g if --enable-debug
if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g"
fi
AC_CHECK_HEADERS([sys/inotify.h], have_inotify=yes, have_inotify=no)
AC_ARG_WITH([inotify],
[AS_HELP_STRING([--without-inotify],
[(Linux only) do not build with inotify support (default is yes)])],
[with_inotify=no],
[with_inotify=yes])
if test "x$have_inotify" = "xyes"; then
if test "x$with_inotify" != "xyes"; then
have_inotify=no
else
AC_DEFINE(HAVE_INOTIFY, 1, [Define if you have inotify support (linux only)])
fi
fi
AC_CHECK_HEADERS([sys/event.h], have_kqueue=yes, have_kqueue=no)
if test "x$have_kqueue" = "xyes"; then
AC_CHECK_FUNCS(kqueue, have_kqueue=yes, have_kqueue=no)
if test "x$have_kqueue" = "xyes"; then
AC_DEFINE(HAVE_KQUEUE, 1, [Define if you have kqueue support (BSD only)])
fi
fi
AC_CHECK_HEADERS([sys/utsname.h])
AC_OUTPUT