Magellan Linux

Diff of /tags/openglupdate-2_3_6/opengl-update.in

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

trunk/opengl-update/opengl-update.sh revision 616 by niro, Wed Nov 14 18:01:25 2007 UTC trunk/opengl-update/opengl-update.in revision 2003 by niro, Mon Dec 31 15:14:19 2012 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # Copyright 1999-2004 Gentoo Foundation  # Copyright 1999-2004 Gentoo Foundation
3  # Distributed under the terms of the GNU General Public License v2  # Distributed under the terms of the GNU General Public License v2
4  # $Header: /home/cvsd/magellan-cvs/magellan-src/opengl-update/opengl-update.sh,v 1.1 2007-11-14 18:01:25 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/opengl-update/opengl-update.sh,v 1.10 2007-11-14 19:19:16 niro Exp $
5  # Author:  Martin Schlemmer <azarah@gentoo.org>  # Author:  Martin Schlemmer <azarah@gentoo.org>
6  # Further modifications by Donnie Berkholz <spyderous@gentoo.org>  # Further modifications by Donnie Berkholz <spyderous@gentoo.org>
7  # Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>  # Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>
# Line 11  Line 11 
11  # <niro@magellan-linux.de>  # <niro@magellan-linux.de>
12  #  #
13    
14  . /etc/init.d/functions  hasq()
15    {
 hasq() {  
16   local x   local x
17    
18   local me=${1}   local me=${1}
19   shift   shift
20            
21   for x in "${@}"; do   for x in $@
22   if [[ "${x}" == "${me}" ]]; then   do
23   return 0   [[ ${x} = ${me} ]] && return 0
  fi  
24   done   done
25    
26   return 1   return 1
27  }  }
28    
29  check_user() {  check_user()
30   if [[ $(id -u) -ne 0 ]]; then  {
31     if [[ $(id -u) -ne 0 ]]
32     then
33   echo "${0}: Must be run as root."   echo "${0}: Must be run as root."
34   exit 1   exit 1
35   fi   fi
36  }  }
37    
38  get_current_implem() {  get_current_implem()
39    {
40   local implem   local implem
41   if [[ -f ${ENV_D} ]]; then  
42     if [[ -f ${ENV_D} ]]
43     then
44   source ${ENV_D}   source ${ENV_D}
45   if [[ -n "${OPENGL_PROFILE}" ]]; then   if [[ -n ${OPENGL_PROFILE} ]]
46     then
47   implem="${OPENGL_PROFILE}"   implem="${OPENGL_PROFILE}"
48   elif [[ -n "${LDPATH}" ]]; then   elif [[ -n ${LDPATH} ]]
49     then
50   implem="${LDPATH%%:*}"   implem="${LDPATH%%:*}"
51   implem="${implem##*opengl/}"   implem="${implem##*opengl/}"
52   implem="${implem%/lib*}"   implem="${implem%/lib*}"
# Line 52  get_current_implem() { Line 58  get_current_implem() {
58   echo ${implem}   echo ${implem}
59  }  }
60    
61  get_implementations() {  get_implementations()
62    {
63   local implems   local implems
64   for dir in ${PREFIX}/lib{,32,64}/opengl/*; do  
65   if [[ -d "${dir}" && ${dir##*/} != "global" ]] && ! hasq ${dir##*/} ${implems}; then   for dir in ${PREFIX}/lib{,32,64}/opengl/*
66     do
67     if [[ -d ${dir} ]] &&
68     [[ ${dir##*/} != global ]] &&
69     ! hasq ${dir##*/} ${implems}
70     then
71   implems=${implems:+${implems} }${dir##*/}   implems=${implems:+${implems} }${dir##*/}
72   fi   fi
73   done   done
74    
75   echo ${implems}   echo ${implems}
76  }  }
77    
78  print_version() {  print_version()
79    {
80   echo "opengl-update ${VERSION}"   echo "opengl-update ${VERSION}"
81  }  }
82    
83  print_usage() {  print_usage()
84    {
85   # Get grammar right in message   # Get grammar right in message
86   local IS_ARE IMPLEM_PLURAL   local IS_ARE IMPLEM_PLURAL
87   if [[ $(echo ${AVAIL_IMPLEMS} | wc -w) -eq 1 ]]; then  
88     if [[ $(echo ${AVAIL_IMPLEMS} | wc -w) -eq 1 ]]
89     then
90   IS_ARE="is"   IS_ARE="is"
91   IMPLEM_PLURAL=""   IMPLEM_PLURAL=""
92   else   else
# Line 83  print_usage() { Line 100  print_usage() {
100  Usage: ${0##*/} [<options>] <GL implementation>  Usage: ${0##*/} [<options>] <GL implementation>
101         Set the opengl implementation.         Set the opengl implementation.
102         Valid options:         Valid options:
103           --help|-h|-?:       Prints this help.
104           --version:          Shows the version of this utility.
105         --use-old:          If an implementation is already set, use that one.         --use-old:          If an implementation is already set, use that one.
106         --prefix=<val>:     Set the source prefix (default: /usr)         --prefix=<val>:     Set the source prefix (default: /usr)
107         --dst-prefix=<val>: Set the destination prefix (default: /usr)         --dst-prefix=<val>: Set the destination prefix (default: /usr)
108         --impl-headers:     Use headers provided by this implementation to         --impl-headers:     Use headers provided by this implementation to
109                             override golbal ones provided by opengl-update.                             override global ones provided by opengl-update.
110    
111  Usage: ${0##*/} --get-implementation  Usage: ${0##*/} --get-implementation
112         Print the current implementaion         Print the current implementaion
# Line 109  FOO Line 128  FOO
128   exit 1   exit 1
129  }  }
130    
131  parse_options() {  parse_options()
132    {
133   local opt   local opt
134   while [[ ${#} -gt 0 ]]; do  
135     while [[ ${#} -gt 0 ]]
136     do
137   opt=${1}   opt=${1}
138   shift   shift
139   case ${opt} in   case ${opt} in
140   --use-old)   --use-old)
141   if [[ -n "${ACTION}" ]]; then   if [[ -n ${ACTION} ]]
142     then
143   ACTION="error"   ACTION="error"
144   echo "Invalid usage."   echo "Invalid usage."
145   else   else
146   if [[ -n "${CURRENT_GL_IMPLEM}" ]] && hasq ${CURRENT_GL_IMPLEM} ${AVAIL_IMPLEMS}; then   if [[ -n "${CURRENT_GL_IMPLEM}" ]] &&
147     hasq ${CURRENT_GL_IMPLEM} ${AVAIL_IMPLEMS}
148     then
149   ACTION="old-implementation"   ACTION="old-implementation"
150   fi   fi
151   fi   fi
152   ;;   ;;
153    
154   --get-implementation)   --get-implementation)
155   if [[ -n "${ACTION}" ]]; then   if [[ -n ${ACTION} ]]
156     then
157   ACTION="error"   ACTION="error"
158   echo "Invalid usage."   echo "Invalid usage."
159   else   else
160   ACTION="get-implementation"   ACTION="get-implementation"
161   fi   fi
162   ;;   ;;
163    
164   --prefix=*)   --prefix=*)
165   PREFIX=${opt#*=}   PREFIX=${opt#*=}
166   AVAIL_IMPLEMS=$(get_implementations)   AVAIL_IMPLEMS=$(get_implementations)
167   ;;   ;;
168   --dst-prefix=*)  
169   DST_PREFIX=${opt#*=}   --dst-prefix=*) DST_PREFIX=${opt#*=} ;;
170   ;;  
171   --impl-headers)   --impl-headers) USE_PROFILE_HEADERS="yes" ;;
172   USE_PROFILE_HEADERS="yes"  
173   ;;   --help|-h|-?) ACTION="usage" ;;
174   --help|-h|-?)  
175   ACION="usage"   --version) ACTION="version" ;;
176   ;;  
  --version)  
  ACTION="version"  
  ;;  
177   *)   *)
178   if hasq ${opt} ${AVAIL_IMPLEMS}; then   if hasq ${opt} ${AVAIL_IMPLEMS}
179   if [[ "${ACTION}" != "old-implementation" ]]; then   then
180   if [[ -n "${ACTION}" ]]; then   if [[ ${ACTION} != old-implementation ]]
181     then
182     if [[ -n ${ACTION} ]]
183     then
184   ACTION="error"   ACTION="error"
185   echo "Invalid usage."   echo "Invalid usage."
186   else   else
187   ACTION="set-implementation"   ACTION="set-implementation"
188   NEW_GL_IMPLEM="${opt}"   NEW_GL_IMPLEM="${opt}"
189   fi   fi
190   fi   fi
191   else   else
192   echo "Unrecognized option: ${opt}"   echo "Unrecognized option: ${opt}"
193   ACTION="error"   ACTION="error"
194   fi   fi
195   ;;   ;;
196   esac   esac
197   done   done
198  }  }
199    
200  set-new-implementation() {  set_new_implementation()
201    {
202   local GL_IMPLEM=${1}   local GL_IMPLEM=${1}
203   local GL_LOCAL   local GL_LOCAL
204    
# Line 178  set-new-implementation() { Line 207  set-new-implementation() {
207   # Set a sane umask... bug #83115   # Set a sane umask... bug #83115
208   umask 022   umask 022
209    
210   if ! hasq ${GL_IMPLEM} ${AVAIL_IMPLEMS}; then   if ! hasq ${GL_IMPLEM} ${AVAIL_IMPLEMS}
211     then
212   echo "Invalid profile selected."   echo "Invalid profile selected."
213   exit 1   exit 1
214   fi   fi
215    
216   echo "Switching to ${GL_IMPLEM} OpenGL interface"   echo "Switching to ${GL_IMPLEM} OpenGL interface"
  rm -f ${ENV_D} &> /dev/null  
217    
218   LIBDIRS="lib32 lib lib64"   rm -f ${ENV_D} &> /dev/null
219   for LIBDIR in ${LIBDIRS}; do  
220   # Special case handling of lib32 because it can be a symlink to   LIBDIRS="lib32 lib lib64"
221   # emul libs   for LIBDIR in ${LIBDIRS}
222   if [[ "${LIBDIR}" = "lib32" ]]; then   do
223   [[ -d "${PREFIX}/${LIBDIR}/opengl" ]] || continue   # Special case handling of lib32 because it can be a symlink to
224   else   # emul libs
225   [[ -d "${PREFIX}/${LIBDIR}/opengl" && ! -h "${PREFIX}/${LIBDIR}" ]] || continue   if [[ ${LIBDIR} = lib32 ]]
226   fi   then
227     [[ -d ${PREFIX}/${LIBDIR}/opengl ]] || continue
228   # Fallback on xorg if we don't have this implementation for this LIBDIR.   else
229   if [[ ! -d ${PREFIX}/${LIBDIR}/opengl/"${GL_IMPLEM}" ]]; then   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] &&
230   GL_LOCAL="xorg"   [[ ! -h ${PREFIX}/${LIBDIR} ]] || continue
231   else   fi
232   GL_LOCAL="${GL_IMPLEM}"  
233   fi   # Fallback on xorg if we don't have this implementation for this LIBDIR.
234     if [[ ! -d ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM} ]]
235   mkdir -p ${DST_PREFIX}/${LIBDIR}   then
236   pushd ${DST_PREFIX}/${LIBDIR} &> /dev/null   GL_LOCAL="xorg"
237     else
238     GL_LOCAL="${GL_IMPLEM}"
239     fi
240    
241     mkdir -p ${DST_PREFIX}/${LIBDIR}
242     pushd ${DST_PREFIX}/${LIBDIR} &> /dev/null
243     # First remove old symlinks
244     for file in lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la}
245     do
246     # exclude libGLU
247     [[ ${file} = libGLU.so ]] && continue
248     [[ -h ${file} ]] && rm -f ${file}
249     done
250    
251     # Note that we don't do .so*, just .so on purpose.  The
252     # loader knows to look in the profile dir, and the
253     # linked just needs the .so
254     for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la}
255     do
256     [[ -f ${file} ]] || continue
257     [[ -f ${file##*/} ]] && rm -f ${file##*/}
258    
259     # Fix libtool archives (#48297)
260     if [[ ${file%.la} != ${file} ]]
261     then
262     sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}
263     else
264     ln -s ${file}
265     fi
266     done
267     popd &> /dev/null
268    
269     if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls ]]
270     then
271     mkdir -p ${DST_PREFIX}/${LIBDIR}/tls
272     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} ; do   for file in lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la}
275     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   # Note that we don't do .so*, just .so on purpose.  The   for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls/lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a,la}
282   # loader knows to look in the profile dir, and the   do
283   # linked just needs the .so   [[ -f ${file} ]] || continue
284   for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/libGL{,core}.{so,a,la}; do   [[ -f ${file##*/} ]] && rm -f ${file##*/}
  [[ -f "${file}" ]] || continue  
  [[ -f "${file##*/}" ]] && rm -f ${file##*/}  
285    
286   # Fix libtool archives (#48297)   # Fix libtool archives (#48297)
287   if [[ "${file%.la}" != "${file}" ]]; then   if [[ ${file%.la} != ${file} ]]
288     then
289   sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}   sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}
290   else   else
291   ln -s ${file}   ln -s ${file}
292   fi   fi
293   done   done
294   popd &> /dev/null   popd &> /dev/null
295     fi
296    
297   if [[ -e "${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls" ]]; then   local MODULEDIR
298   mkdir -p ${DST_PREFIX}/${LIBDIR}/tls   if [[ -e ${DST_PREFIX}/${LIBDIR}/xorg/modules ]]
299   pushd ${DST_PREFIX}/${LIBDIR}/tls &> /dev/null   then
300   # First remove old symlinks   MODULEDIR="xorg/modules"
301   for file in libGL{,core}.{a,so,la} ; do   else
302   [[ -h ${file} ]] && rm -f ${file}   MODULEDIR="modules"
303   done   fi
304    
305   for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls/libGL{,core}.{so,a,la}; do   if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/extensions ]]
306   [[ -f "${file}" ]] || continue   then
307   [[ -f "${file##*/}" ]] && rm -f ${file##*/}   mkdir -p ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions
308     pushd ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions &> /dev/null
309   # Fix libtool archives (#48297)   # First remove old symlinks
310   if [ "${file%.la}" != "${file}" ]; then   for file in lib{wfb,glx,dri,dri2}.{so,dylib,a}
311   sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}   do
312   else   [[ -h ${file} ]] && rm -f ${file}
313   ln -s ${file}   done
314   fi  
315   done   for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/extensions/*.{so,a,la}
316   popd &> /dev/null   do
317   fi   [[ -f ${file} ]] || continue
318     [[ -f ${file##*/} ]] && rm -f ${file##*/}
319   local MODULEDIR  
320   if [[ -e "${DST_PREFIX}/${LIBDIR}/xorg/modules" ]]; then   # Fix libtool archives (#48297)
321   MODULEDIR="xorg/modules"   if [[ ${file%.la} != ${file} ]]
322   else   then
323   MODULEDIR="modules"   sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}
324   fi   else
325     ln -s ${file}
326   if [[ -e "${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/extensions" ]]; then   fi
327   mkdir -p ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions   done
328   pushd ${DST_PREFIX}/${LIBDIR}/${MODULEDIR}/extensions &> /dev/null   popd &> /dev/null
329   # First remove old symlinks   fi
330   for file in libglx.so libglx.a; do  
331   [[ -h ${file} ]] && rm -f ${file}   # Setup the includes
332   done   local -A headers
333     headers[GL]="gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h"
334   for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/extensions/*.{so,a,la}; do   headers[GLES]="egl.h gl_extensions.h glext.h gl.h glplatform.h"
335   [[ -f "${file}" ]] || continue   headers[GLES2]="gl2ext.h gl2.h gl2platform.h"
336   [[ -f "${file##*/}" ]] && rm -f ${file##*/}   headers[EGL]="eglext.h egl.h eglmesaext.h eglplatform.h"
337     headers[KHR]="khrplatform.h"
338   # Fix libtool archives (#48297)   headers[VG]="openvg.h vgext.h vgplatform.h vgu.h"
339   if [[ "${file%.la}" != "${file}" ]]; then   for incl_dir in EGL GL GLES GLES2 KHR VG
340   sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}   do
341   else   mkdir -p ${DST_PREFIX}/include/${incl_dir}
342   ln -s ${file}   pushd ${DST_PREFIX}/include/${incl_dir} &> /dev/null
343   fi   for file in ${headers[${incl_dir}]}
344   done   do
  popd &> /dev/null  
  fi  
   
  # Setup the includes  
  mkdir -p ${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  
345   # IMPORTANT   # IMPORTANT
346   # It is preferable currently to use the standard glext.h file   # It is preferable currently to use the standard glext.h file
347   # however if an OpenGL provider must use a self produced glext.h   # 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   # then it should be installed to ${GL_IMPLEM}/include and the user
349   # can add the --impl-headers option to select it.   # can add the --impl-headers option to select it.
350     if [[ ${USE_PROFILE_HEADERS} = yes ]]
351   if [[ ${USE_PROFILE_HEADERS} == "yes" ]] ; then   then
352   # Check the profile first.   # Check the profile first.
353   if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]]; then   if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} ]]
354     then
355   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
356   ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file}   ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file}
357   fi   fi
358   continue   continue
359   fi   fi
360    
361   if [[ -e ${PREFIX}/${LIBDIR}/opengl/global/include/${file} ]]; then   if [[ -e ${PREFIX}/${LIBDIR}/opengl/global/include/${incl_dir}/${file} ]]
362     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/global/include/${file}   ln -s ${PREFIX}/${LIBDIR}/opengl/global/include/${incl_dir}/${file}
365   elif [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]]; then   elif [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file} ]]
366     then
367   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
368   ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file}   ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${incl_dir}/${file}
369   elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file} ]]; then   elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg/include/${incl_dir}/${file} ]]
370     then
371   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}   [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
372   ln -s ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file}   ln -s ${PREFIX}/${LIBDIR}/opengl/xorg/include/${incl_dir}/${file}
373   fi   fi
374   done   done
375   popd &> /dev/null   popd &> /dev/null
376     done
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"
380    
381   done   done
382    
383   echo "LDPATH=\"${ldpath}\"" > ${ENV_D}   # put only one LDPATH per line!
384   echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D}   local i
385     for i in $(echo ${ldpath} | sed "s:\::\ :g")
386     do
387     echo "LDPATH=\"${i}\"" >> ${ENV_D}
388     done
389     echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D}
390    
391   env-rebuild   env-rebuild
392    
393   return 0   return 0
394  }  }
# Line 332  DST_PREFIX="/usr" Line 403  DST_PREFIX="/usr"
403  AVAIL_IMPLEMS=$(get_implementations)  AVAIL_IMPLEMS=$(get_implementations)
404  CURRENT_GL_IMPLEM=$(get_current_implem)  CURRENT_GL_IMPLEM=$(get_current_implem)
405  USE_PROFILE_HEADERS="no"  USE_PROFILE_HEADERS="no"
406  VERSION="2.2.4"  VERSION="@@VERSION@@"
407    
408  parse_options ${@}  parse_options ${@}
409    
410  case ${ACTION} in  case ${ACTION} in
411   get-implementation)   get-implementation)
412   if [[ -n "${CURRENT_GL_IMPLEM}" ]]; then   if [[ -n ${CURRENT_GL_IMPLEM} ]]
413     then
414   echo ${CURRENT_GL_IMPLEM}   echo ${CURRENT_GL_IMPLEM}
415   exit 0   exit 0
416   else   else
417   exit 2   exit 2
418   fi   fi
419   ;;   ;;
420    
421   old-implementation)   old-implementation)
422   set-new-implementation ${CURRENT_GL_IMPLEM}   set_new_implementation ${CURRENT_GL_IMPLEM}
423   exit $?   exit $?
424   ;;   ;;
425    
426   set-implementation)   set-implementation)
427   if [[ -n "${NEW_GL_IMPLEM}" ]]; then   if [[ -n ${NEW_GL_IMPLEM} ]]
428   set-new-implementation ${NEW_GL_IMPLEM}   then
429     set_new_implementation ${NEW_GL_IMPLEM}
430   exit $?   exit $?
431   else   else
432   print_usage   print_usage
433   exit 1   exit 1
434   fi   fi
435   ;;   ;;
436    
437   version)   version)
438   print_version   print_version
439   exit 0   exit 0
440   ;;   ;;
441    
442   usage)   usage)
443   print_usage   print_usage
444   exit 0   exit 0
445   ;;   ;;
446    
447   error)   error)
448   print_usage   print_usage
449   exit 1   exit 1
450   ;;   ;;
451    
452   *)   *)
453   print_usage   print_usage
454   exit 1   exit 1
455   ;;   ;;
456  esac  esac

Legend:
Removed from v.616  
changed lines
  Added in v.2003