install_headers(
    'ag.h',
    'agproto.h',
    'applewmconst.h',
    'applewmproto.h',
    'bigreqsproto.h',
    'bigreqstr.h',
    'composite.h',
    'compositeproto.h',
    'cup.h',
    'cupproto.h',
    'damageproto.h',
    'damagewire.h',
    'dbe.h',
    'dbeproto.h',
    'dmx.h',
    'dmxproto.h',
    'dpmsconst.h',
    'dpmsproto.h',
    'dri2proto.h',
    'dri2tokens.h',
    'dri3proto.h',
    'EVI.h',
    'EVIproto.h',
    'ge.h',
    'geproto.h',
    'lbx.h',
    'lbxproto.h',
    'mitmiscconst.h',
    'mitmiscproto.h',
    'multibufconst.h',
    'multibufproto.h',
    'panoramiXproto.h',
    'presentproto.h',
    'presenttokens.h',
    'randr.h',
    'randrproto.h',
    'recordconst.h',
    'recordproto.h',
    'recordstr.h',
    'render.h',
    'renderproto.h',
    'saver.h',
    'saverproto.h',
    'secur.h',
    'securproto.h',
    'shapeconst.h',
    'shapeproto.h',
    'shapestr.h',
    'shm.h',
    'shmproto.h',
    'shmstr.h',
    'syncconst.h',
    'syncproto.h',
    'syncstr.h',
    'vldXvMC.h',
    'windowswm.h',
    'windowswmstr.h',
    'xcmiscproto.h',
    'xcmiscstr.h',
    'xf86bigfont.h',
    'xf86bigfproto.h',
    'xf86bigfstr.h',
    'xf86dga1const.h',
    'xf86dga1proto.h',
    'xf86dga1str.h',
    'xf86dgaconst.h',
    'xf86dga.h',
    'xf86dgaproto.h',
    'xf86dgastr.h',
    'xf86misc.h',
    'xf86mscstr.h',
    'xf86vm.h',
    'xf86vmproto.h',
    'xf86vmstr.h',
    'xfixesproto.h',
    'xfixeswire.h',
    'XI2.h',
    'XI2proto.h',
    'XI.h',
    'XIproto.h',
    'XKBgeom.h',
    'XKB.h',
    'XKBproto.h',
    'XKBsrv.h',
    'XKBstr.h',
    'XResproto.h',
    'xtestconst.h',
    'xtestext1const.h',
    'xtestext1proto.h',
    'xtestproto.h',
    'xtrapbits.h',
    'xtrapddmi.h',
    'xtrapdi.h',
    'xtrapemacros.h',
    'xtraplib.h',
    'xtraplibp.h',
    'xtrapproto.h',
    'Xv.h',
    'XvMC.h',
    'XvMCproto.h',
    'Xvproto.h',
    subdir : 'X11/extensions'
)

if get_option('legacy') == true
    install_headers(
        'evieproto.h',
        'fontcache.h',
        'fontcacheP.h',
        'fontcachstr.h',
        'lgewire.h',
        'Print.h',
        'Printstr.h',
        'xcalibrateproto.h',
        'xcalibratewire.h',
        'Xeviestr.h',
        'xf86rush.h',
        'xf86rushstr.h',
        subdir : 'X11/extensions'
    )
endif
