From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id A9F5D3857007 for ; Mon, 13 Sep 2021 14:14:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A9F5D3857007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x136.google.com with SMTP id h29so10215509ila.2 for ; Mon, 13 Sep 2021 07:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vEeinl0VLyCulMAeNUMY2yPt48nUF8Tuc+NX74xn7gE=; b=CXSz0ur3JwVZJzSbcNkdbWL4BI+mvDRPKgIdf81rIPjA0mSNyRppKm9Fhqrp0h287g m4stoNYd9StA+Gw/P/sBtQH+CSVMw7DhG28dPt8QqOt/ZKYV4kc3EUxvDEtKXmeQoc5i VqmoZB7iPngfugm7Z/8e3oXVHnWTRiIu3wrudFUQl3NmwsFyXgWAOsg/8N5jUj5zqwUA z3wCkNqSzSR2UV8qES98q2vEfy3j2dGyRApgVoTkubk8J4BVoj1pAcQCVS+GngtUpDzb FqAI+/D4OLkro9FznTHyROzQrymfcuVzOmYAAy4Lw7eWLIv3ogELqhWdSyOd0avk/JOS tEZQ== 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=vEeinl0VLyCulMAeNUMY2yPt48nUF8Tuc+NX74xn7gE=; b=7OObz2C1sPjJ1u9iG3LssGRal3QhOblpA7s1VuFyeU45MLVm4KDaeHbvjRCDE7KD+P S5M3PaA7dTU/3kj+azO0ZOSynvsEqru3uF907ly6qe6yKu2+xH6moHQC8vr1tFNqyUqT Wid2lBFZxoKsN8K0zvfYhxjToM+i5rC1IlvqAYTcW/yCn48iNmWzxQd0JavJ1qDW84v0 bWhmv0nDfoEKtfc26yERHm38Ve0JyVi6nvOX7UXUihGJuWdyqu9Y9zW7MymqoIa1acYr 4M20yPv+zUW/nZeHlB5uYxoARhUd4x3feRy490el0LpIC4/UDz1w0luFGOj7TgDllNFm JLPQ== X-Gm-Message-State: AOAM532eIO//lJAEYDRU2It2C1hzhi99UcKWW6SopT1c9KpqufhGXykX RIPjsg6EoStOE0dS5B3cRN5r8hxCHBgsXz19 X-Google-Smtp-Source: ABdhPJz4ZfwgouhtxIK/BnNgE7FDZWfoOdKVDHRUBK1TyhDnvypAfropJjHPmisKB6yBJj5gTGfUAA== X-Received: by 2002:a92:6a06:: with SMTP id f6mr8333202ilc.16.1631542442017; Mon, 13 Sep 2021 07:14:02 -0700 (PDT) Received: from murgatroyd.Home (97-122-72-212.hlrn.qwest.net. [97.122.72.212]) by smtp.gmail.com with ESMTPSA id x8sm4851724ilc.40.2021.09.13.07.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:14:01 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Fix no-Python build Date: Mon, 13 Sep 2021 08:13:58 -0600 Message-Id: <20210913141358.1275064-1-tromey@adacore.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 14:14:03 -0000 A build without Python will currently fail, because selftests::test_python uses gdb_python_initialized, which is only conditionally defined. This patch fixes the build by making test_python also be conditionally defined. I chose this approach because the selftest will fail if Python is not enabled, so it didn't seem useful to leave it defined. --- gdb/python/python.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/python/python.c b/gdb/python/python.c index 5918bb414a3..37eacefd8fc 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1878,8 +1878,6 @@ do_start_initialization () return true; } -#endif /* HAVE_PYTHON */ - #if GDB_SELF_TEST namespace selftests { @@ -1921,6 +1919,8 @@ test_python () } // namespace selftests #endif /* GDB_SELF_TEST */ +#endif /* HAVE_PYTHON */ + /* See python.h. */ cmd_list_element *python_cmd_element = nullptr; @@ -2020,9 +2020,11 @@ python executable."), &user_set_python_list, &user_show_python_list); +#ifdef HAVE_PYTHON #if GDB_SELF_TEST selftests::register_test ("python", selftests::test_python); #endif /* GDB_SELF_TEST */ +#endif /* HAVE_PYTHON */ } #ifdef HAVE_PYTHON -- 2.31.1