Git Product home page Git Product logo

Comments (5)

dcat avatar dcat commented on July 17, 2024 1

this is something that shouldn't be committed, at least not to the master branch.

however, I wrote a script that will statically compile all of them in to a single binary called wmbox.

#!/bin/sh

CC=cc

rm -f wmbox.c wmbox
SRC="`ls *.c`"

for i in $SRC
do
	sed "s/^main/${i%.c}_main/" $i | $CC -c -xc -o ${i%c}o -
	echo extern int ${i%.c}_main '(int, char **);' >>wmbox.c
done

cat << EOF >>wmbox.c
#include <string.h>
#include <stdio.h>
int main(int argc, char **argv) {
	argc--; *argv++;
	if (!argc)
		return 0;
EOF

for i in $SRC
do
	[ $i = "util.c" -o $i = "wmbox.c" ] && continue
	echo "	if (!strcmp(*argv, \"${i%.c}\")) return ${i%.c}_main(argc, argv);" >>wmbox.c
done

echo 'return 1;}' >>wmbox.c

${CC} -c wmbox.c
${CC} -o wmbox *.o -static -lxcb -lxcb-util -pthread -lX11  -lXau -lXdmcp

rm -f *.o

from core.

z3bra avatar z3bra commented on July 17, 2024

from core.

lslvr avatar lslvr commented on July 17, 2024

Thanks for your response. I guessed it could involve major changes to the code (just guessed, as I'm not a C programmer). One thing that I like a lot about busybox is the compact size of the binary, which is very helpful for embedded systems.

from core.

lslvr avatar lslvr commented on July 17, 2024

Thank you very much, @dcat! I'll keep this on a fork.

from core.

lslvr avatar lslvr commented on July 17, 2024

The binary can be found on Github releases, just in case somebody else is interested on it. They're generated on Travis CI.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.