[-fno-common] remove x11/wmii or patch it ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[-fno-common] remove x11/wmii or patch it ?

Matthieu Herrb-3
Hi,

wmii doesnt build with -fno-common

suckless.org has decomissionned wmii in 2012 (its main author and
maintainer died in 2010)

https://git.suckless.org/sites/commit/b3f0a378e7d2dab6213be07e8f2b21fb637d6776.html

I'd suggest to delete it.

Alternatively the patches below fix the build (only very ligtly tested
that it still starts)

Index: Makefile
===================================================================
RCS file: /cvs/OpenBSD/ports/x11/wmii/Makefile,v
retrieving revision 1.23
diff -u -p -u -r1.23 Makefile
--- Makefile 12 Jul 2019 20:51:24 -0000 1.23
+++ Makefile 21 Feb 2021 08:56:50 -0000
@@ -3,7 +3,7 @@
 COMMENT= dynamic window manager
 
 DISTNAME= wmii-3.6
-REVISION= 6
+REVISION= 7
 CATEGORIES= x11
 
 HOMEPAGE= http://wmii.suckless.org/
Index: patches/patch-cmd_util_c
===================================================================
RCS file: patches/patch-cmd_util_c
diff -N patches/patch-cmd_util_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-cmd_util_c 21 Feb 2021 08:56:50 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+fix for -fno-common
+
+Index: cmd/util.c
+--- cmd/util.c.orig
++++ cmd/util.c
+@@ -9,6 +9,10 @@
+ #include <util.h>
+ #include <fmt.h>
+
++char *argv0;
++void *__p;
++int __i;
++
+ typedef struct VFmt VFmt;
+ struct VFmt {
+ const char *fmt;
Index: patches/patch-cmd_wmii_dat_h
===================================================================
RCS file: patches/patch-cmd_wmii_dat_h
diff -N patches/patch-cmd_wmii_dat_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-cmd_wmii_dat_h 21 Feb 2021 08:56:50 -0000
@@ -0,0 +1,94 @@
+$OpenBSD$
+
+fix for -fno-common
+
+Index: cmd/wmii/dat.h
+--- cmd/wmii/dat.h.orig
++++ cmd/wmii/dat.h
+@@ -194,7 +194,7 @@ struct Ruleset {
+ };
+
+ /* global variables */
+-struct {
++struct Def {
+ CTuple focuscolor;
+ CTuple normcolor;
+ Font *font;
+@@ -207,8 +207,10 @@ struct {
+ char grabmod[5];
+ ulong mod;
+ int colmode;
+-} def;
++};
+
++extern struct Def def;
++
+ enum {
+ BarLeft, BarRight
+ };
+@@ -223,40 +225,42 @@ struct WMScreen {
+
+ Rectangle r;
+ Rectangle brect;
+-} *screens, *screen;
++};
+
+-Client *client;
+-View *view;
+-Key *key;
+-Divide *divs;
+-Client c_magic;
+-Client c_root;
++extern struct WMScreen  *screens, *screen;
+
+-Handlers framehandler;
++extern Client *client;
++extern View *view;
++extern Key *key;
++extern Divide *divs;
++extern Client c_magic;
++extern Client c_root;
+
+-char buffer[8092];
++extern Handlers framehandler;
+
++extern char buffer[8192];
++
+ /* IXP */
+-IxpServer srv;
+-Ixp9Srv p9srv;
++extern IxpServer srv;
++extern Ixp9Srv p9srv;
+
+ /* X11 */
+-uint num_screens;
+-uint valid_mask;
+-uint num_lock_mask;
+-Bool sel_screen;
++extern uint num_screens;
++extern uint valid_mask;
++extern uint num_lock_mask;
++extern Bool sel_screen;
+
+-Image xor;
++extern Image xor;
+
+-Cursor cursor[CurLast];
+-void (*handler[LASTEvent]) (XEvent *);
++extern Cursor cursor[CurLast];
++extern void (*handler[LASTEvent]) (XEvent *);
+
+ /* Misc */
+-Image *broken;
+-Bool starting;
+-Bool verbose;
+-char *user;
+-char *execstr;
++extern Image *broken;
++extern Bool starting;
++extern Bool verbose;
++extern char *user;
++extern char *execstr;
+
+ #define Debug if(verbose)
+ #define Dprint(...) do{ Debug fprint(2, __VA_ARGS__); }while(0)
Index: patches/patch-cmd_wmii_main_c
===================================================================
RCS file: patches/patch-cmd_wmii_main_c
diff -N patches/patch-cmd_wmii_main_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-cmd_wmii_main_c 21 Feb 2021 08:56:50 -0000
@@ -0,0 +1,44 @@
+$OpenBSD$
+
+fix for -fno-common
+
+Index: cmd/wmii/main.c
+--- cmd/wmii/main.c.orig
++++ cmd/wmii/main.c
+@@ -17,6 +17,36 @@
+ #include <unistd.h>
+ #include "fns.h"
+
++
++struct Def def;
++
++struct WMScreen *screens, *screen;
++
++Client *client;
++View *view;
++Key *key;
++Divide *divs;
++Client c_magic;
++Client c_root;
++
++char buffer[8192];
++
++IxpServer srv;
++
++uint num_screens;
++uint valid_mask;
++uint num_lock_mask;
++Bool sel_screen;
++
++Image xor;
++
++Cursor cursor[CurLast];
++
++Bool starting;
++Bool verbose;
++char *user;
++char *execstr;
++
+ static const char
+ version[] = "wmii-"VERSION", ©2007 Kris Maglione\n";
+
Index: patches/patch-cmd_wmii_x11_c
===================================================================
RCS file: patches/patch-cmd_wmii_x11_c
diff -N patches/patch-cmd_wmii_x11_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-cmd_wmii_x11_c 21 Feb 2021 08:56:50 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+fix for -f no-common
+
+Index: cmd/wmii/x11.c
+--- cmd/wmii/x11.c.orig
++++ cmd/wmii/x11.c
+@@ -11,6 +11,9 @@
+ #include <bio.h>
+ #include "fns.h"
+
++Display *display;
++Screen scr;
++
+ Point ZP = {0, 0};
+ Rectangle ZR = {{0, 0}, {0, 0}};
+
Index: patches/patch-cmd_wmii_x11_h
===================================================================
RCS file: patches/patch-cmd_wmii_x11_h
diff -N patches/patch-cmd_wmii_x11_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-cmd_wmii_x11_h 21 Feb 2021 08:56:50 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+fix for -fno-common
+
+Index: cmd/wmii/x11.h
+--- cmd/wmii/x11.h.orig
++++ cmd/wmii/x11.h
+@@ -94,8 +94,8 @@ struct Font {
+ char *name;
+ };
+
+-Display *display;
+-Screen scr;
++extern Display *display;
++extern Screen scr;
+
+ extern Point ZP;
+ extern Rectangle ZR;
Index: patches/patch-include_util_h
===================================================================
RCS file: patches/patch-include_util_h
diff -N patches/patch-include_util_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_util_h 21 Feb 2021 08:56:50 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+fix for -fno-common
+
+Index: include/util.h
+--- include/util.h.orig
++++ include/util.h
+@@ -37,9 +37,9 @@ char *str_nil(char *s);
+ int utflcpy(char *to, const char *from, int l);
+ uint strlcat(char *dst, const char *src, unsigned int siz);
+
+-char *argv0;
+-void *__p;
+-int __i;
++extern char *argv0;
++extern void *__p;
++extern int __i;
+ #undef ARGBEGIN
+ #undef ARGEND
+ #undef ARGF


--
Matthieu Herrb

Reply | Threaded
Open this post in threaded view
|

Re: [-fno-common] remove x11/wmii or patch it ?

Theo Buehler-3
On Sun, Feb 21, 2021 at 10:08:15AM +0100, Matthieu Herrb wrote:

> Hi,
>
> wmii doesnt build with -fno-common
>
> suckless.org has decomissionned wmii in 2012 (its main author and
> maintainer died in 2010)
>
> https://git.suckless.org/sites/commit/b3f0a378e7d2dab6213be07e8f2b21fb637d6776.html
>
> I'd suggest to delete it.
>
> Alternatively the patches below fix the build (only very ligtly tested
> that it still starts)

The patches look good to me. I think it would make sense to commit them
as it might save someone some work.

ok for that.

I have no objection to removing wmii, but that can be done in a second
step.