Skip to content

Commit

Permalink
clients/Makefile.am, clients/.gitignore: generate a client/libupsclie…
Browse files Browse the repository at this point in the history
…nt-version.h from libtool information file [networkupstools#2431]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jul 15, 2024
1 parent 2897f19 commit 759c2c7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions clients/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/libupsclient-version.h
/upsimage.cgi
/upsset.cgi
/upsstats.cgi
Expand Down
25 changes: 25 additions & 0 deletions clients/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export PATH=@PATH_DURING_CONFIGURE@

EXTRA_DIST =
CLEANFILES =

# nutclient.cpp for some legacy reason (maybe initial detached development?)
# optionally includes "common.h" with the NUT build setup - and this option
Expand Down Expand Up @@ -117,6 +118,30 @@ if HAVE_WINDOWS
libupsclient_la_LDFLAGS += -no-undefined
endif

# ./clients/libupsclient.la samples (partial!) on...
# Linux:
# # The name that we can dlopen(3).
# dlname='libupsclient.so.6'
# # Names of this library.
# library_names='libupsclient.so.6.0.1 libupsclient.so.6 libupsclient.so'
# # Directory that this library needs to be installed in:
# libdir='/usr/local/ups/lib'
# WIN32:
# dlname='libupsclient-6.dll'
# library_names='libupsclient.dll.a'
# libdir='//lib'
CLEANFILES += libupsclient-version.h
libupsclient-version.h: libupsclient.la
@SOFILE_LIBUPSCLIENT="`grep -E '^dlname' '$?' | sed -e 's/^[^=]*=//' -e 's/^\"\\(.*\\)\"/\\1/' -e 's/^'"'"'\\(.*\\)'"'"'/\\1/'`" \
|| SOFILE_LIBUPSCLIENT="" ; \
if [ x"$${SOFILE_LIBUPSCLIENT-}" = x ] ; then \
printf "#ifdef SOFILE_LIBUPSCLIENT\n# undef SOFILE_LIBUPSCLIENT\n#endif\n\n" ; \
printf "#ifdef SOPATH_LIBUPSCLIENT\n# undef SOPATH_LIBUPSCLIENT\n#endif\n\n" ; \
else \
printf "#ifndef SOFILE_LIBUPSCLIENT\n# define SOFILE_LIBUPSCLIENT \"%s\"\n#endif\n\n" "$${SOFILE_LIBUPSCLIENT}" ; \
printf "#ifndef SOPATH_LIBUPSCLIENT\n# define SOPATH_LIBUPSCLIENT \"%s/%s\"\n#endif\n\n" "@LIBDIR@" "$${SOFILE_LIBUPSCLIENT}" ; \
fi > "$@"

if HAVE_CXX11
# libnutclient version information and build
libnutclient_la_SOURCES = nutclient.h nutclient.cpp
Expand Down

0 comments on commit 759c2c7

Please sign in to comment.