source: branches/samba-3.5.x/lib/talloc/script/mksyms.sh

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 1017 bytes
Line 
1#! /bin/sh
2
3#
4# mksyms.sh
5#
6# Extract symbols to export from C-header files.
7# output in version-script format for linking shared libraries.
8#
9# This is the shell wrapper for the mksyms.awk core script.
10#
11# Copyright (C) 2008 Micheal Adam <obnox@samba.org>
12#
13
14LANG=C; export LANG
15LC_ALL=C; export LC_ALL
16LC_COLLATE=C; export LC_COLLATE
17
18if [ $# -lt 2 ]
19then
20 echo "Usage: $0 awk output_file header_files"
21 exit 1
22fi
23
24awk="$1"
25shift
26
27symsfile="$1"
28shift
29symsfile_tmp="$symsfile.$$.tmp~"
30
31proto_src="`echo $@ | tr ' ' '\n' | sort | uniq `"
32
33echo creating $symsfile
34
35mkdir -p `dirname $symsfile`
36
37#Write header
38cat > $symsfile_tmp << EOF
39# This file is autogenerated, please DO NOT EDIT
40{
41 global:
42EOF
43
44#loop on each header
45for i in $proto_src; do
46${awk} -f `dirname $0`/mksyms.awk $i | sort >> $symsfile_tmp
47done;
48
49#Write tail
50cat >> $symsfile_tmp << EOF
51
52 local: *;
53};
54EOF
55
56if cmp -s $symsfile $symsfile_tmp 2>/dev/null
57then
58 echo "$symsfile unchanged"
59 rm $symsfile_tmp
60else
61 mv $symsfile_tmp $symsfile
62fi
Note: See TracBrowser for help on using the repository browser.