+ char *p;
+ bool need_minimal_path = false;
+
+ p = getenv ("PATH");
+
+ if (p && *p) {
+ path = p;
+ } else {
+ need_minimal_path = true;
+ }
+
+#ifdef __APPLE__
+ // many mac users don't have PATH set up to include
+ // likely installed locations of JACK
+ need_minimal_path = true;
+#endif
+
+ if (need_minimal_path) {
+ if (path.empty()) {
+ path = "/usr/bin:/bin:/usr/local/bin:/opt/local/bin";
+ } else {
+ path += ":/usr/local/bin:/opt/local/bin";
+ }
+ }
+
+#ifdef __APPLE__
+ // push it back into the environment so that auto-started JACK can find it.
+ // XXX why can't we just expect OS X users to have PATH set correctly? we can't ...
+ setenv ("PATH", path.c_str(), 1);
+#endif