File: configure.ac

package info (click to toggle)
python-csa 0.1.13-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 572 kB
  • sloc: python: 2,444; cpp: 320; sh: 49; makefile: 39
file content (111 lines) | stat: -rw-r--r-- 3,260 bytes parent folder | download
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
dnl Process this file with autoconf to produce configure.
AC_INIT(csa, 0.1.8)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE

AC_MSG_CHECKING([library directory at])
   eval pfx="/usr/local"
   if test "${exec_prefix}" != "NONE" ; then
      eval pfx="${exec_prefix}"
   elif test "${prefix}" != "NONE" ; then
      eval pfx="${prefix}"
   fi
   eval libdir="`echo "$libdir" | sed "s,\\${exec_prefix},${pfx},"`"
AC_MSG_RESULT($libdir)

#
# Use libneurosim?
#
AC_CHECK_LIB(neurosim, libneurosim_version, HAVE_LIBNEUROSIM="auto", HAVE_LIBNEUROSIM="no")
if test "x$HAVE_LIBNEUROSIM" = xauto; then
   LIBNEUROSIM_LIBS="-lneurosim"
   LIBNEUROSIM_PY_LIBS="-lpyneurosim"
   LIBNEUROSIM_INCLUDE=""
fi
AC_ARG_WITH(libneurosim, [  --with-libneurosim[[=directory]]       Request the use of libneurosim. Optionally give the directory, where libneurosim is installed],
  [
    if test "$withval" != "no"; then
      if test "$withval" != "yes"; then
    	LIBNEUROSIM_LIBS="-L${withval}/lib -lneurosim"
	LIBNEUROSIM_PY_LIBS="-lpyneurosim"
	LIBNEUROSIM_INCLUDE="-I${withval}/include"
      fi
      HAVE_LIBNEUROSIM="yes"
    else
      HAVE_LIBNEUROSIM="no"
    fi
  ])

if test "x$HAVE_LIBNEUROSIM" != xno; then
  AC_DEFINE(HAVE_LIBNEUROSIM, 1, [libneurosim support enabled?])
fi

AC_ARG_WITH([python],
    [AS_HELP_STRING([--without-python], [ignore the presence of Python and disable libpycsa])])

AS_IF([test "x$with_python" != "xno"],
      [AS_IF([test "x$with_python" != "xyes"],
             [PYTHON="$with_python"])
       AM_PATH_PYTHON([2.6], [have_python=yes], [have_python=no])],
      [have_python=no])

AS_IF([test "x$have_python" = "xyes"], [
    PYTHON_INC=`$PYTHON -c 'import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_inc())'`
    AC_CHECK_FILE(["${PYTHON_INC}/Python.h"], [LIBPYCSA_CPPFLAGS="-I${PYTHON_INC}"], [have_python=no])
    PYTHONLIB=""
    AC_CHECK_LIB(python${am_cv_python_version}m,PyArg_ParseTuple,
                 [PYTHONLIB=-lpython${am_cv_python_version}m],
		 [AC_CHECK_LIB(python${am_cv_python_version},PyArg_ParseTuple,
		               [PYTHONLIB=-lpython${am_cv_python_version}])])
])

AC_MSG_CHECKING([whether to build libpycsa])
AS_IF([test "x$have_python" = "xyes"], [],
      [AS_IF([test "x$with_python" = "xyes"],
             [AC_MSG_ERROR([Libpycsa requested, but Python not found])])])
AC_MSG_RESULT([$have_python])

AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],
                      [LIBPYCSA_CXXFLAGS="-fno-strict-aliasing"], [])

# FIXME: this means that --without-python make will not recurse into libpycsa subdir
if test "x$have_python" = "xyes"; then
    LIBPYCSA_SUBDIR="libpycsa"
else
    LIBPYCSA_SUBDIR=""
fi

AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])

AC_SUBST([HAVE_PYTHON])
AC_SUBST([LIBPYCSA_SUBDIR])

AC_SUBST([PYTHON])
AC_SUBST([PYTHONLIB])

AC_SUBST([LIBPYCSA_CPPFLAGS])
AC_SUBST([LIBPYCSA_CXXFLAGS])

AC_LANG(C++)

AC_PROG_CXX
AC_PROG_LIBTOOL

AC_SUBST(LIBNEUROSIM_LIBS)
AC_SUBST(LIBNEUROSIM_PY_LIBS)
AC_SUBST(LIBNEUROSIM_INCLUDE)

AC_CONFIG_FILES([
  Makefile
  csa/__init__.py
  libpycsa/Makefile
])

AC_OUTPUT

dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl End: