From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nd0v6-0001OP-4y for mharc-grub-devel@gnu.org; Fri, 08 Apr 2022 22:33:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nd0v4-0001OH-P5 for grub-devel@gnu.org; Fri, 08 Apr 2022 22:33:46 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:45705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nd0v0-00089s-60 for grub-devel@gnu.org; Fri, 08 Apr 2022 22:33:46 -0400 Received: by mail-qk1-x72e.google.com with SMTP id b19so6257659qkk.12 for ; Fri, 08 Apr 2022 19:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WhE/T90Yh+d2VjgOJLfJNo54d/Hk6+TxlHsBgf5TC+g=; b=dKGAZjEQx27WhJ8cHROZv7oM+Kry9+WZLgHb+GJaKLg0VED3ltoz0ZeWf0Ve6AE5iA v0FaSMl8GB2cRxNVfgjb7zmXTRtueaEYfzjfi8bLvKLDR4kwU63pEOjZs9SBposC8IcO j4sNZ7N8N+YxKaD6CauwgENjSn2pPQE7LW1FDEatQOYtV1npaRYp6kdmdPv/0IijdGYT Gl5GcwTAzvKZ7fMNxv2BIKwueSwrbtFZDW19AF040ZqBKYuBx1NzAgDI3Nd/C/AfvrGp cX4AwFaMyaNvAJcVwBmCT4ZAaajRzKUapZeigHRLu/7n2se+ta/A8k6tE81S6CSNAT+k lScA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WhE/T90Yh+d2VjgOJLfJNo54d/Hk6+TxlHsBgf5TC+g=; b=m+ve85MHtXpYh/AtScJj7V9LdmBXk3k9McAuVxb3YnKvjry0mnwFzbSHhLCvxfi0BL ObdSWyMuMn6vqa95fCZgYXNJBWq4oYsda9d/XECMqpGpufzKfNGwY7vdwh1fOuADcghF mwWFotYhp56soCvJ32Hlu/WOlWnPWUAhP9p0Rbwo2mVa/vnu66qykcK6Qj3hGZK1c1np I884kmdzWnrL9B3juFelbBQPU2L+Dw9PRcDQ7JfHBO6ajJmIQW1iWmbxpjlbMLTzJU6H DSo4imjvycdACO3urpyH54etMLZWJRIRLk7sJF615qBI/OtO3pt9s8/kdnyKOQN79Dag BCXw== X-Gm-Message-State: AOAM533Qq93eFkdN3V6XxVXsfYMvY+bqemXIrcPrvT33dYnqHlPAaJDr 8dLtXZRvczcF1uBeJY6WcVjnkw== X-Google-Smtp-Source: ABdhPJwAVz88tRKdhasXSePLkx1qnmUUnD3BYWr1Nit01mc5oVAWt3kur1LfAopx/y7CNwyuogQcbg== X-Received: by 2002:a05:620a:248a:b0:680:a827:7dc0 with SMTP id i10-20020a05620a248a00b00680a8277dc0mr15040523qkn.37.1649471620827; Fri, 08 Apr 2022 19:33:40 -0700 (PDT) Received: from localhost.localdomain ([185.220.103.12]) by smtp.gmail.com with ESMTPSA id i184-20020a37b8c1000000b00699fa585088sm4687924qkf.46.2022.04.08.19.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 19:33:40 -0700 (PDT) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set Date: Sat, 9 Apr 2022 02:29:59 +0000 Message-Id: <20220409022959.178485-1-development@efficientek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=development@efficientek.com; helo=mail-qk1-x72e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2022 02:33:47 -0000 Autoconf will set a default CFLAGS of "-g -O2" if CFLAGS is not set. CFLAGS was defaulted to "" early in configure to prevent this. A recent commit ad9ccf660013c208077b1e983d6c824df25ed1cf ("configure: Fix various new autotools warnings") added AC_USE_SYSTEM_EXTENSIONS, which pulls in the autoconf CFLAGS check, before we default CFLAGS and thus setting the autoconf default for CFLAGS. Move the default setting of CFLAGS to before AC_USE_SYSTEM_EXTENSIONS so that autoconf will see CFLAGS as set and not give it a default. CFLAGS is also moved above AC_CONFIG_AUX_DIR, because CFLAGS should be defaulted to "" as soon as possible to catch any autoconf macros that try to use some other default. Regardless, this currently has no effect as that macro does not consider the CFLAGS variable. Signed-off-by: Glenn Washburn --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 94653039c1..57fb709451 100644 --- a/configure.ac +++ b/configure.ac @@ -36,12 +36,12 @@ dnl description of the relationships between them. AC_INIT([GRUB],[2.11],[bug-grub@gnu.org]) -AC_USE_SYSTEM_EXTENSIONS -AC_CONFIG_AUX_DIR([build-aux]) - # We don't want -g -O2 by default in CFLAGS : ${CFLAGS=""} +AC_USE_SYSTEM_EXTENSIONS +AC_CONFIG_AUX_DIR([build-aux]) + # Checks for build, host and target systems. AC_CANONICAL_BUILD AC_CANONICAL_HOST -- 2.25.1