autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to add this function to the aclole.m4


From: Ralph Blach
Subject: how to add this function to the aclole.m4
Date: Wed, 19 May 2010 19:21:44 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100402 Fedora/2.0.4-1.fc12 SeaMonkey/2.0.4

I want to add this function to the aclocal.m4

How do I do it.

This should check for function prototypes.

Thanks

Chip

AC_DEFUN(AC_CHECK_FUNC_PROTO,
        [AC_CACHE_CHECK(for $1 function prototype in $2, ac_cv_have_$1_proto,
                AC_EGREP_HEADER($1, $2,
                        ac_cv_have_$1_proto=yes,
                        ac_cv_have_$1_proto=no))
        if test $ac_cv_have_$1_proto = yes ; then
                ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_PROTO
                AC_DEFINE_UNQUOTED($ac_tr_func)
        fi
])

the configure.ac has

AC_CHECK_FUNC_PROTO(gethostname, unistd.h)
AC_CHECK_FUNC_PROTO(getrusage, sys/resource.h)
AC_CHECK_FUNC_PROTO(isfdtype, sys/stat.h)
AC_CHECK_FUNC_PROTO(pselect, sys/select.h)
AC_CHECK_FUNC_PROTO(shm_open, sys/mman.h)


Thanks

chip



reply via email to

[Prev in Thread] Current Thread [Next in Thread]