-# readline.m4 serial 3
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+# readline.m4 serial 4
+dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_TRY_LINK([#include <stdio.h>
#include <readline/readline.h>],
[readline((char*)0);],
- gl_cv_lib_readline=yes)
- if test "$gl_cv_lib_readline" = yes; then
- if test -n "$extra_lib"; then
- LIBREADLINE="$LIBREADLINE -l$extra_lib"
- LTLIBREADLINE="$LTLIBREADLINE -l$extra_lib"
- fi
- break
+ [gl_cv_lib_readline=" -l$extra_lib"])
+ if test "$gl_cv_lib_readline" != no; then
+ break
fi
done
LIBS="$am_save_LIBS"
])
- if test "$gl_cv_lib_readline" = yes; then
+ if test "$gl_cv_lib_readline" != no; then
AC_DEFINE(HAVE_READLINE, 1, [Define if you have the readline library.])
- fi
-
- if test "$gl_cv_lib_readline" = yes; then
+ LIBREADLINE="$LIBREADLINE$gl_cv_lib_readline"
+ LTLIBREADLINE="$LTLIBREADLINE$gl_cv_lib_readline"
AC_MSG_CHECKING([how to link with libreadline])
AC_MSG_RESULT([$LIBREADLINE])
else
-# socklen.m4 serial 3
+# socklen.m4 serial 4
dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
dnl it there first. That file is included by gnulib's socket_.h, which
-dnl all users of this module should include.
+dnl all users of this module should include. Cygwin must not include
+dnl ws2tcpip.h.
AC_DEFUN([gl_TYPE_SOCKLEN_T],
- [AC_CHECK_HEADERS_ONCE([sys/socket.h ws2tcpip.h])
+ [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl
AC_CHECK_TYPE([socklen_t], ,
[AC_MSG_CHECKING([for socklen_t equivalent])
AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv],
- [# Systems have either "struct sockaddr *" or
- # "void *" as the second argument to getpeername
- gl_cv_socklen_t_equiv=
- for arg2 in "struct sockaddr" void; do
+ [# Systems have either "struct sockaddr *" or
+ # "void *" as the second argument to getpeername
+ gl_cv_socklen_t_equiv=
+ for arg2 in "struct sockaddr" void; do
for t in int size_t "unsigned int" "long int" "unsigned long int"; do
AC_TRY_COMPILE(
[#include <sys/types.h>
- #include <sys/socket.h>
+ #include <sys/socket.h>
int getpeername (int, $arg2 *, $t *);],
- [$t len;
+ [$t len;
getpeername (0, 0, &len);],
[gl_cv_socklen_t_equiv="$t"])
- test "$gl_cv_socklen_t_equiv" != "" && break
+ test "$gl_cv_socklen_t_equiv" != "" && break
done
- test "$gl_cv_socklen_t_equiv" != "" && break
- done
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
])
if test "$gl_cv_socklen_t_equiv" = ""; then
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
fi
AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
- [type to use in place of socklen_t if not defined])],
+ [type to use in place of socklen_t if not defined])],
[#include <sys/types.h>
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
- #endif
- #if HAVE_WS2TCPIP_H
+ #elif HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
#endif])])
-# sys_socket_h.m4 serial 1
+# sys_socket_h.m4 serial 2
dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test $ac_cv_header_sys_socket_h = yes; then
SYS_SOCKET_H=''
else
- AC_CHECK_HEADERS_ONCE([winsock2.h ws2tcpip.h])
+ dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+ dnl the check for those headers unconditional; yet cygwin reports
+ dnl that the headers are present but cannot be compiled (since on
+ dnl cygwin, all socket information should come from sys/socket.h).
+ AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
SYS_SOCKET_H='sys/socket.h'
fi
AC_SUBST(SYS_SOCKET_H)
/* readline.c --- Simple implementation of readline.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
Written by Simon Josefsson
This program is free software; you can redistribute it and/or modify
# include <config.h>
#endif
-/* This module is intended to be used when the application only need
+/* This module is intended to be used when the application only needs
the readline interface. If you need more functions from the
readline library, it is recommended to require the readline library
(or improve this module) rather than #if-protect part of your
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
+ME := maint.mk
+
# List of all C-like source code files that will be tested for
# stylistic "errors". You may want to define this to something
# more complex in Makefile.cfg.
@grep -nE '\<free *\( *\(' $(C_SOURCES) && \
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
exit 1; } || :
+
+# Collect the names of rules starting with `sc_'.
+syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(ME))
+.PHONY: $(syntax-check-rules)
+
+syntax-check: $(syntax-check-rules)