mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-gl-amd-sh-3b05ebaa625428ac3590a7ba1848a6234a572db4 / contrib / mapi.sh
blobd7f1e915992d76567c28d3e8b210be207f7d3856
1 echo "building mapi (APIs de/multiplexer) components-->"
2 #===============================================================================
3 # static part of glapi, only mapi/entry.c in mapi bridge mode
4 mkdir -p $build_dir/src/mapi
5 #------------------------------------------------------------------------------
6 printf "CPP $src_dir/src/mapi/entry.c --> $build_dir/src/mapi/entry_mode_bridge.cpp.c\n"
7 $cpp $src_dir/src/mapi/entry.c -o $build_dir/src/mapi/entry_mode_bridge.cpp.c \
8 -DMAPI_MODE_BRIDGE=1 \
9 -DMAPI_ABI_HEADER=\"$build_dir/src/mapi/glapi/static_glapi_mapi_tmp.h\" \
11 -I$cc_internal_fixed_incdir \
12 -I$cc_internal_incdir \
13 -I$linux_incdir \
14 -I$syslib_incdir \
16 -I$build_dir/src/util \
17 -I$src_dir/src/util \
18 -I$build_dir/src \
19 -I$src_dir/src \
20 -I$build_dir/include \
21 -I$src_dir/include \
23 $syslib_cpp_flags_defs \
24 $linux_cpp_flags_defs \
25 $cc_builtins_cpp_flags_defs \
26 $cc_attributes_cpp_flags_defs \
27 $mesa_cpp_flags_defs \
29 $external_deps_cpp_flags
30 #------------------------------------------------------------------------------
31 printf "CC_S $build_dir/src/mapi/entry_mode_bridge.cpp.c --> $build_dir/src/mapi/entry_mode_bridge.cpp.c.s\n"
32 $cc_s $build_dir/src/mapi/entry_mode_bridge.cpp.c -o $build_dir/src/mapi/entry_mode_bridge.cpp.c.s
33 #------------------------------------------------------------------------------
34 printf "AS $build_dir/src/mapi/entry_mode_bridge.cpp.c.s --> $build_dir/src/mapi/entry_mode_bridge.cpp.c.s.o\n"
35 $as $build_dir/src/mapi/entry_mode_bridge.cpp.c.s -o $build_dir/src/mapi/entry_mode_bridge.cpp.c.s.o
36 #------------------------------------------------------------------------------
37 printf "AR RCS $build_dir/libglapi_static.a $build_dir/src/entry_mode_bridge.cpp.c.s.o\n"
38 $ar_rcs $build_dir/libglapi_static.a $build_dir/src/mapi/entry_mode_bridge.cpp.c.s.o &
39 #===============================================================================
40 # shared part of glapi
41 mapi_glapi_c_pathnames="\
42 $src_dir/src/mapi/entry.c \
43 $src_dir/src/mapi/shared-glapi/glapi.c \
44 $src_dir/src/mapi/shared-glapi/stub.c \
45 $src_dir/src/mapi/shared-glapi/table.c \
47 mapi_util_c_pathnames="\
48 $src_dir/src/mapi/u_current.c \
50 #-------------------------------------------------------------------------------
51 for src_pathname in $mapi_glapi_c_pathnames $mapi_util_c_pathnames
53 if test "$(basename $src_pathname)" = "entry.c"; then
54 cpp_filename=entry_mode_glapi.cpp.c
55 else
56 cpp_filename=$(basename $src_pathname .c).cpp.c
58 printf "CPP $src_pathname --> $build_dir/src/mapi/$cpp_filename\n"
59 $cpp $src_pathname -o $build_dir/src/mapi/$cpp_filename \
60 -DMAPI_MODE_GLAPI=1 \
61 -DMAPI_ABI_HEADER=\"$build_dir/src/mapi/glapi/shared_glapi_mapi_tmp.h\" \
63 -I$cc_internal_fixed_incdir \
64 -I$cc_internal_incdir \
65 -I$linux_incdir \
66 -I$syslib_incdir \
68 -I$build_dir/src/mapi/shared-glapi \
69 -I$src_dir/src/mapi/shared-glapi \
70 -I$build_dir/src/mapi \
71 -I$src_dir/src/mapi \
72 -I$build_dir/src/ \
73 -I$src_dir/src/ \
74 -I$build_dir/include \
75 -I$src_dir/include \
77 $syslib_cpp_flags_defs \
78 $linux_cpp_flags_defs \
79 $cc_builtins_cpp_flags_defs \
80 $cc_attributes_cpp_flags_defs \
81 $mesa_cpp_flags_defs \
83 $external_deps_cpp_flags &
84 done
85 #-------------------------------------------------------------------------------
86 wait
87 #------------------------------------------------------------------------------
88 for src_pathname in $mapi_glapi_c_pathnames $mapi_util_c_pathnames
90 if test "$(basename $src_pathname)" = "entry.c"; then
91 cpp_filename=entry_mode_glapi.cpp.c
92 asm_filename=entry_mode_glapi.cpp.c.s
93 else
94 cpp_filename=$(basename $src_pathname .c).cpp.c
95 asm_filename=$(basename $src_pathname .c).cpp.c.s
97 printf "CC_S $build_dir/src/mapi/$cpp_filename --> $build_dir/src/mapi/$asm_filename\n"
98 $cc_s $build_dir/src/mapi/$cpp_filename -o $build_dir/src/mapi/$asm_filename &
99 done
100 #------------------------------------------------------------------------------
101 wait
102 #------------------------------------------------------------------------------
103 libglapi_slib=
104 for src_pathname in $mapi_glapi_c_pathnames $mapi_util_c_pathnames
106 if test "$(basename $src_pathname)" = "entry.c"; then
107 asm_filename=entry_mode_glapi.cpp.c.s
108 o_filename=entry_mode_glapi.cpp.c.s.o
109 else
110 asm_filename=$(basename $src_pathname .c).cpp.c.s
111 o_filename=$(basename $src_pathname .c).cpp.c.s.o
113 libglapi_slib="$libglapi_slib $build_dir/src/mapi/$o_filename"
114 printf "AS $build_dir/src/mapi/$asm_filename --> $build_dir/src/mapi/$o_filename\n"
115 $as $build_dir/src/mapi/$asm_filename -o $build_dir/src/mapi/$o_filename &
116 done
117 #------------------------------------------------------------------------------
118 #===============================================================================
119 wait
120 #===============================================================================
121 mkdir -p \
122 $build_dir/install_root$libdir \
123 $build_dir/install_root$libdir_store
124 #-------------------------------------------------------------------------------
125 printf "BINUTILS LD $build_dir/install_root$libdir_store/libglapi.so.0.0.0\n"
126 $binutils_ld -o $build_dir/install_root$libdir_store/libglapi.so.0.0.0 \
127 -shared \
128 -soname=libglapi.so.0 \
129 --no-undefined \
130 --gc-sections \
131 -s \
132 $syslib_ld_slib_start_files \
133 $cc_ld_slib_start_files \
134 $libglapi_slib \
136 $build_dir/libmesa_util.a \
138 --as-needed \
139 $syslibs_libpthread_ld_flags \
140 $syslibs_libc_ld_flags \
141 --no-as-needed \
142 $cc_ld_slib_end_files \
143 $syslib_ld_slib_end_files
144 #------------------------------------------------------------------------------
145 ln -sf $libdir_store_virtual/libglapi.so.0.0.0 $build_dir/install_root$libdir/libglapi.so.0
146 ln -sf libglapi.so.0.0.0 $build_dir/install_root$libdir_store/libglapi.so
147 #===============================================================================
148 echo "<--mapi components built"