contrib/OWB: add correct SDL dependency, fix compilers used
[AROS-Contrib.git] / freetype1 / net.m4
blob254473be86f8a8aac8aef2525714e5005a4d0451
1 dnl
2 dnl The following was written by jhawk@mit.edu
3 dnl
4 dnl AC_LIBRARY_NET: Id: net.m4,v 1.4 1997/10/25 20:49:53 jhawk Exp 
5 dnl
6 dnl This test is for network applications that need socket() and
7 dnl gethostbyname() -ish functions.  Under Solaris, those applications need to
8 dnl link with "-lsocket -lnsl".  Under IRIX, they should *not* link with
9 dnl "-lsocket" because libsocket.a breaks a number of things (for instance:
10 dnl gethostbyname() under IRIX 5.2, and snoop sockets under most versions of
11 dnl IRIX).
12 dnl 
13 dnl Unfortunately, many application developers are not aware of this, and
14 dnl mistakenly write tests that cause -lsocket to be used under IRIX.  It is
15 dnl also easy to write tests that cause -lnsl to be used under operating
16 dnl systems where neither are necessary (or useful), such as SunOS 4.1.4, which
17 dnl uses -lnsl for TLI.
18 dnl 
19 dnl This test exists so that every application developer does not test this in
20 dnl a different, and subtly broken fashion.
21 dnl 
22 dnl It has been argued that this test should be broken up into two seperate
23 dnl tests, one for the resolver libraries, and one for the libraries necessary
24 dnl for using Sockets API. Unfortunately, the two are carefully intertwined and
25 dnl allowing the autoconf user to use them independantly potentially results in
26 dnl unfortunate ordering dependancies -- as such, such component macros would
27 dnl have to carefully use indirection and be aware if the other components were
28 dnl executed. Since other autoconf macros do not go to this trouble, and almost
29 dnl no applications use sockets without the resolver, this complexity has not
30 dnl been implemented.
31 dnl
32 dnl The check for libresolv is in case you are attempting to link statically
33 dnl and happen to have a libresolv.a lying around (and no libnsl.a).
34 dnl
35 AC_DEFUN(AC_LIBRARY_NET, [
36    # Most operating systems have gethostbyname() in the default searched
37    # libraries (i.e. libc):
38    AC_CHECK_FUNC(gethostbyname, ,
39      # Some OSes (eg. Solaris) place it in libnsl:
40      AC_CHECK_LIB(nsl, gethostbyname, , 
41        # Some strange OSes (SINIX) have it in libsocket:
42        AC_CHECK_LIB(socket, gethostbyname, ,
43           # Unfortunately libsocket sometimes depends on libnsl.
44           # AC_CHECK_LIB's API is essentially broken so the following
45           # ugliness is necessary:
46           AC_CHECK_LIB(socket, gethostbyname,
47              LIBS="-lsocket -lnsl $LIBS",
48                AC_CHECK_LIB(resolv, gethostbyname),
49              -lnsl)
50        )
51      )
52    )
53   AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
54     AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)))
55   ])