gschem/po: Apply updated Dutch translations from Bert Timmerman
[geda-gaf/arnaud.git] / m4 / geda-stroke.m4
blobcadaffa78b8b59204c12c4b74936b58a4efdacac
1 # geda-stroke.m4                                       -*-Autoconf-*-
2 # serial 1.0
4 dnl MIME & desktop icon directories, and MIME database update options
5 dnl Copyright (C) 2009  Peter Brett <peter@peter-b.co.uk>
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 # Check whether we should use libstroke, and if so if libraries are
22 # available.
23 AC_DEFUN([AX_OPTION_STROKE],
25   AC_PREREQ([2.60])dnl
26   AC_MSG_CHECKING([whether to use libstroke])
28   # Check what the user wants
29   AC_ARG_WITH([libstroke],
30     AS_HELP_STRING([--with-libstroke[[[=DIR]]]],
31       [use libstroke (search in [[DIR]])]),
32     [ if test "X$with_libstroke" = "Xno"; then
33         libstroke_use=no
34       else
35         libstroke_use=yes
36         if test "X$with_libstroke" != "Xyes"; then
37           libstroke_prefix=$with_libstroke
38         fi
39       fi
40       AC_MSG_RESULT([$libstroke_use]) ],
41     [ AC_MSG_RESULT([if present])
42   ])
44   # Check if libstroke is actually available!
45   if test "X$libstroke_use" != "Xno"; then
47     # If a prefix to search was specified, then add the appropriate
48     # flags.
49     if test "X$libstroke_use" = "X"; then
50       LIBSTROKE_LDFLAGS="-L$libstroke_prefix/lib"
51       LIBSTROKE_CFLAGS="-I$libstroke_prefix/include"
52     fi
54     # Check that the library and header file are available. Save and
55     # restore CPPFLAGS and LDFLAGS variables.
56     save_CPPFLAGS="$CPPFLAGS"
57     save_LDFLAS="$LDFLAGS"
58     CPPFLAGS="$CPPFLAGS $LIBSTROKE_CFLAGS"
59     LDFLAGS="$LDFLAGS $LIBSTROKE_LDFLAGS"
60     HAVE_LIBSTROKE=yes
61     AC_CHECK_LIB([stroke], [stroke_init], [], [HAVE_LIBSTROKE=no])
62     AC_CHECK_HEADER([stroke.h], [], [HAVE_LIBSTROKE=no
63     CPPFLAGS="$save_CPPDFLAGS"
64     LDFLAGS="$save_LDFLAGS"
66     LIBSTROKE_LDFLAGS="$LIBSTROKE_LDFLAGS -lstroke"])
68     # If --with-libstroke was specified, then we *must* have a usable
69     # libstroke.
70     if test "X$libstroke_use" = "Xyes" -a "X$HAVE_LIBSTROKE" = "Xno"; then
71       AC_MSG_ERROR([You specified that libstroke should be used, but libstroke could not
72 be found. Ensure that all libstroke development files are installed,
73 or configure without --with-libstroke.])
74     fi
75   fi
77   # If we don't have libstroke, clear its flags variables
78   if test "X$HAVE_LIBSTROKE" != "Xyes"; then
79     LIBSTROKE_LDFLAGS=""
80     LIBSTROKE_CFLAGS=""
81   else
82     AC_DEFINE([HAVE_LIBSTROKE], [test "X$HAVE_LIBSTROKE" = "Xyes"],
83       [Define to 1 if libstroke is available])
84   fi
86   AC_SUBST([LIBSTROKE_CPPFLAGS])
87   AC_SUBST([LIBSTROKE_LDFLAGS])
89 ])dnl AX_OPTION_STROKE