@@ -206,13 +206,13 @@ mkdir -p "$OUTDIR"
206
206
# ##########################
207
207
208
208
# CONFIGFLAGS
209
- CONFIGFLAGS=" --enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary "
209
+ CONFIGFLAGS=" -DREDUCE_EXPORTS=ON -DBUILD_BENCH=OFF -DBUILD_GUI_TESTS=OFF -DBUILD_FUZZ_BINARY=OFF "
210
210
211
211
# CFLAGS
212
212
HOST_CFLAGS=" -O2 -g"
213
213
HOST_CFLAGS+=$( find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \; )
214
214
case " $HOST " in
215
- * linux* ) HOST_CFLAGS+=" -ffile-prefix-map=${PWD} =." ;;
215
+ * linux* ) HOST_CFLAGS+=" -ffile-prefix-map=${DISTSRC} /src =." ;;
216
216
* mingw* ) HOST_CFLAGS+=" -fno-ident" ;;
217
217
* darwin* ) unset HOST_CFLAGS ;;
218
218
esac
@@ -239,38 +239,31 @@ mkdir -p "$DISTSRC"
239
239
# Extract the source tarball
240
240
tar --strip-components=1 -xf " ${GIT_ARCHIVE} "
241
241
242
- ./autogen.sh
243
-
244
242
# Configure this DISTSRC for $HOST
245
243
# shellcheck disable=SC2086
246
- env CONFIG_SITE=" ${BASEPREFIX} /${HOST} /share/config.site" \
247
- ./configure --prefix=/ \
248
- --disable-ccache \
249
- --disable-maintainer-mode \
250
- --disable-dependency-tracking \
251
- ${CONFIGFLAGS} \
252
- ${HOST_CFLAGS: +CFLAGS=" ${HOST_CFLAGS} " } \
253
- ${HOST_CXXFLAGS: +CXXFLAGS=" ${HOST_CXXFLAGS} " } \
254
- ${HOST_LDFLAGS: +LDFLAGS=" ${HOST_LDFLAGS} " }
255
-
256
- sed -i.old ' s/-lstdc++ //g' config.status libtool
244
+ env CFLAGS=" ${HOST_CFLAGS} " CXXFLAGS=" ${HOST_CXXFLAGS} " LDFLAGS=" ${HOST_LDFLAGS} " \
245
+ cmake -S . -B build \
246
+ --toolchain " ${BASEPREFIX} /${HOST} /toolchain.cmake" \
247
+ -DWITH_CCACHE=OFF \
248
+ ${CONFIGFLAGS}
257
249
258
250
# Build Bitcoin Core
259
- make --jobs= " $JOBS " ${V: +V=1 }
251
+ cmake --build build -j " $JOBS " ${V: +--verbose }
260
252
261
253
# Check that symbol/security checks tools are sane.
262
- make test-security-check ${V: +V=1 }
254
+ cmake --build build --target test-security-check ${V: +--verbose }
263
255
# Perform basic security checks on a series of executables.
264
- make -C src --jobs=1 check-security ${V: +V=1 }
256
+ cmake --build build -j 1 --target check-security ${V: +--verbose }
265
257
# Check that executables only contain allowed version symbols.
266
- make -C src --jobs=1 check-symbols ${V: +V=1 }
258
+ cmake --build build -j 1 --target check-symbols ${V: +--verbose }
267
259
268
260
mkdir -p " $OUTDIR "
269
261
270
262
# Make the os-specific installers
271
263
case " $HOST " in
272
264
* mingw* )
273
- make deploy ${V: +V=1} BITCOIN_WIN_INSTALLER=" ${OUTDIR} /${DISTNAME} -win64-setup-unsigned.exe"
265
+ cmake --build build -j " $JOBS " -t deploy ${V: +--verbose}
266
+ mv build/bitcoin-win64-setup.exe " ${OUTDIR} /${DISTNAME} -win64-setup-unsigned.exe"
274
267
;;
275
268
esac
276
269
@@ -282,20 +275,25 @@ mkdir -p "$DISTSRC"
282
275
# Install built Bitcoin Core to $INSTALLPATH
283
276
case " $HOST " in
284
277
* darwin* )
285
- make install-strip DESTDIR=" ${INSTALLPATH} " ${V: +V=1}
278
+ # This workaround can be dropped for CMake >= 3.27.
279
+ # See the upstream commit 689616785f76acd844fd448c51c5b2a0711aafa2.
280
+ find build -name ' cmake_install.cmake' -exec sed -i ' s| -u -r | |g' {} +
281
+
282
+ cmake --install build --strip --prefix " ${INSTALLPATH} " ${V: +--verbose}
286
283
;;
287
284
* )
288
- make install DESTDIR= " ${INSTALLPATH} " ${V: +V=1 }
285
+ cmake -- install build --prefix " ${INSTALLPATH} " ${V: +--verbose }
289
286
;;
290
287
esac
291
288
292
289
case " $HOST " in
293
290
* darwin* )
294
- make deploydir ${V: +V=1}
291
+ cmake --build build --target deploy ${V: +--verbose}
292
+ mv build/dist/Bitcoin-Core.zip " ${OUTDIR} /${DISTNAME} -${HOST} -unsigned.zip"
295
293
mkdir -p " unsigned-app-${HOST} "
296
294
cp --target-directory=" unsigned-app-${HOST} " \
297
295
contrib/macdeploy/detached-sig-create.sh
298
- mv --target-directory=" unsigned-app-${HOST} " dist
296
+ mv --target-directory=" unsigned-app-${HOST} " build/ dist
299
297
(
300
298
cd " unsigned-app-${HOST} "
301
299
find . -print0 \
@@ -304,23 +302,18 @@ mkdir -p "$DISTSRC"
304
302
| gzip -9n > " ${OUTDIR} /${DISTNAME} -${HOST} -unsigned.tar.gz" \
305
303
|| ( rm -f " ${OUTDIR} /${DISTNAME} -${HOST} -unsigned.tar.gz" && exit 1 )
306
304
)
307
- make deploy ${V: +V=1} OSX_ZIP=" ${OUTDIR} /${DISTNAME} -${HOST} -unsigned.zip"
308
305
;;
309
306
esac
310
307
(
311
308
cd installed
312
309
313
- # Prune libtool and object archives
314
- find . -name " lib*.la" -delete
315
- find . -name " lib*.a" -delete
316
-
317
310
case " $HOST " in
318
311
* darwin* ) ;;
319
312
* )
320
313
# Split binaries from their debug symbols
321
314
{
322
315
find " ${DISTNAME} /bin" -type f -executable -print0
323
- } | xargs -0 -P" $JOBS " -I{} " ${DISTSRC} /contrib/devtools /split-debug.sh" {} {} {}.dbg
316
+ } | xargs -0 -P" $JOBS " -I{} " ${DISTSRC} /build /split-debug.sh" {} {} {}.dbg
324
317
;;
325
318
esac
326
319
0 commit comments