X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmain.cc;h=a35cd1f3e7735a00ed3c10338319e14761b2a047;hb=7b155267505af3fedffc7972b08cb784c97b7e74;hp=fa038b30bbcd1e1135910837ad06f8053e1ca996;hpb=b85b4d9e54caef0585d308ef3bffee21d0e5ae56;p=ardour.git diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index fa038b30bb..a35cd1f3e7 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -26,10 +26,14 @@ #include #include "pbd/error.h" +#include "pbd/epa.h" #include "pbd/file_utils.h" #include "pbd/textreceiver.h" #include "pbd/failed_constructor.h" #include "pbd/pthread_utils.h" +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS +#include "pbd/boost_debug.h" +#endif #include @@ -105,12 +109,14 @@ Please consider the possibilities, and perhaps (re)start JACK.")); extern void set_language_preference (); // cocoacarbon.mm void -fixup_bundle_environment () +fixup_bundle_environment (int, char* []) { if (!getenv ("ARDOUR_BUNDLED")) { return; } + EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true, "PREBUNDLE_ENV")); + set_language_preference (); char execpath[MAXPATHLEN+1]; @@ -166,7 +172,6 @@ fixup_bundle_environment () setenv ("ARDOUR_PATH", path.c_str(), 1); setenv ("ARDOUR_CONFIG_PATH", path.c_str(), 1); - setenv ("ARDOUR_DATA_PATH", path.c_str(), 1); path = dir_path; path += "/../Resources"; @@ -208,7 +213,7 @@ fixup_bundle_environment () setenv ("ARDOUR_CONTROL_SURFACE_PATH", path.c_str(), 1); - cstr = getenv ("LV2_PATH"); + cstr = getenv ("ARDOUR_PANNER_PATH"); if (cstr) { path = cstr; path += ':'; @@ -216,15 +221,20 @@ fixup_bundle_environment () path = ""; } path += dir_path; - path += "/../Plugins"; - - setenv ("LV2_PATH", path.c_str(), 1); + path += "/lib/panners"; + + setenv ("ARDOUR_PANNER_PATH", path.c_str(), 1); path = dir_path; path += "/../Frameworks/clearlooks"; setenv ("GTK_PATH", path.c_str(), 1); + /* unset GTK_RC_FILES so that we only load the RC files that we define + */ + + unsetenv ("GTK_RC_FILES"); + if (!ARDOUR::translations_are_disabled ()) { path = dir_path; @@ -303,12 +313,14 @@ fixup_bundle_environment () #else void -fixup_bundle_environment (int argc, char* argv[]) +fixup_bundle_environment (int /*argc*/, char* argv[]) { if (!getenv ("ARDOUR_BUNDLED")) { return; } + EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true, "PREBUNDLE_ENV")); + Glib::ustring exec_path = argv[0]; Glib::ustring dir_path = Glib::path_get_dirname (Glib::path_get_dirname (exec_path)); Glib::ustring path; @@ -346,7 +358,6 @@ fixup_bundle_environment (int argc, char* argv[]) setenv ("ARDOUR_PATH", path.c_str(), 1); setenv ("ARDOUR_CONFIG_PATH", path.c_str(), 1); - setenv ("ARDOUR_DATA_PATH", path.c_str(), 1); path = dir_path; path += "/etc"; @@ -388,7 +399,7 @@ fixup_bundle_environment (int argc, char* argv[]) setenv ("ARDOUR_CONTROL_SURFACE_PATH", path.c_str(), 1); - cstr = getenv ("LV2_PATH"); + cstr = getenv ("ARDOUR_PANNER_PATH"); if (cstr) { path = cstr; path += ':'; @@ -396,15 +407,20 @@ fixup_bundle_environment (int argc, char* argv[]) path = ""; } path += dir_path; - path += "/lib/plugins"; + path += "/lib/panners"; - setenv ("LV2_PATH", path.c_str(), 1); + setenv ("ARDOUR_PANNER_PATH", path.c_str(), 1); path = dir_path; path += "/lib/clearlooks"; setenv ("GTK_PATH", path.c_str(), 1); + /* unset GTK_RC_FILES so that we only load the RC files that we define + */ + + unsetenv ("GTK_RC_FILES"); + if (!ARDOUR::translations_are_disabled ()) { path = dir_path; path += "/share/locale"; @@ -520,12 +536,11 @@ int ardour_main (int argc, char *argv[]) int main (int argc, char *argv[]) #endif { -#ifdef __APPLE__ - fixup_bundle_environment (); -#endif + fixup_bundle_environment (argc, argv); - if (!Glib::thread_supported()) + if (!Glib::thread_supported()) { Glib::thread_init(); + } gtk_set_locale (); @@ -553,6 +568,12 @@ int main (int argc, char *argv[]) text_receiver.listen_to (fatal); text_receiver.listen_to (warning); +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS + if (getenv ("BOOST_DEBUG")) { + boost_debug_shared_ptr_show_live_debugging (true); + } +#endif + if (parse_opts (argc, argv)) { exit (1); } @@ -576,7 +597,7 @@ int main (int argc, char *argv[]) } if (no_splash) { - cerr << _("Copyright (C) 1999-2010 Paul Davis") << endl + cerr << _("Copyright (C) 1999-2011 Paul Davis") << endl << _("Some portions Copyright (C) Steve Harris, Ari Johnson, Brett Viren, Joel Baker") << endl << endl << string_compose (_("%1 comes with ABSOLUTELY NO WARRANTY"), PROGRAM_NAME) << endl