diff --git a/android/buildAndroidBOINC-CI.sh b/android/buildAndroidBOINC-CI.sh index 2d599cb7108..e2c3a039016 100755 --- a/android/buildAndroidBOINC-CI.sh +++ b/android/buildAndroidBOINC-CI.sh @@ -270,7 +270,7 @@ if [ $build_with_vcpkg = "yes" ]; then vcpkg_flags="--overlay-triplets=$vcpkg_ports_dir/triplets/default --clean-after-build" if [ ! -d "$VCPKG_ROOT" ]; then mkdir -p $BUILD_DIR - git -C $BUILD_DIR clone https://github.com/microsoft/vcpkg + git -C $BUILD_DIR clone https://github.com/ras0219/vcpkg -b dev/roschuma/curl-android fi if [ ! -e /tmp/vcpkg_updated ]; then git -C $VCPKG_ROOT reset --hard diff --git a/android/build_boinc_arm.sh b/android/build_boinc_arm.sh index 1393b33849a..55789c531e8 100755 --- a/android/build_boinc_arm.sh +++ b/android/build_boinc_arm.sh @@ -73,8 +73,7 @@ if [ -n "$COMPILEBOINC" ]; then if [ -n "$CONFIGURE" ]; then ./_autosetup if [ $BUILD_WITH_VCPKG = "yes" ]; then - chmod +x "$VCPKG_DIR/share/curl/curl-config" - export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" + export _libcurl_pc="$VCPKG_DIR/lib/pkgconfig/libcurl.pc" fi ./configure --host=arm-linux --with-boinc-platform="arm-android-linux-gnu" $CONFIG_FLAGS --disable-server --disable-manager --disable-shared --enable-static --disable-largefile fi diff --git a/android/build_boinc_arm64.sh b/android/build_boinc_arm64.sh index ad1d61c1233..77231a8775e 100755 --- a/android/build_boinc_arm64.sh +++ b/android/build_boinc_arm64.sh @@ -73,8 +73,7 @@ if [ -n "$COMPILEBOINC" ]; then if [ -n "$CONFIGURE" ]; then ./_autosetup if [ $BUILD_WITH_VCPKG = "yes" ]; then - chmod +x "$VCPKG_DIR/share/curl/curl-config" - export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" + export _libcurl_pc="$VCPKG_DIR/lib/pkgconfig/libcurl.pc" fi ./configure --host=aarch64-linux --with-boinc-platform="aarch64-android-linux-gnu" --with-boinc-alt-platform="arm-android-linux-gnu" $CONFIG_FLAGS --disable-server --disable-manager --disable-shared --enable-static fi diff --git a/android/build_boinc_armv6.sh b/android/build_boinc_armv6.sh index cd7a72576fb..6239eaa1671 100755 --- a/android/build_boinc_armv6.sh +++ b/android/build_boinc_armv6.sh @@ -75,8 +75,7 @@ if [ -n "$COMPILEBOINC" ]; then if [ -n "$CONFIGURE" ]; then ./_autosetup if [ $BUILD_WITH_VCPKG = "yes" ]; then - chmod +x "$VCPKG_DIR/share/curl/curl-config" - export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" + export _libcurl_pc="$VCPKG_DIR/lib/pkgconfig/libcurl.pc" fi ./configure --host=armv6-linux --with-boinc-platform="arm-android-linux-gnu" $CONFIG_FLAGS --disable-server --disable-manager --disable-shared --enable-static --disable-largefile sed -e "s%^CLIENTLIBS *= *.*$%CLIENTLIBS = -lm $STDCPPTC%g" client/Makefile > client/Makefile.out diff --git a/android/build_boinc_x86.sh b/android/build_boinc_x86.sh index a626ec08c33..34c52516112 100755 --- a/android/build_boinc_x86.sh +++ b/android/build_boinc_x86.sh @@ -73,8 +73,7 @@ if [ -n "$COMPILEBOINC" ]; then if [ -n "$CONFIGURE" ]; then ./_autosetup if [ $BUILD_WITH_VCPKG = "yes" ]; then - chmod +x "$VCPKG_DIR/share/curl/curl-config" - export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" + export _libcurl_pc="$VCPKG_DIR/lib/pkgconfig/libcurl.pc" fi ./configure --host=i686-linux --with-boinc-platform="x86-android-linux-gnu" $CONFIG_FLAGS --disable-server --disable-manager --disable-shared --enable-static --disable-largefile fi diff --git a/android/build_boinc_x86_64.sh b/android/build_boinc_x86_64.sh index cdb77065289..69f22963064 100755 --- a/android/build_boinc_x86_64.sh +++ b/android/build_boinc_x86_64.sh @@ -73,8 +73,7 @@ if [ -n "$COMPILEBOINC" ]; then if [ -n "$CONFIGURE" ]; then ./_autosetup if [ $BUILD_WITH_VCPKG = "yes" ]; then - chmod +x "$VCPKG_DIR/share/curl/curl-config" - export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" + export _libcurl_pc="$VCPKG_DIR/lib/pkgconfig/libcurl.pc" fi ./configure --host=x86_64-linux --with-boinc-platform="x86_64-android-linux-gnu" --with-boinc-alt-platform="x86-android-linux-gnu" $CONFIG_FLAGS --disable-server --disable-manager --disable-shared --enable-static fi diff --git a/linux/ci_configure_client.sh b/linux/ci_configure_client.sh index 4f16550a3d9..606f161c1b4 100755 --- a/linux/ci_configure_client.sh +++ b/linux/ci_configure_client.sh @@ -13,6 +13,5 @@ export VCPKG_DIR="$VCPKG_ROOT/installed/x64-linux" linux/update_vcpkg.sh -chmod +x "$VCPKG_DIR/share/curl/curl-config" -export _libcurl_config="$VCPKG_DIR/share/curl/curl-config" +export _libcurl_pc="$VCPKG_DIR/lib/pkgconfig/libcurl.pc" ./configure --enable-vcpkg --with-libcurl=$VCPKG_DIR --with-ssl=$VCPKG_DIR --disable-server --enable-client --disable-manager diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 index 1b036fd10d7..189db588dfc 100644 --- a/m4/libcurl.m4 +++ b/m4/libcurl.m4 @@ -70,6 +70,76 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], PATH="${withval%/}/bin:$PATH" fi + AC_PATH_PROG([_libcurl_pc]) + if test x$_libcurl_pc != "x" ; then + AC_CACHE_CHECK([for the version of libcurl], + [libcurl_cv_lib_curl_version], + [libcurl_cv_lib_curl_version=`pkg-config $_libcurl_pc --modversion`]) + _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` + _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse` + + if test $_libcurl_wanted -gt 0 ; then + AC_CACHE_CHECK([for libcurl >= version $2], + [libcurl_cv_lib_version_ok], + [ + if test $_libcurl_version -ge $_libcurl_wanted ; then + libcurl_cv_lib_version_ok=yes + else + libcurl_cv_lib_version_ok=no + fi + ]) + fi + + if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then + if test x"$LIBCURL_CPPFLAGS" = "x" ; then + LIBCURL_CPPFLAGS=`pkg-config $_libcurl_pc --cflags` + fi + + if test x"$LIBCURL" = "x" ; then + if $(pkg-config $_libcurl_pc --static 2>&1 > /dev/null) ; then + LIBCURL="`pkg-config $_libcurl_pc --static`" + fi + fi + + if test x"$LIBCURL" = "x" ; then + LIBCURL="`pkg-config $_libcurl_pc --libs`" + + if test "x`echo \""$LIBCURL"\" | grep ssl`" = x ; then + LIBCURL="${LIBCURL} ${SSL_LIBS}" + fi + + # fix cannot find -lssl + if test "x`echo \""$SSL_LIBS"\" | grep '\-L/'`" != 'x' ; then + LIBCURL="${LIBCURL} ${SSL_LIBS}" + fi + + # This is so silly, but Apple actually has a bug in their + # curl-config script. Fixed in Tiger, but there are still + # lots of Panther installs around. + case "${host}" in + powerpc-apple-darwin7*) + LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` + ;; + armv6-*) + LIBCURL=`echo $LIBCURL -latomic` + ;; + esac + fi + + # All curl-config scripts support --feature + _libcurl_features=`pkg-config $_libcurl_pc --variable=supported_features` + + # Is it modern enough to have --protocols? (7.12.4) + if test $_libcurl_version -ge 461828 ; then + _libcurl_protocols=`pkg-config $_libcurl_pc --variable=supported_protocols` + fi + else + _libcurl_try_link=no + fi + + unset _libcurl_wanted + fi + AC_PATH_PROG([_libcurl_config],[curl-config]) if test x$_libcurl_config != "x" ; then AC_CACHE_CHECK([for the version of libcurl], @@ -123,12 +193,6 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], powerpc-apple-darwin7*) LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'` ;; - x86_64-pc-linux-gnu) - LIBCURL=`echo $LIBCURL -ldl` - ;; - armv6-*) - LIBCURL="-lcurl -lssl -lcrypto -lz -latomic" - ;; esac fi