1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
From 21b61a4f470338ae55e0683effa20482140c7965 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Thu, 4 Oct 2018 10:30:03 +0200
Subject: [PATCH 1/3] Install switcher tool to FHS directory
---
client/Makefile.am | 14 ++++++++++++--
client/file_names.h | 4 ++++
client/file_names_unix.h.in | 23 +++++++++++++++++++++++
3 files changed, 39 insertions(+), 2 deletions(-)
create mode 100644 client/file_names_unix.h.in
diff --git a/client/Makefile.am b/client/Makefile.am
index f39c45fe60..5cff108abb 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -24,7 +24,7 @@ endif
bin_PROGRAMS = boinc_client boinccmd
if !OS_WIN32
-bin_PROGRAMS += switcher
+pkglibexec_PROGRAMS = switcher
endif
boinccmd_SOURCES = boinc_cmd.cpp
@@ -106,7 +106,17 @@ else
if OS_DARWIN
boinc_client_LDFLAGS += -Wl,-flat_namespace,-undefined,dynamic_lookup
else
-boinc_client_SOURCES += hostinfo_unix.cpp
+boinc_client_SOURCES += \
+ hostinfo_unix.cpp \
+ file_names_unix.h
+
+edit = $(SED) -e 's|@pkglibexecdir[@]|$(pkglibexecdir)|g'
+
+file_names_unix.h: file_names_unix.h.in Makefile
+ $(AM_V_GEN)$(edit) $@.in > $@
+
+BUILT_SOURCES = file_names_unix.h
+CLEANFILES = file_names_unix.h
endif
endif
boinc_client_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
diff --git a/client/file_names.h b/client/file_names.h
index 37f9b29466..3506908067 100644
--- a/client/file_names.h
+++ b/client/file_names.h
@@ -97,7 +97,11 @@ extern void send_log_after(const char* filename, double t, MIOFILE& mf);
#define STATE_FILE_PREV "client_state_prev.xml"
#define STDERR_FILE_NAME "stderr.txt"
#define STDOUT_FILE_NAME "stdout.txt"
+#if defined(_WIN32) || defined(__APPLE__)
#define SWITCHER_DIR "switcher"
+#else
+#include "file_names_unix.h"
+#endif
#define SWITCHER_FILE_NAME "switcher"
#define TASK_STATE_FILENAME "boinc_task_state.xml"
#define TEMP_ACCT_FILE_NAME "temp_acct.xml"
diff --git a/client/file_names_unix.h.in b/client/file_names_unix.h.in
new file mode 100644
index 0000000000..d29456af91
--- /dev/null
+++ b/client/file_names_unix.h.in
@@ -0,0 +1,23 @@
+// This file is part of BOINC.
+// http://boinc.berkeley.edu
+// Copyright (C) 2018 University of California
+//
+// BOINC is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// BOINC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef BOINC_FILE_NAMES_UNIX_H
+#define BOINC_FILE_NAMES_UNIX_H
+
+#define SWITCHER_DIR "@pkglibexecdir@"
+
+#endif
--
2.19.0
|