I am trying to figure out how to compile the AOSP with superuser. I was pointed to this question: Build Android with Superuser. The instructions seem a little unclear and I also do not understand exactly what is going on. It also seems to talk about this allowing su privileges on android apps. I am not trying to get this on apps. I was trying to have root access when running some code in the main android source(specifically trying to open a socket in DisplayDevice.cpp).
I have asked a similar question here(Create a socket in android code(not in android application) getting Permission Denied). I figured that since I was put on the right track and now know that I need to compile the code as superuser, I should just ask another question.
I have added the su-binary code to my AOSP code as per instructions from the first SO question. I have also changed my init.rc, but am under the impression that I need to do something to make those changes go through as well. This is not talked about in the question. Right now when I run make su-binary I get "make: Nothing to be done for `su-binary'.". I think something was wrong here. I am using the makefile specified by m-ric. I also was not sure if I needed the Superuser.apk since I am not working with code that will be found in an Android app.
If anyone could point me in the right direction for this I would be really grateful. I am happy to provide more information if needed.