"Fossies" - the Fresh Open Source Software Archive

Member "FunctionCheck-3.2.0/configure.in" (1 Jun 2012, 4568 Bytes) of package /linux/privat/old/FunctionCheck-3.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl Process this file with autoconf to produce a configure script.
    2 dnl Note: this is a test version
    3 dnl
    4 dnl local configure for libfc
    5 dnl
    6 
    7 
    8 AC_INIT(src/fcmanager/main.c)
    9 
   10 AM_INIT_AUTOMAKE(FunctionCheck, 0.0.0)
   11 
   12 dnl Uncomment this, and include "config.h" to get defines
   13 dnl
   14 dnl AM_CONFIG_HEADER(config.h)
   15 
   16 AC_CONFIG_MACRO_DIR([m4])
   17 
   18 dnl some additionnal options to configure
   19 
   20 dnl the 'debug' option allow compilation with debug activated
   21 AC_ARG_ENABLE(debug,
   22      [  --enable-debug    Turn on debugging],
   23      [case "${enableval}" in
   24        yes) debug=true ;;
   25        no)  debug=false ;;
   26        *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
   27      esac],[debug=false])
   28 
   29 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
   30 
   31 dnl Checks for programs. Not sure I need all of them
   32 AC_PROG_CC
   33 AC_PROG_CXX
   34 AC_PROG_INSTALL
   35 AC_PROG_MAKE_SET
   36 AC_PROG_LIBTOOL
   37 
   38 AC_PATH_PROG(MAKEINFO, makeinfo, :)
   39 AC_PATH_PROG(TEXI2HTML, texi2html, :)
   40 
   41 
   42 dnl TO ADD: check for gcc AND gcc --version >= 2.95.2
   43 
   44 
   45 
   46 dnl the conditionnal for -monolithic option for texi2html
   47 AM_CONDITIONAL(TEXI2HTMLOPT, test -n "`${TEXI2HTML} --help 2>&1 | grep monolithic`" )
   48 
   49 
   50 dnl Checks for libraries.
   51 
   52 dnl Checks for header files.
   53 AC_HEADER_STDC
   54 AC_CHECK_HEADERS(link.h errno.h pthread.h unistd.h time.h \
   55         sys/time.h sys/times.h sys/types.h \
   56         limits.h string.h stdarg.h malloc.h \
   57         dlfcn.h sys/ipc.h sys/shm.h)
   58 
   59 
   60 dnl check for pthread in order to set ldflags
   61 AM_CONDITIONAL(WITHTHREAD, test yes = "$ac_cv_header_pthread_h")
   62 
   63 dnl check for dlfcn in order to set ldflags
   64 AM_CONDITIONAL(WITHDLFCN, test yes = "$ac_cv_header_dlfcn_h")
   65 
   66 
   67 dnl warning: the three next AC_* are for autoconf V?.?.?
   68 dnl if autoconf refuse them, comment the three line and
   69 dnl uncomment the line just above
   70 dnl AC_DEFINE(HAVE_DECL__DYNAMIC)
   71 
   72 AC_CHECK_DECLS(_DYNAMIC, , echo "INFO: it seems to be a solaris architecture...", [#include <link.h>] )
   73 
   74 dnl test for the kind of Dyn type: Elf32_Dyn or Elf64_Dyn
   75 dnl   used for solaris, as they don't provide the ElfW(?) macro
   76 AC_CHECK_TYPES(Elf32_Dyn , , , [#include <link.h>])
   77 AC_CHECK_TYPES(Elf64_Dyn , , , [#include <link.h>])
   78 
   79 
   80 
   81 
   82 
   83 dnl difficult: check for __malloc_hook
   84 AC_MSG_CHECKING([for valid hooks in malloc.h ...])
   85 AC_TRY_COMPILE([#ifndef _MALLOC_INTERNAL
   86 #define _MALLOC_INTERNAL
   87 #endif
   88 #include <features.h>
   89 #include <malloc.h>],
   90         [void *ptr_test;
   91 ptr_test = (void*)__malloc_hook;
   92 ptr_test = (void*)__free_hook;
   93 ptr_test = (void*)__realloc_hook;
   94 ptr_test = (void*)__memalign_hook;
   95 ], valid_hooks=yes, valid_hooks=no)
   96 
   97 dnl now test the result
   98 if test yes = "${valid_hooks}"
   99   then
  100     AC_DEFINE(HAVE_VALID_HOOKS)
  101     AC_MSG_RESULT([ yes])
  102   else
  103     AC_MSG_RESULT([ no])
  104 fi
  105 
  106 
  107 dnl Checks for typedefs, structures, and compiler characteristics.
  108 AC_C_CONST
  109 AC_STRUCT_TM
  110 AC_TYPE_PID_T
  111 AC_TYPE_SIZE_T
  112 AC_HEADER_TIME
  113 
  114 
  115 dnl Checks for library functions.
  116 AC_CHECK_FUNCS(gettimeofday strdup strerror getenv setenv unsetenv)
  117 
  118 
  119 dnl Test for pthread presence
  120 if test yes != "$ac_cv_header_pthread_h" ;
  121   then AC_DEFINE(FC_NO_THREAD)
  122        echo "WARNING: no 'pthread.h' on your system."
  123        echo "         profiling threads will be switched"
  124        echo "         to multi-process mode (FORK)."
  125 fi
  126 
  127 dnl Test for ipc/shm
  128 if test yes != "$ac_cv_header_sys_ipc_h" || test yes != "$ac_cv_header_sys_shm_h";
  129   then
  130        echo "FATAL: you do not have 'sys/ipc.h' and/or 'sys/shm.h'"
  131        echo "       needed for communication system."
  132        echo "       Try to install it before. Sorry."
  133        exit
  134 fi
  135 
  136 dnl Test for dlfcn presence
  137 if test yes != "$ac_cv_header_dlfcn_h" ;
  138   then AC_DEFINE(FC_NO_DLFCN)
  139        echo "WARNING: no 'dlfcn.h' on your system."
  140        echo "         profiling programs using 'dlopen/dlcose/dlsym'"
  141        echo "         will give erroneous results."
  142 fi
  143 
  144 dnl Test for getenv presence
  145 if test yes != "$ac_cv_func_getenv" ;
  146   then AC_DEFINE(FC_NO_GETENV)
  147     echo "FATAL: you need a 'getenv' to specify options"
  148     echo "       to FunctionCheck. Sorry."
  149     exit
  150 fi
  151 
  152 dnl Test for setenv presence
  153 if test yes != "$ac_cv_func_setenv" ;
  154   then AC_DEFINE(FC_NO_SETENV)
  155     echo "WARNING: ressource files will not be available"
  156     echo "         because 'setenv' is not available."
  157 fi
  158 
  159 dnl Test for unsetenv presence
  160 if test yes != "$ac_cv_func_unsetenv" ;
  161   then AC_DEFINE(FC_NO_UNSETENV)
  162     echo "WARNING: ressource files will not be available"
  163     echo "         because 'unsetenv' is not available."
  164 fi
  165 
  166 
  167 AC_OUTPUT(\
  168     Makefile \
  169     doc/Makefile \
  170     test/Makefile \
  171     src/Makefile \
  172     src/fcmanager/Makefile \
  173     src/fcdump/Makefile \
  174     src/libfc/Makefile \
  175     src/share/Makefile
  176     )