2 # -*- coding: utf-8 -*-
4 # nacl_build.sh -- NaCl library build script
6 # Copyright (C) 2011 Daniel Borkmann <borkmann@redhat.com>
7 # Copyright (C) 2009-2011 Emmanuel Roullit <emmanuel@netsniff-ng.org>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2 as
11 # published by the Free Software Foundation.
15 nacl_version
="nacl-20110221"
17 nacl_base_url
="http://hyperelliptic.org/nacl"
18 nacl_path
="$nacl_dir/$nacl_version.$nacl_suffix"
21 if test -z "$nacl_build_dir"; then
22 echo "Please input the path where NaCl should be build"
26 if ! test -d "$nacl_build_dir"; then
27 mkdir
"$nacl_build_dir"
30 wget
-O "$nacl_path" "$nacl_base_url/$nacl_version.$nacl_suffix"
31 tar xjf
"$nacl_path" -C "$nacl_build_dir"
33 $cc -Wall -O2 .
/abiname.c
-o .
/abiname
35 shorthostname
=$
(hostname |
sed 's/\..*//' |
tr -cd '[a-z][A-Z][0-9]')
37 echo "Building NaCl for arch $arch on host $shorthostname (grab a coffee, this takes a while) ..."
39 cd "$nacl_build_dir"/"$nacl_version"
43 nacl_lib_path
="$nacl_build_dir/$nacl_version/build/$shorthostname/lib/$arch"
44 nacl_include_path
="$nacl_build_dir/$nacl_version/build/$shorthostname/include/$arch"
46 echo "NaCl lib path $nacl_lib_path"
47 echo "NaCl include path $nacl_include_path"
49 .
/nacl_path.sh
"$nacl_include_path" "$nacl_lib_path"