>>133
--enable-openglのときにHAVE_DIRECTXがundefされるんなら

bin_PROGRAMS = hoge
hoge_SOURCES = main.cc
if HAVE_DIRECTX
hoge_SOURCES += directx_test.h directx_test.cc
else
hoge_SOURCES += opengl_test.h opengl_test.cc
endif

でできんかな?
info automakeのBuilding a programのConditional compilations
あたり。