Mark McLelland, writing under the name Dharmachari Jnanavira, examines sex, homosexuality, and attitudes towards women in Japanese Society from the founding of the first Buddhist temple until the end of the 19th century in this article for Western Buddhist Review .
This article is a must read for anyone writing yaoi (anime or manga based slash) since the attitudes toward two men having sex were so very different from Western views that they should influence both plot and characterization. For someone like Miroku, a 19-year-old 16th century monk, to be totally naive about same sex relationships is just about impossible given the culture but I've seen several stories where the fanfic author wants us to believe that is the case. Likewise any product of the Samurai culture that was strongly influenced by these ideas would not be unaware of such things.
The author does throw in some modern gender stuff towards the end about the death of male friendships in our culture that I don't agree with but other works I've read back up the basic historical information he presents.