1 | #!/bin/sh |
1 | #!/bin/sh |
2 | |
2 | |
3 | # extracts various bits of data form OpenCL heder files, which are expected to |
3 | # extracts various bits of data form OpenCL heder files, which are expected to |
4 | # be in CL/ |
4 | # be in CL/ |
5 | |
5 | |
6 | ALL_H="CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL11/cl_d3d9.h CL/cl_d3d10.h CL12/cl_d3d11.h CL/cl_dx9_media_sharing.h" |
6 | ALL_H="CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h CL12/cl_d3d11.h CL/cl_dx9_media_sharing.h" |
7 | |
7 | |
8 | # constants |
8 | # constants |
9 | ( |
9 | ( |
10 | echo '// autogenerated by h_extract' |
10 | echo '// autogenerated by h_extract' |
11 | cat $ALL_H | |
11 | cat $ALL_H | |
… | |
… | |
40 | echo "const_iv(SUCCESS)" |
40 | echo "const_iv(SUCCESS)" |
41 | cat $ALL_H | |
41 | cat $ALL_H | |
42 | perl -ne 'print "const_iv($1)\n" if !/#define CL_BUILD_(?:NONE|ERROR|IN_PROGRESS)/ && /^#define CL_(\S+)\s+-\d+\s*$/' |
42 | perl -ne 'print "const_iv($1)\n" if !/#define CL_BUILD_(?:NONE|ERROR|IN_PROGRESS)/ && /^#define CL_(\S+)\s+-\d+\s*$/' |
43 | ) >errstr.h |
43 | ) >errstr.h |
44 | |
44 | |
45 | # default constant values to -1 |
45 | # default constant values to 0 |
46 | ( |
46 | ( |
47 | echo '// autogenerated by h_extract' |
47 | echo '// autogenerated by h_extract' |
48 | cat constiv.h | |
48 | cat constiv.h | |
49 | perl -ne '/const_iv\((.*)\)/ or next; print "#ifndef CL_$1\n#define CL_$1 -1\n#endif\n"' |
49 | perl -ne '/const_iv\((.*)\)/ or next; print "#ifndef CL_$1\n#define CL_$1 0\n#endif\n"' |
50 | ) >default.h |
50 | ) >default.h |
51 | |
51 | |
52 | # *glGet*Info |
52 | # *glGet*Info |
53 | ( |
53 | ( |
54 | <CL/cl.hpp perl -ne 'print "$1\n" if /^\s*F\((.*)\)\s*\\?\s*$/' |
54 | <CL/cl.hpp perl -ne 'print "$1\n" if /^\s*F\((.*)\)\s*\\?\s*$/' |
… | |
… | |
73 | cl_kernel_arg_info, CL_KERNEL_ARG_ACCESS_QUALIFIER, cl_kernel_arg_access_qualifier |
73 | cl_kernel_arg_info, CL_KERNEL_ARG_ACCESS_QUALIFIER, cl_kernel_arg_access_qualifier |
74 | cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_NAME, STRING_CLASS |
74 | cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_NAME, STRING_CLASS |
75 | cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_QUALIFIER, cl_kernel_arg_type_qualifier |
75 | cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_QUALIFIER, cl_kernel_arg_type_qualifier |
76 | cl_kernel_arg_info, CL_KERNEL_ARG_NAME, STRING_CLASS |
76 | cl_kernel_arg_info, CL_KERNEL_ARG_NAME, STRING_CLASS |
77 | EOF |
77 | EOF |
78 | ) | sort >getinfo.txt |
78 | ) >getinfo.txt |
79 | |
79 | |