I can't imagine it being illegal (at least in its non-pure form) as it is quite a significant component of black pepper.
If you are even THINKING of synthing through this route (which I'm sure you aren't - there is other places for this) then get the idea out of your head quicksmar. Even if it was just for personal use, the yeild would be so horrendously small and the time and effort taken would be so great (using mainly OTC precursors so you have to synth almost everything from scratch) that it wouldn't be worth your time.
There is plenty of other synths out there on the net, and with time I'm sure you will find them. I will give you this little bit of information though; you'll have a VERY hard time finding all your precursors without getting into contact with some nasty sorts to steal them for you.
I don't know what all the fuss is here, it's not like the OP referred to, or ask for synth instructions. Piperine inhibits certain enzymes including 2D63A4, although any use for this reason should be carefully considered.