summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Kuzminsky <seb@highlab.com>2011-11-03 21:53:10 -0600
committerSebastian Kuzminsky <seb@highlab.com>2011-11-03 21:53:10 -0600
commit15a71bf41c8d893e1b4bfda0ba16c2a4c340c165 (patch)
tree86f5170789af0dbc2776b40206f1a77b574c1307
parent2d44af69b6d87323b31a368d97ac388d18d40a0d (diff)
downloadlinuxcnc-15a71bf41c8d893e1b4bfda0ba16c2a4c340c165.tar.gz
linuxcnc-15a71bf41c8d893e1b4bfda0ba16c2a4c340c165.zip
teach configure to determine the python version
Michael Haberler's awesome g-code remapping patchbomb needs to link a bunch of stuff against libpython, which requires versioned shared libraries. This commit teaches the src/configure script how to ask python what it's version is, and constructs the library name from that version string. It also switches a couple of Submakefiles to use this autoconfigured library version instead of a hardcoded value (that worked on Lucid but not on Hardy). This commit makes it build on Hardy and Lucid and hopefully any other distribution that includes python distutils.
-rw-r--r--src/Makefile.inc.in1
-rw-r--r--src/configure.in5
-rw-r--r--src/emc/pythonplugin/Submakefile5
-rw-r--r--src/emc/rs274ngc/Submakefile3
-rw-r--r--src/emc/sai/Submakefile2
5 files changed, 10 insertions, 6 deletions
diff --git a/src/Makefile.inc.in b/src/Makefile.inc.in
index 1bf4e9514..e91ea3a6f 100644
--- a/src/Makefile.inc.in
+++ b/src/Makefile.inc.in
@@ -203,6 +203,7 @@ CONFIG_OPTO_AC5=m
BUILD_PYTHON=@BUILD_PYTHON@
INCLUDEPY=@INCLUDEPY@
+LIBPYTHON=@LIBPYTHON@
SITEPY=@SITEPY@
#### END CONFIG ####
diff --git a/src/configure.in b/src/configure.in
index e398410f6..3442b410a 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1383,6 +1383,10 @@ if test "$BUILD_PYTHON" = "yes"; then
fi
AC_MSG_RESULT(OK)
+ AC_MSG_CHECKING([version of python libraries])
+ LIBPYTHON=`$PYTHON -c 'import distutils.sysconfig; print "python" + distutils.sysconfig.get_config_vars().get("VERSION")'`
+ AC_MSG_RESULT($LIBPYTHON)
+
AC_MSG_CHECKING([match between tk and Tkinter versions])
PYTHON_TK_VERSION="`$PYTHON -c 'import _tkinter; print _tkinter.TK_VERSION'`"
@@ -1430,6 +1434,7 @@ Install this version and specify --with-tclConfig and --with-tkConfig if necessa
fi
AC_SUBST([BUILD_PYTHON])
+AC_SUBST([LIBPYTHON])
AC_SUBST([INCLUDEPY])
AC_SUBST([SITEPY])
diff --git a/src/emc/pythonplugin/Submakefile b/src/emc/pythonplugin/Submakefile
index e3badf91e..84399ce4a 100644
--- a/src/emc/pythonplugin/Submakefile
+++ b/src/emc/pythonplugin/Submakefile
@@ -1,4 +1,3 @@
-PY=python2.6
BOOST=boost_python
@@ -25,7 +24,7 @@ TARGETS += ../lib/libpyplugin.so emc/pythonplugin/testpp
$(ECHO) Linking $(notdir $@)
@mkdir -p ../lib
@rm -f $@
- $(CXX) -g $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^ -lstdc++ -l$(BOOST) -l$(PY)
+ $(CXX) -g $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^ -lstdc++ -l$(BOOST) -l$(LIBPYTHON)
../include/%.h: ./emc/pythonplugin/%.h
@@ -35,4 +34,4 @@ TARGETS += ../lib/libpyplugin.so emc/pythonplugin/testpp
emc/pythonplugin/testpp: $(call TOOBJS, $(TESTSRCS)) ../lib/libpyplugin.so.0
$(ECHO) Linking $(notdir $@)
- $(CXX) $(LDFLAGS) -o $@ $^ -lstdc++ -l$(BOOST) -l$(PY)
+ $(CXX) $(LDFLAGS) -o $@ $^ -lstdc++ -l$(BOOST) -l$(LIBPYTHON)
diff --git a/src/emc/rs274ngc/Submakefile b/src/emc/rs274ngc/Submakefile
index 2a9085804..b8892907c 100644
--- a/src/emc/rs274ngc/Submakefile
+++ b/src/emc/rs274ngc/Submakefile
@@ -1,5 +1,4 @@
# this should go into configure FIXME
-PY=python2.6
BOOST=boost_python
@@ -37,7 +36,7 @@ TARGETS += ../lib/librs274.so ../lib/librs274.so.0
$(ECHO) Linking $(notdir $@)
@mkdir -p ../lib
@rm -f $@
- $(CXX) -g $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^ -lstdc++ -l$(BOOST) -l$(PY)
+ $(CXX) -g $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^ -lstdc++ -l$(BOOST) -l$(LIBPYTHON)
../include/%.h: ./emc/rs274ngc/%.h
cp $^ $@
diff --git a/src/emc/sai/Submakefile b/src/emc/sai/Submakefile
index 2bdfa4774..5edf0d969 100644
--- a/src/emc/sai/Submakefile
+++ b/src/emc/sai/Submakefile
@@ -9,4 +9,4 @@ $(call TOOBJSDEPS,$(SAISRCS)) : EXTRAFLAGS=-Dinterp_new=interp
../bin/rs274: $(call TOOBJS, $(SAISRCS)) ../lib/librs274.so.0 ../lib/libemc.a ../lib/libnml.so.0 \
../lib/libemchal.so.0
$(ECHO) Linking $(notdir $@)
- $(Q)$(CXX) $(LDFLAGS) -o $@ $^ $(ULFLAGS) /usr/lib/libpython2.6.a
+ $(Q)$(CXX) $(LDFLAGS) -o $@ $^ $(ULFLAGS) -l$(LIBPYTHON)