FS#8622 - Build failure on FreeBSD

Attached to Project: Rockbox
Opened by Bartosz Fabianowski (undo) - Wednesday, 20 February 2008, 16:01 GMT
Last edited by Dominik Riebeling (bluebrother) - Thursday, 21 February 2008, 21:08 GMT
Task Type Bugs
Category Build environment
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


SVN commit 16343 breaks the build on FreeBSD. In it, apps/lang/Makefile was added with code to automatically calculate the size of the largest language file:

$(call PRINTS,Make $(HEADER))
echo "#define MAX_LANGUAGE_SIZE `du -b $(OBJDIR)/* |sort -n |tail -n 1 |cut -f 1`" > $(HEADER)

However, the -b argument passed to du is a GNU extension that is not available on other *NIX systems. The du command therefore silently fails, leaving MAX_LANGUAGE_SIZE undefined.

A more portable method to determine the largest file size will have to be found here, as du on FreeBSD has *no* parameter that would output the number of bytes.
This task depends upon

Closed by  Dominik Riebeling (bluebrother)
Thursday, 21 February 2008, 21:08 GMT
Reason for closing:  Fixed
Additional comments about closing:  Thanks for verifying. Should've noticed that gawk is GNU awk in the first place myself ;-)
Comment by Dominik Riebeling (bluebrother) - Wednesday, 20 February 2008, 19:27 GMT
Would using ls work? I.e. using something like
`ls -lr | gawk '{print $5}' | sort -n | tail -n 1`

(I don't have access to a BSD machine, so I have no idea if that also uses GNU extensions ...)
Comment by Bartosz Fabianowski (undo) - Wednesday, 20 February 2008, 19:34 GMT
gawk stands for "GNU awk", so that command in itself is a GNU extension :). But I just tested that it works if you use plain awk (FreeBSD 6-STABLE):

ls -lr | awk '{print $5}' | sort -n | tail -n 1