Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need build instructions #2

Open
bahamat opened this issue May 13, 2019 · 6 comments
Open

Need build instructions #2

bahamat opened this issue May 13, 2019 · 6 comments

Comments

@bahamat
Copy link
Member

bahamat commented May 13, 2019

No description provided.

@rejohnst
Copy link
Contributor

I just updated the readme with some build instructions. Let me know if that works for you.

Thanks!

@bahamat
Copy link
Member Author

bahamat commented May 13, 2019

@rejohnst Thanks, but it'll need a bit more than that.

$ gmake all
/hwgrok/amd64
gmake[1]: Entering directory `/hwgrok/amd64'
/usr/bin/gcc -g -std=gnu99 -I//usr/include -m64 -c ../hwgrok.c -o hwgrok.o
gmake[1]: /usr/bin/gcc: Command not found
gmake[1]: *** [hwgrok.o] Error 127
gmake[1]: Leaving directory `/hwgrok/amd64'
gmake: *** [amd64] Error 2

@rejohnst
Copy link
Contributor

Yep - I know what that problem is. I just updated the readme with how to deal with this. Give it a look and let me know how it goes.

@bahamat
Copy link
Member Author

bahamat commented May 13, 2019

Given that this is SmartOS, there is no /usr/bin/gcc, and there can't be.

If I override that to use pkgsrc, then I get this error.

[root@11ca0fbf-6d26-4d0b-a79a-bff8e2a1c438 ~/hwgrok]# gmake CC=/opt/local/bin/gcc all
/root/hwgrok/amd64
gmake[1]: Entering directory '/root/hwgrok/amd64'
/opt/local/bin/gcc -g -std=gnu99 -I//usr/include -m64 -c ../hwgrok.c -o hwgrok.o
../hwgrok.c: In function 'grok_usbdev':
../hwgrok.c:921:33: error: 'TOPO_PGROUP_USB_PROPS' undeclared (first use in this function)
../hwgrok.c:921:33: note: each undeclared identifier is reported only once for each function it appears in
../hwgrok.c:922:6: error: 'TOPO_PGROUP_USB_PROPS_VNAME' undeclared (first use in this function)
../hwgrok.c:927:6: error: 'TOPO_PGROUP_USB_PROPS_SPEED' undeclared (first use in this function)
../hwgrok.c:932:6: error: 'TOPO_PGROUP_USB_PROPS_VERSION' undeclared (first use in this function)
../hwgrok.c: In function 'topocb':
../hwgrok.c:1117:40: error: 'USB_DEVICE' undeclared (first use in this function)
Makefile:13: recipe for target 'hwgrok.o' failed
gmake[1]: *** [hwgrok.o] Error 1
gmake[1]: Leaving directory '/root/hwgrok/amd64'
Makefile:19: recipe for target 'amd64' failed
gmake: *** [amd64] Error 2

It took a bit of digging, and comparing with two systems, where one had different errors, that the minimum PI to build this on is 20181122, because that's the first one that includes USB_DEVICE in /usr/include/fm/topo_hc.h.

Switching to a newer PI, I now get this error:

# gmake CC=/opt/local/bin/gcc all
/hwgrok/amd64
gmake[1]: Entering directory `/hwgrok/amd64'
/opt/local/bin/gcc -g -std=gnu99 -I//usr/include -m64 -c ../llist.c -o llist.o
/opt/onbld/bin/i386/ctfconvert -l 0 llist.o
gmake[1]: /opt/onbld/bin/i386/ctfconvert: Command not found
gmake[1]: *** [llist.o] Error 127
gmake[1]: Leaving directory `/hwgrok/amd64'
gmake: *** [amd64] Error 2

@rejohnst
Copy link
Contributor

rejohnst commented May 13, 2019

Sorry you're hitting so many issues. Yeah, there is one way around the minimum SmartOS PI issue - and that is to specify the path to the proto area from a smartos-live repo that was built with the prerequisite changes.

make CC=/opt/local/bin/gcc PROTO=/path/to/built-smartos-live-repo/proto all

My SmartOS build zone has /opt/onbld, but I don't recall if it came with it or I installed it after the fact. If you have a built smartos-live repo, there should be a copy of the CTF tools in there and you can point to it by overriding the CTFTOOLS macro. For example, if you have a built smartos-live repo at /home/user/smartos-live, you would point to it's CTF tools as follows:

make CC=/opt/local/bin/gcc \
CTFTOOLS=/home/user/smartos-live/projects/illumos/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386 all

On OpenIndiana you would simply install thedeveloper/build/onbld IPS package.

@rejohnst
Copy link
Contributor

FWIW, I tweaked the makefile to seach for gcc in your PATH. So now you only need to manually override the CC macro if gcc is not in your path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants