Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix libdir location in pkgconfig files. #3027

Open
wants to merge 1 commit into
base: fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Fix libdir location in pkgconfig files.
The pkgconfig files currently hardcode the library directory as
${prefix}/lib, but the library installation directory in config.mk is
set as lib${LIB_SUFFIX}.  This causes a mismatch between the library
installation directory and the pkgconfig file on redhat-based 64-bit
systems.

This commit remedies the issue for both the Makefile and CMake build by
modifying the pkgconfig files to use CMAKE_INSTALL_LIBDIR instead of
"lib".  In the CMake system, this directly reflects the installation
path.  The Makefiles were modified to replace CMAKE_INSTALL_LIBDIR with
lib${LIB_SUFFIX}, matching the libdir definition in config.mk and
following the pattern used in defining the prefix.

Signed-off-by: Rich Mattes <[email protected]>
  • Loading branch information
richmattes committed Apr 1, 2024
commit 72c2d3ab34d0532a904371935ad773974b57472b
2 changes: 1 addition & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ endif
$(INSTALL) ../include/mqtt_protocol.h "${DESTDIR}${incdir}/mqtt_protocol.h"
$(INSTALL) -d "${DESTDIR}${libdir}/pkgconfig"
$(INSTALL) -m644 ../libmosquitto.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
sed ${SEDINPLACE} -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
sed ${SEDINPLACE} -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@CMAKE_INSTALL_LIBDIR@#lib${LIB_SUFFIX}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
ifeq ($(WITH_SHARED_LIBRARIES),yes)
$(MAKE) -C cpp install
endif
Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif
$(INSTALL) mosquittopp.h "${DESTDIR}${incdir}/mosquittopp.h"
$(INSTALL) -d "${DESTDIR}${libdir}/pkgconfig/"
$(INSTALL) -m644 ../../libmosquittopp.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc"
sed ${SEDINPLACE} -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc"
sed ${SEDINPLACE} -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@CMAKE_INSTALL_LIBDIR@#lib${LIB_SUFFIX}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc"

uninstall :
-rm -f "${DESTDIR}${libdir}/libmosquittopp.so.${SOVERSION}"
Expand Down
2 changes: 1 addition & 1 deletion libmosquitto.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@

Name: mosquitto
Description: mosquitto MQTT library (C bindings)
Expand Down
2 changes: 1 addition & 1 deletion libmosquittopp.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@

Name: mosquittopp
Description: mosquitto MQTT library (C++ bindings)
Expand Down