VirtualBox

source: kBuild/trunk/src/gmake/acinclude.m4@ 285

Last change on this file since 285 was 150, checked in by bird, 20 years ago

This commit was generated by cvs2svn to compensate for changes in r149,
which included commits to RCS files with non-trunk default branches.

  • Property svn:eol-style set to native
File size: 4.0 KB
Line 
1dnl acinclude.m4 -- Extra macros needed for GNU make.
2dnl
3dnl Automake will incorporate this into its generated aclocal.m4.
4
5dnl ---------------------------------------------------------------------------
6dnl Got this from the lynx 2.8 distribution.
7dnl by T.E.Dickey <[email protected]>
8dnl and Jim Spath <[email protected]>
9dnl and Philippe De Muyter <[email protected]>
10dnl
11dnl Created: 1997/1/28
12dnl Updated: 1997/12/23
13dnl ---------------------------------------------------------------------------
14dnl After checking for functions in the default $LIBS, make a further check
15dnl for the functions that are netlib-related (these aren't always in the
16dnl libc, etc., and have to be handled specially because there are conflicting
17dnl and broken implementations.
18dnl Common library requirements (in order):
19dnl -lresolv -lsocket -lnsl
20dnl -lnsl -lsocket
21dnl -lsocket
22dnl -lbsd
23AC_DEFUN([CF_NETLIBS],[
24cf_test_netlibs=no
25AC_MSG_CHECKING(for network libraries)
26AC_CACHE_VAL(cf_cv_netlibs,[
27AC_MSG_RESULT(working...)
28cf_cv_netlibs=""
29cf_test_netlibs=yes
30AC_CHECK_FUNCS(gethostname,,[
31 CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
32 CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
33#
34# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
35# I don't know the entrypoints - 97/7/22 TD
36AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
37#
38if test "$ac_cv_func_lsocket" != no ; then
39AC_CHECK_FUNCS(socket,,[
40 CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
41 CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
42fi
43#
44AC_CHECK_FUNCS(gethostbyname,,[
45 CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
46#
47AC_CHECK_FUNCS(strcasecmp,,[
48 CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
49])
50LIBS="$LIBS $cf_cv_netlibs"
51test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
52])dnl
53dnl ---------------------------------------------------------------------------
54dnl Re-check on a function to see if we can pick it up by adding a library.
55dnl $1 = function to check
56dnl $2 = library to check in
57dnl $3 = environment to update (e.g., $LIBS)
58dnl $4 = what to do if this fails
59dnl
60dnl This uses 'unset' if the shell happens to support it, but leaves the
61dnl configuration variable set to 'unknown' if not. This is a little better
62dnl than the normal autoconf test, which gives misleading results if a test
63dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
64dnl used (autoconf does not distinguish between a null token and one that is
65dnl set to 'no').
66AC_DEFUN([CF_RECHECK_FUNC],[
67AC_CHECK_LIB($2,$1,[
68 CF_UPPER(cf_tr_func,$1)
69 AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func,1,[Define if you have function $1])
70 ac_cv_func_$1=yes
71 $3="-l$2 [$]$3"],[
72 ac_cv_func_$1=unknown
73 unset ac_cv_func_$1 2>/dev/null
74 $4],
75 [[$]$3])
76])dnl
77dnl ---------------------------------------------------------------------------
78dnl Make an uppercase version of a variable
79dnl $1=uppercase($2)
80AC_DEFUN([CF_UPPER],
81[
82changequote(,)dnl
83$1=`echo $2 | tr '[a-z]' '[A-Z]'`
84changequote([,])dnl
85])dnl
86
87
88dnl ---------------------------------------------------------------------------
89dnl From Paul Eggert <[email protected]>
90
91AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
92 [AC_CACHE_CHECK([for nanoseconds field of struct stat.st_mtim],
93 ac_cv_struct_st_mtim_nsec,
94 [ac_save_CPPFLAGS="$CPPFLAGS"
95 ac_cv_struct_st_mtim_nsec=no
96 # tv_nsec -- the usual case
97 # _tv_nsec -- Solaris 2.6, if
98 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
99 # && !defined __EXTENSIONS__)
100 # st__tim.tv_nsec -- UnixWare 2.1.2
101 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
102 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
103 AC_TRY_COMPILE([#include <sys/types.h>
104#include <sys/stat.h>
105 ], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
106 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
107 done
108 CPPFLAGS="$ac_save_CPPFLAGS"
109 ])
110
111 if test $ac_cv_struct_st_mtim_nsec != no; then
112 AC_DEFINE_UNQUOTED([ST_MTIM_NSEC], [$ac_cv_struct_st_mtim_nsec],
113 [Define if struct stat contains a nanoseconds field])
114 fi
115 ]
116)
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette