Re: Detecting kfreebsd kernel while compiling [hurd]
On Tue, 2010-02-02 at 14:35:01 +0100, Joachim Wiedorn wrote:
> Guillem Jover <email@example.com> wrote:
> > As being said on the list, explicitly checking for those on the source
> > is not usually the correct solution. I've taken a look at the xfe code
> But what is the correct solution?
It depends. Most of the stuff is best autodetected at build time, which
as Thorsten has pointed out with autotools is pretty easy to accomplish,
but autotools can also be abused horribly. Some other stuff can simply
rely on preprocessor macros. Some others are best detected at run-time.
And then some things are best left to the human building the software
I guess it's worth writting about, I might consider writting this kind
of porting articles at some point.
> > For the tty ones in xvt/ttyinit.c the linux check is wrong, it should
> > check for __GLIBC__ (which is what was intended as can be read from
> But __GLIBC__ would be also true for GNU/kFreeBSD, but the existing
> device is not /dev/ptmx. So I must differentiate between GNU/Linux and
> GNU/kFreeBSD, isn't it?
No, because as all those GNU based systems use glibc they have openpty()
available which is taken care of by the LIBC_OPENPTY macro.
Also it seems you removed support for other systems? I'm attaching an
updated (and untested) patch for this one.
> > Then there's the mount/unmount support, which seems to be truly Linux
> > specific.
> But I still I don't know how to change them for the right support on
> GNU/kFreeBSD and GNU/Hurd. I think I must speak with upstream.
After a closer look, it does not seem it might need that much changes
to work on something non-Linux. It seems to need mostly a file with the
list of file systems and another with the mounted ones, so FSTAB_PATH
seems fine, but MTAB_PATH would be "/etc/mtab" on other unices. Then
there's some code assuming udev is being used. And the filesystem
names will need to be adapted per kernel. Code in ‘src/FileList.cpp’
and ‘src/DirList.cpp’ AFAICS.
> > And finally the package support, which should not be kernel dependent
> > at all (currently wrongly checks for Linux). This check should just be
> > removed and the functionality enabled at build or run time if dpkg or
> Where are the code about you speak here? I don't understand your idea
> and I don't know what I should change.
The code is in ‘src/XFilePackage.cpp’. There's a bogus detection system
in main() which just executes ‘dpkg --version’ and ‘rpm --version’ and
based on that decides if the distribution is either deb or rpm based.
Which seems wrong, as dpkg can be found in stuff like Gentoo, or some
rpm based system, and the user most likely do not want a package being
installed through the non-native packaging system. Probably the best in
this case is to specify the packaging system at build time with a new
configure --with-<PACKAGE> option (check autoconf's AC_ARG_WITH).
Subject: xvt for other kernel
Author: Joachim Wiedorn <ad_debian at joonet.de>
Forwarded: still in discussion
For xvt inside of xfe there is the need to configure xvt
depending of the Operating System. Fixed the macro checks
for several systems, including GNU based ones (which enables
support for GNU/Hurd and GNU/kFreeBSD).
xvt/ttyinit.c | 25 ++++++++++++++-----------
xvt/xvt.h | 5 -----
2 files changed, 14 insertions(+), 16 deletions(-)
@@ -115,7 +115,7 @@
#endif /* SUNOS */
+/* Solaris */
@@ -123,39 +123,42 @@
-#endif /* SUNOS5 */
+/* OSF/1 */
-#endif /* OSF1 */
+/* AIX */
#endif /* AIX3 */
+/* Ultrix */
#define TTYTAB "/etc/ttys" /* File to search for tty utmp slot number */
-#endif /* ULTRIX */
+/* HP-UX */
-#endif /* HPUX */
+/* glibc based systems */
@@ -58,11 +58,6 @@ int getdtablesize();
-#else /* !SUNOS5 */
-int ioctl(int fd, unsigned request, char *arg);
-#endif /* LINUX */
#endif /* !SUNOS5 */