From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web09.13281.1638547727747119937 for ; Fri, 03 Dec 2021 08:08:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TxjkbKqC; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638547726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=72FKq3dQgWd8Umvs1mMI2K9mCCSmnyWb4TSZzVOys/k=; b=TxjkbKqCG12KXFO2famn+V7KR7sM4N6pf0IC1n5YJvO+YnnWxZaYOK/bdtJITnSEUgbJEe YsK8NZyZ7kPtOqoFadL7/uMsS+YRLrSxlquEWBPojoJJraDjgwioJyORoegIqruE7owgxN MnJ2uEn0SJ3S07/rTYdk75NorIjVR94= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-420-b50QdA0gPPOW8LtzHSCfAA-1; Fri, 03 Dec 2021 11:08:43 -0500 X-MC-Unique: b50QdA0gPPOW8LtzHSCfAA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0BDB281CCB6; Fri, 3 Dec 2021 16:08:42 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.170]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF3244EC37; Fri, 3 Dec 2021 16:08:14 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CE208180039C; Fri, 3 Dec 2021 17:07:48 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Guomin Jiang , Pawel Polawski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Xiaoyu Lu , Gerd Hoffmann Subject: [PATCH 05/24] CryptoPkg/openssl: process_files.pl: change config header handling Date: Fri, 3 Dec 2021 17:07:29 +0100 Message-Id: <20211203160748.866150-6-kraxel@redhat.com> In-Reply-To: <20211203160748.866150-1-kraxel@redhat.com> References: <20211203160748.866150-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Let the openssl build system create the generated files. Just run 'make build_generated' instead of duplicating the build rules in process_files.pl. openssl 3.0 has split the configuration into multiple smaller files. Find them all using glob and process them in a loop. Signed-off-by: Gerd Hoffmann --- CryptoPkg/Library/OpensslLib/process_files.pl | 43 +++++-------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl index 51138f8edab8..e903263a7582 100755 --- a/CryptoPkg/Library/OpensslLib/process_files.pl +++ b/CryptoPkg/Library/OpensslLib/process_files.pl @@ -203,21 +203,8 @@ BEGIN { ) == 0 || die "OpenSSL Configure failed!\n"; - # Generate opensslconf.h per config data - system( - "perl -I. -Mconfigdata util/dofile.pl " . - "include/openssl/opensslconf.h.in " . - "> include/openssl/opensslconf.h" - ) == 0 || - die "Failed to generate opensslconf.h!\n"; - - # Generate dso_conf.h per config data - system( - "perl -I. -Mconfigdata util/dofile.pl " . - "include/crypto/dso_conf.h.in " . - "> include/crypto/dso_conf.h" - ) == 0 || - die "Failed to generate dso_conf.h!\n"; + # Generate files per config data + system("make build_all_generated"); chdir($basedir) || die "Cannot change to base directory \"" . $basedir . "\""; @@ -416,25 +403,15 @@ if (!defined $arch) { } # -# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration +# Copy generated files # -print "\n--> Duplicating opensslconf.h into Include/openssl ... "; -system( - "perl -pe 's/\\n/\\r\\n/' " . - "< " . $OPENSSL_PATH . "/include/openssl/opensslconf.h " . - "> " . $OPENSSL_PATH . "/../../Include/openssl/opensslconf.h" - ) == 0 || - die "Cannot copy opensslconf.h!"; -print "Done!"; - -print "\n--> Duplicating dso_conf.h into Include/crypto ... "; -system( - "perl -pe 's/\\n/\\r\\n/' " . - "< " . $OPENSSL_PATH . "/include/crypto/dso_conf.h" . - "> " . $OPENSSL_PATH . "/../../Include/crypto/dso_conf.h" - ) == 0 || - die "Cannot copy dso_conf.h!"; -print "Done!\n"; +for my $file (map { s/\.in//; $_ } glob($OPENSSL_PATH . "/include/*/*.h.in")) { + my $dest = $file; + $dest =~ s|.*/include/|../Include/|; + print "\n--> Duplicating $file into $dest ... "; + system("perl -pe 's/\\n/\\r\\n/' < $file > $dest") == 0 + or die "Cannot copy $file !"; +} print "\nProcessing Files Done!\n"; -- 2.33.1