autoconf
[Top][All Lists]
Advanced

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

How do I exit if headers/libraries are missing.??????


From: David Kirkby
Subject: How do I exit if headers/libraries are missing.??????
Date: Sat, 21 Apr 2001 23:50:32 +0100

Hi,
        I've written a small finite element programme that can be compiled to
use multiple processors (MP), by giving the option --with-mp to
autoconf. If this option is selected, configure checks for a few
important MP header files and libraries, that are needed, including:

<thread.h>
<pthread.h>
<pthreads.h>
thread, pthread or pthreads libraries. 

If the --with-mp is given, it's essential that at least one of these
libraries and  one of the header files are present. How would I exit
with an error message if one is not ??

I've got this so far, but are unsure how to exit with an error message
if there is no support on the system for multi-processing, yet the
--with-mp option to configure was selected. 


dnl Multi-Processor Support
AC_ARG_WITH(mp, [  --with-mp=[no]           support multiple processors
(needs pthreads installed) ])
if test "x$with_mp" = "xyes"; then
AC_DEFINE(ENABLE_MP)
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_CHECK_LIB(thread,  pthread_create)
AC_CHECK_LIB(pthread,  pthread_create)
AC_CHECK_LIB(pthreads, pthread_create)
AC_CHECK_LIB(thread, thr_setconcurrency,
[AC_DEFINE(HAVE_THR_SETCONCURRENCY)])
fi

-- 
Dr. David Kirkby Ph.D,
email: address@hidden 
former email address: address@hidden
web page: http://www.david-kirkby.co.uk       
Amateur radio callsign: G8WRB



reply via email to

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