Liam McLoughlin | 4f268f4 | 2013-03-04 18:09:53 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | OUT=$1 |
| 10 | shift |
| 11 | for v; do |
Alex Vakulenko | 02a06c4 | 2014-08-26 09:56:46 -0700 | [diff] [blame] | 12 | # Extract all the libchromeos sublibs from 'dependencies' section of |
| 13 | # 'libchromeos-<(libbase_ver)' target in libchromeos.gypi and convert them |
| 14 | # into an array of "-lchromeos-<sublib>-<v>" flags. |
| 15 | sublibs=($(sed -n " |
| 16 | /'target_name': 'libchromeos-<(libbase_ver)'/,/target_name/ { |
| 17 | /dependencies/,/],/ { |
| 18 | /libchromeos/ { |
| 19 | s:[',]::g |
| 20 | s:<(libbase_ver):${v}:g |
| 21 | s:libchromeos:-lchromeos: |
| 22 | p |
| 23 | } |
| 24 | } |
| 25 | }" libchromeos.gypi)) |
| 26 | |
| 27 | echo "GROUP ( AS_NEEDED ( ${sublibs[@]} ) )" > "${OUT}"/lib/libchromeos-${v}.so |
Liam McLoughlin | 4f268f4 | 2013-03-04 18:09:53 -0500 | [diff] [blame] | 28 | |
| 29 | deps=$(<"${OUT}"/gen/libchromeos-${v}-deps.txt) |
| 30 | pc="${OUT}"/lib/libchromeos-${v}.pc |
| 31 | |
| 32 | sed \ |
| 33 | -e "s/@BSLOT@/${v}/g" \ |
| 34 | -e "s/@PRIVATE_PC@/${deps}/g" \ |
| 35 | "libchromeos.pc.in" > "${pc}" |
Alex Vakulenko | f788c95 | 2014-08-20 17:35:12 -0700 | [diff] [blame] | 36 | |
| 37 | deps_test=$(<"${OUT}"/gen/libchromeos-test-${v}-deps.txt) |
| 38 | sed \ |
| 39 | -e "s/@BSLOT@/${v}/g" \ |
| 40 | -e "s/@PRIVATE_PC@/${deps}/g" \ |
| 41 | "libchromeos-test.pc.in" > "${OUT}/lib/libchromeos-test-${v}.pc" |
Liam McLoughlin | 4f268f4 | 2013-03-04 18:09:53 -0500 | [diff] [blame] | 42 | done |