These merchants feature mens jeans in 40 inch inseams:

Zappos.com

Zappos features Stetson and Cinch tall mens jeans in extra long 40 inch inseams.
Free Shipping & Free Return Shipping, so order several and keep the ones you like.

Tractor Supply Company 

Tractor Supply Company features Wrangler 40 inch inseam tall mens jeans. Use the Size dropdown menu on the left of their page to find your size.