Skip to content

Commit

Permalink
fixed again configure.ac and .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
yersinia committed Mar 16, 2012
1 parent bbb53e7 commit c407884
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ aclocal.m4
archive.tar.gz
autom4te*
build
m4
m4/*
!m4/p0f.m4
!m4/ax_lib_socket_nsl.m4
build-aux
cat-id-tbl.c
.ccache
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ AC_PROG_MAKE_SET

# Checks for libraries.
AC_MSG_CHECKING([checking for pcap library])
LIB_SOCKET_NSL
have_pcap=no
AC_PATH_TOOL(PCAP_CONFIG, pcap-config)
AS_IF([test -n "$PCAP_CONFIG"],
Expand Down
40 changes: 40 additions & 0 deletions m4/ax_lib_socket_nsl.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_lib_socket_nsl.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_LIB_SOCKET_NSL
#
# DESCRIPTION
#
# This macro figures out what libraries are required on this platform to
# link sockets programs.
#
# The common cases are not to need any extra libraries, or to need
# -lsocket and -lnsl. We need to avoid linking with libnsl unless we need
# it, though, since on some OSes where it isn't necessary it will totally
# break networking. Unisys also includes gethostbyname() in libsocket but
# needs libnsl for socket().
#
# LICENSE
#
# Copyright (c) 2008 Russ Allbery <[email protected]>
# Copyright (c) 2008 Stepan Kasal <[email protected]>
# Copyright (c) 2008 Warren Young <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 6

AU_ALIAS([LIB_SOCKET_NSL], [AX_LIB_SOCKET_NSL])
AC_DEFUN([AX_LIB_SOCKET_NSL],
[
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([socket], [socket], [], [
AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
[], [-lnsl])])
])
3 changes: 3 additions & 0 deletions acinclude.m4 → m4/p0f.m4
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ AS_VAR_POPDEF([p0f_ldflags])dnl
AS_VAR_POPDEF([p0f_my_ldflags])dnl
m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
])



0 comments on commit c407884

Please sign in to comment.