xref: /aosp_15_r20/external/executorch/third-party/link_python.sh (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1*523fa7a6SAndroid Build Coastguard Worker#!/bin/bash
2*523fa7a6SAndroid Build Coastguard Worker# Copyright (c) Meta Platforms, Inc. and affiliates.
3*523fa7a6SAndroid Build Coastguard Worker# All rights reserved.
4*523fa7a6SAndroid Build Coastguard Worker#
5*523fa7a6SAndroid Build Coastguard Worker# This source code is licensed under the BSD-style license found in the
6*523fa7a6SAndroid Build Coastguard Worker# LICENSE file in the root directory of this source tree.
7*523fa7a6SAndroid Build Coastguard Worker
8*523fa7a6SAndroid Build Coastguard Worker# Links the path of python3 include directory to the first argument (for
9*523fa7a6SAndroid Build Coastguard Worker# example, a buck2 out directory).
10*523fa7a6SAndroid Build Coastguard Worker
11*523fa7a6SAndroid Build Coastguard Workerset -e
12*523fa7a6SAndroid Build Coastguard Worker
13*523fa7a6SAndroid Build Coastguard Worker# "-I/path/to/include -I/path/to/include" -> "/path/to/include"
14*523fa7a6SAndroid Build Coastguard WorkerINCLUDE=$(python3-config --includes | cut -d' ' -f1 | sed -r 's/^.{2}//')
15*523fa7a6SAndroid Build Coastguard Worker
16*523fa7a6SAndroid Build Coastguard Workerln -s "$INCLUDE" "$1"/include
17