I am currently toying with the source of diskdev_cmds. After the usual fumbling that happens when trying to build without an Xcode environment, I get the Makefile to work.
I went as far as building everything, but I have an issue with fsck_hfs.tproj/dfalib. Here I report the error:
make: Entering directory `/private/var/root/diskdev_cmds-557/fsck_hfs.tproj/dfalib'
===== Building libdfalib.a RELEASE =====
/usr/bin/gcc -g -Os -pipe -Wall -Werror -Wno-unused-function -DBSD=1 -DDEBUG_BUILD=0 -DCONFIG_HFS_
TRIM=1 -Wno-four-char-constants -fpascal-strings -I/tmp/diskdev_cmds/Build/dfalib -c -o /tmp/diskd
In file included from CheckHFS.h:24,
../fsck_messages.h:143: error: expected identifier or '(' before '^' token
../fsck_messages.h:145: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fsckGetBlo
../fsck_messages.h:146: error: expected declaration specifiers or '...' before 'fsckBlock_t'
make: *** [build] Error 1
Howev, if I ask make to use clang to build running make CC=clang, I can pass the error. Thought this seem to be ok, I've problems with clang (to put it simple, it can't link libraries/executables against crt1.o/bundle/whatever, so it cannot link. The rare times I manage to link a binary, it's broken as it raises SIGSYS).
Suggestions are welcomed.