Skip to content

Commit

Permalink
Document linkflags
Browse files Browse the repository at this point in the history
  • Loading branch information
lonkamikaze committed Dec 28, 2016
1 parent a97ab9e commit 2d80d99
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ all: ${TARGETS}

.sinclude ".depend"

# Building
loadplay.o:
${CXX} -c ${CXXFLAGS} -fPIC -o ${.TARGET} ${.IMPSRC}

# Linking
#
# | Flag | Targets | Why |
# |-----------|-------------------|----------------------------------------|
# | -lutil | powerd++ | Required for pidfile_open() etc. |
# | -lpthread | powerd++, loadrec | FreeBSD 12 userland bug workaround[^1] |
# | -lpthread | libloadplay.so | Uses std::thread |
#
# [^1]: Signals get lost en route to the process if pthread is not
# linked in, e.g. head/r310361 is affected by this.

powerd++: ${.TARGET}.o
${CXX} -lpthread -lutil ${CXXFLAGS} -o ${.TARGET} ${.ALLSRC}

Expand All @@ -27,9 +42,6 @@ loadrec: ${.TARGET}.o
libloadplay.so: ${.TARGET:C/^lib//:C/\.so$//}.o
${CXX} -lpthread -shared ${CXXFLAGS} -o ${.TARGET} ${.ALLSRC}

loadplay.o:
${CXX} -c ${CXXFLAGS} -fPIC -o ${.TARGET} ${.IMPSRC}

# Combinable build targets
.ifmake(debug)
CXXFLAGS= ${DBGFLAGS}
Expand Down
2 changes: 2 additions & 0 deletions src/sys/pidfile.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** \file
* Implements safer c++ wrappers for the pidfile_*() interface.
*
* Requires linking with -lutil.
*/

#ifndef _POWERDXX_SYS_PIDFILE_HPP_
Expand Down

0 comments on commit 2d80d99

Please sign in to comment.