1 dnl _GEANY_CHECK_SOCKET_PREREQ
2 AC_DEFUN([_GEANY_CHECK_SOCKET_PREREQ],
4 AC_ARG_ENABLE([socket],
5 [AS_HELP_STRING([--enable-socket],
6 [enable if you want to detect a running instance [default=yes]])],
7 [geany_enable_socket="$enableval"],
8 [geany_enable_socket="auto"])
11 dnl GEANY_CHECK_SOCKET([enable])
12 AC_DEFUN([GEANY_CHECK_SOCKET],
14 AC_REQUIRE([_GEANY_CHECK_SOCKET_PREREQ])
16 dnl this way of calling once is a bit ugly, but we need to be able to
17 dnl call this from one or more locations, the first one maybe in a shell
19 if test "x$_geany_enable_socket_done" = x; then
20 dnl This one gives precedence for user choice
21 dnl if test "x$geany_enable_socket" = xauto; then
22 dnl if test -n "$1"; then
23 dnl geany_enable_socket="$1"
25 dnl geany_enable_socket=yes
29 geany_enable_socket="$1"
30 elif test "x$geany_enable_socket" = xauto; then
31 geany_enable_socket=yes
34 if test "x$geany_enable_socket" = xyes; then
35 AC_DEFINE([HAVE_SOCKET], [1], [Define if you want to detect a running instance])
36 # this should bring in libsocket on Solaris:
37 AC_SEARCH_LIBS([connect],[socket])
40 GEANY_STATUS_ADD([Use (UNIX domain) socket support], [$geany_enable_socket])
41 _geany_enable_socket_done=yes