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

gmake install fails on freebsd #1614

Closed
ckrey opened this issue Mar 4, 2020 · 4 comments
Closed

gmake install fails on freebsd #1614

ckrey opened this issue Mar 4, 2020 · 4 comments

Comments

@ckrey
Copy link

ckrey commented Mar 4, 2020

Problem:

...
sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr/local#" -e "s#@VERSION@#1.6.9#" "/usr/local/lib/pkgconfig/libmosquitto.pc"
sed: -e: No such file or directory
...

Analysis:
sed in freebsd has a non-optional argument to the -i option sed(1). gsed or other versions of sed interpret a missing argument to the -i option as a zero-length argument.

Solution:
Use a zero-length argument in the two relevant Makefiles

% git diff
diff --git a/lib/Makefile b/lib/Makefile
index 2abffd7a..91507b2d 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -74,7 +74,7 @@ endif
        $(INSTALL) mqtt_protocol.h "${DESTDIR}${incdir}/mqtt_protocol.h"
        $(INSTALL) -d "${DESTDIR}${libdir}/pkgconfig"
        $(INSTALL) -m644 ../libmosquitto.pc.in "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
-       sed -i -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
+       sed -i "" -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc"
 ifeq ($(WITH_SHARED_LIBRARIES),yes)
        $(MAKE) -C cpp install
 endif
diff --git a/lib/cpp/Makefile b/lib/cpp/Makefile
index 8606da70..884bc10d 100644
--- a/lib/cpp/Makefile
+++ b/lib/cpp/Makefile
@@ -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 -i -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc"
+       sed -i "" -e "s#@CMAKE_INSTALL_PREFIX@#${prefix}#" -e "s#@VERSION@#${VERSION}#" "${DESTDIR}${libdir}/pkgconfig/libmosquittopp.pc"

 uninstall :
        -rm -f "${DESTDIR}${libdir}/libmosquittopp.so.${SOVERSION}"
ralight added a commit that referenced this issue Mar 12, 2020
Closes #1614. Thanks to Christoph Krey.
@ralight
Copy link
Contributor

ralight commented Mar 12, 2020

So was it you that switched JP over to FreeBSD, or the other way round? :)

Your fix doesn't work on my version of sed, I've put in a different fix that does the job on both systems.

@jpmens
Copy link

jpmens commented Mar 12, 2020

@ralight I switched myself over! :-)

@ckrey
Copy link
Author

ckrey commented Mar 12, 2020

As always, JP switched me over

@ralight
Copy link
Contributor

ralight commented Mar 12, 2020

I've only dabbled on digital ocean, but that is enough for compiling and testing. If you are happy with the fix, please close the bug in your own time.

@ralight ralight closed this as completed Apr 30, 2020
FranciscoKnebel pushed a commit to Open-Digital-Twin/mosquitto that referenced this issue Jul 30, 2020
Closes eclipse#1614. Thanks to Christoph Krey.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants