Magellan Linux

Diff of /trunk/opengl-update/opengl-update.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/opengl-update/opengl-update.sh revision 633 by niro, Wed Nov 14 19:19:16 2007 UTC trunk/opengl-update/opengl-update.in revision 2847 by niro, Wed Nov 5 16:29:59 2014 UTC
# Line 11  Line 11 
11  # <niro@magellan-linux.de>  # <niro@magellan-linux.de>
12  #  #
13    
 . /etc/init.d/functions  
   
14  hasq()  hasq()
15  {  {
16   local x   local x
# Line 243  set_new_implementation() Line 241  set_new_implementation()
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##*/}
# Line 271  set_new_implementation() Line 271  set_new_implementation()
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##*/}
# Line 305  set_new_implementation() Line 307  set_new_implementation()
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
# Line 327  set_new_implementation() Line 329  set_new_implementation()
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[GLES3]="gl3ext.h gl3.h gl31.h gl3platform.h"
337   # It is preferable currently to use the standard glext.h file   headers[EGL]="eglext.h egl.h eglextchromium.h eglmesaext.h eglplatform.h"
338   # however if an OpenGL provider must use a self produced glext.h   headers[KHR]="khrplatform.h"
339   # then it should be installed to ${GL_IMPLEM}/include and the user   headers[VG]="openvg.h vgext.h vgplatform.h vgu.h"
340   # can add the --impl-headers option to select it.   for incl_dir in EGL GL GLES GLES2 GLES3 KHR VG
341     do
342     # run this only if the include dir exist in the chosen profile
343     [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/include/${incl_dir} ]] || continue
344    
345     mkdir -p ${DST_PREFIX}/include/${incl_dir}
346     pushd ${DST_PREFIX}/include/${incl_dir} &> /dev/null
347     for file in ${headers[${incl_dir}]}
348     do
349     # IMPORTANT
350     # It is preferable currently to use the standard glext.h file
351     # however if an OpenGL provider must use a self produced glext.h
352     # then it should be installed to ${GL_IMPLEM}/include and the user
353     # can add the --impl-headers option to select it.
354     if [[ ${USE_PROFILE_HEADERS} = yes ]]
355     then
356     # Check the profile first.
357     if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} ]]
358     then
359     [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
360     ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file}
361     fi
362     continue
363     fi
364    
365   if [[ ${USE_PROFILE_HEADERS} = yes ]]   if [[ -e ${PREFIX}/${LIBDIR}/opengl/global/include/${incl_dir}/${file} ]]
366   then   then
367   # Check the profile first.   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
368   if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]]   ln -s ${PREFIX}/${LIBDIR}/opengl/global/include/${incl_dir}/${file}
369     elif [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} ]]
370     then
371     [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
372     ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file}
373     elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg/include/${incl_dir}/${file} ]]
374   then   then
375   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
376   ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file}   ln -s ${PREFIX}/${LIBDIR}/opengl/xorg/include/${incl_dir}/${file}
377   fi   fi
378   continue   done
379   fi   popd &> /dev/null
380     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  
381    
382   # Setup the $LDPATH   # Setup the $LDPATH
383   ldpath="${ldpath:+${ldpath}:}${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib"   ldpath="${ldpath:+${ldpath}:}${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib"

Legend:
Removed from v.633  
changed lines
  Added in v.2847