--- /dev/null
+$NetBSD$
+
+--- cinelerra/mwindow.C.orig 2010-02-01 09:14:29.000000000 +0000
++++ cinelerra/mwindow.C
+@@ -19,6 +19,8 @@
+ *
+ */
+
++#include "config.h"
++
+ #include "asset.h"
+ #include "assets.h"
+ #include "awindowgui.h"
+@@ -1248,11 +1250,11 @@ void MWindow::test_plugins(EDL *new_edl,
+ }
+ }
+
+-
++#if defined(PROC_SHMMAX_PATH)
+ void MWindow::init_shm()
+ {
+ // Fix shared memory
+- FILE *fd = fopen("/proc/sys/kernel/shmmax", "w");
++ FILE *fd = fopen(PROC_SHMMAX_PATH, "w");
+ if(fd)
+ {
+ fprintf(fd, "0x7fffffff");
+@@ -1260,10 +1262,10 @@ void MWindow::init_shm()
+ }
+ fd = 0;
+
+- fd = fopen("/proc/sys/kernel/shmmax", "r");
++ fd = fopen(PROC_SHMMAX_PATH, "r");
+ if(!fd)
+ {
+- MainError::show_error("MWindow::init_shm: couldn't open /proc/sys/kernel/shmmax for reading.\n");
++ MainError::show_error("MWindow::init_shm: couldn't open " PROC_SHMMAX_PATH " for reading.\n");
+ return;
+ }
+
+@@ -1273,13 +1275,17 @@ void MWindow::init_shm()
+ fd = 0;
+ if(result < 0x7fffffff)
+ {
+- eprintf("WARNING: /proc/sys/kernel/shmmax is 0x%llx, which is too low.\n"
++ eprintf("WARNING: " PROC_SHMMAX_PATH " is 0x%llx, which is too low.\n"
+ "Before running Cinelerra do the following as root:\n"
+- "echo \"0x7fffffff\" > /proc/sys/kernel/shmmax\n",
++ "echo \"0x7fffffff\" > " PROC_SHMMAX_PATH "\n",
+ result);
+ }
+ }
+-
++#else
++void MWindow::init_shm() {
++ /* We can't do anything. */
++}
++#endif
+
+
+ void MWindow::create_objects(int want_gui,