python,build: Reinstate prepare target.
[gpgme.git] / lang / python / setup.py.in
index bf4efa3..8ddbf27 100755 (executable)
@@ -34,12 +34,13 @@ in_tree = False
 extra_swig_opts = []
 extra_macros = dict()
 
-if os.path.exists("../../../src/gpgme-config"):
+abs_top_builddir = os.environ.get("abs_top_builddir")
+if abs_top_builddir:
     # In-tree build.
     in_tree = True
-    gpgme_config = ["../../../src/gpgme-config"] + gpgme_config_flags
-    gpgme_h = "../../../src/gpgme.h"
-    library_dirs = ["../../../src/.libs"] # XXX uses libtool internals
+    gpgme_config = [os.path.join(abs_top_builddir, "src/gpgme-config")] + gpgme_config_flags
+    gpgme_h = os.path.join(abs_top_builddir, "src/gpgme.h")
+    library_dirs = [os.path.join(abs_top_builddir, "src/.libs")] # XXX uses libtool internals
     extra_macros.update(
         HAVE_CONFIG_H=1,
         HAVE_DATA_H=1,