[OpenSSL-3.0LTS] automatically generate N6's Makefile from configdata.pm
TNF HEAD seems its Makefile is automatically generated from OpenSSL generated Makefile(and *.d file) by shell script and awk.
but OpenSSL has it’s Makefile generation tools by perl and all configuration data is stored in configdata\.pm, it’s better to using it.
Comments (8)
-
reporter -
reporter all libraries that OpenSSL is build is recored as $unified_info{'libraries'}
our %unified_info = ( ... "libraries" => [ "apps/libapps.a", "libcrypto", "libssl", "providers/libcommon.a", "providers/libdefault.a", "providers/liblegacy.a", "test/libtestutil.a" ], ...
lib*.a is archive library, if $unified_info{'attributes'}->{'libraries'}->{$library}->{'noinst'} is 1, library is private and no need to be installed.
our %unified_info = ( "attributes" => { ... "libraries" => { "apps/libapps.a" => { "noinst" => "1" }, "providers/libcommon.a" => { "noinst" => "1" }, "providers/libdefault.a" => { "noinst" => "1" }, "providers/liblegacy.a" => { "noinst" => "1" }, "test/libtestutil.a" => { "has_main" => "1", "noinst" => "1" } }, ...
lib*.a is used not only for static linking apps/testcases, also for shared libraries. so that PIC(lib*_pic.a) archive should be build.
lib* is shared library, always installed.
-
reporter archive libraries dependency is stored as $unified_info{'sources'}->{$library}
our %unified_info = ( ... "sources" => { ... "apps/libapps.a" => [ "apps/lib/libapps-lib-app_libctx.o", ... ], "libcrypto" => [ "crypto/aes/libcrypto-lib-aes_cbc.o", ... "providers/libdefault.a" ],
shared libraries dependency is stored as $unified_info{'shared_sources'}->{$library}
our %unified_info = ( ... "shared_sources" => { "libcrypto" => [ "crypto/aes/libcrypto-shlib-aes_cbc.o", ... "libcrypto.ld", ... "providers/libdefault.a" ],
*.ld is for ELF symbol versioning, see ld(1)'s --version-script option.
-
reporter \*.o is object file.
lib*-shlib-*.o is PIC object, lib*-lib-*.o is static linked object.
it’s source code also recorded in $unified_info{'sources'}->{$object}.
our %unified_info = ( ... "sources" => { ... "apps/lib/libapps-lib-app_libctx.o" => [ "../../../dist/apps/lib/app_libctx.c" ], ... "crypto/aes/libcrypto-shlib-aes_cbc.o" => [ "../../../dist/crypto/aes/aes_cbc.c" ],
-
reporter \$unified_info{'defines'}->{$library} is CPPFLAGS definitions.
our %unified_info = ( ... "defines" => { "crypto/providers/liblegacy.a" => [ "SHA1_ASM" ], "engines/loader_attic" => [ "OPENSSL_NO_PROVIDER_CODE" ], "libcrypto" => [ "GHASH_ASM", "OPENSSL_BN_ASM_MONT", "OPENSSL_CPUID_OBJ", "SHA1_ASM" ], "providers/libcommon.a" => [ "OPENSSL_BN_ASM_MONT", "OPENSSL_CPUID_OBJ" ], "providers/libdefault.a" => [ "OPENSSL_CPUID_OBJ", "SHA1_ASM" ], "providers/libfips.a" => [ "FIPS_MODULE", "GHASH_ASM", "OPENSSL_BN_ASM_MONT", "OPENSSL_CPUID_OBJ", "SHA1_ASM" ], "providers/liblegacy.a" => [ "OPENSSL_CPUID_OBJ" ], ...
-
reporter public header files to be installed is not recored on configdata\.pm, using find(1) is only way:
install_dev: install_runtime_libs @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) @$(ECHO) "*** Installing development files" @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(INSTALLTOP)/include/openssl" @ : @set -e; for i in $(SRCDIR)/include/openssl/*.h \ $(BLDDIR)/include/openssl/*.h; do \ fn=`basename $$i`; \ $(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ cp $$i "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ chmod 644 "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ done
-
reporter also mandoc to be installed is not recored on configdata\.pm, use find(1) too:
install_man_docs: build_man_docs @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man1" @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man3" @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man5" @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man7" @$(ECHO) "*** Installing manpages" @set -e; for x in dummy $(MANDOCS1); do \ if [ "$$x" = "dummy" ]; then continue; fi; \ fn=`basename $$x`; \ $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ cp $$x "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ chmod 644 "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ $(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 $${fn}$(MANSUFFIX) "$ (DESTDIR)$(MANDIR)/man1"; \ done ... @set -e; for x in dummy $(MANDOCS7); do \ if [ "$$x" = "dummy" ]; then continue; fi; \ fn=`basename $$x`; \ $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ cp $$x "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ chmod 644 "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ $(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 $${fn}$(MANSUFFIX) "$ (DESTDIR)$(MANDIR)/man7"; \ done
-
reporter hmm, shlib-*.o and lib-*.o is same PIC object(same as N’s *.pico and lib*_pic.a).
- Log in to comment
first, run Configure with BSD-generic32 target.
it generates MI part.
second, run Configure with NetBSD-${MACHINE_CPU} target(added target by me).
the difference between NetBSD-${MACHINE_CPU} and BSD-generic32 becomes MD part.