From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 0368C3858D1E for ; Wed, 30 Nov 2022 17:59:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0368C3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52f.google.com with SMTP id e13so25116141edj.7 for ; Wed, 30 Nov 2022 09:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qXUcr0Y9aZMuqPYgcRgyE+S1OnRJYytwUdLv6K/rpdA=; b=m5MGBf4Os1fey908PxYGWRPUF2obQ+hy12qFSzzBEqI08hy5ST9OsGWrinH4BVAiJY GB5ZNWBOzGqfDakNitRK/Fi1vylLRZHeH42FAr8AhA+jUN0Sr6C0XydsZybHdH/Dn8/U N7JprZJgmrnwxypr4bK8ZDK10TdkNUJUsBmXBiQf7z45Bq6b26cUnBJIptrDxWfZHyo9 3m1QX0XC32Uh1as5FQkGBzyV6hktTu374BG2ObCbSsAN7NY12Lcmk2W9NVvM++jqKnR0 PPiHXHJQMle8Q8mPJm1INyLly2YxyHeZbu3oOCiI8iz0amNIOK9AYaDLLk/K+3CGZM3z sB6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qXUcr0Y9aZMuqPYgcRgyE+S1OnRJYytwUdLv6K/rpdA=; b=j1G2si0Vg9SLN83iQygOvGMHD/6ZP+ztr7LmiQeR281vrn+Q3L+nUs/KzCQ1AqCu0U H0yrlMdAcPTNYaTsqiP7bMhC4NyQloC6hTGxfOUgOFcQtzSWXT0/HQ6ZusaULCff0Cmb guS1gRugwxw7fwjSmxKNWG9l16nm6jOJkD+Ax2h+abSun7/hjOyDbzYwbuQkwb7UK84U Mi+8s6tAjYc9t6o4DEu1O2d6wQz7hJfTJPZfamYdIUMquP58UC6KqyA7XBb2CKyKyFuA cFIwGj3CZBVBcx2UaWXh967SQllPVzNIQUhSHVheQtHoV6yedViHI7AOCOzm6m4Pk4Wv 3aXg== X-Gm-Message-State: ANoB5pk1oqpb+oH4LQgcbTX0QXVuJosaqZTRFDa+MdRDD3ANHRJ7wSCL +DD8233TGCnj5OXSPUnVC9ze0v+GpdqgQysAwPI= X-Google-Smtp-Source: AA0mqf7NRyhi4DfHQ4rbJWrHiCXJnw46MJIRAf6Ui+oKxmQnq7cF9Kyf5g88lWPQ8Wy5kVHX0x3hTKHhTw13Dw8Xlmk= X-Received: by 2002:a05:6402:24a1:b0:463:e963:5149 with SMTP id q33-20020a05640224a100b00463e9635149mr56471984eda.219.1669831144568; Wed, 30 Nov 2022 09:59:04 -0800 (PST) MIME-Version: 1.0 References: <20221129100804.c5b3e5bc669ff92f2100c3a3@schemamania.org> In-Reply-To: From: Jonathan Wakely Date: Wed, 30 Nov 2022 17:58:53 +0000 Message-ID: Subject: Re: access to include path in front end To: "James K. Lowden" Cc: gcc@gcc.gnu.org, Michael Matz Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 30 Nov 2022 at 15:59, Michael Matz wrote: > If you're looking at the C frontends for inspiration, then: > > c-family/c.opt defines which options are recognized and several specifics > about them, e.g. for -I it has: > > ---- > I > C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) > -I Add to the end of the main include path. > ---- > > (look at some other examples therein, also in common.opt to get a feel). There is also https://gcc.gnu.org/onlinedocs/gccint/Options.html describing these files. > If you're also using the model of a compiler driver (i.e. the gcc program, > source in gcc.cc) that actually calls compiler (cc1), assembler and > linker, then you also need to arrange for that program to pass all -I > options to the compiler proper. That is done with the spec language, by > somewhere having '{I*}' in the specs for invoking the cobol compiler. > E.g. look in gcc.cc for '@c' (matching the file extension) how that entry > uses '%(cpp_unique_options)', and how cpp_unique_options is defined for > the specs language: > > INIT_STATIC_SPEC ("cpp_unique_options", &cpp_unique_options), > > and > > static const char *cpp_unique_options = > "%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %@{I*&F*} %{P} %I\ > > (the specs language used here is documented in a lengthy comment early in > gcc.cc, "The Specs Language") Also documented at https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html