diff options
author | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2021-08-02 15:03:25 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-02 15:03:25 +1000 |
commit | 248cdc9cf6e17f8519bf23197de28db48d9b0e01 (patch) | |
tree | e5392cbf5cbb430330acfe73fd754aa5f11ae46b | |
parent | fa301f56c3bce87eed72e0cc1c125202dd53ff80 (diff) | |
parent | 558bd4d9c5e52be09fce5771f86ca407dc2966db (diff) | |
download | mod_wsgi-248cdc9cf6e17f8519bf23197de28db48d9b0e01.tar.gz |
Merge pull request #694 from abbra/no-default-rpath
Do not add default RPATH.
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | setup.py | 14 |
2 files changed, 18 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 9d4f779..37a0f86 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ XCODE_BIN_PATTERN="${XCODE_PREFIX}.*/usr/bin/" if test -x "${APXS}"; then APXS_CC=`${APXS} -q CC` APXS_LIBTOOL=`${APXS} -q LIBTOOL | sed -e "s/ .*$//"` + APXS_LIBDIR=`${APXS} -q LIBDIR | sed -e "s/ .*$//"` case ${APXS_CC} in ${XCODE_PREFIX}*) if test ! -x ${XCODE_CC}; then @@ -159,8 +160,12 @@ fi if test "${PYTHONFRAMEWORKDIR}" = "no-framework" -o \ "${ENABLE_FRAMEWORK}" != "yes"; then - LDFLAGS1="-L${PYTHONLIBDIR}" - LDFLAGS2="-L${PYTHONCFGDIR}" + if test "${PYTHONLIBDIR}" != "${APXS_LIBDIR}" ; then + LDFLAGS1="-L${PYTHONLIBDIR}" + fi + if test "${PYTHONCFGDIR}" != "${APXS_LIBDIR}" ; then + LDFLAGS2="-L${PYTHONCFGDIR}" + fi LDLIBS1="-lpython${PYTHON_LDVERSION}" @@ -445,6 +445,7 @@ else: PYTHON_LDVERSION = get_python_config('LDVERSION') or PYTHON_VERSION PYTHON_LIBDIR = get_python_config('LIBDIR') + APXS_LIBDIR = get_apxs_config('LIBDIR') PYTHON_CFGDIR = get_python_lib(plat_specific=1, standard_lib=1) + '/config' if PYTHON_LDVERSION and PYTHON_LDVERSION != PYTHON_VERSION: @@ -452,7 +453,10 @@ else: if not os.path.exists(PYTHON_CFGDIR): PYTHON_CFGDIR = '%s-%s' % (PYTHON_CFGDIR, sys.platform) - PYTHON_LDFLAGS = ['-L%s' % PYTHON_LIBDIR, '-L%s' % PYTHON_CFGDIR] + PYTHON_LDFLAGS = ['-L%s' % PYTHON_CFGDIR] + if PYTHON_LIBDIR != APXS_LIBDIR: + PYTHON_LDFLAGS.insert(0, '-L%s' % PYTHON_LIBDIR) + PYTHON_LDLIBS = ['-lpython%s' % PYTHON_LDVERSION] if os.path.exists(os.path.join(PYTHON_LIBDIR, @@ -472,9 +476,13 @@ EXTRA_LINK_ARGS = PYTHON_LDFLAGS + PYTHON_LDLIBS # Force adding of LD_RUN_PATH for platforms that may need it. +LD_RUN_PATHS = [] if os.name != 'nt': LD_RUN_PATH = os.environ.get('LD_RUN_PATH', '') - LD_RUN_PATH += ':%s:%s' % (PYTHON_LIBDIR, PYTHON_CFGDIR) + LD_RUN_PATHS = [PYTHON_CFGDIR] + if PYTHON_LIBDIR != APXS_LIBDIR: + LD_RUN_PATHS.insert(0, PYTHON_LIBDIR) + LD_RUN_PATH += ':' + ':'.join(LD_RUN_PATHS) LD_RUN_PATH = LD_RUN_PATH.lstrip(':') os.environ['LD_RUN_PATH'] = LD_RUN_PATH @@ -507,7 +515,7 @@ else: extension = Extension(extension_name, source_files, include_dirs=INCLUDE_DIRS, extra_compile_args=EXTRA_COMPILE_FLAGS, - extra_link_args=EXTRA_LINK_ARGS) + extra_link_args=EXTRA_LINK_ARGS, runtime_library_dirs=LD_RUN_PATHS) def _documentation(): result = [] |