~rabbits/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH uxn11] build.sh: automatically include X11 libs on OpenBSD

Details
Message ID
<165356535353.11464.14987999443077883824-0@git.sr.ht>
DKIM signature
missing
Download raw message
Patch: +8 -0
From: crossbower <crossbower@gmail.com>

---
 build.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/build.sh b/build.sh
index b32c8e8..a51b494 100755
--- a/build.sh
@@ -5,6 +5,14 @@ DEBUG_FLAGS="-std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragm
EMU_INC="src/uxn.c src/devices/system.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c src/uxn11.c -o bin/uxn11 -lX11"
CLI_INC="src/uxn.c src/devices/system.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli"

# find X11 libs on various systems
if [ -e /usr/X11R6 ]; then
	# OpenBSD
	RELEASE_FLAGS="-L/usr/X11R6/lib/ -I/usr/X11R6/include/ $RELEASE_FLAGS"
	DEBUG_FLAGS="-L/usr/X11R6/lib/ -I/usr/X11R6/include/ $DEBUG_FLAGS"
fi


if [ "${1}" = '--format' ];
then
	echo "Formatting.."
-- 
2.34.2
Details
Message ID
<20220601160820.2uaopsul2bo4ss3l@t480>
In-Reply-To
<165356535353.11464.14987999443077883824-0@git.sr.ht> (view parent)
DKIM signature
pass
Download raw message
On Thu, May 26, 2022 at 13:37:57 +0200, ~crossbower wrote:
> +# find X11 libs on various systems
> +if [ -e /usr/X11R6 ]; then
> +	# OpenBSD
> +	RELEASE_FLAGS="-L/usr/X11R6/lib/ -I/usr/X11R6/include/ $RELEASE_FLAGS"
> +	DEBUG_FLAGS="-L/usr/X11R6/lib/ -I/usr/X11R6/include/ $DEBUG_FLAGS"
> +fi

A more general way to do this would be to use pkg-config, maybe in a way like:

    RELEASE_FLAGS="$RELEASE_FLAGS $(pkg-config --cflags --libs x11 2>/dev/null || printf "%s" "-L/usr/X11R6/lib -I/usr/X11R6/include -lX11")"

~phoebos
Reply to thread Export thread (mbox)