LXDE is already ported to FreeBSD but not LXDM. 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:WARNING: sysconfdir is not /etc.
Set --sysconfdir flag to /usr/local/etc:
Code: Select all
./configure --sysconfdir=$PREFIX/etc
Solution 2:invalid application of 'sizeof' to incomplete type 'LXDM_CRED'
Define _WANT_UCRED in src/lxcom.h or src/lxcom.c before the sys/ucred.h include
Include sys/param.h in src/lxcom.h & change all defined(__NetBSD__) except the first one to defined(BSD) in src/lxcom.c:
src/lxcom.h:
Code: Select all
#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: Select all
#endif
- #if defined(__NetBSD__)
+ #if defined(BSD)
typedef struct sockcred LXDM_CRED;
Solution 3: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: Select all
...
...
+ #if defined(__FreeBSD__)
+ size = SOCKCREDSIZE(((struct sockcred *)CMSG_DATA(cmptr))->sc_ngroups);
+ #else
size = SOCKCREDSIZE(((cred *)CMSG_DATA(cmptr))->sc_ngroups);
+ #endif /* __FreeBSD__ */
...
...
Solution 4:src/lxcom.c:158:71: error: called object '1' is not a function
Remove the (c) from LXDM_PEER_PID for FreeBSD in src/lxcom.c:
src/lxcom.c:
Code: Select all
...
...
+ #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__ */
...
...
Solution 5: HACKsrc/lxcom.c:294:43: error: 'SO_PASSCRED' undeclared (first use in this function)
Define SO_PASSCRED as 16 (for i386 & amd64, may need to be different for other platforms) in src/lxcom.h.
src/lxcom.h:
Code: Select all
...
...
#endif
+ #if !defined(SO_PASSCRED)
+ #define SO_PASSCRED 16
+ #endif
void lxcom_init(const char *sock);
...
...
Solution 6:src/pam.c:48:20: fatal error: shadow.h: No such file or directory
compilation terminated.
Include xorg/shadow.h for FreeBSD in src/pam.c, src/lxdm.c, & src/auth.c.
src/pam.c:
Code: Select all
...
...
#include <grp.h>
+ #if defined(__FreeBSD__)
+ #include <xorg/shadow.h>
+ #else
#include <shadow.h>
+ #endif
#include <glib.h>
...
...
Solution 7: HACK/usr/local/include/xorg/miscstruct.h:53:20: fatal error: pixman.h: No such file or directory
Add in include to the pixman-1 directory.
Code: Select all
$ make CFLAGS="-I/usr/local/include/pixman-1"
Solution 8: HACKsrc/lxdm.c:54:20: fatal error: sys/vt.h: No such file or directory
Remove the include of sys/vt.h from src/lxdm.c for FreeBSD & create a new struct & two new defines in src/lxdm.h.
src/lxdm.c:
Code: Select all
...
...
#include <glib/gstdio.h>
#if !defined(__FreeBSD__)
#include <sys/vt.h>
#endif
#include <sys/ioctl.h>
...
...
Code: Select all
...
...
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
...
...
Those solutions fixed the compile errors. But now I am left with a load of linker errors:
Any help with these errors is much appreciated.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