Skip to content

Commit

Permalink
Shared library instead of monolithic
Browse files Browse the repository at this point in the history
  • Loading branch information
Knogle committed Sep 20, 2024
1 parent b937535 commit c6cf3a5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
22 changes: 11 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ check-format:
all: build-openssl $(SUBDIRS)

build-openssl:
cd external/openssl && ./Configure linux-x86_64 no-shared no-comp no-engine no-md4 no-md2 no-ripemd no-whirlpool \
no-dsa no-dh no-ec no-ecdsa no-ecdh no-sm2 no-sm3 no-sm4 no-aria \
no-cast no-camellia no-seed no-rc2 no-rc4 no-rc5 no-des no-blake2 no-poly1305 \
no-chacha no-scrypt no-siphash no-ssl no-tls no-tls1 no-tls1_1 no-tls1_2 no-tls1_3 \
no-dtls no-dtls1 no-dtls1_2 no-nextprotoneg no-ocsp no-srp no-srtp no-psk \
no-deprecated no-legacy no-tests no-shared no-dso no-async no-atexit no-autoalginit \
no-autoload-config no-static-engine no-ui-console no-filenames \
--prefix=$(abs_top_srcdir)/external/openssl/build && make -j$(shell nproc) && make install_sw



cd external/openssl && \
./Configure linux-x86_64 shared no-cast no-camellia no-seed no-rc2 no-rc4 no-rc5 no-des no-blake2 no-poly1305 \
no-dsa no-dh no-ec no-ecdsa no-ecdh no-sm2 no-sm3 no-sm4 no-aria no-ssl \
no-chacha no-scrypt no-siphash no-ssl no-tls no-tls1 no-tls1_1 no-tls1_2 no-tls1_3 \
no-dtls no-dtls1 no-dtls1_2 no-nextprotoneg no-ocsp no-srp no-srtp no-psk \
no-deprecated no-legacy \
--prefix=$(abs_top_srcdir)/external/openssl/build && \
make -j$(shell nproc) && \
make install_sw && \
\
cp $(abs_top_srcdir)/external/openssl/build/lib64/libcrypto.so* $(abs_top_srcdir)/src
29 changes: 25 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
# Include directories and linker flags for OpenSSL
AM_CFLAGS = -I$(top_srcdir)/external/openssl/build/include -Wl,--gc-sections -flto -Os -s -fno-ident
AM_LDFLAGS = -L$(top_srcdir)/external/openssl/build/lib64 -l:libssl.a -l:libcrypto.a
AM_CFLAGS = -I$(top_srcdir)/external/openssl/build/include \
-Wl,--gc-sections -flto -Os -s -fno-ident

# Set the linker to look for libraries in the current directory
AM_LDFLAGS = -L. -Wl,--as-needed -Wl,-rpath,'$$ORIGIN'

# List of binaries to be built
bin_PROGRAMS = nwipe

# Source files for the project
nwipe_SOURCES = context.h logging.h options.h prng.h version.h temperature.h nwipe.c gui.c method.h pass.c device.c gui.h isaac_rand/isaac_standard.h isaac_rand/isaac_rand.h isaac_rand/isaac_rand.c isaac_rand/isaac64.h isaac_rand/isaac64.c mt19937ar-cok/mt19937ar-cok.c nwipe.h mt19937ar-cok/mt19937ar-cok.h alfg/add_lagg_fibonacci_prng.h alfg/add_lagg_fibonacci_prng.c xor/xoroshiro256_prng.h xor/xoroshiro256_prng.c aes/aes_ctr_prng.h aes/aes_ctr_prng.c pass.h device.h logging.c method.c options.c prng.c version.c temperature.c PDFGen/pdfgen.h PDFGen/pdfgen.c create_pdf.c create_pdf.h embedded_images/shred_db.jpg.c embedded_images/tick_erased.jpg.c embedded_images/tick_erased.jpg.h embedded_images/redcross.c embedded_images/redcross.h hpa_dco.h hpa_dco.c miscellaneous.h miscellaneous.c embedded_images/nwipe_exclamation.jpg.h embedded_images/nwipe_exclamation.jpg.c conf.h conf.c customers.h customers.c hddtemp_scsi/hddtemp.h hddtemp_scsi/scsi.h hddtemp_scsi/scsicmds.h hddtemp_scsi/get_scsi_temp.c hddtemp_scsi/scsi.c hddtemp_scsi/scsicmds.c
nwipe_SOURCES = context.h logging.h options.h prng.h version.h nwipe.c gui.c \
method.h pass.c device.c gui.h isaac_rand/isaac_standard.h \
isaac_rand/isaac_rand.h isaac_rand/isaac_rand.c isaac_rand/isaac64.h \
isaac_rand/isaac64.c mt19937ar-cok/mt19937ar-cok.c \
nwipe.h mt19937ar-cok/mt19937ar-cok.h alfg/add_lagg_fibonacci_prng.h \
alfg/add_lagg_fibonacci_prng.c xor/xoroshiro256_prng.h \
xor/xoroshiro256_prng.c aes/aes_ctr_prng.h aes/aes_ctr_prng.c \
pass.h device.h logging.c method.c options.c prng.c version.c \
temperature.c PDFGen/pdfgen.h PDFGen/pdfgen.c create_pdf.c \
create_pdf.h embedded_images/shred_db.jpg.c \
embedded_images/tick_erased.jpg.c embedded_images/tick_erased.jpg.h \
embedded_images/redcross.c embedded_images/redcross.h hpa_dco.h \
hpa_dco.c miscellaneous.h miscellaneous.c \
embedded_images/nwipe_exclamation.jpg.h \
embedded_images/nwipe_exclamation.jpg.c conf.h conf.c \
customers.h customers.c hddtemp_scsi/hddtemp.h \
hddtemp_scsi/scsi.h hddtemp_scsi/scsicmds.h \
hddtemp_scsi/get_scsi_temp.c hddtemp_scsi/scsi.c \
hddtemp_scsi/scsicmds.c

# Libraries dependencies, including libparted and libconfig
nwipe_LDADD = -l:libssl.a -l:libcrypto.a $(PARTED_LIBS) $(LIBCONFIG)
nwipe_LDADD = -lssl -lcrypto $(PARTED_LIBS) $(LIBCONFIG)

0 comments on commit c6cf3a5

Please sign in to comment.