[Vm-dev] [commit] r2140 - use padsp iff oss built;
communicate with VM via env vars
commits at squeakvm.org
commits at squeakvm.org
Thu Sep 17 17:10:28 UTC 2009
Author: piumarta
Date: 2009-09-17 10:10:27 -0700 (Thu, 17 Sep 2009)
New Revision: 2140
Modified:
trunk/platforms/unix/ChangeLog
trunk/platforms/unix/cmake/Plugins.cmake
trunk/platforms/unix/cmake/config.in
trunk/platforms/unix/cmake/squeak.in
trunk/platforms/unix/vm/build.cmake
Log:
use padsp iff oss built; communicate with VM via env vars
Modified: trunk/platforms/unix/ChangeLog
===================================================================
--- trunk/platforms/unix/ChangeLog 2009-09-17 15:56:33 UTC (rev 2139)
+++ trunk/platforms/unix/ChangeLog 2009-09-17 17:10:27 UTC (rev 2140)
@@ -1,5 +1,15 @@
2009-09-17 <piumarta at ubuntu.piumarta.com>
+ * cmake/Plugins.cmake: Set ${plugin}_disabled for each plugin,
+ recording whether the plugin is to be built.
+
+ * vm/build.cmake: Set useoss according to vm-sound-OSS_disabled.
+
+ * cmake/config.in: Substitute [useoss] when configuring.
+
+ * cmake/squeak.in: Communicate with the VM via environment. Don't
+ attempt to user padsp wrapper unless vm-sound-OSS was built.
+
* vm/config.cmake: Configure interp as "gnu-interp" if compiler is
GCC, otherwise "interp".
Modified: trunk/platforms/unix/cmake/Plugins.cmake
===================================================================
--- trunk/platforms/unix/cmake/Plugins.cmake 2009-09-17 15:56:33 UTC (rev 2139)
+++ trunk/platforms/unix/cmake/Plugins.cmake 2009-09-17 17:10:27 UTC (rev 2140)
@@ -1,6 +1,6 @@
# Figure out which plugins to build and create a configuration for each.
#
-# Last edited: 2009-08-26 21:00:32 by piumarta on emilia-2.local
+# Last edited: 2009-09-17 09:34:24 by piumarta on ubuntu.piumarta.com
FILE (STRINGS ${src}/plugins.int plugins_int)
STRING (REGEX REPLACE ".*= (.*)" "\\1" plugins_int ${plugins_int})
@@ -107,10 +107,12 @@
LIST (APPEND plugins_dis ${plugin})
ENDIF (${plugins_list} STREQUAL "plugins_int")
MESSAGE ("!! ${plugin} disabled")
+ SET (${plugin}_disabled 1)
ELSE (DEFINED plugin_disabled)
IF (${plugins_list} STREQUAL "plugins_int")
USE_LIBRARY (${plugin})
ENDIF (${plugins_list} STREQUAL "plugins_int")
+ SET (${plugin}_disabled)
ENDIF (DEFINED plugin_disabled)
ENDFOREACH (plugin)
ENDMACRO (CONFIGURE_PLUGIN_LIST)
Modified: trunk/platforms/unix/cmake/config.in
===================================================================
--- trunk/platforms/unix/cmake/config.in 2009-09-17 15:56:33 UTC (rev 2139)
+++ trunk/platforms/unix/cmake/config.in 2009-09-17 17:10:27 UTC (rev 2140)
@@ -12,4 +12,5 @@
s%\[plgdir\]%@prefix@/@plgdir@%g
s%\[mandir\]%@prefix@/@mandir@%g
s%\[docdir\]%@prefix@/@docdir@%g
+s%\[useoss\]%@useoss@%g
" < $1 > $2
Modified: trunk/platforms/unix/cmake/squeak.in
===================================================================
--- trunk/platforms/unix/cmake/squeak.in 2009-09-17 15:56:33 UTC (rev 2139)
+++ trunk/platforms/unix/cmake/squeak.in 2009-09-17 17:10:27 UTC (rev 2140)
@@ -3,23 +3,27 @@
# Launch squeakvm from the command line or a menu script, with a good
# plugin path, text encodings and pulseaudio kludge
#
-# Last edited: 2009-08-27 22:25:34 by piumarta on emilia-2.local
+# Last edited: 2009-09-17 10:05:45 by piumarta on ubuntu.piumarta.com
PATH=/usr/bin:/bin
-me=`basename $0`
bindir=`dirname $0`
bindir=`cd ${bindir}; pwd`
prefix=`dirname ${bindir}`
libdir="${prefix}/lib/squeak"
plgdir="${libdir}/[version]"
-wrapper=""
+useoss="[useoss]"
vm="squeakvm"
plugins=""
-sound=""
-pathenc="-pathenc UTF-8"
-encoding="-encoding UTF-8"
+wrapper=""
+for opt in $*; do
+ case ${opt} in
+ -vm-sound*) useoss="false";;
+ -vm) case "$2" in sound*) useoss="false"; esac;;
+ esac
+done
+
# find the vm and set the plugin path
if test -x "${plgdir}/${vm}"; then # bin/squeak -> lib/squeak/x.y-z/squeakvm
@@ -36,45 +40,34 @@
exit 1
fi
-# deal with pulseaudio if it is running
+# command-line overrides environment, so communicate anything we decide here via the environment
-if pulseaudio --check 2>/dev/null; then
- sound="-vm-sound-oss"
- if padsp true 2>/dev/null; then
- wrapper=padsp
+if test -z "${SQUEAK_PATHENC}"; then SQUEAK_PATHENC="UTF-8"; export SQUEAK_PATHENC; fi
+if test -z "${SQUEAK_ENCODING}"; then SQUEAK_ENCODING="UTF-8"; export SQUEAK_ENCODING; fi
+
+if test -z "${SQUEAK_PLUGINS}"; then
+ if test -n "${plugins}"; then
+ SQUEAK_PLUGINS="${plugins}"
+ export SQUEAK_PLUGINS
fi
fi
-# we should not interfere with the user's command-line options
+# deal with pulseaudio if it is running
-for opt in $*; do
- case ${opt} in
- -plugins) plugins="";;
- -pathenc) pathenc="";;
- -encoding) encoding="";;
- -vm-sound*) sound=""; wrapper="";;
- -vm) case "$2" in sound*) sound=""; wrapper=""; esac;;
- esac
-done
-
-# we should not interfere with the user's environment variables
-
-if test -n "${SQUEAK_PLUGINS}"; then
- plugins=""
+if test -z "${SQUEAK_VM}"; then
+ if ${useoss}; then
+ if pulseaudio --check 2>/dev/null; then
+ if padsp true 2>/dev/null; then
+ wrapper="padsp"
+ SQUEAK_VM="sound-OSS"
+ export SQUEAK_VM
+ fi
+ fi
+ fi
fi
-if test -n "${SQUEAK_PATHENC}"; then
- pathenc=""
-fi
+# run the vm
-if test -n "${SQUEAK_ENCODING}"; then
- encoding=""
-fi
-
-if test -z "${plugins}"; then
- set -x
- exec ${wrapper} "${vm}" ${pathenc} ${encoding} ${sound} "$@"
-else
- set -x
- exec ${wrapper} "${vm}" ${pathenc} ${encoding} -plugins "${plugins}" ${sound} "$@"
-fi
+set | fgrep SQUEAK_
+set -x
+exec ${wrapper} "${vm}" "$@"
Modified: trunk/platforms/unix/vm/build.cmake
===================================================================
--- trunk/platforms/unix/vm/build.cmake 2009-09-17 15:56:33 UTC (rev 2139)
+++ trunk/platforms/unix/vm/build.cmake 2009-09-17 17:10:27 UTC (rev 2140)
@@ -47,6 +47,12 @@
INSTALL (PROGRAMS ${bld}/squeakvm DESTINATION ${plgdir})
+IF (vm-sound-OSS_disabled)
+ SET (useoss "false")
+ELSE ()
+ SET (useoss "true")
+ENDIF ()
+
CONFIGURE_FILE (${config}/config.in ${bld}/config @ONLY)
# launcher scripts
More information about the Vm-dev
mailing list