diff --git a/src/build/Common.gmake b/src/build/Common.gmake
index 87f2bb62a9faaa26e9e541b80848d8652b2041d5..f568e776e326499e4fd5dceeb48e3b39f15ecd63 100644
--- a/src/build/Common.gmake
+++ b/src/build/Common.gmake
@@ -50,6 +50,7 @@
 #  DONT_CLOBBER_CC	- Do not change the default setting of CC				#
 #  OBJPATH_SUFFIX	- Suffix appended to OBJPATH usefull for compiling 		#
 #					  different options of the same source file				#
+#  STATIC			- Create a statically linked build if possible			#
 #																			#
 # Common Build Macros Defined:												#
 #  DELETE			- Delete files (Preferrably verbose)					#
@@ -204,6 +205,11 @@ UL_SUF		:=
 OUTPUT		:=	-o
 LOUTPUT		:=	-o
 
+ifdef STATIC
+ LDFLAGS	+=	-static
+ CFLAGS		+=	-DSTATIC_LINK
+endif
+
 ifeq ($(os),openbsd)
  SOFILE	:=	$(SOFILE).$(VERSION)
 else
diff --git a/src/conio/Common.gmake b/src/conio/Common.gmake
index 49827d0a7a75c28f97da34eaeb144a942aaff464..a451f9b1d495945b81573d000d16b83f1f584787 100644
--- a/src/conio/Common.gmake
+++ b/src/conio/Common.gmake
@@ -1,9 +1,13 @@
 CIOLIB-MT_LIBS		+=	$(UL_PRE)ncurses$(UL_SUF)
 ifndef NO_X
- ifeq ($(os),linux)
-  CIOLIB-MT_LIBS		+=  $(UL_PRE)dl$(UL_SUF)
- endif
- ifeq ($(os),sunos)
-  CIOLIB-MT_LIBS		+=  $(UL_PRE)dl$(UL_SUF)
+ ifdef STATIC
+  CIOLIB-MT_LIBS		+=	-lXlib
+ else
+  ifeq ($(os),linux)
+   CIOLIB-MT_LIBS		+=  $(UL_PRE)dl$(UL_SUF)
+  endif
+  ifeq ($(os),sunos)
+   CIOLIB-MT_LIBS		+=  $(UL_PRE)dl$(UL_SUF)
+  endif
  endif
 endif
diff --git a/src/conio/console.c b/src/conio/console.c
index 99e53f6e7233ecea9519a188e3abc118c7425f05..bbfa4a9e340dcc33ad1d000c4e00053ffca8d3f8 100644
--- a/src/conio/console.c
+++ b/src/conio/console.c
@@ -93,7 +93,9 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
+#ifndef STATIC_LINK
 #include <dlfcn.h>
+#endif
 #include <fcntl.h>
 #include <limits.h>
 #include <paths.h>
@@ -1286,6 +1288,34 @@ console_init()
 	if(dpy!=NULL)
 		return(0);
 
+#ifdef STATIC_LINK
+	x11.XChangeGC=XChangeGC;
+	x11.XCopyPlane=XCopyPlane;
+	x11.XFillRectangle=XFillRectangle;
+	x11.XFlush=XFlush;
+	x11.XBell=XBell;
+	x11.XLookupString=XLookupString;
+	x11.XNextEvent=XNextEvent;
+	x11.XAllocSizeHints=XAllocSizeHints;
+	x11.XSetWMNormalHints=XSetWMNormalHints;
+	x11.XResizeWindow=XResizeWindow;
+	x11.XMapWindow=XMapWindow;
+	x11.XFree=XFree;
+	x11.XFreePixmap=XFreePixmap;
+	x11.XCreateBitmapFromData=XCreateBitmapFromData;
+	x11.XAllocColor=XAllocColor;
+	x11.XOpenDisplay=XOpenDisplay;
+	x11.XCreateSimpleWindow=XCreateSimpleWindow;
+	x11.XCreateGC=dlsym(dl,"XCreateGC");
+	x11.XSelectInput=XSelectInput;
+	x11.XStoreName=XStoreName;
+	x11.XGetSelectionOwner=XGetSelectionOwner;
+	x11.XConvertSelection=XConvertSelection;
+	x11.XGetWindowProperty=XGetWindowProperty;
+	x11.XChangeProperty=XChangeProperty;
+	x11.XSendEvent=XSendEvent;
+	x11.XSetSelectionOwner=XSetSelectionOwner;
+#else
 	if((dl=dlopen("libX11.so",RTLD_LAZY))==NULL)
 		return(-1);
 	if((x11.XChangeGC=dlsym(dl,"XChangeGC"))==NULL) {
@@ -1392,6 +1422,7 @@ console_init()
 		dlclose(dl);
 		return(-1);
 	}
+#endif
 
 	sem_init(&console_mode_changed,0,0);
 	sem_init(&copybuf_set,0,0);