Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

According to FreeBSD, from version 10 they use Clang/LLVM instead of gcc. on the surface of it all things should perform as been before even better. but I have faced this reality more than I want to. Some codes can't be compiled this way.
For example I tried to compile Snapwm. First native FreeBSD make is actually pmake and that is out of the question. So gmake is our choice. but issuing gmake on the code will produce this error:

gcc -g -std=c99 -pedantic -Wall -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -c -o snapwm.o snapwm.c gmake: gcc: Command not found gmake: *** [snapwm.o] Error 127

So the question becomes how to compile the code that suffers from these set backs.

share|improve this question
    
FreeBSD is using clang/llvm for the world and kernel. Nothing is preventing you from using gcc and gnu-make for ports or personal projects. As-long-I-remember gnu-make was named gmake on FreeBSD platform: this is hardly new. –  Ouki Apr 16 at 11:27
    
@Ouki Yes but how? what would be the command? it is not that simple? Is it a way to gmake it with clang? –  r004 Apr 16 at 12:18
1  
This is what ports are: a set of configure options and if needed patch to files and/or makefile (have a look in /usr/ports/x11-wm/ctwm/files for instance). There is currently no one command way of doing it, as there is no ports for snapwm. You need to do it the hard way: configure/Imake whatever you can and/or modify the makefile to reflect your setup. –  Ouki Apr 16 at 13:35

1 Answer 1

up vote 1 down vote accepted

Sometimes needs some patch. I've createad which you can apply and can build with gmake. I didn't try the compiled snapwm I've tested only building process.

diff -ur Nextwm-master.orig/Makefile Nextwm-master/Makefile
--- Nextwm-master.orig/Makefile 2014-03-12 19:46:34.000000000 +0100
+++ Nextwm-master/Makefile  2014-04-16 13:07:08.000000000 +0200
@@ -1,12 +1,12 @@
-CFLAGS+= -g -std=c99 -pedantic -Wall -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2
+CFLAGS+= -g -std=c99 -pedantic -Wall -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -I/usr/local/include/
 LDADD+= -lX11 -lXinerama
-LDFLAGS= -Wl,-O1,--sort-common,--as-needed,-z,relro
+LDFLAGS= -Wl,-O1,--sort-common,--as-needed,-z,relro,-L/usr/local/lib
 EXEC=snapwm

 PREFIX?= /usr/local
 BINDIR?= $(PREFIX)/bin

-CC=gcc
+CC=clang

 all: $(EXEC)

diff -ur Nextwm-master.orig/snapwm.c Nextwm-master/snapwm.c
--- Nextwm-master.orig/snapwm.c 2014-03-12 19:46:34.000000000 +0100
+++ Nextwm-master/snapwm.c  2014-04-16 13:03:24.000000000 +0200
@@ -27,6 +27,7 @@
 //#include <X11/keysym.h>
 /* For a multimedia keyboard */
 #include <X11/XF86keysym.h>
+#include <sys/signal.h>
 #include <X11/Xproto.h>
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
share|improve this answer
    
@r004 does it work? –  uzsolt Apr 19 at 9:23
    
hello and very much thank you. I was very late because I moved around the snapwm to make sure it worked. –  r004 Apr 21 at 0:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.