"Fossies" - the Fresh Open Source Software Archive

Member "hydra-3.3.2/mpl/configure.ac" (12 Nov 2019, 37703 Bytes) of package /linux/misc/hydra-3.3.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 3.3.1_vs_3.3.2.

    1 AC_PREREQ(2.63)
    2 #
    3 # (C) 2006 by Argonne National Laboratory.
    4 #     See COPYRIGHT in top-level directory.
    5 #
    6 
    7 AC_INIT([MPL], [0.1])
    8 
    9 # sanity check that --srcdir was specified correctly
   10 AC_CONFIG_SRCDIR([src/str/mpl_str.c])
   11 
   12 AC_CONFIG_AUX_DIR(confdb)
   13 AC_CONFIG_MACRO_DIR(confdb)
   14 AM_INIT_AUTOMAKE([subdir-objects] [-Wall -Werror foreign 1.12.3])
   15 
   16 dnl must come before LT_INIT, which AC_REQUIREs AC_PROG_CC
   17 PAC_PROG_CC
   18 AM_PROG_CC_C_O
   19 
   20 AC_USE_SYSTEM_EXTENSIONS
   21 
   22 AM_PROG_AR
   23 
   24 LT_PREREQ([2.2.6])
   25 
   26 # Bug in libtool adds -O2 and -g by default
   27 PAC_PUSH_FLAG([CFLAGS])
   28 LT_INIT()
   29 PAC_POP_FLAG([CFLAGS])
   30 
   31 # ----------------------------------------------------------------------------
   32 # Set default library names if names haven't already been provided
   33 AC_ARG_VAR([MPLLIBNAME],[can be used to override the name of the MPL library (default: "mpl")])
   34 MPLLIBNAME=${MPLLIBNAME:-"mpl"}
   35 AC_SUBST(MPLLIBNAME)
   36 export MPLLIBNAME
   37 
   38 if test -s "$srcdir/VERSION" ; then
   39    . $srcdir/VERSION
   40    AC_SUBST(libmpl_so_version)
   41 else
   42    AC_MSG_ERROR([Version information not found. Configuration aborted.])
   43 fi
   44 
   45 AC_CONFIG_HEADER([include/config.h])
   46 AC_CONFIG_COMMANDS([prefix-config],[perl $srcdir/confdb/cmd_prefix_config_h.pl MPL include/config.h include/mplconfig.h])
   47 
   48 # Non-verbose make
   49 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
   50 
   51 AC_C_CONST
   52 AC_C_RESTRICT
   53 AC_C_INLINE
   54 
   55 PAC_C_MACRO_VA_ARGS
   56 PAC_C_BUILTIN_EXPECT
   57 
   58 AC_ARG_ENABLE(embedded,
   59     AC_HELP_STRING([--enable-embedded], [Build MPL in embedded mode (default is no)]),
   60     [embedded=yes],
   61     [embedded=no])
   62 AM_CONDITIONAL([MPL_EMBEDDED_MODE],[test "x${embedded}" = "xyes"])
   63 
   64 AC_ARG_ENABLE(g,
   65     AC_HELP_STRING([--enable-g=option],
   66 	[
   67 		Control the level of debugging support in MPL.
   68 		"option" is a list of comma separated names.  Default
   69 		is "all".
   70 
   71 	    none|no   - No debugging
   72 	    log       - Enable debug event logging
   73 	    mem       - Enable memory tracing
   74 	    yes|all   - All of the above choices (except "none", obviously)
   75 	]),,[enable_g=none])
   76 
   77 # enable-g
   78 # strip off multiple options, separated by commas
   79 PAC_PUSH_FLAG(IFS)
   80 IFS=","
   81 for option in $enable_g ; do
   82     case "$option" in
   83 	 log)
   84 	 enable_g_log=yes
   85 	 ;;
   86 
   87 	 mem)
   88 	 enable_g_mem=yes
   89 	 ;;
   90 
   91 	 all|yes)
   92 	 enable_g_log=yes
   93 	 enable_g_mem=yes
   94 	 ;;
   95 
   96 	 no|none)
   97 	 ;;
   98 
   99 	 *)
  100 	 AC_MSG_WARN([Unknown value $option for enable-g])
  101 	 ;;
  102     esac
  103 done
  104 PAC_POP_FLAG(IFS)
  105 
  106 if test "$enable_g_log" = "yes" ; then
  107    AC_DEFINE([USE_DBG_LOGGING],[1],[Define to enable logging macros])
  108 fi
  109 
  110 if test "$enable_g_mem" = "yes" ; then
  111    AC_DEFINE([USE_MEMORY_TRACING],[1],[Define to enable memory tracing])
  112 fi
  113 
  114 
  115 # support gcov test coverage information
  116 PAC_ENABLE_COVERAGE
  117 
  118 # check for compiler support for the __typeof() extension
  119 AC_CACHE_CHECK([whether the compiler supports __typeof(variable)],
  120                [pac_cv_have___typeof],
  121 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[double foo = 0.0; __typeof(foo) bar = 1.0;]])],
  122                   [pac_cv_have___typeof=yes],
  123                   [pac_cv_have___typeof=no])]
  124 )
  125 if test "$pac_cv_have___typeof" = "yes" ; then
  126     AC_DEFINE([HAVE___TYPEOF],[1],[defined if the C compiler supports __typeof(variable)])
  127 fi
  128 
  129 dnl Check if the necessary headers are available
  130 AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h sys/types.h sys/uio.h execinfo.h unistd.h errno.h windows.h sys/mman.h)
  131 
  132 # A C99 compliant compiler should have inttypes.h for fixed-size int types
  133 AC_CHECK_HEADERS(inttypes.h stdint.h)
  134 AC_HEADER_STDBOOL
  135 
  136 #######################################################################
  137 # valgrind support
  138 AC_ARG_WITH([valgrind],
  139 [AS_HELP_STRING([--without-valgrind],[to disable valgrind support (such as because of version issues)])]
  140 [AS_HELP_STRING([--with-valgrind=PATH],[use valgrind headers installed in PATH (default is "yes", use no special path)])],
  141 [],[with_valgrind=yes])
  142 if test "$with_valgrind" != "no" ; then
  143     savedCPPFLAGS="$CPPFLAGS"
  144     if test "$with_valgrind" != "yes" ; then
  145         # Clients of MPL will either need to respect the localdefs file (as in
  146         # MPICH) or add this entry to their own CPPFLAGS-equivalent.
  147         # (TODO: a pkg-config file would help with this)
  148         PAC_APPEND_FLAG([-I${with_valgrind}], [CPPFLAGS])
  149     fi
  150     # headers for valgrind client requests
  151     AC_CHECK_HEADERS([valgrind.h memcheck.h valgrind/valgrind.h valgrind/memcheck.h])
  152     # headers for valgrind-based thread checking tools
  153     # TODO: incorporate ThreadSanitizer as well (include dynamic_annotations.h,
  154     # link with dynamic_annotations.c)
  155     AC_CHECK_HEADERS([helgrind.h valgrind/helgrind.h])
  156     AC_CHECK_HEADERS([drd.h valgrind/drd.h])
  157 
  158     # ensure that we have a new enough valgrind with all the client macros
  159     # a preproc test would probably be sufficient, but the LINK_IFELSE helps us
  160     # double-check that we aren't accidentally grabbing the headers for some
  161     # other platform
  162     AC_CACHE_CHECK([whether the valgrind headers are broken or too old],
  163                    [pac_cv_have_broken_valgrind],
  164                    [AC_LINK_IFELSE(
  165                        [AC_LANG_PROGRAM([
  166 #if defined(HAVE_VALGRIND_H) && defined(HAVE_MEMCHECK_H)
  167 #  include <valgrind.h>
  168 #  include <memcheck.h>
  169 #elif defined(HAVE_VALGRIND_VALGRIND_H) && defined(HAVE_VALGRIND_MEMCHECK_H)
  170 #  include <valgrind/valgrind.h>
  171 #  include <valgrind/memcheck.h>
  172 #else
  173 #  error unexpected valgrind header error
  174 #endif
  175 int foo = 10;
  176 char mempool_obj;
  177 ],[
  178 #if defined(VALGRIND_MAKE_MEM_DEFINED)
  179     VALGRIND_MAKE_MEM_NOACCESS(&foo,sizeof(foo));
  180     VALGRIND_MAKE_MEM_UNDEFINED(&foo,sizeof(foo));
  181     VALGRIND_MAKE_MEM_DEFINED(&foo,sizeof(foo));
  182     VALGRIND_CHECK_MEM_IS_DEFINED(&foo,sizeof(foo));
  183     VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&foo,sizeof(foo));
  184 #elif defined(VALGRIND_MAKE_READABLE)
  185 /* older (pre-3.2.0), but still supported style */
  186     VALGRIND_MAKE_READABLE(&foo,sizeof(foo));
  187     VALGRIND_MAKE_NOACCESS(&foo,sizeof(foo));
  188     VALGRIND_MAKE_UNDEFINED(&foo,sizeof(foo));
  189     VALGRIND_CHECK_READABLE(&foo,sizeof(foo));
  190     VALGRIND_CHECK_WRITEABLE(&foo,sizeof(foo));
  191 #else
  192 #error missing essential valgrind client macros
  193 #endif
  194     VALGRIND_CREATE_BLOCK(&foo,sizeof(foo),"description");
  195     if (RUNNING_ON_VALGRIND) ++foo;
  196     VALGRIND_PRINTF_BACKTRACE("testing: %s","valgrind support");
  197     VALGRIND_CREATE_MEMPOOL(&mempool_obj,0,0);
  198     VALGRIND_MEMPOOL_ALLOC(&mempool_obj,&foo,sizeof(foo));
  199     VALGRIND_MEMPOOL_FREE(&mempool_obj,&foo);
  200     VALGRIND_DESTROY_MEMPOOL(&mempool_obj);
  201 ]) dnl end PROGRAM
  202                        ],
  203                        [pac_cv_have_broken_valgrind=no], dnl end if-true
  204                        [pac_cv_have_broken_valgrind=yes] dnl end if-false
  205                    )] dnl end IFELSE
  206                    ) dnl end CACHE_CHECK
  207 
  208     if test "$pac_cv_have_broken_valgrind" = "yes" ; then
  209         AC_DEFINE([HAVE_BROKEN_VALGRIND],[1],[define if valgrind is old and/or broken compared to what we are expecting])
  210         CPPFLAGS="$savedCPPFLAGS"
  211     fi
  212 fi
  213 
  214 
  215 #######################################################################
  216 ## TIMER CODE
  217 #######################################################################
  218 
  219 # ----------------------------------------------------------------------------
  220 # Support for timers.  The following code processes the 
  221 #  --enable-timer-type=name argument and selects the timer based on 
  222 # both that field and what configure is able to determine is available.
  223 # The file src/include/mpl_timer.h is also created.
  224 # ----------------------------------------------------------------------------
  225 
  226 # clock_gettime is the POSIX gettimeofday
  227 # gethrtime is the Solaris high-resolution timer
  228 dnl
  229 dnl Specific checks that a function works correctly
  230 dnl
  231 dnl Now that we know what the options are, choose the timer to use
  232 dnl
  233 dnl The default preference is
  234 dnl    Solaris gethrtime
  235 dnl    Posix   clock_gettime
  236 dnl    Unix    gettimeofday (one of two versions)
  237 dnl
  238 dnl Also available are various hardware time stamps
  239 dnl    Linux-x86 cycle counter
  240 dnl    Powerpc-64bit timebase cycle counter
  241 dnl
  242 dnl We also allow --enable-timer-type=name to select a timer type
  243 AC_ARG_ENABLE(timer-type,
  244 [  --enable-timer-type=name - Select the timer to use for MPI_Wtime and
  245                              internal timestamps.
  246         ppc64_cycle        - Powerpc-64bit; returns cycle counts using timebase register
  247         gethrtime          - Solaris timer (Solaris systems only)
  248         clock_gettime      - Posix timer (where available)
  249         gettimeofday       - Most Unix systems
  250         linux86_cycle      - Linux x86; returns cycle counts, not time in seconds*
  251         gcc_ia64_cycle     - IPF ar.itc timer*
  252 	mach_absolute_time - Mach absolute time (alternative to clock_gettime
  253                              for OSX)
  254         device             - The timer is provided by the device
  255 
  256         *Note that the cycle timers are intended to be used by
  257         developers for internal low-level timing.  Normal users should
  258         not use these as they are not guaranteed to be accurate in
  259         certain situations.
  260 ],timer_type=$enable_timer_type)
  261 
  262 ## The user did not specify a timer type.  Try to find a sane option
  263 ## that is supported by the platform.
  264 if test -z "$timer_type" ; then
  265     # Try to pick a timer based on what is available
  266     AC_CHECK_FUNCS(clock_gettime clock_getres gethrtime mach_absolute_time gettimeofday)
  267     if test "$ac_cv_func_gethrtime" = "yes" ; then
  268         # Sigh.  The Solaris include files do not define hrtime_t
  269 	# Before we accept this choice, make sure that we can 
  270 	# do arithmetic with hrtime_t .
  271         AC_CACHE_CHECK([that hrtime_t is properly defined for gethrtime],
  272 	pac_cv_hrtime_works,[
  273 	AC_TRY_COMPILE([
  274 #include <sys/time.h>
  275 ],[hrtime_t t1, t2; t1 = 1; t2 = 2; t1 = t1 + t2;],
  276 pac_cv_hrtime_works=yes,pac_cv_hrtime_works=no)])
  277 	# A more ambitious test would look to see if casting an 
  278 	# hrtime_t to int64_t works, and even more ambitious
  279 	# would check whether long or long long was 64 bits (or even
  280 	# better, the sizeof hrtime_t).  
  281 
  282         # AC_CHECK_FUNCS has false positive when checking whether gethrtime is
  283         # available on Solaris with strict configuration. We must use
  284         # AC_CHECK_DECL to confirm it.
  285         AC_CHECK_DECL(gethrtime)
  286     fi
  287     if test "$ac_cv_func_gethrtime" = "yes" -a \
  288             "$ac_cv_has_decl_gethrtime" = "yes" -a \
  289             "$pac_cv_hrtime_works" = "yes" ; then
  290         timer_type=gethrtime
  291     elif test "$ac_cv_func_clock_gettime" = "yes" -a \
  292               "$ac_cv_func_clock_getres" = "yes" ; then
  293 	 # Test on both because some systems (e.g., cygwin) provide
  294 	 # clock_gettime but not clock_getres
  295         timer_type=clock_gettime
  296     elif test "$ac_cv_func_mach_absolute_time" = "yes" ; then 
  297         timer_type=mach_absolute_time
  298     elif test "$ac_cv_func_gettimeofday" = "yes" ; then
  299         timer_type=gettimeofday
  300     fi
  301 fi
  302 if test -z "$timer_type" ; then
  303     AC_MSG_ERROR([No timer found])
  304 fi
  305 
  306 # Check for valid timer and select datatypes for the time stamp
  307 case "$timer_type" in
  308 
  309     gethrtime)
  310     MPL_TIMER_TYPE=hrtime_t
  311     AC_CHECK_FUNC(gethrtime,,[
  312          AC_MSG_ERROR([Requested timer gethrtime is not available])
  313 ])
  314     ;;
  315 
  316     clock_gettime)
  317     missing_function=no
  318     AC_SEARCH_LIBS([clock_gettime],[rt],,AC_MSG_ERROR([clock_gettime is not available]))
  319     AC_SEARCH_LIBS([clock_getres],[rt],,AC_MSG_ERROR([clock_getres is not available]))
  320     MPL_TIMER_TYPE="struct timespec"
  321     # AIX does not always define struct timespec (!)
  322     # Make sure that we can use struct timespec
  323     AC_CACHE_CHECK([whether struct timespec is defined in time.h],
  324                     pac_cv_struct_timespec_defined,[
  325     AC_TRY_COMPILE([
  326 #include <time.h>],[
  327     struct timespec t;],pac_cv_struct_timespec_defined=yes,
  328     pac_cv_struct_timespec_defined=no)
  329 ])
  330     if test "$pac_cv_struct_timespec_defined" != "yes" ; then
  331         # Try again, but with -D_XOPEN_SOURCE=500 (works for AIX)
  332         AC_CACHE_CHECK([whether struct timespec is defined in time.h with _XOPEN_SOURCE=500],
  333                     pac_cv_struct_timespec_defined_with_xopen500,[
  334         AC_TRY_COMPILE([
  335 #define _XOPEN_SOURCE 500
  336 #include <time.h>],[
  337     struct timespec t;],pac_cv_struct_timespec_defined_with_xopen500=yes,
  338     pac_cv_struct_timespec_defined_with_xopen500=no)
  339 ])
  340 	if test "$pac_cv_struct_timespec_defined_with_xopen500" = "yes" ; then
  341 	    # We need to define _XOPEN_SOURCE=500, but we need to ensure that
  342 	    # this is done before any include files are loaded.  At
  343 	    # this point it is really too late to add this definition,
  344 	    # since it may make other tests incompatible.
  345 	    AC_MSG_ERROR([The available timer requires _XOPEN_SOURCE=500.  Add -D_XOPEN_SOURCE=500 to CFLAGS and rerun configure])
  346         fi
  347     fi
  348     # 
  349     # FreeBSD 4.3 incorrectly puts the header into sys/time.h; 
  350     # time.h is required (see pages 45 and 46 in the POSIX standard).
  351     # See if we can compile
  352     AC_CACHE_CHECK([for CLOCK_REALTIME defined in time.h],pac_cv_posix_clock_realtime,[
  353     AC_TRY_COMPILE([
  354 #include <time.h>],[
  355     clockid_t cid = CLOCK_REALTIME;],pac_cv_posix_clock_realtime=yes,
  356 pac_cv_posix_clock_realtime=no)])
  357     if test "$pac_cv_posix_clock_realtime" = "no" ; then
  358          AC_MSG_WARN([POSIX timer requires definitions in time.h])
  359 	 # Check for the definition in sys/time.h, which is where
  360 	 # OpenBSD and FreeBSD have put it by mistake
  361          AC_TRY_COMPILE([
  362 #include <time.h>
  363 #include <sys/time.h>],[
  364     clockid_t cid = CLOCK_REALTIME;],pac_cv_posix_clock_realtime=yes,
  365 pac_cv_posix_clock_realtime=no)
  366 	if test "$pac_cv_posix_clock_realtime" = yes ; then
  367 	    AC_MSG_WARN([sys/time.h required for POSIX timer])
  368 	    AC_DEFINE(NEEDS_SYS_TIME_H,1,[Define if sys/time.h is required to get timer definitions])
  369 	else
  370 	    AC_MSG_ERROR([Cannot find the definition of CLOCK_REALTIME for the POSIX timer])
  371 	fi
  372     fi
  373     ;;
  374 
  375     gettimeofday)
  376     MPL_TIMER_TYPE="struct timeval"
  377     # We may have already tested for gettimeofday.  If we got a "yes",
  378     # we're good to go
  379     if test "$ac_cv_func_gettimeofday" != "yes" ; then
  380         AC_CHECK_FUNC(gettimeofday,,[
  381          AC_MSG_ERROR([Requested timer gettimeofday is not available])
  382 ])
  383     fi
  384     ;;
  385 
  386     linux86_cycle|linux86_cycle_2)
  387     
  388 # The following AC_TRY_RUN statements are needed because x86_64 compilers
  389 # usually know about rdtscp but the cpu may or may not actually implement the
  390 # feature.  This is not cross-compile safe, unfortunately.  In the long run we
  391 # should allow the user to override this with a configure flag.
  392     AC_CACHE_CHECK([that linux86 cycle counter is available],
  393         pac_cv_linux86_cycle,
  394             AC_TRY_RUN([
  395 int main()
  396 {
  397     /* rdtscp */
  398     long long var, *var_ptr=&var;
  399     __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
  400     return 0;
  401 }
  402             ],pac_cv_linux86_cycle=rdtscp,
  403                 AC_TRY_RUN([[
  404 int main()
  405 {
  406     /* cpuid 64 */
  407     long long var, *var_ptr=&var;
  408     __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
  409     return 0;
  410 }
  411                 ]],pac_cv_linux86_cycle=cpuid_rdtsc64,
  412                     AC_TRY_RUN([[[
  413 int main()
  414 {
  415     /* cpuid 32 */
  416     long long var, *var_ptr=&var;
  417     __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
  418     return 0;
  419 }
  420                     ]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
  421                         AC_TRY_RUN([[[[
  422 int main()
  423 {
  424     /* simple */
  425     long long var, *var_ptr=&var;
  426     __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
  427     return 0;
  428 }
  429                         ]]]],pac_cv_linux86_cycle=rdtsc,
  430                         pac_cv_linux86_cycle=no)
  431                     )
  432                 ),
  433 dnl The if-cross-compiling clause from the first AC_TRY_RUN.  Hope that if the
  434 dnl compiler knows about the instruction then it's supported by the target
  435 dnl platform.
  436                 AC_TRY_COMPILE(,[[
  437                     long long var, *var_ptr=&var;
  438                     __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
  439                 ]],pac_cv_linux86_cycle=rdtscp,
  440                     AC_TRY_COMPILE(,[[[
  441                         long long var, *var_ptr=&var;
  442                         __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
  443                     ]]],pac_cv_linux86_cycle=cpuid_rdtsc64,
  444                         AC_TRY_COMPILE(,[[[[
  445                             long long var, *var_ptr=&var;
  446                             __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
  447                         ]]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
  448                             AC_TRY_COMPILE(,[[[[[
  449                                 long long var, *var_ptr=&var;
  450                                 __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
  451                             ]]]]],pac_cv_linux86_cycle=rdtsc,
  452                             pac_cv_linux86_cycle=no)
  453                         )
  454                     )
  455                 )
  456             )
  457     )
  458 
  459     case "$pac_cv_linux86_cycle" in
  460         "rdtscp")
  461             AC_DEFINE(LINUX86_CYCLE_RDTSCP,1,[Define which x86 cycle counter to use])
  462 	    ;;
  463         "cpuid_rdtsc64")
  464             AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC64,1,[Define which x86 cycle counter to use])
  465             ;;
  466         "cpuid_rdtsc32")
  467             AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC32,1,[Define which x86 cycle counter to use])
  468 	    ;;
  469         "rdtsc")
  470             AC_DEFINE(LINUX86_CYCLE_RDTSC,1,[Define which x86 cycle counter to use])
  471 	    ;;
  472         *)
  473             cpu_gcc_x86_cycle=no
  474 	    ;;
  475     esac
  476 
  477     if test "$cpu_gcc_x86_cycle" = "no" ; then
  478         AC_MSG_ERROR([Linux86 cycle counter is not available on this system and or with the $CC compiler])
  479     fi
  480     MPL_TIMER_TYPE="long long"
  481     ;;
  482 
  483     gcc_ia64_cycle)
  484     AC_CACHE_CHECK([that IPF timer is available],
  485 pac_cv_ia64_cycle,[
  486     AC_TRY_COMPILE(,[
  487     long var, *var_ptr=&var;
  488 #ifdef __INTEL_COMPILER
  489 #include "ia64regs.h"
  490     var=__getReg(_IA64_REG_AR_ITC);
  491 #else
  492     __asm__ __volatile__("mov %0=ar.itc" : "=r" (var_ptr));
  493 #endif
  494 ],pac_cv_gcc_ia64_cycle=yes,pac_cv_gcc_ia64_cycle=no)])
  495     if test "$pac_cv_gcc_ia64_cycle" != "yes" ; then
  496         AC_MSG_ERROR([IPF cycle counter is not available on this system and or with the $CC compiler])
  497      fi
  498      MPL_TIMER_TYPE="long"
  499      ;;
  500 
  501     mach_absolute_time)
  502     AC_CHECK_FUNC(mach_absolute_time,,[AC_MSG_ERROR([mach_absolute_time is not available])])
  503     AC_CHECK_FUNC(mach_timebase_info,,[AC_MSG_ERROR([mach_timebase_info is not available])])
  504     MPL_TIMER_TYPE="uint64_t"
  505     ;;
  506 
  507     device)
  508     # The device selected should export the datatype for the timer
  509     MPL_TIMER_TYPE="void *"
  510     ;;
  511 
  512     ppc64_cycle)
  513     AC_CACHE_CHECK([that ppc64 timebase cycle counter is available],
  514                 pac_cv_ppc64_cycle,[
  515     AC_TRY_COMPILE([
  516     ],[
  517         unsigned temp;
  518         asm volatile ("mfspr %0,%1" : "=r" (temp)        : "i" (0x10D));
  519     ],pac_cv_ppc64_cycle=yes,
  520     pac_cv_ppc64_cycle=no)
  521     ])
  522     if test "$pac_cv_ppc64_cycle" != "yes" ; then
  523         AC_MSG_ERROR([The PPC64 cycle counter is not available on this system and or with the $CC compiler])
  524     fi
  525     MPL_TIMER_TYPE="uint64_t"
  526     ;;
  527     *)
  528     AC_MSG_ERROR([Invalid timer type $timer_type])
  529     ;;
  530 esac
  531 # Convert timer type to upper case
  532 timer_type=`echo $timer_type | \
  533     tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  534 MPL_TIMER_KIND=MPL_TIMER_KIND__$timer_type
  535 AC_SUBST(MPL_TIMER_KIND)
  536 AC_SUBST(MPL_TIMER_TYPE)
  537 AC_MSG_NOTICE([Timer type selected is $timer_type])
  538 
  539 #######################################################################
  540 ## END OF TIMER CODE
  541 #######################################################################
  542 
  543 
  544 #######################################################################
  545 ## START OF PROCESSOR YIELD CODE
  546 #######################################################################
  547 # If the user specified a method to use, we check if it's available.
  548 # If a method was not specified, we make a guess based on the OS.  The
  549 # default is to use sched_yield() or yield() if one is available,
  550 # otherwise, default to nothing.  After that we define the appropriate
  551 # macro.
  552 
  553 AC_CHECK_HEADERS(sched.h)
  554 AC_CHECK_HEADERS(unistd.h)
  555 AC_CHECK_HEADERS(sys/select.h)
  556 AC_CHECK_FUNCS(sched_yield yield usleep sleep select)
  557 
  558 if test "$ac_cv_func_usleep" = "yes" ; then
  559     PAC_FUNC_NEEDS_DECL([#include <unistd.h>],usleep)
  560 fi
  561 
  562 AC_ARG_ENABLE([yield],
  563     [AS_HELP_STRING([--enable-yield], [choose a method to yield the processor in busy loops.  Available methods are: sched_yield, yield, select, usleep, sleep, nothing])],
  564     [AS_CASE([$enableval],
  565         [sched_yield], [AS_IF([test "x$ac_cv_func_sched_yield" != "xyes"], [enable_yield=unavail])],
  566         [yield],       [AS_IF([test "x$ac_cv_func_yield"       != "xyes"], [enable_yield=unavail])],
  567         [select],      [AS_IF([test "x$ac_cv_func_select"      != "xyes"], [enable_yield=unavail])],
  568         [usleep],      [AS_IF([test "x$ac_cv_func_usleep"      != "xyes"], [enable_yield=unavail])],
  569         [sleep],       [AS_IF([test "x$ac_cv_func_sleep"       != "xyes"], [enable_yield=unavail])],
  570         [nothing|no|none], [],
  571         [AC_MSG_ERROR([Invalid option $enableval for --enable-yield])])
  572 
  573      AS_IF([test "x$enable_yield" = "xunavail"],
  574               [AC_MSG_ERROR([Yield method $enableval is not available on this platform.])])
  575     ],
  576     [# none specified by user; make a guess based on os
  577      AS_CASE([$host],
  578         [*-*-darwin*],
  579             [# In Lion, sched_yield worked but none of the other options had any effect
  580              AS_IF([test "x$ac_cv_func_sched_yield" = "xyes"], [enable_yield=sched_yield],
  581                    [enable_yield=nothing])],
  582         [*-*-linux*],
  583             [# sched_yield() has been broken in linux since 2.6.23, and no good alternative exists.
  584              enable_yield=nothing],
  585         [# default: just use sched_yield() or yield()
  586          AS_IF([test "x$ac_cv_func_sched_yield" = "xyes"], [enable_yield=sched_yield],
  587                [test "x$ac_cv_func_yield" = "xyes"], [enable_yield=yield],
  588                [enable_yield=nothing])])
  589     ]
  590 )
  591 
  592 # set the appropriate macro
  593 AS_CASE([$enable_yield],
  594     [sched_yield],
  595         [AC_DEFINE(USE_SCHED_YIELD_FOR_YIELD,1,[Define to use sched_yield to yield processor])],
  596     [yield],
  597         [AC_DEFINE(USE_YIELD_FOR_YIELD,1,[Define to use yield to yield processor])],
  598     [select],
  599         [AC_DEFINE(USE_SELECT_FOR_YIELD,1,[Define to use select to yield processor])],
  600     [usleep],
  601         [AC_DEFINE(USE_USLEEP_FOR_YIELD,1,[Define to use usleep to yield processor])],
  602     [sleep],
  603         [AC_DEFINE(USE_SLEEP_FOR_YIELD,1,[Define to use sleep to yield processor])],
  604     [nothing|no|none],
  605         [AC_DEFINE(USE_NOTHING_FOR_YIELD,1,[Define to use nothing to yield processor])],
  606     [AC_MSG_ERROR([Invalid value $enable_yield for enable_yield.])]
  607 )
  608 
  609 #######################################################################
  610 ## END OF PROCESSOR YIELD CODE
  611 #######################################################################
  612 
  613 
  614 #######################################################################
  615 ## START OF THREADS CODE
  616 #######################################################################
  617 PAC_SET_HEADER_LIB_PATH(uti)
  618 
  619 AC_ARG_WITH([thread-package],
  620 [  --with-thread-package=package     Thread package to use. Supported thread packages include:
  621         posix or pthreads - POSIX threads (default, if required)
  622         solaris - Solaris threads (Solaris OS only)
  623         abt or argobots - Argobots threads
  624         win - windows threads
  625         uti - POSIX threads plus Utility Thread Offloading library
  626         none - no threads
  627 ],,with_thread_package=posix)
  628 
  629 if test "${thread_pkg_required}" = "no" -o "${with_thread_package}" = "no" ; then
  630    with_thread_package=none
  631 fi
  632 
  633 if test "${with_thread_package}" = "yes" ; then
  634    with_thread_package=posix
  635 fi
  636 
  637 if test "${thread_pkg_required}" = "yes" -a "${with_thread_package}" = "none" ; then
  638    AC_ERROR([if no thread package is available, use --enable-threads=single or funneled])
  639 fi
  640 
  641 THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_INVALID
  642 case $with_thread_package in
  643     posix|pthreads|uti)
  644 	if test "${with_thread_package}" = "pthreads" ; then
  645 	    with_thread_package=posix
  646 	fi
  647 	AC_CHECK_HEADERS(pthread.h)
  648 
  649         # If pthreads library is found, just include it on the link line. We don't try
  650         # to test if the C compiler needs it or not, since the C++ or Fortran
  651         # compilers might need it even if the C compiler doesn't
  652         # (nvcc with gfortran, for example).
  653         #
  654         # OSF1 has __pthread_create but not pthread_create (because of
  655         # inconsistencies in the pthread spec).  Thus, we look for pthread_key_create
  656         AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
  657 	if test "$have_pthreads" = "yes" ; then
  658 	   PAC_PREPEND_FLAG([-lpthread],[LIBS])
  659 	fi
  660 
  661         AC_CHECK_FUNCS(pthread_yield)
  662 
  663         # this check should come after the AC_CHECK_LIB for -lpthread
  664         AC_CHECK_FUNC([pthread_key_create],[],[AC_MSG_ERROR([unable to find pthreads library])])
  665 
  666 	# Check for a routine that specify a routine to call on
  667 	# thread exit.  We can use this to release memory that may
  668 	# be allocated by the MPL library in the thread.
  669 	# A complication: pthread_cleanup_push may be a macro; in that
  670 	# case, check_funcs will fail to find it.
  671 	# Under OSX, pthread_cleanup_push and pop are macros that must
  672 	# appear together in the same lexical scope, and hence are
  673 	# really useless in libraries that may allocate data within
  674 	# a user-managed thread.
  675 	AC_CHECK_FUNCS(pthread_cleanup_push)
  676 	if test "$ac_cv_func_pthread_cleanup_push" = "no" ; then
  677             AC_CACHE_CHECK([whether pthread_cleanup_push is available (may be a macro in pthread.h)],pac_cv_func_pthread_cleanup_push,[
  678 	    AC_TRY_LINK([
  679 #include <pthread.h>
  680 void f1(void *a) { return; }],
  681 [pthread_cleanup_push( f1, (void *)0 );],
  682             pac_cv_func_pthread_cleanup_push=yes,
  683             pac_cv_func_pthread_cleanup_push=no)])
  684             if test "$pac_cv_func_pthread_cleanup_push" = yes ; then
  685 	        AC_DEFINE(HAVE_PTHREAD_CLEANUP_PUSH_MACRO,1,[Define if pthread_cleanup_push is available, even as a macro])
  686             fi
  687 
  688         fi
  689 
  690 	if test "${with_thread_package}" = "uti" ; then
  691 	    PAC_CHECK_HEADER_LIB(uti.h,uti,uti_attr_init,have_uti=yes,have_uti=no)
  692 	    if test "${have_uti}" = "yes" ; then
  693 		AC_MSG_NOTICE([Using POSIX and Utility Thread Offloading library for thread package])
  694 	    else
  695 		AC_MSG_ERROR([Unable to find Utility Thread Offloading library])
  696 	    fi
  697 	    THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_UTI
  698 	else
  699 	    AC_MSG_NOTICE([POSIX will be used for thread package.])
  700 	    THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_POSIX
  701 	fi
  702 	;;
  703     solaris)
  704 	AC_CHECK_HEADERS(thread.h)
  705 	AC_CHECK_FUNCS(thr_yield)
  706 	AC_SEARCH_LIBS(thr_create,thread,found=yes,found=no)
  707 	if test "$found" != "yes" ; then
  708 	   AC_MSG_ERROR([unable to find Solaris threads library])
  709 	fi
  710 	# FIXME: need to add -mt if using solaris compilers
  711         THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_SOLARIS
  712 	;;
  713     win|windows)
  714         with_thread_package=win
  715         THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_WIN
  716         AC_MSG_ERROR([The 'win' thread package is not supported via autoconf builds at this time.])
  717         ;;
  718     abt|argobots)
  719         with_thread_package=argobots
  720         AC_CHECK_HEADER([abt.h],[],AC_MSG_ERROR([unable to find Argobots header file]))
  721         AC_CHECK_LIB([abt],[ABT_key_create],[],AC_MSG_ERROR([unable to find Argobots library]))
  722         PAC_PREPEND_FLAG([-labt],[LIBS])
  723         THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_ARGOBOTS
  724         ;;
  725     no|none)
  726 	with_thread_package=none
  727         THREAD_PACKAGE_NAME=MPL_THREAD_PACKAGE_NONE
  728 	;;
  729     *)
  730 	AC_MSG_ERROR([The specified thread package, $with_thread_package, is not supported.])
  731 	;;
  732 esac
  733 
  734 # Define and export the selected thread library so that other packages
  735 # know what's used in MPL
  736 AC_DEFINE_UNQUOTED([THREAD_PACKAGE_NAME],[$THREAD_PACKAGE_NAME],[set to the name of the thread package])
  737 
  738 # check for compiler-support for thread-local storage (MPL_TLS)
  739 if test "${with_thread_package}" != "argobots" ; then
  740     PAC_CC_CHECK_TLS
  741 fi
  742 
  743 #######################################################################
  744 ## END OF THREADS CODE
  745 #######################################################################
  746 
  747 #######################################################################
  748 ## START OF PROCESS MUTEX CODE
  749 #######################################################################
  750 
  751 AC_ARG_WITH([proc-mutex-package],
  752 [  --with-proc-mutex-package=package     Interprocess mutex package to use. Supported packages include:
  753         posix or pthreads - POSIX threads (default, if required)
  754         none - no interprocess mutex support
  755 ],,with_proc_mutex_package=posix)
  756 
  757 if test "${with_proc_mutex_package}" = "no" ; then
  758    with_proc_mutex_package=none
  759 fi
  760 if test "${with_proc_mutex_package}" = "yes" ; then
  761    with_proc_mutex_package=posix
  762 fi
  763 
  764 PROC_MUTEX_PACKAGE_NAME=MPL_PROC_MUTEX_PACKAGE_INVALID
  765 case $with_proc_mutex_package in
  766   posix|pthreads)
  767     if test "${with_proc_mutex_package}" = "pthreads" ; then
  768         with_proc_mutex_package=posix
  769     fi
  770 
  771     # Do not prepend -lpthread again if already checked by thread package
  772     if test "${with_thread_package}" != "posix" ; then
  773         AC_CHECK_HEADERS(pthread.h)
  774 
  775         # If pthreads library is found, just include it on the link line. We don't try
  776         # to test if the C compiler needs it or not, since the C++ or Fortran
  777         # compilers might need it even if the C compiler doesn't
  778         # (nvcc with gfortran, for example).
  779         AC_CHECK_LIB([pthread],[pthread_mutex_init],have_pthreads=yes)
  780         if test "$have_pthreads" = "yes" ; then
  781            PAC_PREPEND_FLAG([-lpthread],[LIBS])
  782         fi
  783     fi
  784 
  785     # this check should come after the AC_CHECK_LIB for -lpthread
  786     AC_CHECK_FUNC([pthread_mutex_init],[],[AC_MSG_ERROR([unable to find pthreads library])])
  787     # pthread_mutexattr_setpshared is first released in Issue 5
  788     AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
  789 
  790     AC_MSG_NOTICE([POSIX will be used for interprocess mutex package.])
  791     PROC_MUTEX_PACKAGE_NAME=MPL_PROC_MUTEX_PACKAGE_POSIX
  792   ;;
  793   no|none)
  794     with_proc_mutex_package=none
  795     PROC_MUTEX_PACKAGE_NAME=MPL_PROC_MUTEX_PACKAGE_NONE
  796   ;;
  797   *)
  798     AC_MSG_ERROR([The specified interprocess mutex package, $with_proc_mutex_package, is not supported.])
  799   ;;
  800 esac
  801 
  802 # Define and export the selected interprocess mutex package so that other packages
  803 # know what's used in MPL
  804 AC_DEFINE_UNQUOTED([PROC_MUTEX_PACKAGE_NAME],[$PROC_MUTEX_PACKAGE_NAME],[set to the name of the interprocess mutex package])
  805 #######################################################################
  806 ## END OF PROCESS MUTEX CODE
  807 #######################################################################
  808 
  809 #######################################################################
  810 ## START OF PTHREAD MUTEX COMMON CHECK
  811 #######################################################################
  812 if test "${with_thread_package}" = "pthreads" -o "${with_proc_mutex_package}" = "pthreads"; then
  813   # Check for PTHREAD_MUTEX_ERRORCHECK_NP and PTHREAD_MUTEX_ERRORCHECK
  814   AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK_NP],
  815   pac_cv_has_pthread_mutex_errorcheck_np,[
  816   AC_TRY_COMPILE([#include <pthread.h>],
  817                  [int a=PTHREAD_MUTEX_ERRORCHECK_NP;],
  818                  pac_cv_has_pthread_mutex_errorcheck_np=yes,
  819                  pac_cv_has_pthread_mutex_errorcheck_np=no)])
  820   AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK],
  821   pac_cv_has_pthread_mutex_errorcheck,[
  822   AC_TRY_COMPILE([#include <pthread.h>],
  823                  [int a=PTHREAD_MUTEX_ERRORCHECK;],
  824                  pac_cv_has_pthread_mutex_errorcheck=yes,
  825                  pac_cv_has_pthread_mutex_errorcheck=no)])
  826 
  827   if test "$pac_cv_has_pthread_mutex_errorcheck" = yes ; then
  828       AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK,
  829                 [Define to an expression that will result in an error checking mutex type.])
  830   elif test "$pac_cv_has_pthread_mutex_errorcheck_np" = yes ; then
  831       AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
  832                 [Define to an expression that will result in an error checking mutex type.])
  833   fi
  834 
  835   PAC_FUNC_NEEDS_DECL([#include <pthread.h>],pthread_mutexattr_settype)
  836 fi
  837 #######################################################################
  838 ## END OF PTHREAD MUTEX COMMON CHECK
  839 #######################################################################
  840 
  841 #######################################################################
  842 ## START OF DBG CODE
  843 #######################################################################
  844 
  845 # mkstemp() is a better replacement for mktemp()
  846 AC_HAVE_FUNCS(mkstemp)
  847 if test "$ac_cv_func_mkstemp" = "yes" ; then
  848     PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
  849 fi
  850 # fdopen() converts from an fd to a FILE*
  851 AC_HAVE_FUNCS(fdopen)
  852 if test "$ac_cv_func_fdopen" = "yes" ; then
  853     PAC_FUNC_NEEDS_DECL([#include <stdio.h>],fdopen)
  854 fi
  855 
  856 AC_CHECK_FUNCS(getpid)
  857 
  858 #######################################################################
  859 ## END OF DBG CODE
  860 #######################################################################
  861 
  862 #######################################################################
  863 ## START OF SHM CODE
  864 #######################################################################
  865 
  866 dnl Check for shm
  867 PAC_ARG_SHARED_MEMORY
  868 
  869 case $with_shared_memory in
  870     sysv)
  871         AC_DEFINE(MPL_USE_SYSV_SHM,1,[Define if use SYSV shared memory])
  872         ;;
  873     mmap)
  874         AC_DEFINE(MPL_USE_MMAP_SHM,1,[Define if use MMAP shared memory])
  875         ;;
  876     nt)
  877         AC_DEFINE(MPL_USE_NT_SHM,1,[Define if use Windows shared memory])
  878         ;;
  879     *)
  880         AC_MSG_ERROR([cannot support shared memory:  need either sysv shared memory functions or mmap in order to support shared memory])
  881 esac
  882 
  883 
  884 #######################################################################
  885 ## END OF SHM CODE
  886 #######################################################################
  887 
  888 ## Enable creation of libtool-style versioning or no versioning
  889 AC_ARG_ENABLE(versioning,
  890         [AC_HELP_STRING([--enable-versioning],[Enable library versioning])],,
  891         [enable_versioning=yes])
  892 
  893 if test "$enable_versioning" = "yes" ; then
  894    libmpl_so_versionflags="-version-info \$(libmpl_so_version)"
  895 else
  896    libmpl_so_versionflags="-avoid-version"
  897 fi
  898 export libmpl_so_versionflags
  899 AC_SUBST(libmpl_so_versionflags)
  900 
  901 #######################################################################
  902 
  903 
  904 # Check for strdup
  905 AC_CHECK_FUNCS(strdup)
  906 if test "$ac_cv_func_strdup" = "yes" ; then
  907    PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
  908 fi
  909 
  910 # Check for snprintf
  911 AC_CHECK_FUNCS(snprintf)
  912 if test "$ac_cv_func_snprintf" = "yes" ; then
  913     PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
  914 fi
  915 
  916 # Check for strncmp
  917 AC_CHECK_FUNCS(strncmp)
  918 if test "$ac_cv_func_strncmp" = "yes" ; then
  919     PAC_FUNC_NEEDS_DECL([#include <string.h>],strncmp)
  920 fi
  921 
  922 # Check for putenv
  923 AC_CHECK_FUNCS(putenv)
  924 if test "$ac_cv_func_putenv" = "yes" ; then
  925     PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv)
  926 fi
  927 
  928 # Check for strerror
  929 AC_CHECK_FUNCS(strerror)
  930 if test "$ac_cv_func_strerror" = "yes" ; then
  931     PAC_FUNC_NEEDS_DECL([#include <string.h>],strerror)
  932 fi
  933 
  934 # Check for usleep
  935 AC_CHECK_FUNCS(usleep)
  936 if test "$ac_cv_func_usleep" = "yes" ; then
  937     PAC_FUNC_NEEDS_DECL([#include <unistd.h>],usleep)
  938 fi
  939 
  940 # Check if we can implement MPL_aligned_alloc
  941 AC_CHECK_FUNCS(posix_memalign)
  942 AC_CHECK_FUNCS(aligned_alloc)
  943 if test "$ac_cv_func_aligned_alloc" = "yes" ; then
  944     PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],aligned_alloc)
  945 fi
  946 if test "$ac_cv_func_posix_memalign" = "yes" -o "$ac_cv_func_aligned_alloc" = "yes"; then
  947    AC_DEFINE([DEFINE_ALIGNED_ALLOC],[1],[Define to 1 if MPL enables MPL_aligned_alloc.])
  948 fi
  949 
  950 AC_CHECK_FUNCS(backtrace_symbols)
  951 
  952 # Check for libbacktrace support
  953 PAC_PUSH_FLAG([LIBS])
  954 PAC_PREPEND_FLAG([-lbacktrace],[LIBS])
  955 AC_LINK_IFELSE([
  956     AC_LANG_PROGRAM([
  957 #include <backtrace.h>
  958 ],[
  959 backtrace_create_state(0, 0, 0, 0);
  960 backtrace_print(0, 0, 0);
  961 ])],
  962     [ac_cv_lib_backtrace=yes],
  963     [ac_cv_lib_backtrace=no]
  964 )
  965 PAC_POP_FLAG([LIBS])
  966 
  967 if test "$ac_cv_lib_backtrace" = "yes" ; then
  968     AC_DEFINE([HAVE_LIBBACKTRACE],[1],[Define to 1 if you have the backtrace header (backtrace.h) and library (-lbacktrace)])
  969     PAC_PREPEND_FLAG([-lbacktrace],[LIBS])
  970 fi
  971 AC_CHECK_DECLS([backtrace_create_state, backtrace_print])
  972 
  973 # Check for libunwind support
  974 PAC_PUSH_FLAG([LIBS])
  975 PAC_PREPEND_FLAG([-lunwind],[LIBS])
  976 AC_LINK_IFELSE([
  977     AC_LANG_PROGRAM([
  978 #include<libunwind.h>
  979 ],[
  980 unw_backtrace(0, 0);
  981 ])],
  982     [ac_cv_lib_libunwind=yes],
  983     [ac_cv_lib_libunwind=no]
  984 )
  985 PAC_POP_FLAG([LIBS])
  986 
  987 if test "$ac_cv_lib_libunwind" = "yes" ; then
  988     AC_DEFINE([HAVE_LIBUNWIND],[1],[Define to 1 if you have the libunwind header (libunwind.h) and library (-lunwind)])
  989     PAC_PREPEND_FLAG([-lunwind],[LIBS])
  990 fi
  991 
  992 AX_LIB_SOCKET_NSL
  993 AC_CHECK_HEADERS(ifaddrs.h arpa/inet.h)
  994 AC_CHECK_FUNCS(inet_ntop getifaddrs)
  995 
  996 dnl Check for ATTRIBUTE
  997 PAC_C_GNU_ATTRIBUTE
  998 AX_GCC_VAR_ATTRIBUTE(aligned)
  999 AX_GCC_VAR_ATTRIBUTE(used)
 1000 
 1001 dnl Check for fallthrough attribute
 1002 PAC_PUSH_ALL_FLAGS
 1003 dnl This check requires removing -Wall and -Wextra first or it will fail. Just
 1004 dnl clear them all.
 1005 CFLAGS=""
 1006 AX_GCC_FUNC_ATTRIBUTE(fallthrough)
 1007 PAC_POP_ALL_FLAGS
 1008 
 1009 dnl Final output
 1010 AC_CONFIG_FILES([Makefile localdefs include/mpl_timer.h])
 1011 AC_OUTPUT