summaryrefslogtreecommitdiff
path: root/emulators/mame-devel/files/sdlmame.in
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/mame-devel/files/sdlmame.in')
-rw-r--r--emulators/mame-devel/files/sdlmame.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/emulators/mame-devel/files/sdlmame.in b/emulators/mame-devel/files/sdlmame.in
new file mode 100644
index 000000000000..9a7c7215f76a
--- /dev/null
+++ b/emulators/mame-devel/files/sdlmame.in
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# The executable needs to be run from its data directory, and needs to store
+# configuration in it. We therefore mirror the data directory hierarchy in
+# ~/.cube, and create symlinks to the data files.
+#
+
+if [ -d ~/.sdlmame ]
+then
+ echo "Using existing ~/.sdlmame directory."
+else
+ echo "Creating ~/.sdlmame directory."
+ cd %%DATADIR%% || exit 1
+ find * -type d -exec mkdir -p ~/.sdlmame/{} \;
+ find * -type f -exec ln -s %%DATADIR%%/{} ~/.sdlmame/{} \; 2>/dev/null
+fi
+
+cd ~/.sdlmame || exit 1
+exec %%PREFIX%%/libexec/sdlmame/mame "$@"