Revert "Merge remote branch 'cros/upstream' into tempbranch2"

This reverts commit 25fc6d1f28e54c46689f12d3b93c2540ef45323a.

TBR=ericli@chromium.org

Review URL: http://codereview.chromium.org/3541002

Change-Id: Ib0165b19bfdf02264f8a6a74ddf3ae74c8c0f7df
diff --git a/client/deps/boottool/boottool.py b/client/deps/boottool/boottool.py
index a391be3..2718af1 100755
--- a/client/deps/boottool/boottool.py
+++ b/client/deps/boottool/boottool.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 from autotest_lib.client.bin import utils
 
 # To use this, you have to set PERL5LIB to:
@@ -15,9 +16,9 @@
     srcdir = os.path.join(topdir, 'src')
     utils.extract_tarball_to_dir(tarball, srcdir)
     os.chdir(srcdir)
-    utils.system('perl Makefile.PL PREFIX=' + topdir)
-    utils.make()
-    utils.make('install')
+    utils.system ('perl Makefile.PL PREFIX=' + topdir)
+    utils.system ('make')
+    utils.system ('make install')
     os.chdir(topdir)
 
 
diff --git a/client/deps/boottool/common.py b/client/deps/boottool/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/boottool/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/dejagnu/common.py b/client/deps/dejagnu/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/dejagnu/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/dejagnu/dejagnu.py b/client/deps/dejagnu/dejagnu.py
index 33888f3..8bfe7b8 100755
--- a/client/deps/dejagnu/dejagnu.py
+++ b/client/deps/dejagnu/dejagnu.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 from autotest_lib.client.bin import utils
 
 version = 1
@@ -9,9 +10,9 @@
     srcdir = os.path.join(topdir, 'src')
     utils.extract_tarball_to_dir(tarball, 'src')
     os.chdir(srcdir)
-    utils.configure('--prefix=%s/dejagnu' % topdir)
-    utils.make()
-    utils.make('install')
+    utils.system ('./configure --prefix=%s/dejagnu' % topdir)
+    utils.system('make')
+    utils.system('make install')
 
     os.chdir(topdir)
 
diff --git a/client/deps/libaio/common.py b/client/deps/libaio/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/libaio/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/libaio/libaio.py b/client/deps/libaio/libaio.py
index 5389f32..62a6ed8 100755
--- a/client/deps/libaio/libaio.py
+++ b/client/deps/libaio/libaio.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 from autotest_lib.client.bin import utils
 
 version = 1
@@ -10,8 +11,8 @@
     utils.extract_tarball_to_dir(tarball, srcdir)
     os.chdir(srcdir)
     utils.system('patch -p1 < ../00_arches.patch')
-    utils.make()
-    utils.make('prefix=%s install' % topdir)
+    utils.system('make')
+    utils.system('make prefix=%s install' % topdir)
     os.chdir(topdir)
 
 
diff --git a/client/deps/libcap/common.py b/client/deps/libcap/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/libcap/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/libcap/libcap.py b/client/deps/libcap/libcap.py
index d31c8f9..d599efe 100755
--- a/client/deps/libcap/libcap.py
+++ b/client/deps/libcap/libcap.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-import os
+import os, common
 from autotest_lib.client.bin import utils
 
 version = 2
@@ -9,7 +9,7 @@
     topdir = os.getcwd()
     utils.extract_tarball_to_dir(tarball, srcdir)
     os.chdir(srcdir)
-    utils.make('-C libcap LIBATTR=no')
+    utils.system('make -C libcap LIBATTR=no')
     os.chdir(topdir)
 
 srcdir = os.path.abspath('./src')
diff --git a/client/deps/libnet/common.py b/client/deps/libnet/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/libnet/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/libnet/libnet.py b/client/deps/libnet/libnet.py
index 0b0dd1a..32cb8ae 100755
--- a/client/deps/libnet/libnet.py
+++ b/client/deps/libnet/libnet.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 from autotest_lib.client.bin import utils
 
 version = 1
@@ -12,9 +13,9 @@
                        tarball)
     utils.extract_tarball_to_dir(tarball, 'src')
     os.chdir(srcdir)
-    utils.configure ('--prefix=%s/libnet' % topdir)
-    utils.make()
-    utils.make('install')
+    utils.system ('./configure --prefix=%s/libnet' % topdir)
+    utils.system('make')
+    utils.system('make install')
 
     os.chdir(topdir)
 
diff --git a/client/deps/mysql/common.py b/client/deps/mysql/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/mysql/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/mysql/mysql.py b/client/deps/mysql/mysql.py
index 2328d30..d8f0037 100755
--- a/client/deps/mysql/mysql.py
+++ b/client/deps/mysql/mysql.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 from autotest_lib.client.bin import utils
 
 version = 3
@@ -11,10 +12,10 @@
         utils.get_file('http://mirror.x10.com/mirror/mysql/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz', tarball)
     utils.extract_tarball_to_dir(tarball, 'src')
     os.chdir(srcdir)
-    utils.configure('--prefix=%s/mysql --enable-thread-safe-client' \
+    utils.system ('./configure --prefix=%s/mysql --enable-thread-safe-client' \
                     % topdir)
-    utils.make('-j %d' % utils.count_cpus())
-    utils.make('install')
+    utils.system('make -j %d' % utils.count_cpus())
+    utils.system('make install')
 
     #
     # MySQL doesn't create this directory on it's own.
diff --git a/client/deps/pgpool/common.py b/client/deps/pgpool/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/pgpool/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/pgpool/pgpool.py b/client/deps/pgpool/pgpool.py
index 1c52bfb..c4caab5 100755
--- a/client/deps/pgpool/pgpool.py
+++ b/client/deps/pgpool/pgpool.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 from autotest_lib.client.bin import utils
 
 version = 1
@@ -15,10 +16,10 @@
     os.chdir(srcdir)
     # FIXEME - Waiting to be able to use self.autodir instead of
     # os.environ['AUTODIR']
-    utils.configure('--prefix=%s/pgpool --with-pgsql=%s/deps/pgsql/pgsql' \
+    utils.system('./configure --prefix=%s/pgpool --with-pgsql=%s/deps/pgsql/pgsql' \
                     % (topdir, os.environ['AUTODIR']))
-    utils.make('-j %d' % utils.count_cpus())
-    utils.make('install')
+    utils.system('make -j %d' % utils.count_cpus())
+    utils.system('make install')
 
     os.chdir(topdir)
 
diff --git a/client/deps/pgsql/common.py b/client/deps/pgsql/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/pgsql/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/pgsql/pgsql.py b/client/deps/pgsql/pgsql.py
index e1aabf7..5df7a8d 100755
--- a/client/deps/pgsql/pgsql.py
+++ b/client/deps/pgsql/pgsql.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 from autotest_lib.client.bin import utils
 
 version = 4
@@ -11,9 +12,9 @@
         utils.get_file('ftp://ftp.postgresql.org/pub/source/v8.3.1/postgresql-8.3.1.tar.bz2', tarball)
     utils.extract_tarball_to_dir(tarball, 'src')
     os.chdir(srcdir)
-    utils.configure('--without-readline --without-zlib --enable-debug --prefix=%s/pgsql' % topdir)
-    utils.make('-j %d' % utils.count_cpus())
-    utils.make('install')
+    utils.system ('./configure --without-readline --without-zlib --enable-debug --prefix=%s/pgsql' % topdir)
+    utils.system('make -j %d' % utils.count_cpus())
+    utils.system('make install')
 
     os.chdir(topdir)
 
diff --git a/client/deps/systemtap/common.py b/client/deps/systemtap/common.py
new file mode 100644
index 0000000..0f18586
--- /dev/null
+++ b/client/deps/systemtap/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "../../"))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/deps/systemtap/systemtap.py b/client/deps/systemtap/systemtap.py
index 4504dfa..f6c34d7 100755
--- a/client/deps/systemtap/systemtap.py
+++ b/client/deps/systemtap/systemtap.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import os
+import common
 import shutil
 from autotest_lib.client.bin import utils
 
@@ -11,10 +12,10 @@
 
     os.chdir(srcdir)
 
-    utils.configure('--with-elfutils=elfutils ' \
-                    '--prefix=%s/systemtap' % topdir)
-    utils.make('-j %d' % utils.count_cpus())
-    utils.make('install')
+    utils.system('./configure --with-elfutils=elfutils ' \
+                 '--prefix=%s/systemtap' % topdir)
+    utils.system('make -j %d' % utils.count_cpus())
+    utils.system('make install')
 
     os.chdir(topdir)