241 |
mkdir -p ${DST_PREFIX}/${LIBDIR} |
mkdir -p ${DST_PREFIX}/${LIBDIR} |
242 |
pushd ${DST_PREFIX}/${LIBDIR} &> /dev/null |
pushd ${DST_PREFIX}/${LIBDIR} &> /dev/null |
243 |
# First remove old symlinks |
# First remove old symlinks |
244 |
for file in libGL{,core}.{a,so,la} |
for file in lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la} |
245 |
do |
do |
246 |
|
# exclude libGLU |
247 |
|
[[ ${file} = libGLU.so ]] && continue |
248 |
[[ -h ${file} ]] && rm -f ${file} |
[[ -h ${file} ]] && rm -f ${file} |
249 |
done |
done |
250 |
|
|
251 |
# Note that we don't do .so*, just .so on purpose. The |
# Note that we don't do .so*, just .so on purpose. The |
252 |
# loader knows to look in the profile dir, and the |
# loader knows to look in the profile dir, and the |
253 |
# linked just needs the .so |
# linked just needs the .so |
254 |
for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/libGL{,core}.{so,a,la} |
for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la} |
255 |
do |
do |
256 |
[[ -f ${file} ]] || continue |
[[ -f ${file} ]] || continue |
257 |
[[ -f ${file##*/} ]] && rm -f ${file##*/} |
[[ -f ${file##*/} ]] && rm -f ${file##*/} |
271 |
mkdir -p ${DST_PREFIX}/${LIBDIR}/tls |
mkdir -p ${DST_PREFIX}/${LIBDIR}/tls |
272 |
pushd ${DST_PREFIX}/${LIBDIR}/tls &> /dev/null |
pushd ${DST_PREFIX}/${LIBDIR}/tls &> /dev/null |
273 |
# First remove old symlinks |
# First remove old symlinks |
274 |
for file in libGL{,core}.{a,so,la} |
for file in lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la} |
275 |
do |
do |
276 |
|
# exclude libGLU |
277 |
|
[[ ${file} = libGLU.so ]] && continue |
278 |
[[ -h ${file} ]] && rm -f ${file} |
[[ -h ${file} ]] && rm -f ${file} |
279 |
done |
done |
280 |
|
|
281 |
for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls/libGL{,core}.{so,a,la} |
for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls/lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la} |
282 |
do |
do |
283 |
[[ -f ${file} ]] || continue |
[[ -f ${file} ]] || continue |
284 |
[[ -f ${file##*/} ]] && rm -f ${file##*/} |
[[ -f ${file##*/} ]] && rm -f ${file##*/} |
307 |
mkdir -p ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions |
mkdir -p ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions |
308 |
pushd ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions &> /dev/null |
pushd ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions &> /dev/null |
309 |
# First remove old symlinks |
# First remove old symlinks |
310 |
for file in libglx.so libglx.a |
for file in lib{wfb,glx,dri,dri2}.{so,dylib,a} |
311 |
do |
do |
312 |
[[ -h ${file} ]] && rm -f ${file} |
[[ -h ${file} ]] && rm -f ${file} |
313 |
done |
done |
329 |
fi |
fi |
330 |
|
|
331 |
# Setup the includes |
# Setup the includes |
332 |
mkdir -p ${DST_PREFIX}/include/GL |
local -A headers |
333 |
pushd ${DST_PREFIX}/include/GL &> /dev/null |
headers[GL]="gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h" |
334 |
for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h |
headers[GLES]="egl.h gl_extensions.h glext.h gl.h glplatform.h" |
335 |
do |
headers[GLES2]="gl2ext.h gl2.h gl2platform.h" |
336 |
# IMPORTANT |
headers[EGL]="eglext.h egl.h eglmesaext.h eglplatform.h" |
337 |
# It is preferable currently to use the standard glext.h file |
headers[KHR]="khrplatform.h" |
338 |
# however if an OpenGL provider must use a self produced glext.h |
headers[VG]="openvg.h vgext.h vgplatform.h vgu.h" |
339 |
# then it should be installed to ${GL_IMPLEM}/include and the user |
for incl_dir in EGL GL GLES GLES2 KHR VG |
340 |
# can add the --impl-headers option to select it. |
do |
341 |
|
mkdir -p ${DST_PREFIX}/include/${incl_dir} |
342 |
|
pushd ${DST_PREFIX}/include/${incl_dir} &> /dev/null |
343 |
|
for file in ${headers[${incl_dir}]} |
344 |
|
do |
345 |
|
# IMPORTANT |
346 |
|
# It is preferable currently to use the standard glext.h file |
347 |
|
# however if an OpenGL provider must use a self produced glext.h |
348 |
|
# then it should be installed to ${GL_IMPLEM}/include and the user |
349 |
|
# can add the --impl-headers option to select it. |
350 |
|
if [[ ${USE_PROFILE_HEADERS} = yes ]] |
351 |
|
then |
352 |
|
# Check the profile first. |
353 |
|
if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} ]] |
354 |
|
then |
355 |
|
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
356 |
|
ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} |
357 |
|
fi |
358 |
|
continue |
359 |
|
fi |
360 |
|
|
361 |
if [[ ${USE_PROFILE_HEADERS} = yes ]] |
if [[ -e ${PREFIX}/${LIBDIR}/opengl/global/include/${incl_dir}/${file} ]] |
|
then |
|
|
# Check the profile first. |
|
|
if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]] |
|
362 |
then |
then |
363 |
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
364 |
ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} |
ln -s ${PREFIX}/${LIBDIR}/opengl/global/include/${incl_dir}/${file} |
365 |
|
elif [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} ]] |
366 |
|
then |
367 |
|
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
368 |
|
ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} |
369 |
|
elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg/include/${incl_dir}/${file} ]] |
370 |
|
then |
371 |
|
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
372 |
|
ln -s ${PREFIX}/${LIBDIR}/opengl/xorg/include/${incl_dir}/${file} |
373 |
fi |
fi |
374 |
continue |
done |
375 |
fi |
popd &> /dev/null |
376 |
|
done |
|
if [[ -e ${PREFIX}/${LIBDIR}/opengl/global/include/${file} ]] |
|
|
then |
|
|
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
|
|
ln -s ${PREFIX}/${LIBDIR}/opengl/global/include/${file} |
|
|
elif [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]] |
|
|
then |
|
|
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
|
|
ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} |
|
|
elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file} ]] |
|
|
then |
|
|
[[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} |
|
|
ln -s ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file} |
|
|
fi |
|
|
done |
|
|
popd &> /dev/null |
|
377 |
|
|
378 |
# Setup the $LDPATH |
# Setup the $LDPATH |
379 |
ldpath="${ldpath:+${ldpath}:}${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib" |
ldpath="${ldpath:+${ldpath}:}${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib" |