ahkok / user-session-units

A collection of units for the systemd user session.
GNU Lesser General Public License v2.1
72 stars 23 forks source link

Doesn't build against systemd git master (cannot find -lsystemd-login) #18

Open eliasp opened 10 years ago

eliasp commented 10 years ago
>>> Compiling source in /var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999 ...
>>> Working in BUILD_DIR: "/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999_build"
make -j3
x86_64-pc-linux-gnu-gcc -DPACKAGE_NAME=\"user-session-units\" -DPACKAGE_TARNAME=\"user-session-units\" -DPACKAGE_VERSION=\"9\" -DPACKAGE_STRING=\"user-session-units\ 9\" -DPACKAGE_BUGREPORT=\"auke-jan.h.kok@intel.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"user-session-units\" -DVERSION=\"9\" -I. -I/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999    -std=gnu99 -fstack-protector -Wall -pedantic -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wformat -Wformat-security -Werror=format-security -Wconversion -march=core2 -O2 -pipe -ggdb -c -o launcher.o `test -f 'src/launcher.c' || echo '/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999/'`src/launcher.c
x86_64-pc-linux-gnu-gcc -DPACKAGE_NAME=\"user-session-units\" -DPACKAGE_TARNAME=\"user-session-units\" -DPACKAGE_VERSION=\"9\" -DPACKAGE_STRING=\"user-session-units\ 9\" -DPACKAGE_BUGREPORT=\"auke-jan.h.kok@intel.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"user-session-units\" -DVERSION=\"9\" -I. -I/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999    -std=gnu99 -fstack-protector -Wall -pedantic -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wformat -Wformat-security -Werror=format-security -Wconversion -march=core2 -O2 -pipe -ggdb -c -o pam.o `test -f 'src/pam.c' || echo '/var/tmp/portage/sys-apps/user-session-units-9999/work/user-session-units-9999/'`src/pam.c
x86_64-pc-linux-gnu-gcc -std=gnu99 -fstack-protector -Wall -pedantic -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wformat -Wformat-security -Werror=format-security -Wconversion -march=core2 -O2 -pipe -ggdb  -Wl,-O1 -Wl,--as-needed -o user-session-launch launcher.o pam.o -lsystemd-login -lpam -lpam_misc
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsystemd-login
collect2: error: ld returned 1 exit status
make: *** [user-session-launch] Error 1
fredcadete commented 9 years ago

I have an idea of the root cause: systemd stopped packaging libsystemd-login as a separate library at version 209. See https://github.com/systemd/systemd/blob/master/NEWS#L2460

A workaround is to configure systemd with --enable-compat-libs.

A solution in user-session-units would be to either:

sofar commented 9 years ago

Considering 209 being somewhat old already, I'm more than willing to take a patch for the s/libsystemd-login/libsystemd/ change. Of course a version detection patch would be more complete, but it'll likely be a bit more complex.

Care to write a patch, @fredcadete ?

fredcadete commented 9 years ago

There it is. Used pkgconfig's ldflags in the end.

My build against systemd 211 now passes. I did not test it on runtime though. Good luck!