From b486c0e9b238d932491724a0ed6b625175e67911 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 13 Dec 2019 12:04:34 +0100 Subject: [PATCH] Modernize FreeBSD support FreeBSD (and Dragonfly for the matter) elf works the same as on linux Remove special cases historically added for FreeBSD. While here drop support for older, not supported anymore FreeBSD versions. --- support/shlib-install | 34 +--------------------------------- support/shobj-conf | 40 +--------------------------------------- 2 files changed, 2 insertions(+), 72 deletions(-) diff --git a/support/shlib-install b/support/shlib-install index f4eea27..8edfb55 100755 --- a/support/shlib-install +++ b/support/shlib-install @@ -118,7 +118,7 @@ INSTALL_LINK2='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2' # Create symlinks to the installed library. This section is incomplete. # case "$host_os-$host_vendor" in -*linux*|freebsd*-gentoo) +*linux*|freebsd*|dragonfly*) # libname.so.M -> libname.so.M.N ${echo} ${RM} ${INSTALLDIR}/$LINK2 if [ -z "$uninstall" ]; then @@ -154,38 +154,6 @@ solaris2*|aix4.[2-9]*|aix[5-9]*|osf*|irix[56]*|sysv[45]*|dgux*|interix*) fi ;; - -# FreeBSD 3.x and above can have either a.out or ELF shared libraries -freebsd3*|freebsdaout*) - if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then - # libname.so -> libname.so.M - ${echo} ${RM} ${INSTALLDIR}/$LINK1 - if [ -z "$uninstall" ]; then - eval $INSTALL_LINK1 - fi - else - # libname.so.M -> libname.so.M.N - ${echo} ${RM} ${INSTALLDIR}/$LINK2 - if [ -z "$uninstall" ]; then - eval $INSTALL_LINK2 - fi - - # libname.so -> libname.so.M.N - ${echo} ${RM} ${INSTALLDIR}/$LINK1 - if [ -z "$uninstall" ]; then - eval $INSTALL_LINK1 - fi - fi - ;; - -freebsd[4-9]*|freebsd1[0-9]*|freebsdelf*|dragonfly*) - # libname.so -> libname.so.M - ${echo} ${RM} ${INSTALLDIR}/$LINK1 - if [ -z "$uninstall" ]; then - eval $INSTALL_LINK1 - fi - ;; - hpux1*) # libname.sl -> libname.M ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl diff --git a/support/shobj-conf b/support/shobj-conf index 95fa1ae..e0440da 100644 --- a/support/shobj-conf +++ b/support/shobj-conf @@ -123,7 +123,7 @@ sunos5*|solaris2*) ;; # All versions of Linux (including Gentoo/FreeBSD) or the semi-mythical GNU Hurd. -linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo) +linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*|dragonfly*) SHOBJ_CFLAGS=-fPIC SHOBJ_LD='${CC}' SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' @@ -132,44 +132,6 @@ linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo) SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' ;; -freebsd2*) - SHOBJ_CFLAGS=-fpic - SHOBJ_LD=ld - SHOBJ_LDFLAGS='-x -Bshareable' - - SHLIB_XLDFLAGS='-R$(libdir)' - SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' - ;; - -# FreeBSD-3.x ELF -freebsd3*|freebsdaout*) - SHOBJ_CFLAGS=-fPIC - SHOBJ_LD='${CC}' - - if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then - SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' - - SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)' - SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' - else - SHOBJ_LDFLAGS='-shared' - - SHLIB_XLDFLAGS='-R$(libdir)' - SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' - fi - ;; - -# FreeBSD-4.x and later have only ELF -freebsd[4-9]*|freebsd1[0-9]*|freebsdelf*|dragonfly*) - SHOBJ_CFLAGS=-fPIC - SHOBJ_LD='${CC}' - - SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' - SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)' - - SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' - ;; - # Darwin/MacOS X darwin*) # Common definitions for all darwin/mac os x versions -- 2.24.0