aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2010-12-29 02:46:26 +0000
committerRob Austein <sra@hactrn.net>2010-12-29 02:46:26 +0000
commitd662ed08e008cddd97f2ef076417c51918fc518d (patch)
treedc142e148b5f8980b1bf404451b299fd384156f2
parente0f59781161f8faf2ca51265041852980ae66f85 (diff)
First cut at getting Python stuff fully (well, more fully) under autoconf
svn path=/pow/Makefile.in; revision=3582
-rw-r--r--pow/Makefile.in13
-rw-r--r--pow/POW-0.7/setup.py9
-rw-r--r--pywrap/Makefile.in9
-rw-r--r--pywrap/build.py8
-rw-r--r--rpkid/tests/smoketest.py5
-rw-r--r--rpkid/tests/yamltest.py3
6 files changed, 29 insertions, 18 deletions
diff --git a/pow/Makefile.in b/pow/Makefile.in
index 6b58d9da..cab078bf 100644
--- a/pow/Makefile.in
+++ b/pow/Makefile.in
@@ -12,10 +12,15 @@ SOURCES = POW-${VERSION}/lib/__init__.py \
POW-${VERSION}/dumpasn1.cfg \
POW-${VERSION}/POW.c
+
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@ -lssl -lcrypto
+
all: ${STAMP}
${STAMP}: ${SOURCES}
- cd POW-${VERSION}; python setup.py build
+ cd POW-${VERSION}; AC_CFLAGS='${CFLAGS}' AC_LDFLAGS='${LDFLAGS}' AC_LIBS='${LIBS}' @PYTHON@ setup.py build
ln -sf POW-${VERSION}/build/lib.* buildlib
touch $@
@@ -25,11 +30,5 @@ clean:
install:
@echo Not attempting to install modified POW, if you want that, do it yourself
-# Doesn't really work at the moment
-#
-#test: all
-# cp -p POW-${VERSION}/test/test.py POW-${VERSION}/build/lib.*/.
-# cd POW-${VERSION}/build/lib.*/. && python test.py
-
test:
@true
diff --git a/pow/POW-0.7/setup.py b/pow/POW-0.7/setup.py
index 21862805..8a9ec00f 100644
--- a/pow/POW-0.7/setup.py
+++ b/pow/POW-0.7/setup.py
@@ -37,9 +37,12 @@ setup(name = 'POW',
ext_modules = [ Extension('POW._POW',
['POW.c'],
libraries = libraries,
- library_dirs = library_dirs,
- include_dirs = include_dirs,
- extra_link_args = extra_link_args) ])
+# library_dirs = library_dirs,
+# include_dirs = include_dirs,
+# extra_link_args = extra_link_args,
+ extra_compile_args = list(os.environ["AC_CFLAGS"].split()),
+ extra_link_args = list(os.environ["AC_LDFLAGS"].split())
+ ) ])
os.remove('lib/_objects.py')
os.remove('lib/_oids.py')
diff --git a/pywrap/Makefile.in b/pywrap/Makefile.in
index 7c37faab..36432cd9 100644
--- a/pywrap/Makefile.in
+++ b/pywrap/Makefile.in
@@ -1,9 +1,16 @@
# $Id$
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@ -lssl -lcrypto
+
all: pywrap
pywrap: pywrap.c
- python build.py
+ AC_CFLAGS='${CFLAGS}' AC_LDFLAGS='${LDFLAGS}' AC_LIBS='${LIBS}' @PYTHON@ build.py
clean:
rm -f *.o pywrap
+
+test:
+ @true
diff --git a/pywrap/build.py b/pywrap/build.py
index 23bd4cdf..286b034a 100644
--- a/pywrap/build.py
+++ b/pywrap/build.py
@@ -25,18 +25,14 @@ import os, subprocess, sys
from distutils.sysconfig import (get_config_var as getvar,
get_python_inc as getinc)
-openssl_dir = os.path.realpath(os.path.join(os.getcwd(), "../openssl/openssl"))
-
cmd = getvar("CC").split()
cmd.append("-o")
cmd.append("pywrap")
cmd.append("pywrap.c")
-cmd.append("-Wl,-rpath,%s" % openssl_dir)
-cmd.append("-L%s" % openssl_dir)
-cmd.append("-lcrypto")
-cmd.append("-lssl")
+for var in ("AC_CFLAGS", "AC_LDFLAGS", "AC_LIBS"):
+ cmd.extend(os.environ[var].split())
cmd.append("-I%s" % getinc(plat_specific = False))
cmd.append("-I%s" % getinc(plat_specific = True))
diff --git a/rpkid/tests/smoketest.py b/rpkid/tests/smoketest.py
index b298142e..5d6b56d9 100644
--- a/rpkid/tests/smoketest.py
+++ b/rpkid/tests/smoketest.py
@@ -139,10 +139,13 @@ prog_irdbd = cfg.get("prog_irdbd", "../../irdbd.py")
prog_poke = cfg.get("prog_poke", "../../testpoke.py")
prog_rootd = cfg.get("prog_rootd", "../../rootd.py")
prog_pubd = cfg.get("prog_pubd", "../../pubd.py")
-prog_openssl = cfg.get("prog_openssl", "../../../openssl/openssl/apps/openssl")
prog_rsyncd = cfg.get("prog_rsyncd", "rsync")
prog_rcynic = cfg.get("prog_rcynic", "../../../rcynic/rcynic")
+prog_openssl = cfg.get("prog_openssl", "../../../openssl/openssl/apps/openssl")
+if not os.path.exists(prog_openssl):
+ prog_openssl = "openssl"
+
rcynic_stats = cfg.get("rcynic_stats", "echo ; ../../../rcynic/show.sh %s.xml ; echo" % rcynic_name)
rpki_sql_file = cfg.get("rpki_sql_file", "../rpkid.sql")
diff --git a/rpkid/tests/yamltest.py b/rpkid/tests/yamltest.py
index 0eb69834..8e140746 100644
--- a/rpkid/tests/yamltest.py
+++ b/rpkid/tests/yamltest.py
@@ -72,7 +72,10 @@ prog_rpkid = cleanpath(rpkid_dir, "rpkid.py")
prog_irdbd = cleanpath(rpkid_dir, "irdbd.py")
prog_pubd = cleanpath(rpkid_dir, "pubd.py")
prog_rootd = cleanpath(rpkid_dir, "rootd.py")
+
prog_openssl = cleanpath(this_dir, "../../openssl/openssl/apps/openssl")
+if not os.path.exists(prog_openssl):
+ prog_openssl = "openssl"
class roa_request(object):
"""