Why don't you start with the original port x11-wm/icewm and modify it to build the new fork? Looking at that port I see there are a few FreeBSD specific patches in the files/ directory. I'm betting you need some of them in order to get it to build. They may need to be modified to apply cleanly to the new source though.
You have two bad options. One is to run Linux as the author of IceWM wants you to do. The second one is that you fork the fork and fix non portability issues. If the guy who did the original fork was competent and serious about the quality she/he would not make such beginner mistake.There are some useful configure switches, which I figured out myself. However, struct glob_pattern_p is not in glob.h, and it seems to be glibc/Linux specific. At this point I don't know how to proceed.
Interestingly enough someone was aware and wanted to fix it with commit 759987, but didn't. glob_pattern_p is still in use.You have two bad options. One is to run Linux as the author of IceWM wants you to do. The second one is that you fork the fork and fix non portability issues. If the guy who did the original fork was competent and serious about the quality she/he would not make such beginner mistake.
The configure script searches for asprintf(3) (a GNUisms that was imported by the BSDs very long ago) and if it's found defines HAVE_ASPRINTF. The code then assumes that you also have glob_pattern_p (bad!).globit.c makes use of GNUisms (asprintf, glob_pattern_p), make that code conditional and fix unsafe code
cmake -DENABLE_NLS=NO
instead of the configure script. Can't speak for functionality though. It's clear that some kind of completion support gets disabled by not having glob_pattern_p.diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ffdff19..68a4bcc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -331,6 +331,7 @@ set(icewm_libs ${sm_LIBS} ${nls_LIBS} ${lsd_LDFLAGS} ${pixbuf_LDFLAGS} ${fontcon
TARGET_LINK_LIBRARIES(icewm${EXEEXT} ${icewm_libs})
ADD_EXECUTABLE(genpref${EXEEXT} genpref.cc)
+SET_TARGET_PROPERTIES(genpref${EXEEXT} PROPERTIES COMPILE_FLAGS "${x11_CFLAGS}")
TARGET_LINK_LIBRARIES(genpref${EXEEXT} ${EXTRA_LIBS})
IF(CONFIG_FDO_MENUS)
diff --git a/src/globit.cc b/src/globit.cc
index c0164ef..6e26da1 100644
--- a/src/globit.cc
+++ b/src/globit.cc
@@ -1,5 +1,5 @@
#include "config.h"
-#ifdef HAVE_ASPRINTF
+#if defined(HAVE_ASPRINTF) && !defined(__FreeBSD__)
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
diff --git a/src/yapp.h b/src/yapp.h
index 8d473f8..75c3e10 100644
--- a/src/yapp.h
+++ b/src/yapp.h
@@ -1,6 +1,7 @@
#ifndef __YAPP_H
#define __YAPP_H
+#define _POSIX_VISIBLE 200112
#include <signal.h>
#include "ypaths.h"
diff --git a/src/yinput.cc b/src/yinput.cc
index f5f5f2e..bd641eb 100644
--- a/src/yinput.cc
+++ b/src/yinput.cc
@@ -722,7 +722,7 @@ void YInputLine::autoScroll(int delta, const XMotionEvent *motion) {
beginAutoScroll(delta ? true : false, motion);
}
void YInputLine::complete() {
-#ifdef HAVE_ASPRINTF
+#if defined(HAVE_ASPRINTF) && !defined(__FreeBSD__)
char *res=NULL;
int res_count=0;
cstring t(fText);