Hands on compiling xredit

discuss compiling applications for Puppy
Post Reply
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

Hands on compiling xredit

#1 Post by goingnuts »

xredit:
"This editor is a simple, but powerful editor to run under XWindows. It features an intuitive user surface with mouse support, multiple file editing, formatting service and makros."

Besides that it screams for some visual styling... :)

Download and unpack the source. Running make gives the following error:
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../../i486-t2-linux-gnu/bin/ld: cannot find -lX11

Change CFFLAGS-line in makefile to:

Code: Select all

CFLAGS=-Wall -DBLACK0 -DNOIBM -I/usr/include/X11 -L/usr/X11/lib -lX11
The -DBLACK0 -DNOIBM is specific for this program - just passing some settings...
Now it works. Stripped binary is 77K with this modest dependency list:
libX11, libc, libXau, libXdmcp and libdl.

The make file does not respond to "make clean". You have to delete files manually or add the following in the end of the makefile:

Code: Select all

clean:
	rm -f xredit *.o
Note: The space before rm is a tab.
Lets make the binary smaller. Change CC-line in makefile to:

Code: Select all

CC=gcc -Os -mtune=i386
Run make and strip - now binary is 56K - that's 25% smaller.
We could knock of another 1k by using sstrip

Anyone know how to make it smaller or how to compile with Xau and Xdmcp as static libs?

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

to compile xau and xdmcp as static, you should first build x11 to use the static libs, but you would need to add -fpic or -fPIC to CFLAGS when you compile them ... just delete their .so file so that the linker uses libXau.a etc...

otherwise there is no point, since libX11 has those as dependencies

chances are xau and xdmcp won't even need to be linked then.

if you link xau and xdmcp into x11, you may also want to replace them with symlinks to x11

keep in mind that this would be very nonstandard
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#3 Post by goingnuts »

technosaurus wrote:...otherwise there is no point, since libX11 has those as dependencies...
I see...thanks!
Wish one could edit post here as my first post could need some adjustments after testing in a fresh frugal P412 environment...
Why is that disabled here?

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#4 Post by sc0ttman »

goingnuts wrote:
technosaurus wrote:...otherwise there is no point, since libX11 has those as dependencies...
I see...thanks!
Wish one could edit post here as my first post could need some adjustments after testing in a fresh frugal P412 environment...
Why is that disabled here?
I'm avoiding posting here (except this, obviously) till it's sorted...
The mods are aware, but as yet, no action.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

asok4uuu
Posts: 1
Joined: Wed 24 Aug 2011, 17:42
Contact:

#5 Post by asok4uuu »

chances are xau and xdmcp won't even need to be linked then.

if you link xau and xdmcp into x11, you may also want to replace them with symlinks to x11

keep in mind that this would be very nonstandard

Post Reply