Note: I have also posted this to the LXDE forums: http://forum.lxde.org/viewtopic.php?f=1&t=36839
So far with some help from the users of #bsdports on the EFNet IRC channel, I have been able to compile LXDM. But, I am now having problems linking. I will name some of the fixes that I have used (some are ugly hacks):
Error 1:
Solution 1:
Set --sysconfdir flag to /usr/local/etc:
Error 2:
Solution 2:
Define _WANT_UCRED in src/lxcom.h or src/lxcom.c before the sys/ucred.h is included.
Include sys/param.h in src/lxcom.h and change all defined(__NetBSD__) except the first one to defined(BSD) in src/lxcom.c:
src/lxcom.h:
src/lxcom.c:
Error 3:
Solution 3:
Replace cred * with struct sockcred for FreeBSD in src/lxcom.c:
src/lxcom.c:
Error 4:
Solution 4:
Remove the (c) from LXDM_PEER_PID for FreeBSD in src/lxcom.c:
src/lxcom.c:
Error 5:
Solution 5: HACK
Define SO_PASSCRED as 16 (for i386 and amd64, it may need to be different for other platforms) in src/lxcom.h.
src/lxcom.h:
Error 6:
Solution 6:
Include xorg/shadow.h for FreeBSD in src/pam.c, src/lxdm.c and src/auth.c.
src/pam.c:
Error 7:
Solution 7: HACK
Add an include to the pixman-1 directory.
Error 8:
Solution 8: HACK
Remove the include of sys/vt.h from src/lxdm.c for FreeBSD and create a new struct and two new defines in src/lxdm.h.
src/lxdm.c:
src/lxdm.h:
Linker errors:
Those solutions fixed the compile errors. But now I am left with a load of linker errors:
[/file]
So far with some help from the users of #bsdports on the EFNet IRC channel, I have been able to compile LXDM. But, I am now having problems linking. I will name some of the fixes that I have used (some are ugly hacks):
Error 1:
Code:
WARNING: sysconfdir is not /etc.
Solution 1:
Set --sysconfdir flag to /usr/local/etc:
./configure --sysconfdir=$PREFIX/etc.Error 2:
Code:
invalid application of 'sizeof' to incomplete type 'LXDM_CRED'
Solution 2:
Define _WANT_UCRED in src/lxcom.h or src/lxcom.c before the sys/ucred.h is included.
Include sys/param.h in src/lxcom.h and change all defined(__NetBSD__) except the first one to defined(BSD) in src/lxcom.c:
src/lxcom.h:
Code:
#ifndef _LXCOM_H_
#define LXCOM_H_
+ #if defined(__unix__) || defined(unix)
+ #include <sys/param.h>
+ #endif
+
+ #if !defined(_WANT_UCRED)
+ #define _WANT_UCRED
+ #endif
void lxcom_init(const char *sock);
...
Code:
#endif
- #if defined(__NetBSD__)
+ #if defined(BSD)
typedef struct sockcred LXDM_CRED;
Error 3:
Code:
src/lxcom.c:147:11: error: 'cred' undeclared (first use in this function)
Replace cred * with struct sockcred for FreeBSD in src/lxcom.c:
src/lxcom.c:
Code:
...
+ #if defined(__FreeBSD__)
+ size = SOCKCREDSIZE(((struct sockcred *)CMSG_DATA(cmptr))->sc_ngroups);
+ #else
size = SOCKCREDSIZE(((cred *)CMSG_DATA(cmptr))->sc_ngroups);
+ #endif /* __FreeBSD__ */
...
Error 4:
Code:
src/lxcom.c:158:71: error: called object '1' is not a function
Solution 4:
Remove the (c) from LXDM_PEER_PID for FreeBSD in src/lxcom.c:
src/lxcom.c:
Code:
...
+ #if defined(__FreeBSD__)
+ res=((LXComFunc)callback)(user_data,LXDM_PEER_UID(c),LXDM_PEER_PID,argc,argv);
+ #else
res=((LXComFunc)callback)(user_data,LXDM_PEER_UID(c),LXDM_PEER_PID(c),argc,argv);
+ #endif /* __FreeBSD__ */
...
Error 5:
Code:
src/lxcom.c:294:43: error: 'SO_PASSCRED' undeclared (first use in this function)
Solution 5: HACK
Define SO_PASSCRED as 16 (for i386 and amd64, it may need to be different for other platforms) in src/lxcom.h.
src/lxcom.h:
Code:
...
#endif
+ #if !defined(SO_PASSCRED)
+ #define SO_PASSCRED 16
+ #endif
void lxcom_init(const char *sock);
...
Error 6:
Code:
src/pam.c:48:20: fatal error: shadow.h: No such file or directory
compilation terminated.
Solution 6:
Include xorg/shadow.h for FreeBSD in src/pam.c, src/lxdm.c and src/auth.c.
src/pam.c:
Code:
...
#include <grp.h>
+ #if defined(__FreeBSD__)
+ #include <xorg/shadow.h>
+ #else
#include <shadow.h>
+ #endif
#include <glib.h>
...
Error 7:
Code:
/usr/local/include/xorg/miscstruct.h:53:20: fatal error: pixman.h: No such file or directory
Solution 7: HACK
Add an include to the pixman-1 directory.
Code:
$ make CFLAGS="-I/usr/local/include/pixman-1"
Error 8:
Code:
src/lxdm.c:54:20: fatal error: sys/vt.h: No such file or directory
Solution 8: HACK
Remove the include of sys/vt.h from src/lxdm.c for FreeBSD and create a new struct and two new defines in src/lxdm.h.
src/lxdm.c:
Code:
...
#include <glib/gstdio.h>
#if !defined(__FreeBSD__)
#include <sys/vt.h>
#endif
#include <sys/ioctl.h>
...
src/lxdm.h:
Code:
...
void free_xsessions(GSList *);
struct vt_stat {
unsigned short v_active; /* active vt */
unsigned short v_signal; /* signal to send */
unsigned short v_state; /* vt bitmask */
};
#define VT_GETSTATE 0x5603
#define VT_ACTIVATE 0x5606
G_END_DECLS
...
Linker errors:
Those solutions fixed the compile errors. But now I am left with a load of linker errors:
Code:
lxdm_binary-lxdm.o: In function `lxsession_stop':
lxdm.c:(.text+0x7d0): undefined reference to `xconn_clean'
lxdm_binary-lxdm.o: In function `lxsession_free':
lxdm.c:(.text+0x8c8): undefined reference to `xconn_close'
lxdm_binary-lxdm.o: In function `on_xserver_stop':
lxdm.c:(.text+0x1be8): undefined reference to `xconn_close'
lxdm_binary-lxdm.o: In function `lxdm_startx':
lxdm.c:(.text+0x1dbe): undefined reference to `xconn_open'
lxdm_binary-lxdm.o: In function `log_sigsegv':
lxdm.c:(.text+0x3386): undefined reference to `backtrace'
lxdm.c:(.text+0x33a0): undefined reference to `backtrace_symbols'
collect2: error: ld returned 1 exit status
Last edited by a moderator: