Skip to content

Commit 976d4da

Browse files
committed
Update configure script
1 parent 928023f commit 976d4da

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
^appveyor\.yml$
1111
^LICENSE\.md$
1212
^README\.md$
13+
^configure.log$

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ tools/option_table.txt
1212
inst/doc
1313
R/sysdata.rda
1414
windows
15+
configure.log

cleanup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
rm -f src/Makevars configure.log

configure

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
2-
# Anticonf (tm) script by Jeroen Ooms (2018)
2+
# Anticonf (tm) script by Jeroen Ooms (2020)
33
PKG_CONFIG_NAME="opencv4"
44
PKG_CONFIG_NAME_ALT="opencv"
55
PKG_DEB_NAME="libopencv-dev"
66
PKG_RPM_NAME="opencv-devel"
7-
PKG_BREW_NAME="opencv@2"
7+
PKG_BREW_NAME="opencv"
88
PKG_TEST_HEADER="<opencv2/opencv.hpp>"
99
PKG_LIBS="-lopencv_{stitching,superres,videostab,aruco,bgsegm,bioinspired,ccalib,dnn_objdetect,\
1010
dpm,face,photo,fuzzy,hfs,img_hash,line_descriptor,optflow,reg,rgbd,saliency,stereo,structured_light,\
@@ -66,22 +66,21 @@ else
6666
CXX11CPP=$(${R_HOME}/bin/R CMD config CXXCPP)
6767
fi
6868

69-
7069
# Test configuration
71-
echo "#include $PKG_TEST_HEADER" | ${CXX11CPP} ${CPPFLAGS} ${PKG_CFLAGS} -xc++ - >/dev/null
72-
73-
# Customize the error
70+
echo "#include $PKG_TEST_HEADER" | ${CXX11CPP} ${CPPFLAGS} ${PKG_CFLAGS} -xc++ - >/dev/null 2>configure.log
7471
if [ $? -ne 0 ]; then
75-
echo "------------------------- ANTICONF ERROR ---------------------------"
76-
echo "Configuration failed because $PKG_CONFIG_NAME was not found. Try installing:"
72+
echo "-----------------------------[ ANTICONF ]-------------------------------"
73+
echo "Configuration failed to find $PKG_CONFIG_NAME library. Try installing:"
7774
echo " * deb: $PKG_DEB_NAME (Debian, Ubuntu, etc)"
7875
echo " -> for Ubuntu Xenial use: ppa:cran/opencv"
7976
echo " * rpm: $PKG_RPM_NAME (Fedora, CentOS, RHEL)"
8077
echo " * brew: $PKG_BREW_NAME (Mac OSX)"
8178
echo "If $PKG_CONFIG_NAME is already installed, check that 'pkg-config' is in your"
8279
echo "PATH and PKG_CONFIG_PATH contains a $PKG_CONFIG_NAME.pc file."
83-
echo "--------------------------------------------------------------------"
84-
exit 1;
80+
echo "---------------------------[ ERROR MESSAGE ]----------------------------"
81+
cat configure.log
82+
echo "------------------------------------------------------------------------"
83+
exit 1
8584
fi
8685

8786
# Write to Makevars

0 commit comments

Comments
 (0)