rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/${libdir}/${moduledir}/extensions/${file}"
fi
done
for file in ${PREFIX}/${libdir}/opengl/${gl_local}/extensions/*.{so,a,la}; do
[[ -f ${file} ]] || continue
if [[ -f $(basename "${file}") ]] ; then
rm -f "$(basename "${file}")" || die -q "Failed to delete ${DST_PREFIX}/${libdir}/${moduledir}/extensions/$(basename "${file}")"
fi
# Fix libtool archives (#48297)
if [[ ${file%.la} != ${file} ]] ; then
sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${libdir}:g" "${file}" > "$(basename "${file}")" || die -q "Failed to create ${DST_PREFIX}/${libdir}/${moduledir}/extensions/$(basename "${file}")"
else
ln -s "${file}" || die -q "Failed to create ${libdir}/$(basename "${file}")"
fi
done
popd &> /dev/null
fi
# Setup the includes
mkdir -p "${DST_PREFIX}/include/GL" || die "Failed to create ${DST_PREFIX}/include/GL"
pushd "${DST_PREFIX}/include/GL" &> /dev/null
for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do
# IMPORTANT
# It is preferable currently to use the standard glext.h file
# however if an OpenGL provider must use a self produced glext.h
# then it should be installed to ${gl_implem}/include and the user
# can add the --impl-headers option to select it.
if [[ "${USE_PROFILE_HEADERS}" == "yes" ]] ; then
# Check the profile first.
if [[ -e ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} ]] ; then
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")"
fi
ln -s ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")"
continue
fi
fi
if [[ -e ${PREFIX}/${libdir}/opengl/global/include/${file} ]] ; then
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")"
fi
ln -s ${PREFIX}/${libdir}/opengl/global/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")"
elif [[ -e ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} ]] ; then
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")"
fi
ln -s ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")"
elif [[ -e ${PREFIX}/${libdir}/opengl/xorg-x11/include/${file} ]] ; then
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")"
fi
ln -s ${PREFIX}/${libdir}/opengl/xorg-x11/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")"