Solved Make a stand alone application

What would I do to compile from ports a program that is stand-alone.
I want to be able to transfer it to various memory sticks. Same Arch.
The program is: sysutils/flashrom

Is there a make for this?
 
Is it possible to compile for multi-arch with static or any method? Size is not an issue.
I would like to built a multi-arch version of flashrom.
 
I would like to built a multi-arch version of flashrom.
How "multi-arch" does it have to be? As far as I know there's no real solution for this on FreeBSD but if multi-arch is limited to 32 vs. 64 bit you might be able to get away with just building a 32 bit executable.
 
Thanks,
I was just wondering if there was such a thing as multi-arch binaries. No big deal. Just curious.
 
Can someone tell me how to static compile this? What is the procedure for static compiling a port?
 
So roughly I need to static compile any dependancies that the application needs then static compile the application?
That is my best guess. So what I think I need to do is run make in /usr/ports/sysutils/flashrom
That should get me all the files I need in place. Then perhaps write a custom makefile for the static builds?
One for each dependency, sysutils/dmidecode, devel/libpci and devel/libftdi1
Guess I need to their dependencies too:
misc/pciids, devel/libconfuse, /converters/libiconv, devel/boost-libs, devel/icu .
So that covers all dependencies of everything all the way out...

Is there a ports makefile option for static building a port? I can't find anything similar.
 
I found a port with static compile option - archivers/gtar

Looks like I need to study these options:
STATIC_LDFLAGS= -static
STATIC_CONFIGURE_ENV= SHLIBEXT=""

STATIC_VARS= STATIC_ARGS=build
STATIC_VARS_OFF= STATIC_ARGS=lib
 
This was the classic case of DuckDuckGo failing me.
Went to Google where it referenced a post that showed how to do it:
Code:
MAKE_ARGS+=    STATIC=1
I now have a 576kb flashrom that I can use on a thumbdrive.

Next up, USB memstick misc/ytree static build with all the archiving programs included.
I also want to include these goodies:
[VIEWER]
.jpg,.gif,.bmp,.tif,.ppm,.xpm=xv
.1,.2,.3,.4,.5,.6,.7,.8,.n=nroff -man | less
.ps=ghostview
.mid,.MID=playmidi -e
.wav,.WAV=splay
.au=auplay
.avi,.mpg,.mov=xanim
.htm,.html=lynx
.pdf,.PDF=acroread
.mp3=mpg123
 
This was the classic case of DuckDuckGo failing me. Went to Google where it referenced a post that showed how to do it:

I've always found DDG's search to be weaker than Google's as well. However, you don't have to leave DDG to get results from Google.
Not sure if you're aware but you can access Google search results directly through DDG using their bang symbol (!).
Just type !g <search-query> in the DDG search box And DDG will retrieve the Google results page directly without passing any of your details on to Google.
They have bangs for other large and popular sites as well (Amazon, Wikipedia, Youtube etc).
Perform one search using DDG's !g and another using Google directly and check the difference in the search URL returned.
The extra information in the direct Google query URL is the information stored about you and your query.

Apologies in advance for hijacking your thread with this semi-off-topic comment :)
 
Returning to this topic I have built misc/ytree as a static build.
I was surprised that /ports-mgmt/dialog4ports was required.
When reading bsd.port.mk I thought make all-depends-list would show all dependencies.
Why did it not show ports-mgmt/dialog4ports as a dependency?
I see ytree needs ncurses so I am guessing that dialog4ports is providing ncurses.
Perhaps this is an artifact of static building? Needs to pull in dialog4ports to be self contained application?

The size difference is so small with ytree this was actually a worthy endevour.
My version is 188K
Code:
-rwxrw-r-x  1 root  wheel  188995 Jun 24 01:18 ytree
When installed from packages it is 166K.
Code:
-r-xr-xr-x  1 root  wheel  166096 Apr 12 05:42 /usr/local/bin/ytree

So it did not grow much at all. Having only devel/readline and print/indexinfo as dependencies helped.

Since I branched my ports tree for static building I would like to add some applications as I noted above.
What should I use in my custom Makefile for ytree to include xv for image viewing?
 
I think I can call it a dependency to include it:
/usr/ports/misc/ytree/Makefile
Code:
RUN_DEPENDS=    ${LOCALBASE}/usr/local/sbin/xv:graphics/xv
xv alone has 12 dependencies. This could get interesting for static building


I really need scripting help. I want to add a string to every ports Makefile
{$STRING}="MAKE_ARGS+= STATIC=1"
To every Makefile of the output of make all-depends-list

OK this will grab a list of ports I need to modify.
/usr/ports/graphics/xv/make all-depends-list > depends.list

How can I append a string into each ports Makefile found in this depends.list file?
echo {$STRING} > {$PORTNAME}/Makefile ????
Make the string and portnames variables?
 
Back
Top