~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to m4/servent.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# servent.m4 serial 2
 
2
dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc.
 
3
dnl This file is free software; the Free Software Foundation
 
4
dnl gives unlimited permission to copy and/or distribute it,
 
5
dnl with or without modifications, as long as this notice is preserved.
 
6
 
 
7
AC_DEFUN([gl_SERVENT],
 
8
[
 
9
  dnl Where are getservent(), setservent(), endservent(), getservbyname(),
 
10
  dnl getservbyport() defined?
 
11
  dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(),
 
12
  dnl getprotobynumber() defined?
 
13
  dnl - On Solaris, they are in libsocket. Ignore libxnet.
 
14
  dnl - On Haiku, they are in libnetwork.
 
15
  dnl - On BeOS, they are in libnet.
 
16
  dnl - On native Windows, they are in ws2_32.dll.
 
17
  dnl - Otherwise they are in libc.
 
18
  AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
 
19
  SERVENT_LIB=
 
20
  gl_saved_libs="$LIBS"
 
21
  AC_SEARCH_LIBS([getservbyname], [socket network net],
 
22
    [if test "$ac_cv_search_getservbyname" != "none required"; then
 
23
       SERVENT_LIB="$ac_cv_search_getservbyname"
 
24
     fi])
 
25
  LIBS="$gl_saved_libs"
 
26
  if test -z "$SERVENT_LIB"; then
 
27
    AC_CHECK_FUNCS([getservbyname], , [
 
28
      AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32],
 
29
        [gl_cv_w32_getservbyname],
 
30
        [gl_cv_w32_getservbyname=no
 
31
         gl_save_LIBS="$LIBS"
 
32
         LIBS="$LIBS -lws2_32"
 
33
         AC_LINK_IFELSE(
 
34
           [AC_LANG_PROGRAM(
 
35
              [[
 
36
#ifdef HAVE_WINSOCK2_H
 
37
#include <winsock2.h>
 
38
#endif
 
39
#include <stddef.h>
 
40
              ]],
 
41
              [[getservbyname(NULL,NULL);]])],
 
42
           [gl_cv_w32_getservbyname=yes])
 
43
         LIBS="$gl_save_LIBS"
 
44
        ])
 
45
      if test "$gl_cv_w32_getservbyname" = "yes"; then
 
46
        SERVENT_LIB="-lws2_32"
 
47
      fi
 
48
    ])
 
49
  fi
 
50
  AC_SUBST([SERVENT_LIB])
 
51
])