From a4ba76fd90f04c1ddb95a4cc045b56b9b6df22c6 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Sun, 28 Jan 2024 22:55:11 -0500 Subject: [PATCH] modules: minor refactor/tweaks Just some minor clean ups like fixing whitespace and sorting things. I added (bash)/removed (libusb) white space in order to look like the other modules. I sorted the --enable/--disable/--with blocks so that common stuff looked similar which should aid in comparing modules. I also removed a couple of duplicate config options (--disable-fallback-curses & --disable-regex). Signed-off-by: Manuel Mendez Signed-off-by: Thierry Laurion --- modules/bash | 12 +++++------ modules/cairo | 12 ++++++++--- modules/cryptsetup2 | 2 +- modules/dropbear | 2 +- modules/gpg | 16 +++++++-------- modules/gpg2 | 47 +++++++++++++++++++++---------------------- modules/ioport | 2 +- modules/kbd | 4 ++-- modules/libassuan | 2 +- modules/libgcrypt | 2 +- modules/libgpg-error | 8 ++++---- modules/libnitrokey | 12 +++++------ modules/libusb | 10 ++++----- modules/lvm2 | 20 +++++++++--------- modules/newt | 2 +- modules/openssl | 5 ++++- modules/pinentry | 13 ++++++------ modules/popt | 3 +-- modules/powerpc-utils | 2 +- modules/qrencode | 2 +- modules/slang | 8 ++++---- modules/tpm2-tss | 2 +- modules/util-linux | 12 +++++------ 23 files changed, 103 insertions(+), 97 deletions(-) diff --git a/modules/bash b/modules/bash index e29fed72..62f063f9 100644 --- a/modules/bash +++ b/modules/bash @@ -14,16 +14,16 @@ bash_configure := CFLAGS="-g0 -Os" LDFLAGS="-s" ./configure \ $(CROSS_TOOLS) \ --host $(target) \ --prefix="/usr" \ - --enable-largefile \ - --infodir=/usr/share/info \ - --mandir=/usr/share/man \ - --without-bash-malloc \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man \ --disable-coprocesses \ - --enable-debugger \ --disable-net-redirections \ - --enable-single-help-strings \ --disable-nls \ + --enable-debugger \ + --enable-largefile \ --enable-readline \ + --enable-single-help-strings \ + --without-bash-malloc bash_target := $(MAKE_JOBS) \ && $(MAKE) -C $(build)/$(bash_dir) \ diff --git a/modules/cairo b/modules/cairo index b4970652..81d71e9a 100644 --- a/modules/cairo +++ b/modules/cairo @@ -12,10 +12,16 @@ cairo_configure := \ ./configure \ --host $(MUSL_ARCH)-elf-linux \ --prefix="/" \ - --disable-xlib --disable-xcb --disable-pdf \ - --disable-ps --disable-svg --disable-script \ - --disable-ft --disable-fc --disable-pthread \ + --disable-fc \ + --disable-ft \ --disable-gobject \ + --disable-pdf \ + --disable-ps \ + --disable-pthread \ + --disable-script \ + --disable-svg \ + --disable-xcb \ + --disable-xlib \ && sed \ -e 's/^hardcode_libdir_flag_spec.*/hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_DISABLE__ "/' \ < libtool \ diff --git a/modules/cryptsetup2 b/modules/cryptsetup2 index b7ffd8d4..6becf6db 100644 --- a/modules/cryptsetup2 +++ b/modules/cryptsetup2 @@ -16,8 +16,8 @@ cryptsetup2_configure := \ ./configure \ --host $(MUSL_ARCH)-elf-linux \ --prefix "/" \ - --disable-rpath \ --disable-gcrypt-pbkdf2 \ + --disable-rpath \ --enable-cryptsetup-reencrypt \ --with-crypto_backend=kernel \ --with-tmpfilesdir=$(INSTALL)/lib/tmpfiles.d diff --git a/modules/dropbear b/modules/dropbear index 285f97bb..ac32a59c 100644 --- a/modules/dropbear +++ b/modules/dropbear @@ -11,8 +11,8 @@ dropbear_configure := ./configure \ $(CROSS_TOOLS) \ --host $(MUSL_ARCH)-elf-linux \ --prefix "/" \ - --disable-syslog \ --disable-lastlog \ + --disable-syslog \ --disable-utmp \ --disable-utmpx \ --disable-wtmp \ diff --git a/modules/gpg b/modules/gpg index e6b8f2c5..7bab72e7 100644 --- a/modules/gpg +++ b/modules/gpg @@ -23,20 +23,20 @@ gpg_configure := \ ./configure \ --build $(MUSL_ARCH)-elf-linux \ --host $(MUSL_ARCH)-linux-musl \ - --with-libusb="$(INSTALL)" \ --prefix "/" \ - --enable-card-support \ - --disable-bzip2 \ --disable-asm \ + --disable-bzip2 \ + --disable-dns-cert \ + --disable-dns-srv \ --disable-exec \ - --disable-photo-viewers \ + --disable-finger \ + --disable-hkp \ --disable-keyserver-helpers \ --disable-ldap \ - --disable-hkp \ - --disable-finger \ - --disable-dns-srv \ - --disable-dns-cert \ + --disable-photo-viewers \ --disable-regex \ + --enable-card-support \ + --with-libusb="$(INSTALL)" \ # Run one build to generate the executables with the pre-defined # exec_prefix and datarootdir, then a second make to install the binaries diff --git a/modules/gpg2 b/modules/gpg2 index 141dbeb3..6190ec5c 100644 --- a/modules/gpg2 +++ b/modules/gpg2 @@ -18,35 +18,34 @@ gpg2_configure := \ ./configure \ CPPFLAGS="-I$(INSTALL)/include/libusb-1.0" \ --host $(MUSL_ARCH)-linux-musl \ - --with-libusb="$(INSTALL)" \ - --with-gpg-error-prefix="$(INSTALL)" \ - --with-libgcrypt-prefix="$(INSTALL)" \ - --with-libassuan-prefix="$(INSTALL)" \ - --with-ksba-prefix="$(INSTALL)" \ - --with-npth-prefix="$(INSTALL)" \ --prefix "/" \ --libexecdir "/bin" \ - --enable-scdaemon \ - --enable-ccid-driver \ - --disable-tofu \ - --disable-rpath \ - --disable-regex \ - --disable-doc \ - --disable-bzip2 \ - --disable-exec \ - --disable-photo-viewers \ - --disable-ldap \ - --disable-regex \ - --disable-nls \ --disable-all-tests \ - --disable-wks-tools \ - --disable-gnutls \ + --disable-bzip2 \ --disable-dirmngr \ - --disable-ntbtls \ - --disable-libdns \ - --disable-zip \ - --disable-sqlite \ + --disable-doc \ + --disable-exec \ + --disable-gnutls \ --disable-gpgsm \ + --disable-ldap \ + --disable-libdns \ + --disable-nls \ + --disable-ntbtls \ + --disable-photo-viewers \ + --disable-regex \ + --disable-rpath \ + --disable-sqlite \ + --disable-tofu \ + --disable-wks-tools \ + --disable-zip \ + --enable-ccid-driver \ + --enable-scdaemon \ + --with-gpg-error-prefix="$(INSTALL)" \ + --with-ksba-prefix="$(INSTALL)" \ + --with-libassuan-prefix="$(INSTALL)" \ + --with-libgcrypt-prefix="$(INSTALL)" \ + --with-libusb="$(INSTALL)" \ + --with-npth-prefix="$(INSTALL)" \ # Run one build to generate the executables with the pre-defined # exec_prefix and datarootdir, then a second make to install the binaries diff --git a/modules/ioport b/modules/ioport index 2d1c6b35..ab25c929 100644 --- a/modules/ioport +++ b/modules/ioport @@ -8,8 +8,8 @@ ioport_hash := 7fac1c4b61eb9411275de0e1e7d7a8c3f34166f64f16413f50741e8fce2b8dc0 ioport_configure := CFLAGS=-Os ./configure \ $(CROSS_TOOLS) \ + --host i386-elf-linux \ --prefix "/" \ - --host i386-elf-linux ioport_target := \ $(MAKE_JOBS) $(CROSS_TOOLS) inb && \ diff --git a/modules/kbd b/modules/kbd index f6d3f405..2286e5cc 100644 --- a/modules/kbd +++ b/modules/kbd @@ -16,11 +16,11 @@ kbd_hash := aaed530a1490d63d041448372e2ad4f38c3179042903251000b71d527c46e945 kbd_configure := CFLAGS=-Os ./configure \ $(CROSS_TOOLS) \ - --prefix "" \ --host i386-elf-linux \ - --disable-optional-progs \ + --prefix "" \ --disable-libkeymap \ --disable-libkfont \ + --disable-optional-progs \ --disable-vlock \ kbd_target := \ diff --git a/modules/libassuan b/modules/libassuan index a2536be7..e641854f 100644 --- a/modules/libassuan +++ b/modules/libassuan @@ -12,8 +12,8 @@ libassuan_configure := \ ./configure \ --host $(MUSL_ARCH)-linux-musl \ --prefix "/" \ - --disable-static \ --disable-doc \ + --disable-static \ --with-gpg-error-prefix="$(INSTALL)" \ libassuan_target := $(MAKE_JOBS) \ diff --git a/modules/libgcrypt b/modules/libgcrypt index c46fe608..a3ece058 100644 --- a/modules/libgcrypt +++ b/modules/libgcrypt @@ -12,9 +12,9 @@ libgcrypt_configure := \ ./configure \ --host=$(MUSL_ARCH)-linux-musl \ --prefix "/" \ + --disable-doc \ --disable-static \ --with-gpg-error-prefix="$(INSTALL)" \ - --disable-doc \ libgcrypt_target := $(MAKE_JOBS) \ DESTDIR="$(INSTALL)" \ diff --git a/modules/libgpg-error b/modules/libgpg-error index 28b01f32..0c855356 100644 --- a/modules/libgpg-error +++ b/modules/libgpg-error @@ -10,12 +10,12 @@ libgpg-error_configure := \ $(CROSS_TOOLS) \ CFLAGS="-Os" \ ./configure \ - --prefix "/" \ --host=$(MUSL_ARCH)-linux-musl \ - --disable-static \ - --disable-nls \ - --disable-languages \ + --prefix "/" \ --disable-doc \ + --disable-languages \ + --disable-nls \ + --disable-static \ --disable-tests \ --enable-install-gpg-error-config \ diff --git a/modules/libnitrokey b/modules/libnitrokey index 455680f4..8bdb7116 100644 --- a/modules/libnitrokey +++ b/modules/libnitrokey @@ -14,20 +14,20 @@ libnitrokey_hash := 4f3382b6193afe69c2001321038fce9490bc28803ed687152a397ccd8914 cmake_cross := "-DCMAKE_AR=$(CROSS)ar" \ -DCMAKE_CXX_COMPILER="$(CROSS)g++" \ - -DCMAKE_C_COMPILER="$(CROSS)gcc" \ - -DCMAKE_CXX_FLAGS="-Os -fdata-sections -ffunction-sections -ffile-prefix-map=$(pwd)=heads -gno-record-gcc-switches -D__MUSL__ -I$(INSTALL)/include -L$(INSTALL)/lib " \ - -DCMAKE_LINKER="$(CROSS)ld" - -DCMAKE_SHARED_LINKER_FLAGS="-gc-sections" -DCMAKE_CXX_COMPILER_AR="$(CROSS)ar" \ + -DCMAKE_CXX_FLAGS="-Os -fdata-sections -ffunction-sections -ffile-prefix-map=$(pwd)=heads -gno-record-gcc-switches -D__MUSL__ -I$(INSTALL)/include -L$(INSTALL)/lib " \ + -DCMAKE_C_COMPILER="$(CROSS)gcc" \ + -DCMAKE_LINKER="$(CROSS)ld" -DCMAKE_NM="$(CROSS)nm" \ - -DCMAKE_OBJDUMP="$(CROSS)objdump" \ -DCMAKE_OBCOPY="$(CROSS)obcopy" \ + -DCMAKE_OBJDUMP="$(CROSS)objdump" \ + -DCMAKE_SHARED_LINKER_FLAGS="-gc-sections" -DCMAKE_STRIP="$(CROSS)strip" libnitrokey_configure := \ mkdir build -p && \ cd build && \ - $(CROSS_TOOLS) cmake .. -DNO_LOG=ON -DBUILD_SHARED_LIBS=OFF -DCOMPILE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/ -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=MinSizeRel $(cmake_cross) + $(CROSS_TOOLS) cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=/ -DCOMPILE_TESTS=OFF -DNO_LOG=ON $(cmake_cross) # install "by-hand" as INSTALL_PREFIX is not working as expected libnitrokey_target := $(CROSS_TOOLS) $(MAKE_JOBS) -C build DESTDIR="$(INSTALL)" && \ diff --git a/modules/libusb b/modules/libusb index a3d40c56..2e9569f4 100644 --- a/modules/libusb +++ b/modules/libusb @@ -12,11 +12,11 @@ libusb_hash := 7dce9cce9a81194b7065ee912bcd55eeffebab694ea403ffb91b67db66b1824b libusb_configure := \ CFLAGS="-Os" \ ./configure \ - $(CROSS_TOOLS)\ - --host $(MUSL_ARCH)-elf-linux\ - --prefix "/"\ - --disable-udev\ - --disable-tests\ + $(CROSS_TOOLS) \ + --host $(MUSL_ARCH)-elf-linux \ + --prefix "/" \ + --disable-tests \ + --disable-udev \ # Run one build to generate the executables with the pre-defined # exec_prefix and datarootdir, then a second make to install the binaries diff --git a/modules/lvm2 b/modules/lvm2 index be1435a3..e51292d6 100644 --- a/modules/lvm2 +++ b/modules/lvm2 @@ -18,20 +18,20 @@ lvm2_configure := \ ./configure \ --host $(MUSL_ARCH)-elf-linux \ --prefix "/" \ - --enable-devmapper \ - --disable-selinux \ - --disable-udev-systemd-background-jobs \ - --disable-realtime \ + --disable-blkid_wiping \ + --disable-cache_check_needs_check \ + --disable-cmirrord \ --disable-dmeventd \ --disable-lvmetad \ --disable-lvmpolld \ - --disable-use-lvmlockd \ - --disable-use-lvmetad \ - --disable-use-lvmpolld \ - --disable-blkid_wiping \ - --disable-cmirrord \ - --disable-cache_check_needs_check \ + --disable-realtime \ + --disable-selinux \ --disable-thin_check_needs_check \ + --disable-udev-systemd-background-jobs \ + --disable-use-lvmetad \ + --disable-use-lvmlockd \ + --disable-use-lvmpolld \ + --enable-devmapper \ --with-cluster=none \ --with-thin-check= \ diff --git a/modules/newt b/modules/newt index 3cd37658..d9fb2c2d 100644 --- a/modules/newt +++ b/modules/newt @@ -23,6 +23,6 @@ newt_libraries := \ newt_configure := \ ./autogen.sh && CFLAGS="-Os" ./configure \ $(CROSS_TOOLS) \ - --prefix "/" \ --host $(MUSL_ARCH)-elf-linux \ + --prefix "/" \ --without-tcl diff --git a/modules/openssl b/modules/openssl index a9cbdcf5..47072442 100644 --- a/modules/openssl +++ b/modules/openssl @@ -7,6 +7,9 @@ openssl_tar := openssl-$(openssl_version).tar.gz openssl_url := https://www.openssl.org/source/$(openssl_tar) openssl_hash := 6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e +# hack to provide path to libgcc +LIBGCC_DIR := $(dir $(shell $(heads_cc) -print-libgcc-file-name)) + # The only optional algorithm that's enabled is SM3. tpm2-tss uses SHA, AES, # and SM3. openssl_configure := \ @@ -14,7 +17,6 @@ openssl_configure := \ CFLAGS="-Os" \ ./Configure \ --prefix="/" \ - no-tests \ linux-$(strip $(arch)) \ no-aria \ no-bf \ @@ -42,6 +44,7 @@ openssl_configure := \ no-siv \ no-sm2 \ no-sm4 \ + no-tests \ no-whirlpool \ openssl_target := $(MAKE_JOBS) \ diff --git a/modules/pinentry b/modules/pinentry index 7fa92cdf..239c6b75 100644 --- a/modules/pinentry +++ b/modules/pinentry @@ -19,17 +19,16 @@ pinentry_configure := \ ./configure \ --host $(MUSL_ARCH)-linux-musl \ --prefix "/" \ - --enable-pinentry-tty \ + --disable-fallback-curses \ --disable-libsecret \ - --disable-fallback-curses \ --disable-pinentry-curses \ - --disable-pinentry-qt \ - --disable-pinentry-gtk2 \ - --disable-pinentry-gnome3 \ - --disable-pinentry-fltk \ --disable-pinentry-emacs \ - --disable-fallback-curses \ + --disable-pinentry-fltk \ + --disable-pinentry-gnome3 \ + --disable-pinentry-gtk2 \ + --disable-pinentry-qt \ --disable-pinentry-qt5 \ + --enable-pinentry-tty \ --with-gpg-error-prefix="$(INSTALL)" \ --with-libassuan-prefix="$(INSTALL)" \ diff --git a/modules/popt b/modules/popt index 9a0ec319..6e24422d 100644 --- a/modules/popt +++ b/modules/popt @@ -8,9 +8,8 @@ popt_hash := c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9 popt_configure := ./configure \ $(CROSS_TOOLS) \ - --prefix "/" \ --host $(MUSL_ARCH)-elf-linux \ - + --prefix "/" \ popt_target := \ $(MAKE_JOBS) \ diff --git a/modules/powerpc-utils b/modules/powerpc-utils index dc19d13f..5526afd8 100644 --- a/modules/powerpc-utils +++ b/modules/powerpc-utils @@ -13,8 +13,8 @@ powerpc-utils_configure := \ ./configure \ --host $(MUSL_ARCH)-elf-linux \ --prefix "/" \ + --without-librtas \ --without-systemd \ - --without-librtas powerpc-utils_target := \ $(MAKE_JOBS) \ diff --git a/modules/qrencode b/modules/qrencode index 565b98f6..fbfbb870 100644 --- a/modules/qrencode +++ b/modules/qrencode @@ -12,9 +12,9 @@ qrencode_configure := \ CFLAGS="-Os" \ ./configure \ $(CROSS_TOOLS) \ + --host $(MUSL_ARCH)-elf-linux \ --prefix "/" \ --without-tools \ - --host $(MUSL_ARCH)-elf-linux \ qrencode_target := \ $(MAKE_JOBS) \ diff --git a/modules/slang b/modules/slang index 779d6db6..c99c6449 100644 --- a/modules/slang +++ b/modules/slang @@ -9,12 +9,12 @@ slang_hash := 54f0c3007fde918039c058965dffdfd6c5aec0bad0f4227192cc486021f08c36 slang_configure := ./configure \ $(CROSS_TOOLS) \ ac_cv_path_nc5config=ncurses-config \ - --prefix "/" \ --host $(MUSL_ARCH)-elf-linux \ - --with-z=no \ - --with-png=no \ - --with-pcre=no \ + --prefix "/" \ --with-onig=no \ + --with-pcre=no \ + --with-png=no \ + --with-z=no \ && mkdir -p src/elfobjs # Disable parallel make for the install target diff --git a/modules/tpm2-tss b/modules/tpm2-tss index 3795e21f..c8c1c84e 100644 --- a/modules/tpm2-tss +++ b/modules/tpm2-tss @@ -22,9 +22,9 @@ tpm2-tss_configure := aclocal && automake --add-missing && autoreconf -fi \ --host $(MUSL_ARCH)-elf-linux \ --prefix "/" \ --disable-doxygen-doc \ + --disable-doxygen-html \ --disable-doxygen-man \ --disable-doxygen-rtf \ - --disable-doxygen-html \ --disable-fapi \ --disable-static \ diff --git a/modules/util-linux b/modules/util-linux index 804ae56e..9ab8dae5 100644 --- a/modules/util-linux +++ b/modules/util-linux @@ -13,16 +13,16 @@ util-linux_configure := \ --host $(MUSL_ARCH)-elf-linux \ --prefix "/" \ --oldincludedir "$(INSTALL)/include" \ + --disable-all-programs \ + --disable-bash-completion \ + --enable-agetty \ + --enable-libblkid \ + --enable-libuuid \ --without-ncurses \ --without-ncursesw \ + --without-python \ --without-tinfo \ --without-udev \ - --without-python \ - --disable-bash-completion \ - --disable-all-programs \ - --enable-libuuid \ - --enable-libblkid \ - --enable-agetty \ util-linux_target := \