morgant / mlvwm

Macintosh-like Virtual Window Manager (official repo)
http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html
283 stars 10 forks source link

Does not compile on FreeBSD: fatal error: ' X11 .rules' file not found #26

Open probonopd opened 3 years ago

probonopd commented 3 years ago
FreeBSD% cd man && xmkmf && cd -

imake -DUseInstalled -I/usr/local/lib/X11/config
In file included from Imakefile.c:15:
In file included from /usr/local/lib/X11/config/Imake.tmpl:316:
/usr/local/lib/X11/config/Imake.rules:1674:27: warning: empty character constant
      [-Winvalid-pp-token]
        for flag in ${MAKEFLAGS} ''; do \                               @@\
                                 ^
In file included from Imakefile.c:15:
/usr/local/lib/X11/config/Imake.tmpl:2144:10: fatal error: ' X11 .rules' file not found
#include ProjectRulesFile
         ^~~~~~~~~~~~~~~~
/usr/local/lib/X11/config/Imake.tmpl:2142:35: note: expanded from macro 'ProjectRulesFile'
# define ProjectRulesFile       Concat3(<,TopLevelProject,.rules>)
                                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lib/X11/config/Imake.rules:256:23: note: expanded from macro 'Concat3'
#define Concat3(a,b,c)a/**/b/**/c
                      ^~~~~~~~~~~
<scratch space>:3:1: note: expanded from here
< X11 .rules>
^~~~~~~~~~~~~
1 warning and 1 error generated.
imake: Exit code 1.
  Stop.

Do you know how to get it to compile on FreeBSD?

morgant commented 2 years ago

My apologies for my extremely late response on this and many thanks for reporting the issue.

I have not run into this error before, but I also haven't tried to compile on FreeBSD yet. In my initial research, I dug up a forum post about Imake & X11 .rules on GhostBSD that seems to match the error you're getting. While it only contains supposition as to the cause, it confirms that some errant spaces are being inserted into the 'X11.rules` filename. The guess is that this is caused by a clang vs gcc difference.

It's interesting that I haven't run into this under OpenBSD/amd64 as the default compiler is also clang, not gcc. Looking at OpenBSD's Imake port, it appears to use tradcpp for a preprocessor. [FreeBSD's imake(1)] manual page mentions tradcpp as well (see the "ENVIRONMENT VARIABLES" section) and notes:

"By default, imake will use cc -E or tradcpp, depending on the OS specific configuration."

I'm not sure what the default is on FreeBSD, but it's probably worth testing a clean build with the IMAKECPP environment variable set to the full path to tradcpp.

Let me know if that's something you can test or not.

probonopd commented 2 years ago

Hello @morgant, thanks for looking into this. Do you happen to know how I could find out the full path to tradcpp?

morgant commented 2 years ago

No problem, @probonopd. Looking at the FreeBSD tradcpp port, it appears that tradcpp is installed in ${PREFIX}/bin, which I believe defaults to /usr/local/bin/. You may need to install the tradcpp package.

probonopd commented 2 years ago

Thanks, this helped. Got it to compile like this:

cd ./mlvwm/
env IMAKECPP=/usr/local/bin/tradcpp xmkmf
make

However, trying to run it results in a segfault:

./mlvwm       
MLVWM : another WM may be running.

pkill -f KWin
./mlvwm          
Segmentation Fault
        in 
morgant commented 2 years ago

One step forward, one step back, I guess.

I'm currently doing my development & testing on OpenBSD, which is slightly different that FreeBSD as far as X11 goes, but not drastically so. In my case, I'm using xenodm(1) as opposed to startx, so I have the following as the last line in my user's ~/.xsession file (as opposed to in my ~/.xinitrc file, if I were using startx):

exec mlvwm -debug

Of course, the -debug option is not required.

You haven't yet stated which version of FreeBSD you're running or what your X11 configuration is, so I'll guess a bit. Please do let me know what your configuration is and correct me wherever I'm incorrect.

Making an educated guess based on the fact that you're killing KWin before launching mlvwm, I believe you're running KDE. I think SDDM is suggested for KDE on FreeBSD, but maybe you're using startx. I'd suggest using XDM on FreeBSD for mlvwm, though I haven't tested it. This is because mlvwm is only a window manager, not a full desktop environment, so will need a login manager.

If you install and use either XDM or startx, I'd suggest putting the aforementioned exec mlvwm (or using a full path to your compiled copy if you haven't installed it) as the last line in either your user's ~/.xsession (for XDM) or ~/.xinitrc (for startx) file.

I hope some of this is helpful. Let me know how it goes and any further information you feel might be helpful in troubleshooting.