Commit 87ec9abfe0a55c061ba14b96c553419cf35f986b
1 parent
9c6cf81b
Modify the Solaris kluge so that it only applies for the Sun Studio compiler.
We need a kluge to compile the swig wrappers using the Sun Studio compiler on Solaris. By default, the Sun Studio compiler tries to compile them with the C compiler, as the C compiler was also used to compile Python. swig wrapper files, however, are C++, hence they need a C++ compiler. We therefore declare a prefix variable PYTHON_BUILD_PREFIX that is used in the Makefile.am of the pyext directory. The characters in this variable will be prefixed to the python setup.py calls for building. In case that a Sun Studio compiler is detected, we set the prefix to "CC=CC", which means that we set the Sun Studio C++ compiler (CC) to be the C compiler (environment variable CC). Note that we also need an extra library Cstd for the Sun Studio compiler, that is defined by the PYTHON_EXTRA_LIBS parameter.
Showing
1 changed file
with
13 additions
and
12 deletions
configure.ac
| ... | ... | @@ -727,27 +727,28 @@ AM_CONDITIONAL(WITH_PYTHON, test "x$enable_python" = "xyes") |
| 727 | 727 | # Set Python environment |
| 728 | 728 | if test "x$enable_python" = "xyes"; then |
| 729 | 729 | |
| 730 | - # Set host specific build prefix (needed for Solaris pycc bug) | |
| 730 | + # Initialise Python environment | |
| 731 | 731 | PYTHON_BUILD_PREFIX= |
| 732 | - case $host in | |
| 733 | - sparc*-sun-solaris*) PYTHON_BUILD_PREFIX="CC=CC" ;; | |
| 734 | - *) PYTHON_BUILD_PREFIX="" ;; | |
| 735 | - esac | |
| 736 | - AC_SUBST(PYTHON_BUILD_PREFIX) | |
| 737 | - | |
| 738 | - # Set host specific extra libraries. Add all host specific libraries here that | |
| 739 | - # need to be linked in the python module | |
| 740 | 732 | PYTHON_EXTRA_LIBS= |
| 733 | + | |
| 734 | + # Solaris Sun Studio compiler kluge (to prevent from using pycc for swig | |
| 735 | + # compilation) | |
| 741 | 736 | case $host in |
| 742 | - sparc*-sun-solaris*) PYTHON_EXTRA_LIBS="Cstd" ;; | |
| 743 | - *) PYTHON_EXTRA_LIBS="" ;; | |
| 737 | + *-*-solaris*) | |
| 738 | + if test "${CC}" = cc; then | |
| 739 | + PYTHON_BUILD_PREFIX="CC=CC" | |
| 740 | + PYTHON_EXTRA_LIBS="Cstd" | |
| 741 | + fi | |
| 742 | + ;; | |
| 744 | 743 | esac |
| 744 | + | |
| 745 | + # Set Python environment | |
| 746 | + AC_SUBST(PYTHON_BUILD_PREFIX) | |
| 745 | 747 | AC_SUBST(PYTHON_EXTRA_LIBS) |
| 746 | 748 | |
| 747 | 749 | fi |
| 748 | 750 | |
| 749 | 751 | |
| 750 | - | |
| 751 | 752 | ############################################################################# |
| 752 | 753 | # Initialise directory path for test environment # |
| 753 | 754 | ############################################################################# | ... | ... |