#!/bin/sh # extracts various bits of data form OpenCL heder files, which are expected to # be in CL/ # constants cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h | perl -ne 'print "#ifdef CL_$1\nconst_iv($1)\n#endif\n" if /^#define CL_(\S+)/' >constiv.h # constants that look like enum values cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h | perl -ne 'print "#ifdef CL_$1\nconst_iv($1)\n#endif\n" if /^#define CL_(\S+)\s+0x[0-9a-fA-F]{4}/' >enumstr.h # *glGet*Info ( getinfo.txt # error codes ( echo "const_iv(SUCCESS)" cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h | perl -ne 'print "#ifdef CL_$1\nconst_iv($1)\n#endif\n" if !/#define CL_BUILD_(?:NONE|ERROR|IN_PROGRESS)/ && /^#define CL_(\S+)\s+-\d+\s*$/' ) >errstr.h