1b519abb606c819c446a408f422530268b21a100bMathias Agopian#! /bin/sh
2b519abb606c819c446a408f422530268b21a100bMathias Agopian#
3b519abb606c819c446a408f422530268b21a100bMathias Agopian# Copyright (C) 2008 Google Inc.
4b519abb606c819c446a408f422530268b21a100bMathias Agopian#
5b519abb606c819c446a408f422530268b21a100bMathias Agopian# Licensed under the Apache License, Version 2.0 (the "License");
6b519abb606c819c446a408f422530268b21a100bMathias Agopian# you may not use this file except in compliance with the License.
7b519abb606c819c446a408f422530268b21a100bMathias Agopian# You may obtain a copy of the License at
8b519abb606c819c446a408f422530268b21a100bMathias Agopian#
9b519abb606c819c446a408f422530268b21a100bMathias Agopian#      http://www.apache.org/licenses/LICENSE-2.0
10b519abb606c819c446a408f422530268b21a100bMathias Agopian#
11b519abb606c819c446a408f422530268b21a100bMathias Agopian# Unless required by applicable law or agreed to in writing, software
12b519abb606c819c446a408f422530268b21a100bMathias Agopian# distributed under the License is distributed on an "AS IS" BASIS,
13b519abb606c819c446a408f422530268b21a100bMathias Agopian# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14b519abb606c819c446a408f422530268b21a100bMathias Agopian# See the License for the specific language governing permissions and
15b519abb606c819c446a408f422530268b21a100bMathias Agopian# limitations under the License.
16b519abb606c819c446a408f422530268b21a100bMathias Agopian
172b6694f5f0106b535bf9188262ca8ca72278e906Jesse Hall# Force a specific locale for sorting to avoid irrelevant differences
182b6694f5f0106b535bf9188262ca8ca72278e906Jesse Hall# in the generated files that could hide real differences.
192b6694f5f0106b535bf9188262ca8ca72278e906Jesse Hallexport LC_ALL=POSIX
202b6694f5f0106b535bf9188262ca8ca72278e906Jesse Hall
21618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian./glapigen ../../include/GLES/gl.h      > ../GLES_CM/gl_api.in
22618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian./glapigen ../../include/GLES/glext.h   > ../GLES_CM/glext_api.in
234c0596f4cc7d3a0bbbe5862cb38585a58ef4d0a3Jesse Hall./glapigen ../../include/GLES3/gl3.h    > ../GLES2/gl2_api.in
24618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian./glapigen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_api.in
25b1a39d67be99fe6c4545b25e10ac82a5dd1df634Mathias Agopian
26618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian./glentrygen ../../include/GLES/gl.h      > /tmp/gl_entries.in
27618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian./glentrygen ../../include/GLES/glext.h   > /tmp/glext_entries.in
284c0596f4cc7d3a0bbbe5862cb38585a58ef4d0a3Jesse Hall./glentrygen ../../include/GLES3/gl3.h    > /tmp/gl2_entries.in
29618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian./glentrygen ../../include/GLES2/gl2ext.h > /tmp/gl2ext_entries.in
30b1a39d67be99fe6c4545b25e10ac82a5dd1df634Mathias Agopian
312b6694f5f0106b535bf9188262ca8ca72278e906Jesse Hall# The awk command removes lines with the same function name as an earlier
322b6694f5f0106b535bf9188262ca8ca72278e906Jesse Hall# line, even if the rest of the line differs. Although signatures of
334774338bd0ad1ebe42c311fd0c72f13786b5c800Jesse Hall# functions with the same name should be the same, the different versions
344774338bd0ad1ebe42c311fd0c72f13786b5c800Jesse Hall# have some irrelevant whitespace and parameter name differences.
35618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopiancat /tmp/gl_entries.in \
36618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian    /tmp/glext_entries.in \
37618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian    /tmp/gl2_entries.in \
38618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian    /tmp/gl2ext_entries.in \
39618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian        | sort -t, -k2 \
40618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian        | awk -F, '!_[$2]++' \
41618fa10949c42eb83fa5fe105fe542bcff833ddaMathias Agopian            > ../entries.in
42a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevich
43a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevichcat ../../include/GLES/gl.h \
44a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevich    ../../include/GLES/glext.h \
45a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevich    ../../include/GLES2/gl2ext.h \
464774338bd0ad1ebe42c311fd0c72f13786b5c800Jesse Hall    ../../include/GLES3/gl3.h \
47a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevich        | ./glenumsgen \
48a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevich        | sort \
49a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevich        > ../enums.in
50a2dd6cf59962e3a21a47df29b2f243e904839ba7Jack Palevich
51