501 cd ~ 502 export PREFIX=/opt/static 503 sudo mkdir -p "$PREFIX" 504 sudo chown "$USER":"$USER" "$PREFIX" 505 if [ -f /usr/lib/x86_64-linux-gnu/libssl.a ] && [ -f /usr/lib/x86_64-linux-gnu/libcrypto.a ]; then echo "Nutze systemweite statische OpenSSL-Libs."; export OPENSSL_ROOT=/usr; else echo "Baue OpenSSL statisch (system hat keine .a)." export OPENSSL_VER=3.3.2; curl -LO "https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz"; tar xzf "openssl-${OPENSSL_VER}.tar.gz"; cd "openssl-${OPENSSL_VER}" ./Configure linux-x86_64 no-shared --prefix="$PREFIX" --libdir=lib; make -j"$(nproc)"; make install_sw; export OPENSSL_ROOT="$PREFIX"; cd -; fi 506 export OPENSSL_VER=3.6.0 507 curl -LO "https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz" 508 tar xzf "openssl-${OPENSSL_VER}.tar.gz" 509 cd "openssl-${OPENSSL_VER}" 510 ./Configure linux-x86_64 no-shared --prefix="$PREFIX" --libdir=lib 511 make -j"$(nproc)" 512 make install_sw 513 export OPENSSL_ROOT="$PREFIX" 514 cd - 515 CURL_VER=8.16.0 516 curl -LO "https://curl.se/download/curl-${CURL_VER}.tar.gz" 517 tar xzf "curl-${CURL_VER}.tar.gz" 518 cd "curl-${CURL_VER}" 519 export CPPFLAGS="-I${OPENSSL_ROOT}/include" 520 export LDFLAGS="-L${OPENSSL_ROOT}/lib -static" 521 export PKG_CONFIG_PATH="${OPENSSL_ROOT}/lib/pkgconfig" 522 export PKG_CONFIG="pkg-config --static" 523 sudo apt-get install zlib1g-dev 524 cd .. 525 git clone --depth=1 https://github.com/google/brotli.git 526 cd brotli/ 527 cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=OFF -DBROTLI_BUILD_TOOLS=OFF -DBROTLI_BUILD_TESTS=OFF 528 cmake --build build -j"$(nproc)" 529 cmake --install build 530 cd - 531 ls -l $PREFIX/lib/libbrotli* 532 cd curl-8.16.0 533 export PKG_CONFIG="pkg-config --static" 534 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:${OPENSSL_ROOT}/lib/pkgconfig" 535 export CPPFLAGS="-I$PREFIX/include -I${OPENSSL_ROOT}/include" 536 export LDFLAGS="-static -L$PREFIX/lib -L${OPENSSL_ROOT}/lib" 537 ./configure --prefix="$PREFIX" --disable-shared --enable-static --with-openssl --enable-http --with-brotli --without-zstd --without-libidn2 --without-nghttp2 --without-nghttp3 --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-mqtt --disable-ares 538 export PKG_CONFIG="pkg-config --static" 539 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 540 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" # isoliert von /usr/lib/pkgconfig 541 export CPPFLAGS="-I$PREFIX/include -I${OPENSSL_ROOT}/include" 542 export LDFLAGS="-static -L$PREFIX/lib -L${OPENSSL_ROOT}/lib" 543 ./configure --prefix="$PREFIX" --disable-shared --enable-static --with-openssl --enable-http --with-brotli --without-zstd --without-libidn2 --without-libpsl \ # <-- wichtig 544 --without-nghttp2 --without-nghttp3 --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-mqtt --disable-ares 545 ./configure --prefix="$PREFIX" --disable-shared --enable-static --with-openssl --enable-http --with-brotli --without-zstd --without-libidn2 --without-libpsl \ 546 ./configure --prefix="$PREFIX" --disable-shared --enable-static --with-openssl --enable-http --with-brotli --without-zstd --without-libidn2 --without-libpsl \ --without-nghttp2 --without-nghttp3 --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-mqtt --disable-ares 547 gedit test 548 . ./test 549 make -j"$(nproc)" 550 make install 551 cd - 552 "$PREFIX/bin/curl-config" --features 553 git clone --depth=1 https://github.com/monitoring-plugins/monitoring-plugins.git 554 cd monitoring-plugins 555 ./tools/setup 556 echo $? 557 export PKG_CONFIG="pkg-config --static" 558 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 559 export CPPFLAGS="-I$PREFIX/include" 560 export LDFLAGS="-static -L$PREFIX/lib" 561 ./configure 562 echo $? 563 make -C plugins -j1 check_curl V=1 564 cd ~/monitoring-plugins 565 make distclean || true 566 git clean -fdx 567 export PREFIX=/opt/static 568 export PATH="$PREFIX/bin:$PATH" 569 export PKG_CONFIG="pkg-config --static" 570 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 571 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" # isoliert von /usr/*.pc 572 export CURL_CONFIG="$PREFIX/bin/curl-config" 573 echo $OPENSSL_ROOT 574 export OPENSSL_ROOT=${OPENSSL_ROOT:-/usr} 575 export CPPFLAGS="-I$PREFIX/include -I${OPENSSL_ROOT}/include" 576 export LDFLAGS="-static -L$PREFIX/lib -L${OPENSSL_ROOT}/lib" 577 export CURL_CFLAGS="-I$PREFIX/include" 578 export CURL_LIBS="-Wl,-Bstatic -L$PREFIX/lib -lcurl -lbrotlidec -lbrotlicommon -lz -lssl -lcrypto -Wl,-Bdynamic -ldl -lpthread" 579 ./tools/setup 580 echo $? 581 ./configure --without-uriparser --without-ldap --without-ldaps 582 make -C plugins -j1 check_curl V=1 583 (cd plugins && gcc -E -Wp,-v $CPPFLAGS -I.. -I../lib -I../gl -I../intl check_curl.c >/dev/null) 584 cd ~/monitoring-plugins 585 make distclean || true 586 rm -f config.cache config.status 587 git clean -fdx 588 export PREFIX=/opt/static 589 export PKG_CONFIG="pkg-config --static" 590 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 591 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 592 export CPPFLAGS="-I$PREFIX/include" 593 export LDFLAGS="-static -L$PREFIX/lib" 594 export ac_cv_header_uriparser_Uri_h=no 595 export ac_cv_lib_uriparser_uriParseUriA=no 596 ./tools/setup 597 ./configure --without-uriparser --without-ldap --without-ldaps 598 make -C plugins -j1 check_curl V=1 599 grep -R "URIPARSER" config.h plugins/check_curl.d/config.h || echo "OK: kein HAVE_URIPARSER" 600 sudo apt-get install -y cmake 601 export PREFIX=/opt/static 602 git clone --depth=1 https://github.com/uriparser/uriparser.git 603 cd uriparser/ 604 cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=OFF -DURIPARSER_BUILD_TESTS=OFF -DURIPARSER_BUILD_DOCS=OFF 605 cmake --build build -j"$(nproc)" 606 cmake --install build 607 cd .. 608 cd ~/monitoring-plugins 609 make distclean || true 610 rm -f config.cache config.status 611 git clean -fdx 612 export PKG_CONFIG="pkg-config --static" 613 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 614 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 615 export CPPFLAGS="-I$PREFIX/include" 616 export LDFLAGS="-static -L$PREFIX/lib" 617 export CURL_CFLAGS="-I$PREFIX/include" 618 export CURL_LIBS="-Wl,-Bstatic -L$PREFIX/lib -lcurl -lbrotlidec -lbrotlicommon -lz -lssl -lcrypto -Wl,-Bdynamic -ldl -lpthread" 619 ./tools/setup 620 ./configure --with-uriparser --without-ldap --without-ldaps 621 make -C plugins -j1 check_curl V=1 622 cd ~/monitoring-plugins 623 make -j1 V=1 plugins/check_curl 624 cd ~/monitoring-plugins 625 make -j1 V=1 -C lib libmonitoringplug.a 626 make -j1 V=1 -C plugins check_curl 627 make -C plugins -j1 check_curl V=1 628 ./configure --without-uriparser --without-ldap --without-ldaps 629 make -j1 V=1 -C lib libmonitoringplug.a 630 make -C plugins -j1 check_curl V=1 631 cd ~/monitoring-plugins 632 make distclean || true 633 rm -f config.cache 634 ./tools/setup 635 ./configure --with-uriparser --without-ldap --without-ldaps 636 make -j1 V=1 plugins/check_curl 637 make -j1 -C gl libgnu.a 638 ls -l plugins 639 make -j1 V=1 plugins/check_curl 640 make distclean || true 641 rm -f config.cache 642 ./tools/setup 643 ./configure --with-uriparser --without-ldap --without-ldaps 644 make -j1 -C gl libgnu.a V=1 645 curl -LO https://github.com/monitoring-plugins/monitoring-plugins/archive/refs/tags/v2.4.0.tar.gz 646 tar xzf v2.4.0.tar.gz 647 cd monitoring-plugins-2.4.0 648 export PREFIX=/opt/static 649 export PKG_CONFIG="pkg-config --static" 650 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 651 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 652 export CPPFLAGS="-I$PREFIX/include" 653 export LDFLAGS="-static -L$PREFIX/lib" 654 [200~./configure --without-uriparser --without-ldap --without-ldaps 655 ~./configure --without-uriparser --without-ldap --without-ldaps 656 ./configure --without-uriparser --without-ldap --without-ldaps 657 autoreconf -i 658 autoreconf -i --force 659 ./configure --without-uriparser --without-ldap --without-ldaps 660 make -j1 -C gl libgnu.a V=1 661 make distclean || true 662 rm -f config.cache config.status 663 git clean -fdx 2>/dev/null || true 664 export PREFIX=/opt/static 665 export PKG_CONFIG="pkg-config --static" 666 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 667 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 668 export CPPFLAGS="-I$PREFIX/include" 669 export LDFLAGS="-static -L$PREFIX/lib" 670 ./configure --without-uriparser --without-ldap --without-ldaps 671 history 672 find . -type f -name configure 673 ls -rtl 674 ls -rtl 675 cd .. 676 ls -rtl 677 tar xvzf v2.4.0.tar.gz 678 cd monitoring-plugins-2.4.0 679 ls -rtl 680 ./configure --without-uriparser --without-ldap --without-ldaps 681 ls -rtl 682 ls -rtl config* 683 ls -l | grep conf 684 rm -rf gl m4 config.cache config.status 685 ./tools/setup 686 ./configure --without-uriparser --without-ldap --without-ldaps 687 ./configure --without-ldap 688 cd .. 689 rm -fR monitoring-plugins-2.4.0 690 ls -rtl 691 tar xvzf v2.4.0.tar.gz 692 cd monitoring-plugins-2.4.0/ 693 ./tools/setup 694 export PREFIX=/opt/static 695 export PKG_CONFIG="pkg-config --static" 696 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 697 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 698 export CPPFLAGS="-I$PREFIX/include" 699 export LDFLAGS="-static -L$PREFIX/lib" 700 ./configure --without-uriparser --without-ldap --without-ldaps 701 make -j1 -C gl libgnu.a V=1 702 export CPPFLAGS="-I$PREFIX/include -DGNULIB_defined_F_DUPFD_CLOEXEC=0" 703 make -j1 -C gl libgnu.a V=1 704 export CPPFLAGS="-I$PREFIX/include -DGNULIB_defined_F_DUPFD_CLOEXEC=1" 705 make -j1 -C gl libgnu.a V=1 706 cd .. 707 rm -fR monitoring-plugins-2.4.0 708 tar xvzf v2.4.0.tar.gz 709 cd monitoring-plugins-2.4.0/ 710 ./tools/setup 711 export PREFIX=/opt/static 712 export PKG_CONFIG="pkg-config --static" 713 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 714 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 715 export CPPFLAGS="-I$PREFIX/include" 716 export LDFLAGS="-static -L$PREFIX/lib" 717 ./configure --without-uriparser --without-ldap --without-ldaps 718 make -j1 V=1 719 install -D -m0755 plugins/check_curl ../check_curl-static 720 find . -type f -name check_curl-static 721 find . -type f -name "check_curl" 722 find . -type f -name "check_curl*" 723 "$PREFIX/bin/curl-config" --features 724 file plugins/check_curl 725 make -j1 -C plugins check_curl V=1 726 make -j1 -C gl libgnu.a V=1 727 make -j1 -C lib libmonitoringplug.a V=1 728 make -j1 -C plugins check_curl V=1 729 make -j1 -C gl libgnu.a V=1 730 make -j1 -C lib libmonitoringplug.a V=1 731 make -j1 -C plugins check_curl V=1 732 export PREFIX=/opt/static 733 export PKG_CONFIG="pkg-config --static" 734 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 735 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 736 # Diese beiden Variablen helfen Automake, falls pkg-config zickt: 737 export URIPARSER_CFLAGS="-I$PREFIX/include" 738 export URIPARSER_LIBS="-L$PREFIX/lib -luriparser" 739 # CURL & static Flags (wie bisher) 740 export CPPFLAGS="-I$PREFIX/include" 741 export LDFLAGS="-static -L$PREFIX/lib" 742 # 2) sauber neu konfigurieren 743 make distclean || true 744 rm -f config.cache config.status 745 ./configure --with-uriparser --without-ldap --without-ldaps 746 make -j1 V=1 747 find . -type f -name "check_curl*" 748 file ./plugins/check_curl 749 ls -l ./plugins/check_curl 750 date 751 make -C plugins clean 752 make -C plugins V=1 check_curl LIBS="-L/opt/static/lib -luriparser" 753 make distclean || true 754 rm -f config.cache config.status 755 export PREFIX=/opt/static 756 export PKG_CONFIG="pkg-config --static" 757 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 758 export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" 759 # gegen deine Includes/Libs, +no-pie (manche Toolchains linken sonst PIE) 760 export CFLAGS="-O2 -fno-pie" 761 export CPPFLAGS="-I$PREFIX/include" 762 export LDFLAGS="-static -L$PREFIX/lib -no-pie" 763 # wenn du uriparser nutzt (sonst --without-uriparser) 764 ./configure --with-uriparser --without-ldap --without-ldaps 765 make -j1 -C gl libgnu.a V=1 766 make -j1 V=1 check_curl_LDFLAGS="-all-static" LIBS="-Wl,-Bstatic -L$PREFIX/lib \ -luriparser -lcurl -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon \ -Wl,-Bdynamic -ldl -lpthread" 767 find . -type f -name "check_curl*" 768 date 769 ls -l ./plugins/check_curl 770 file ./plugins/check_curl 771 make -C plugins clean 772 make -C plugins V=1 check_curl check_curl_LDFLAGS="-all-static" LIBS="-Wl,-Bstatic -L$PREFIX/lib -luriparser -lcurl -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon -Wl,-Bdynamic -ldl -lpthread" 773 file plugins/check_curl 774 ls -l ./plugins/check_curl 775 make -j1 V=1 check_curl_LDFLAGS="-all-static" LIBS="-Wl,-Bstatic -L$PREFIX/lib \ -luriparser -lcurl -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon \ -Wl,-Bdynamic -ldl -lpthread" 776 file plugins/check_curl 777 ldd plugins/check_curl 778 cd .. 779 rm -fR monitoring-plugins-2.4.0 780 ls -rtl 781 tar xvzf v2.4.0.tar.gz 782 cd monitoring-plugins-2.4.0/ 783 ./configure --with-uriparser --without-ldap --without-ldaps 784 ls -rtl 785 ./tools/setup 786 ./configure --with-uriparser --without-ldap --without-ldaps 787 make -j1 -C gl libgnu.a 788 make -j1 V=1 check_curl_LDFLAGS="-all-static" LIBS="-Wl,-Bstatic -L$PREFIX/lib \ -luriparser -lcurl -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon \ -Wl,-Bdynamic -ldl -lpthread" 789 make -j1 -C gl libgnu.a 790 make -j1 -C lib libmonitoringplug.a 791 make -j1 -C plugins check_curl-check_curl.o libnpcommon.a picohttpparser/libpicohttpparser.a 792 export PREFIX=/opt/static 793 export SYS=/usr/lib/x86_64-linux-gnu 794 SSL_LIBS="$PREFIX/lib/libssl.a $PREFIX/lib/libcrypto.a" 795 gcc -static -no-pie -O2 -s -o plugins/check_curl plugins/check_curl-check_curl.o plugins/libnpcommon.a lib/libmonitoringplug.a gl/libgnu.a plugins/picohttpparser/libpicohttpparser.a $PREFIX/lib/liburiparser.a $PREFIX/lib/libcurl.a $PREFIX/lib/libbrotlidec.a $PREFIX/lib/libbrotlicommon.a $SYS/libz.a $SSL_LIBS $SYS/libresolv.a -ldl -lpthread -lm 796 echo $? 797 file plugins/check_curl 798 ldd plugins/check_curl 799 ls -lh plugins/check_curl 800 history >build-check_curl-history.txt