geany/m4/geany-socket.m4
Colomban Wendling 93a349005f Auto-generate final configure summary
Add and use macros to generate final configure summary rather than
hard-code it.  This allows for the status to be registered from where
they comes rather than all in the end.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@6008 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-10-06 00:45:33 +00:00

44 lines
1.3 KiB
Plaintext

dnl _GEANY_CHECK_SOCKET_PREREQ
AC_DEFUN([_GEANY_CHECK_SOCKET_PREREQ],
[
AC_ARG_ENABLE([socket],
[AS_HELP_STRING([--enable-socket],
[enable if you want to detect a running instance [default=yes]])],
[geany_enable_socket="$enableval"],
[geany_enable_socket="auto"])
])
dnl GEANY_CHECK_SOCKET([enable])
AC_DEFUN([GEANY_CHECK_SOCKET],
[
AC_REQUIRE([_GEANY_CHECK_SOCKET_PREREQ])
dnl this way of calling once is a bit ugly, but we need to be able to
dnl call this from one or more locations, the first one maybe in a shell
dnl conditional.
if test "x$_geany_enable_socket_done" = x; then
dnl This one gives precedence for user choice
dnl if test "x$geany_enable_socket" = xauto; then
dnl if test -n "$1"; then
dnl geany_enable_socket="$1"
dnl else
dnl geany_enable_socket=yes
dnl fi
dnl fi
if test -n "$1"; then
geany_enable_socket="$1"
elif test "x$geany_enable_socket" = xauto; then
geany_enable_socket=yes
fi
if test "x$geany_enable_socket" = xyes; then
AC_DEFINE([HAVE_SOCKET], [1], [Define if you want to detect a running instance])
# this should bring in libsocket on Solaris:
AC_SEARCH_LIBS([connect],[socket])
fi
GEANY_STATUS_ADD([Use (UNIX domain) socket support], [$geany_enable_socket])
_geany_enable_socket_done=yes
fi
])