Skip to content

Commit

Permalink
m4/ax_realpath_lib.m4, tools/nut-scanner/nutscan-init.c: add HP-UX *.…
Browse files Browse the repository at this point in the history
…sl file name patterns into the loop [networkupstools#2431]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jul 15, 2024
1 parent 400c374 commit ccd43fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
9 changes: 6 additions & 3 deletions m4/ax_realpath_lib.m4
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ AC_DEFUN([AX_REALPATH_LIB],
dnl # Primarily we care to know dynamically linked (shared object)
dnl # files, so inject the extension to the presumed base name
AS_CASE(["${myLIBNAME}"],
[*.so*|*.a|*.o|*.lo|*.la|*.dll|*.dll.a|*.lib|*.dylib], [],
[*.so*|*.a|*.o|*.lo|*.la|*.dll|*.dll.a|*.lib|*.dylib|*.sl], [],
[
AS_CASE(["${target_os}"],
[*mingw*], [myLIBNAME="${myLIBNAME}.dll"],
[*darwin*], [myLIBNAME="${myLIBNAME}.dylib"],
[myLIBNAME="${myLIBNAME}.so"])
[*hpux*|*hp?ux*], [
dnl # See detailed comments in nutscan-init.c
myLIBNAME="${myLIBNAME}.sl"
],[myLIBNAME="${myLIBNAME}.so"])
]
)
Expand All @@ -67,7 +70,7 @@ AC_DEFUN([AX_REALPATH_LIB],
dnl Alas, the portable solution with sed is to avoid
dnl parentheses and pipe chars, got too many different
dnl ways to escape them in the wild
myLIBNAME_LD="`echo "$myLIBNAME" | sed -e 's/^lib/-l/' -e 's/\.dll$//' -e 's/\.dll\.a$//' -e 's/\.a$//' -e 's/\.o$//' -e 's/\.la$//' -e 's/\.lo$//' -e 's/\.lib$//' -e 's/\.dylib$//' -e 's/\.so\..*$//' -e 's/\.so//'`"
myLIBNAME_LD="`echo "$myLIBNAME" | sed -e 's/^lib/-l/' -e 's/\.dll$//' -e 's/\.dll\.a$//' -e 's/\.a$//' -e 's/\.o$//' -e 's/\.la$//' -e 's/\.lo$//' -e 's/\.lib$//' -e 's/\.dylib$//' -e 's/\.so\..*$//' -e 's/\.so//' -e 's/\.sl\..*$//' -e 's/\.sl//'`"
], [myLIBNAME_LD="-l$myLIBNAME"] dnl best-effort...
)
Expand Down
17 changes: 15 additions & 2 deletions tools/nut-scanner/nutscan-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,21 @@
#else
# ifdef NUT_PLATFORM_APPLE_OSX
# define SOEXT ".dylib"
# else /* not WIN32, not MACOS */
# define SOEXT ".so"
# else
# ifdef NUT_PLATFORM_HPUX
/* Note: depending on CPU arch and OS version, library file name
* patterns here could have been "*.so" as well. E.g. per
* https://community.hpe.com/t5/operating-system-hp-ux/so-and-sl-files/td-p/3780528
* *.sl are used in PA-RISC (11.11)
* *.so shared libraries are used in HP-UX 11.20 and upwards.
* Integrity (Itanium-based) HPUX can use *.sl as well, but it
* is not recommended, see ld(1) under -lx:
* https://web.archive.org/web/20090925153446/http://docs.hp.com/en/B2355-60103/ld.1.html
*/
# define SOEXT ".sl"
# else /* not WIN32, not MACOS, not HPUX */
# define SOEXT ".so"
# endif
# endif
#endif

Expand Down

0 comments on commit ccd43fc

Please sign in to comment.