Skip to content

Commit c93d93b

Browse files
committed
Cover 'yes/no' case fully from configure so no ifeq needed in make
1 parent 8e29b40 commit c93d93b

File tree

4 files changed

+35
-17
lines changed

4 files changed

+35
-17
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ VignetteBuilder: simplermarkdown
1212
LazyLoad: yes
1313
LinkingTo: Rcpp, BH
1414
Description: An R Interface to 'Bloomberg' is provided via the 'Blp API'.
15-
SystemRequirements: GNU make. A valid Bloomberg installation. The API headers and
15+
SystemRequirements: A valid Bloomberg installation. The API headers and
1616
dynamic library are downloaded from <https://github.com/Rblp/blp> during the
1717
build step. See <https://bloomberg.github.io/blpapi-docs/cpp/3.24.6> as well as
1818
<https://www.bloomberg.com/professional/support/api-library/> for API

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else
3939
echo "Check https://www.bloomberg.com/professional/support/api-library/ for possible support first."
4040
echo "Contributions welcome, see https://github.com/Rblp/blp for integration with Rblapi."
4141
echo "The build will proceed but not be functional for lack of a library."
42-
sed -e"s/@have_blp@/no/" src/Makevars.in > src/Makevars
42+
cp -ax src/Makevars.no_blp src/Makevars
4343
exit 0
4444
fi
4545

@@ -66,7 +66,7 @@ else
6666
echo "Unsupported platform and architecture combination: ${platform} ${arch}."
6767
echo "The build will proceed but not be functional for lack of a library."
6868
echo "If you need such a combination please get in touch with the Blp vendor."
69-
sed -e"s/@have_blp@/no/" src/Makevars.in > src/Makevars
69+
cp -ax src/Makevars.no_blp src/Makevars
7070
exit 0
7171
fi
7272

src/Makevars.in

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,21 @@
2020
## You should have received a copy of the GNU General Public License
2121
## along with Rblpapi. If not, see <http://www.gnu.org/licenses/>.
2222

23-
## ------ Overall 'do we expect to have blp support available' state filled in by configure
23+
## Overall 'do we expect to have blp support available' state filled in by configure
2424
##
25+
## (This variable is actually not used below and just left as a reminder 'how to' do
26+
## such replacements with `sed` from `configure`. The build with blp uses the same library
27+
## names throughout; we used to have 32 vs 64 bit builds in past.)
2528
HAVE_BLP = @have_blp@
2629

27-
## ------ Case of blp support available
28-
##
29-
ifeq ($(HAVE_BLP), yes)
30-
3130
## this used to be filled in by configure but now both cases use the same value anyway
3231
BBG_LIB = -lblpapi3_64
3332
BBG_RPATH = '$$ORIGIN/../blp'
33+
3434
## set include and linker options
3535
## Bbg API files are assummed to be in the standard search path
3636
PKG_CPPFLAGS = -I../inst/include/ -I. -DHaveBlp
3737
PKG_LIBS = $(BBG_LIB) -L../inst/blp -Wl,-rpath,$(BBG_RPATH)
3838

3939
all: $(SHLIB)
4040
@if command -v install_name_tool; then echo "fixing"; install_name_tool -add_rpath @loader_path/../blp Rblpapi.so; fi
41-
42-
43-
## ------ Alternate case of no blp support on build platform
44-
else
45-
46-
## use flag to compile without interfacing blp objects
47-
PKG_CPPFLAGS = -DNoBlpHere
48-
49-
endif

src/Makevars.no_blp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## -*- mode: makefile; -*-
2+
##
3+
## Makefile -- Unix build system
4+
##
5+
## Copyright (C) 2015-present Dirk Eddelbuettel and Jeroen Ooms
6+
## Copyright (C) 2022-present Tomas Kalibera and Dirk Eddelbuettel
7+
##
8+
## This file is part of Rblpapi
9+
##
10+
## Rblpapi is free software: you can redistribute it and/or modify
11+
## it under the terms of the GNU General Public License as published by
12+
## the Free Software Foundation, either version 2 of the License, or
13+
## (at your option) any later version.
14+
##
15+
## Rblpapi is distributed in the hope that it will be useful,
16+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
## GNU General Public License for more details.
19+
##
20+
## You should have received a copy of the GNU General Public License
21+
## along with Rblpapi. If not, see <http://www.gnu.org/licenses/>.
22+
23+
## The 'no blp' build does not require headers or linking: when no blp is
24+
## available, none is used: the build is 'naked'
25+
26+
## use flag to compile without interfacing blp objects
27+
PKG_CPPFLAGS = -DNoBlpHere

0 commit comments

Comments
 (0)