[vlc-devel] [PATCH] bin/vlc: allow to override VLC_*_PATH envs on debug builds

Thomas Guillem thomas at gllm.fr
Wed Dec 14 14:09:52 CET 2016


---
 bin/darwinvlc.m | 10 ++++++++--
 bin/vlc.c       | 10 ++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/bin/darwinvlc.m b/bin/darwinvlc.m
index 93314c8..d9b6076 100644
--- a/bin/darwinvlc.m
+++ b/bin/darwinvlc.m
@@ -94,8 +94,14 @@ int main(int i_argc, const char *ppsz_argv[])
 #endif
 
 #ifdef TOP_BUILDDIR
-    setenv("VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", 1);
-    setenv("VLC_DATA_PATH", TOP_SRCDIR"/share", 1);
+# ifndef NDEBUG
+#  define ENV_OVERWRITE 0
+# else
+#  define ENV_OVERWRITE 1
+# endif
+    setenv("VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", ENV_OVERWRITE);
+    setenv("VLC_DATA_PATH", TOP_SRCDIR"/share", ENV_OVERWRITE);
+# undef ENV_OVERWRITE
 #endif
 
 #ifndef ALLOW_RUN_AS_ROOT
diff --git a/bin/vlc.c b/bin/vlc.c
index 0a33a0f..c7a95c7 100644
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -131,8 +131,14 @@ int main( int i_argc, const char *ppsz_argv[] )
 #endif
 
 #ifdef TOP_BUILDDIR
-    setenv ("VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", 1);
-    setenv ("VLC_DATA_PATH", TOP_SRCDIR"/share", 1);
+# ifndef NDEBUG
+#  define ENV_OVERWRITE 0
+# else
+#  define ENV_OVERWRITE 1
+# endif
+    setenv ("VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", ENV_OVERWRITE);
+    setenv ("VLC_DATA_PATH", TOP_SRCDIR"/share", ENV_OVERWRITE);
+# undef ENV_OVERWRITE
 #endif
 
     /* Clear the X.Org startup notification ID. Otherwise the UI might try to
-- 
2.10.2



More information about the vlc-devel mailing list