summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-09-17 21:10:33 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-09-17 21:10:33 +0000
commite95630bd19a0edceccd42e5a2db0198608d8c97c (patch)
tree60ef190d6eb72b1934b8e632f46b2b46567d1b44
parent2643967c17a6e653785f18035b661f14ea4a596b (diff)
Python-EFL should be 200% foo-proof and aler the foo.
Now I want to see if raster manages to break it! Damn! :-D SVN revision: 52386
-rw-r--r--configure.ac14
-rw-r--r--m4/filter-var.m410
-rw-r--r--m4/pythonpath.m481
-rw-r--r--python-ethumb.pc.in2
-rw-r--r--python-ethumb_client.pc.in4
5 files changed, 105 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index b5b32f2..dc9796d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,11 @@ if test "x$CYTHON_FOUND" != "xyes"; then
119fi 119fi
120AM_CONDITIONAL(HAVE_CYTHON, [test "x$CYTHON_FOUND" = "xyes"]) 120AM_CONDITIONAL(HAVE_CYTHON, [test "x$CYTHON_FOUND" = "xyes"])
121 121
122FILTER_VAR_REGEXP([CFLAGS], [-fvisibility=hidden])
123FILTER_VAR_REGEXP([LDFLAGS], [-fvisibility=hidden])
124
125AM_CHECK_PYTHONPATH
126
122AC_PATH_PROG([EPYDOC], [epydoc], [no]) 127AC_PATH_PROG([EPYDOC], [epydoc], [no])
123AC_SUBST(EPYDOC) 128AC_SUBST(EPYDOC)
124AM_CONDITIONAL(HAVE_EPYDOC, [test "x$EPYDOC" != "xno"]) 129AM_CONDITIONAL(HAVE_EPYDOC, [test "x$EPYDOC" != "xno"])
@@ -171,10 +176,9 @@ echo "Installation...........: make install (as root if needed, with 'su' or 'su
171echo " prefix...............: $prefix" 176echo " prefix...............: $prefix"
172echo 177echo
173echo 178echo
174echo "To use the local version (as opposed to the installed version) use:" 179
175echo 180if test "x$PYTHONPATH_CORRECT" != "xyes"; then
176echo " export PYTHONPATH=\"$PWD:$PWD/.libs:\$PYTHONPATH\"" 181 AC_MSG_WARN([your \$PYTHONPATH does not contains the required directories to support your desired installation. Please check warnings above.])
177echo " python -c 'import ethumb; print ethumb' # test load" 182fi
178echo
179 183
180 184
diff --git a/m4/filter-var.m4 b/m4/filter-var.m4
new file mode 100644
index 0000000..9c970e4
--- /dev/null
+++ b/m4/filter-var.m4
@@ -0,0 +1,10 @@
1dnl FILTER_VAR_REGEXP(VARIABLE, REGEXP-TO-DELETE [, ACTION-IF-REMOVED])
2dnl Applies "sed" regular expression to remove REGEXP-TO-DELETE from $VARIABLE
3AC_DEFUN([FILTER_VAR_REGEXP],
4[
5_tmp_[]$1=`echo "$[]$1" | sed -e 's/$2//g'`
6if test "x$_tmp_[]$1" != "x$[]$1"; then
7 ifelse([$3], [], [AC_MSG_WARN([Removed $2 from \$[]$1])], [$3])
8 $1="$_tmp_[]$1"
9fi
10])
diff --git a/m4/pythonpath.m4 b/m4/pythonpath.m4
new file mode 100644
index 0000000..7dc5a1a
--- /dev/null
+++ b/m4/pythonpath.m4
@@ -0,0 +1,81 @@
1dnl _CHECK_PYTHONPATH(PATH, ACTION-YES, ACTION-NO)
2AC_DEFUN([_CHECK_PYTHONPATH],
3[
4m4_define([pyprog], [import sys; sys.exit(not ('$1' in sys.path))])
5
6changequote(, )
7_cachevar=`echo "$1" | sed -e "s/[^a-zA-Z0-9_]/_0123_/g" `
8changequote([, ])
9_cachevar="py_cv_path_${_cachevar}"
10
11AC_CACHE_CHECK([for $1 in \$PYTHONPATH], [$_cachevar],
12 [
13 _res=no
14 if AC_RUN_LOG([$PYTHON -c "pyprog"]); then
15 _res=yes
16 fi
17 eval "${_cachevar}=$_res"
18 unset _res
19 ])
20eval "_res=\${${_cachevar}}"
21if test "$_res" = "yes"; then
22 $2
23else
24 $3
25fi
26])
27
28dnl a macro to check if install location is in $PYTHONPATH or builtin locations
29dnl AM_CHECK_PYTHONPATH([ACTION-YES [, ACTION-NO]])
30dnl defines PYTHONPATH_CORRECT=yes/no
31AC_DEFUN([AM_CHECK_PYTHONPATH],
32[AC_REQUIRE([AM_PATH_PYTHON])
33
34_orig_exec_prefix="$exec_prefix"
35if test -z "$exec_prefix" -o "$exec_prefix" = "NONE"; then
36 exec_prefix="$prefix"
37fi
38_pythondir=`eval "echo $pythondir"`
39_pyexecdir=`eval "echo $pyexecdir"`
40exec_prefix="${_orig_exec_prefix}"
41unset _orig_exec_prefix
42
43PYTHONPATH_CORRECT=yes
44
45_CHECK_PYTHONPATH([$_pythondir],
46 [ifelse([$1], [], [:], [$1])],
47 [PYTHONPATH_CORRECT=no
48 ifelse([$2], [],
49 [AC_MSG_WARN([\$PYTHONPATH does not include $_pythondir, this may result in runtime problems with python that uses this module.])],
50 [$2])])
51
52if test "$_pythondir" != "$_pyexecdir"; then
53_CHECK_PYTHONPATH([$_pyexecdir],
54 [ifelse([$1], [], [:], [$1])],
55 [PYTHONPATH_CORRECT=no
56 ifelse([$2], [],
57 [AC_MSG_WARN([\$PYTHONPATH does not include $_pyexecdir, this may result in runtime problems with python that uses this module.])],
58 [$2])])
59fi
60
61unset _pythondir
62unset _pyexecdir
63])
64
65dnl a macro to check if given directory is in $PYTHONPATH or builtin locations
66dnl AM_CHECK_PYTHONPATH_CONTAINS(DIRECTORY [, ACTION-YES [, ACTION-NO]])
67dnl defines PYTHONPATH_CORRECT=yes/no
68AC_DEFUN([AM_CHECK_PYTHONPATH_CONTAINS],
69[AC_REQUIRE([AM_PATH_PYTHON])
70
71_dir="$1"
72_dir=`expr "X$_dir" : 'X\(.*[^/]\)' \| "X$_dir" : 'X\(.*\)'`
73
74_CHECK_PYTHONPATH([$_dir],
75 [ifelse([$2], [], [:], [$2])],
76 [ifelse([$3], [],
77 [AC_MSG_WARN([\$PYTHONPATH does not include $_dir, this may result in runtime problems with python that uses this module.])],
78 [$3])])
79
80unset _dir
81])
diff --git a/python-ethumb.pc.in b/python-ethumb.pc.in
index 963f471..47b202c 100644
--- a/python-ethumb.pc.in
+++ b/python-ethumb.pc.in
@@ -3,6 +3,8 @@ exec_prefix=@exec_prefix@
3libdir=@libdir@ 3libdir=@libdir@
4datarootdir=@datarootdir@ 4datarootdir=@datarootdir@
5datadir=@datarootdir@/@PACKAGE@ 5datadir=@datarootdir@/@PACKAGE@
6pythondir=@pythondir@
7pyexecdir=@pyexecdir@
6 8
7Name: @PACKAGE@ 9Name: @PACKAGE@
8Description: Python bindings for Ethumb 10Description: Python bindings for Ethumb
diff --git a/python-ethumb_client.pc.in b/python-ethumb_client.pc.in
index 576131f..5ec56a1 100644
--- a/python-ethumb_client.pc.in
+++ b/python-ethumb_client.pc.in
@@ -2,7 +2,9 @@ prefix=@prefix@
2exec_prefix=@exec_prefix@ 2exec_prefix=@exec_prefix@
3libdir=@libdir@ 3libdir=@libdir@
4datarootdir=@datarootdir@ 4datarootdir=@datarootdir@
5datadir=@datarootdir@/python-ecore-evas 5datadir=@datarootdir@/python-ethumb
6pythondir=@pythondir@
7pyexecdir=@pyexecdir@
6 8
7Name: Python Ethumb Client 9Name: Python Ethumb Client
8Description: Python bindings for Ethumb Client 10Description: Python bindings for Ethumb Client