]>
Commit | Line | Data |
---|---|---|
1b233b95 | 1 | # -*- shell-script -*- |
d27ce529 | 2 | HAVE_OPENSSL='@HAVE_OPENSSL@' |
05b3c97b | 3 | HAVE_PYTHON='@HAVE_PYTHON@' |
8073dd31 | 4 | EGREP='@EGREP@' |
05b3c97b | 5 | PERL='@PERL@' |
79982e90 EJ |
6 | |
7 | if test x"$PYTHON" = x; then | |
8 | PYTHON='@PYTHON@' | |
9 | fi | |
99155935 | 10 | |
67e96a5d | 11 | PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH |
99155935 | 12 | export PYTHONPATH |
be44585c BP |
13 | |
14 | PYTHONIOENCODING=utf_8 | |
15 | export PYTHONIOENCODING | |
42c2ebcd | 16 | |
853d1083 BP |
17 | # PYTHONDONTWRITEBYTECODE=yes keeps Python 2.6+ from creating .pyc and .pyo |
18 | # files. Creating .py[co] works OK for any given version of Open | |
19 | # vSwitch, but it causes trouble if you switch from a version with | |
20 | # foo/__init__.py into an (older) version with plain foo.py, since | |
21 | # foo/__init__.pyc will cause Python to ignore foo.py. | |
22 | # | |
23 | # Python before version 2.6 always creates .pyc files, so if you develop | |
24 | # with such an older version then you're out of luck. | |
25 | PYTHONDONTWRITEBYTECODE=yes | |
26 | export PYTHONDONTWRITEBYTECODE | |
27 | ||
e6e590a7 BP |
28 | # Test whether the current working directory name is all ASCII |
29 | # characters. Some Python code doesn't tolerate non-ASCII characters | |
30 | # in filenames very well, so if the current working directory is | |
31 | # non-ASCII then we skip the tests that run those programs. | |
32 | # | |
33 | # This would be just papering over a real problem, except that the | |
34 | # tests that we skip are launched from initscripts and thus normally | |
35 | # run in system directories with ASCII names. (This problem only came | |
36 | # up at all because the Debian autobuilders do build in a top-level | |
37 | # directory named /«BUILDDIR».) | |
38 | case `pwd | tr -d ' -~'` in | |
39 | '') non_ascii_cwd=false ;; | |
40 | *) non_ascii_cwd=true | |
41 | esac | |
42 | ||
42c2ebcd EJ |
43 | if test $HAVE_PYTHON = yes; then |
44 | if python -m argparse 2>/dev/null; then | |
45 | : | |
46 | else | |
47 | PYTHONPATH=$PYTHONPATH:$abs_top_srcdir/python/compat | |
48 | export PYTHONPATH | |
79982e90 | 49 | fi |
42c2ebcd | 50 | fi |
2db1f87e | 51 | |
f0b87599 EM |
52 | # Enable malloc debugging features. |
53 | case `uname` in | |
54 | Linux) | |
b6137ea8 BP |
55 | MALLOC_PERTURB_=165; export MALLOC_PERTURB_ |
56 | ||
57 | # Before glibc 2.11, the feature enabled by MALLOC_CHECK_ was not | |
58 | # thread-safe. See https://bugzilla.redhat.com/show_bug.cgi?id=585674 and | |
59 | # in particular the patch attached there, which was applied to glibc CVS as | |
60 | # "Restore locking in free_check." between 1.11 and 1.11.1. | |
61 | vswitchd=$abs_top_builddir/vswitchd/ovs-vswitchd | |
62 | glibc=`ldd $vswitchd | sed -n 's/^ libc\.[^ ]* => \([^ ]*\) .*/\1/p'` | |
63 | glibc_version=`$glibc | sed -n '1s/.*version \([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/p'` | |
64 | case $glibc_version in | |
65 | 2.[0-9] | 2.1[01]) mcheck=disabled ;; | |
66 | *) mcheck=enabled ;; | |
67 | esac | |
68 | if test $mcheck = enabled; then | |
69 | MALLOC_CHECK_=2; export MALLOC_CHECK_ | |
70 | else | |
71 | echo >&2 "glibc $glibc_version detected, disabling memory checking" | |
72 | fi | |
f0b87599 EM |
73 | ;; |
74 | FreeBSD) | |
75 | case `uname -r` in | |
76 | [789].*) | |
77 | MALLOC_CONF=AJ | |
78 | ;; | |
79 | *) | |
80 | MALLOC_CONF=abort:true,junk:true,redzone:true | |
81 | ;; | |
82 | esac | |
83 | export MALLOC_CONF | |
84 | esac | |
9a9808d7 YT |
85 | |
86 | # The name of loopback interface | |
87 | case `uname` in | |
88 | Linux) | |
89 | LOOPBACK_INTERFACE=lo | |
90 | ;; | |
91 | FreeBSD|NetBSD) | |
92 | LOOPBACK_INTERFACE=lo0 | |
93 | ;; | |
94 | esac | |
c7c1bdf3 | 95 | |
d98e1498 | 96 | # Check for platform. |
c7c1bdf3 GS |
97 | case `uname` in |
98 | MINGW*) | |
99 | IS_WIN32="yes" | |
d98e1498 PS |
100 | IS_BSD="no" |
101 | ;; | |
102 | FreeBSD|NetBSD) | |
103 | IS_WIN32="no" | |
104 | IS_BSD="yes" | |
c7c1bdf3 GS |
105 | ;; |
106 | *) | |
107 | IS_WIN32="no" | |
d98e1498 | 108 | IS_BSD="no" |
c7c1bdf3 GS |
109 | ;; |
110 | esac | |
0f1e8ed0 GS |
111 | |
112 | # XXX: Disable Python related tests on Windows because Open vSwitch code | |
113 | # written in Python has not been ported to the Windows platform. We will | |
114 | # need to remove the next block after porting is complete. | |
115 | if test "$IS_WIN32" = "yes"; then | |
116 | HAVE_PYTHON="no" | |
117 | fi |