1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/rapi.c)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(librapi2, 0.11.1)
AM_CONFIG_HEADER(rapi_config.h)
CFLAGS="-Wsign-compare -Wno-long-long $CFLAGS"
case $target in
powerpc-apple-*)
dnl Prevent "Undefined Macro argument list" error.
CFLAGS="-no-cpp-precomp $CFLAGS"
;;
*)
;;
esac
dnl Checks for typedefs, structures, and compiler characteristics.
saved_CFLAGS="$CFLAGS"
CFLAGS=""
AC_C_CONST
CFLAGS="$saved_CFLAGS"
AC_CHECK_SIZEOF(void *)
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
dnl AM_PATH_CHECK(,,AC_MSG_WARN([Check not available.]))
dnl Check for dmalloc first
AC_ARG_WITH(dmalloc,
AC_HELP_STRING([--with-dmalloc=PREFIX],[use dmalloc (default is NO)]),
[case "${withval}" in
yes) dmalloc=true ;;
no) dmalloc=false ;;
*) dmalloc=true; dmalloc_prefix="-L${withval}" ;;
esac],[dmalloc=false])
if ${dmalloc}; then
AC_CHECK_LIB(dmalloc,main,,[
AC_MSG_ERROR([Can't find dmalloc library])
],${dmalloc_prefix})
AC_CHECK_HEADERS(dmalloc.h,,[
AC_MSG_ERROR([Can't find dmalloc.h])
])
fi
dnl Checks for libraries.
AC_LIB_RPATH
dnl Check for libsynce
PKG_CHECK_MODULES(LIBSYNCE, libsynce >= 0.11.1)
dnl Checks for header files.
dnl For readv/writev
AC_CHECK_HEADERS(sys/uio.h)
dnl Checks for library functions.
AC_CHECK_FUNCS(readv)
AC_CHECK_FUNCS(writev)
dnl #
dnl # Now we must check for Python/Pyrex
dnl #
dnl # (need python, python headers, and pyrex)
AC_ARG_ENABLE(python-bindings, AS_HELP_STRING([--disable-python-bindings], [do not build python bindings]),[enable_python=$enableval], [enable_python=auto])
if test x$enable_python = xno; then
have_python=no
else
AC_MSG_NOTICE([Checking to see if we can build Python bindings])
have_python=no
if test x$enable_python != xyes -a x$enable_python != xauto; then
minimum_version=$enable_python
enable_python=yes
else
minimum_version=2.2
fi
AM_PATH_PYTHON($minimum_version, [have_python_path=yes], [have_python_path=no] )
AC_CHECK_PROGS(PYREX, pyrexc)
AM_CHECK_PYTHON_HEADERS([have_python_header=yes], [have_python_header=no])
if test x$have_python_path = xno -o x$have_python_header = xno -o x$PYREX != xpyrexc ; then
if test x$enable_python = xyes ; then
AC_MSG_ERROR([Building python bindings requested, but can't build them])
else
AC_MSG_NOTICE([Not building Python bindings])
fi
else
if test -z "$PYTHON" ; then
AC_MSG_WARN([Python not found])
else
have_python=yes
fi
if test x$have_python = xno ; then
if test x$enable_python = xyes ; then
AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
fi
fi
fi
fi
AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
# checks for pthreads
ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
if test $enable_threads != "pthread"; then
AC_MSG_ERROR([unable to find pthreads, currently this is required])
else
AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
fi
AC_CONFIG_FILES(
[script/synce-install-cab],
[chmod +x script/synce-install-cab]
)
AC_CONFIG_FILES(
[script/synce-remove-program],
[chmod +x script/synce-remove-program]
)
AC_OUTPUT([librapi2.pc
Makefile
src/Makefile
src/support/Makefile
src/config/Makefile
src/rapi/Makefile
src/rapi2/Makefile
man/Makefile
script/Makefile
tests/Makefile
tests/CeRapiInvoke/Makefile
tests/rapi/Makefile
tools/Makefile
tools/man/Makefile
python/Makefile
python/tests/Makefile])
|