diff --git a/config/python.m4 b/config/python.m4 index e500873ff3..b295ad3d3a 100644 --- a/config/python.m4 +++ b/config/python.m4 @@ -120,16 +120,11 @@ else found_shlib=0 for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib do - # Note: DLSUFFIX is for loadable modules, not shared - # libraries, so cannot be used here portably. Just - # check all known possibilities. - for e in .so .dll .dylib .sl; do - if test -e "$d/lib${ldlibrary}$e"; then - python_libdir="$d" - found_shlib=1 - break 2 - fi - done + if test -e "$d/lib${ldlibrary}${DLSUFFIX}"; then + python_libdir="$d" + found_shlib=1 + break 2 + fi done # Some platforms (OpenBSD) require us to accept a bare versioned shlib # (".so.n.n") as well. However, check this only after failing to find diff --git a/configure b/configure index fb07cd27d9..da177403ef 100755 --- a/configure +++ b/configure @@ -10570,16 +10570,11 @@ else found_shlib=0 for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib do - # Note: DLSUFFIX is for loadable modules, not shared - # libraries, so cannot be used here portably. Just - # check all known possibilities. - for e in .so .dll .dylib .sl; do - if test -e "$d/lib${ldlibrary}$e"; then - python_libdir="$d" - found_shlib=1 - break 2 - fi - done + if test -e "$d/lib${ldlibrary}${DLSUFFIX}"; then + python_libdir="$d" + found_shlib=1 + break 2 + fi done # Some platforms (OpenBSD) require us to accept a bare versioned shlib # (".so.n.n") as well. However, check this only after failing to find diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 551023c6fb..d0ec325bf1 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -118,7 +118,6 @@ endif ifeq ($(PORTNAME), darwin) ifdef soname # linkable library - DLSUFFIX = .dylib ifneq ($(SO_MAJOR_VERSION), 0) version_link = -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) endif @@ -127,7 +126,6 @@ ifeq ($(PORTNAME), darwin) shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) else # loadable module - DLSUFFIX = .so LINK.shared = $(COMPILER) -bundle -multiply_defined suppress endif BUILD.exports = $(AWK) '/^[^\#]/ {printf "_%s\n",$$1}' $< >$@ diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin index 4fc81c1584..45f253a5b4 100644 --- a/src/makefiles/Makefile.darwin +++ b/src/makefiles/Makefile.darwin @@ -10,5 +10,5 @@ else endif # Rule for building a shared library from a single .o file -%.so: %.o +%$(DLSUFFIX): %.o $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -bundle $(BE_DLLLIBS) -o $@ diff --git a/src/template/darwin b/src/template/darwin index e14d53b601..fd30e19b6a 100644 --- a/src/template/darwin +++ b/src/template/darwin @@ -55,3 +55,5 @@ case $host_os in USE_SYSV_SEMAPHORES=1 ;; esac + +DLSUFFIX=".dylib"