s3:libads: add ads_connect_creds() helper
[Samba.git] / source3 / script / mksyms.sh
blob9a0868510e6ba3be29e88472755a208741f39e91
1 #! /bin/sh
4 # mksyms.sh
6 # Extract symbols to export from C-header files.
7 # output in version-script format for linking shared libraries.
9 # This is the shell wrapper for the mksyms.awk core script.
11 # Copyright (C) 2008 Michael Adam <obnox@samba.org>
14 LANG=C
15 export LANG
16 LC_ALL=C
17 export LC_ALL
18 LC_COLLATE=C
19 export LC_COLLATE
21 if [ $# -lt 2 ]; then
22 echo "Usage: $0 awk output_file header_files"
23 exit 1
26 awk="$1"
27 shift
29 symsfile="$1"
30 shift
31 symsfile_tmp="$symsfile.$$.tmp~"
33 proto_src="$(echo "$@" | tr ' ' '\n' | sort | uniq)"
35 echo creating $symsfile
37 mkdir -p $(dirname $symsfile)
39 ${awk} -f $(dirname $0)/mksyms.awk $proto_src >$symsfile_tmp
41 if cmp -s $symsfile $symsfile_tmp 2>/dev/null; then
42 echo "$symsfile unchanged"
43 rm $symsfile_tmp
44 else
45 mv $symsfile_tmp $symsfile