only def graphite external if --enable-graphite

Change-Id: I58271b5138b6dda4c448af63146a2f2171cb61a1
(cherry picked from commit 026dc56eb7deb7c49b6d54875a697d4a431082fe)