ardour
system_exec.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Paul Davis
3  Copyright (C) 2010-2014 Robin Gareus <robin@gareus.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19 */
20 
21 #include <glibmm/miscutils.h>
22 #include "pbd/file_utils.h"
23 #include "pbd/error.h"
24 
26 #include "ardour/system_exec.h"
27 
28 using namespace ARDOUR;
29 
31 
32 static char *vfork_exec_wrapper_path() {
33 #ifdef PLATFORM_WINDOWS
34  return NULL;
35 #else
36  std::string vfork_exec_wrapper;
37  if (!PBD::find_file (
39  ARDOUR::ardour_dll_directory() // deployed
40  + G_SEARCHPATH_SEPARATOR_S + Glib::build_filename(ARDOUR::ardour_dll_directory(), "vfork") // src, build (ardev, etc)
41  ),
42  "ardour-exec-wrapper", vfork_exec_wrapper)) {
43  PBD::fatal << "vfork exec wrapper 'ardour-exec-wrapper' was not found in $PATH." << endmsg;
44  /* not reached */
45  return NULL;
46  }
47  return strdup(vfork_exec_wrapper.c_str());
48 #endif
49 }
50 
51 SystemExec::SystemExec (std::string c, char ** a)
52  : PBD::SystemExec(c, a)
53 {
54 #ifndef PLATFORM_WINDOWS
55  if (!_vfork_exec_wrapper) {
57  }
58 #endif
59 }
60 
61 SystemExec::SystemExec (std::string c, std::string a)
62  : PBD::SystemExec(c, a)
63 {
64 #ifndef PLATFORM_WINDOWS
65  if (!_vfork_exec_wrapper) {
67  }
68 #endif
69 }
70 
71 SystemExec::SystemExec (std::string c, const std::map<char, std::string> subs)
72  : PBD::SystemExec(c, subs)
73 {
74 #ifndef PLATFORM_WINDOWS
75  if (!_vfork_exec_wrapper) {
77  }
78 #endif
79 }
80 
LIBPBD_API Transmitter fatal
static char * vfork_exec_wrapper_path()
Definition: system_exec.cc:32
std::ostream & endmsg(std::ostream &ostr)
Definition: transmitter.h:71
static char * _vfork_exec_wrapper
Definition: system_exec.h:43
bool find_file(const Searchpath &search_path, const string &filename, std::string &result)
Definition: file_utils.cc:187
Definition: amp.h:29
LIBARDOUR_API std::string ardour_dll_directory()
Definition: debug.h:30
SystemExec(std::string c, std::string a="")
Definition: system_exec.cc:61