sac-su.m4 1.45 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
dnl ======================================================================
dnl su module
dnl ======================================================================

dnl The macro SAC_SOFIA_SU is in a separate file, sofia-su2.m4, because
dnl SAC_SOFIA_SU creates a separate configuration file <su/su_configure.h>. 
dnl If SAC_SOFIA_SU is included to a aclocal.m4 of another package,
dnl autoheader returns a spurious error and automake complains about missing
dnl su/su_configure.h.

dnl ======================================================================
dnl SAC_WITH_RT - check for POSIX realtime library
dnl ======================================================================
AC_DEFUN([SAC_WITH_RT],[
AC_ARG_WITH(rt,  
[  --with-rt               use POSIX realtime library (used by default)])
])

dnl ======================================================================
dnl SAC_CHECK_SU_LIBS - check for libraries used by su
dnl ======================================================================
AC_DEFUN([SAC_CHECK_SU_LIBS], [
AC_REQUIRE([SAC_WITH_RT])
24 25
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_LIB(socket, socketpair,,,-lnsl)
Pekka Pessi's avatar
Pekka Pessi committed
26 27 28 29 30 31 32 33 34 35 36
if test "${with_rt}" != no; then
	AC_SEARCH_LIBS(clock_gettime, rt)
fi
])dnl

dnl ======================================================================
dnl SAC_SU - main macro for checking su dependencies
dnl ======================================================================
AC_DEFUN([SAC_SU], [
AC_REQUIRE([SAC_CHECK_SU_LIBS])
])