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
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(libstroke/stroke.c)
dnl Initialize automake stuff
PACKAGE=libstroke
dnl version
LIBSTROKE_VERSION=0.5
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $LIBSTROKE_VERSION, no-define)
dnl Create a configuration header
AM_CONFIG_HEADER(config.h)
dnl Build time sanity check...
AM_SANITY_CHECK
dnl Initialize libtool
AM_PROG_LIBTOOL
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
dnl Checks for header files.
AC_PATH_X
AC_PATH_XTRA
CFLAGS="$X_CFLAGS $CFLAGS"
LDFLAGS="$X_LDFLAGS $X_LIBS $LDFLAGS"
X_EXTRA_LIBS="$X_EXTRA_LIBS -lX11 -lm"
dnl Check for X libraries.
AC_CHECK_LIB(X11, XOpenDisplay, X11LIB="-lX11", X11LIB=no, $X_EXTRA_LIBS)
if test "$X11LIB" = no; then
AC_MSG_ERROR(Cannot find -lX11 library)
fi
dnl What I really want to do is this:
dnl AC_CHECK_LIB(,fabs,,,m)
dnl Check and see if fabs is available w/o linking libm. If not, check if
dnl it is available with libm, and if so, add -lm to the LIBS.
dnl But this check fails hard. ;-)
dnl So I do this instead, which I hope will help Tru64 UN*X
AC_CHECK_LIB(m,fabs)
AC_ARG_ENABLE(use_tcl,
[ --enable-tcl Compile the tcl bindings],
[case "${enableval}" in
yes) use_tcl=true ;;
no) use_tcl=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tcl) ;;
esac],[use_tcl=false])
AM_CONDITIONAL(ENABLE_TCL, test x$use_tcl = xtrue)
dnl AC_PATH_PROG(ENABLE_TCL, $with_tcl, "foobaz")
dnl AC_SUBST(ENABLE_TCL)
dnl build this variable from the pieces
X_LDFLAGS="${X_LIBS} ${X11LIB}"
dnl How to use this macro?
dnl AM_PATH_GLIB
CFLAGS=$saved_cflags
LDFLAGS=$saved_ldflags
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
AC_ARG_WITH(mouse-footprints,
[ --with-mouse-footprints Draw mouse footprints in X],
[AC_DEFINE(STROKE_MOUSE_FOOTPRINTS)])
dnl check for GTK
dnl we won't build libgstroke if it's not found
AC_MSG_CHECKING(gtk+ library)
AM_PATH_GTK(1.2.7, HAVE_LIBGTK=yes
AC_DEFINE(HAVE_LIBGTK, 1, [Define if libgtk is available]),
AC_MSG_WARN(
***** NOTE: The GNOME stroke support won't be built
)
HAVE_LIBGTK=no,
)
AM_CONDITIONAL(HAVE_LIBGTK, test "x$HAVE_LIBGTK" = "xyes")
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LDFLAGS)
dnl if test ${no_gtk}x = yesx
dnl then
dnl AC_OUTPUT( Makefile
dnl libstroke/Makefile \
dnl tests/Makefile )
dnl else
dnl AC_OUTPUT( Makefile
dnl libstroke/Makefile \
dnl libgstroke/Makefile \
dnl tests/Makefile )
dnl fi
AC_OUTPUT( Makefile
libstroke/Makefile \
libgstroke/Makefile \
doc/Makefile \
javastroke/Makefile \
tests/Makefile )
|