Effective meson Lagrangian with chiral and heavy quark symmetries from quark flavor dynamics