Skip to content

Commit 2cf9674

Browse files
committed
add cflag SUFFIX and PREFIX defines to pkgconfig file
1 parent 1192235 commit 2cf9674

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tools/build_openblas.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ dlltool --input-def ${DLL_BASENAME}.def \
136136
# Replace the DLL name with the generated name.
137137
sed -i "s/ -lopenblas.*$/ -l${DLL_BASENAME:3}/g" pkgconfig/openblas*.pc
138138
mv pkgconfig/*.pc pkgconfig/scipy-openblas.pc
139+
if [ "$if_bits" == "64" ]; then
140+
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_ -DBLAS_SYMBOL_SUFFIX=64_/" -i pkgconfig/scipy-openblas.pc
141+
else
142+
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_/" -i pkgconfig/scipy-openblas.pc
143+
fi
139144
popd
140145
# Build template site.cfg for using this build
141146
cat > ${build_bits}/site.cfg.template << EOF

tools/build_steps.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ function do_build_lib {
178178
else
179179
local version=$(cd OpenBLAS && git describe --tags --abbrev=8)
180180
fi
181+
mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
181182
local plat_tag=$(get_plat_tag $plat)
182183
local suff=""
183184
[ -n "$suffix" ] && suff="-$suffix"
@@ -186,11 +187,11 @@ function do_build_lib {
186187
# do it ourselves
187188
static_libname=$(basename `find OpenBLAS -maxdepth 1 -type f -name '*.a' \! -name '*.dll.a'`)
188189
renamed_libname=$(basename `find OpenBLAS -maxdepth 1 -type f -name '*.renamed'`)
189-
# set -x # echo commands
190190
cp -f "OpenBLAS/${renamed_libname}" "$BUILD_PREFIX/lib/${static_libname}"
191-
# set +x
191+
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_ -DBLAS_SYMBOL_SUFFIX=64_/" -i.bak $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
192+
else
193+
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_/" -i.bak $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
192194
fi
193-
mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
194195

195196
local out_name="openblas${symbolsuffix}-${version}-${plat_tag}${suff}.tar.gz"
196197
tar zcvf libs/$out_name \

0 commit comments

Comments
 (0)