#!/bin/bash # This isn't a configure generated by autoconf! MISSING_PKG_CONFIG=0 MISSING_DEFS=0 MISSING_NACL=0 [ -z $CC ] && CC=cc TMPDIR=$(mktemp -d config.XXXXXX) trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM check_pkg_config() { echo -n "[*] Checking pkg-config ... " if [ "x$(which pkg-config)" == "x" ] ; then echo "[NO]" MISSING_PKG_CONFIG=1 else echo "[YES]" fi } check_ccache() { echo -n "[*] Checking ccache ... " if [ "x$(which ccache)" == "x" ] ; then echo "[NO]" echo "CONFIG_CCACHE=" >> Config else echo "[YES]" echo "CONFIG_CCACHE=ccache" >> Config fi } check_nacl() { echo -n "[*] Checking nacl ... " cat > $TMPDIR/nacltest.c << EOF #include "crypto_hash_sha512.h" #include "crypto_verify_32.h" #include "crypto_hash_sha512.h" #include "crypto_box_curve25519xsalsa20poly1305.h" #include "crypto_scalarmult_curve25519.h" #include "crypto_auth_hmacsha512256.h" int main(void) { } EOF if [ -z $NACL_INC_DIR ] ; then NACL_INC_DIR="/usr/include/nacl" fi if [ -z $NACL_LIB_DIR ] ; then NACL_LIB_DIR="/usr/lib" fi LDFLAGS="-L $NACL_LIB_DIR" CFLAGS="-I $NACL_INC_DIR" $CC $CFLAGS $LDFLAGS -o $TMPDIR/nacltest $TMPDIR/nacltest.c >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/nacltest ] ; then echo "[NO]" MISSING_NACL=1 else echo "[YES]" echo "CONFIG_NACL_INC_DIR:=$NACL_INC_DIR" >> Config echo "CONFIG_NACL_LIB_DIR:=$NACL_LIB_DIR" >> Config fi } check_libnl() { echo -n "[*] Checking libnl ... " cat > $TMPDIR/libnltest.c << EOF #include #include #include #include #include #include #if LIBNL_VER_NUM < LIBNL_VER(3,0) # error incompatible libnl version #endif void main(void) { struct nl_sock *sock = nl_socket_alloc(); struct nl_cache *nl_cache; int ret = genl_connect(sock); ret = genl_ctrl_alloc_cache(sock, &nl_cache); } EOF $CC \ $(pkg-config --cflags libnl-3.0) \ $(pkg-config --cflags libnl-genl-3.0) \ -o $TMPDIR/libnltest \ $TMPDIR/libnltest.c \ $(pkg-config --libs libnl-3.0) \ $(pkg-config --libs libnl-genl-3.0) \ >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/libnltest ] ; then echo "[NO]" MISSING_DEFS=1 else echo "[YES]" fi } check_tpacket() { echo -n "[*] Checking tpacket ... " cat > $TMPDIR/tpackettest.c << EOF #include #include struct tpacket3_hdr *hdr; void main(void) { printf("%d\n", hdr->tp_status); } EOF $CC -o $TMPDIR/tpackettest $TMPDIR/tpackettest.c >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/tpackettest ] ; then echo "[NO]" MISSING_DEFS=1 else echo "[YES]" fi } check_ncurses() { echo -n "[*] Checking ncurses ... " cat > $TMPDIR/ncursestest.c << EOF #include void main(void) { WINDOW *screen = initscr(); } EOF $CC \ $(pkg-config --cflags ncurses) \ -o $TMPDIR/ncursestest $TMPDIR/ncursestest.c \ $(pkg-config --libs ncurses) \ >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/ncursestest ] ; then echo "[NO]" MISSING_DEFS=1 else echo "[YES]" fi } check_libgeoip() { echo -n "[*] Checking libGeoIP ... " cat > $TMPDIR/geoiptest.c << EOF #include #include void main(void) { GeoIP *geoip; int dbs[] = { GEOIP_CITY_EDITION_REV1, GEOIP_CITY_EDITION_REV1_V6, GEOIP_COUNTRY_EDITION, GEOIP_COUNTRY_EDITION_V6, GEOIP_ASNUM_EDITION, GEOIP_ASNUM_EDITION_V6, }; geoip = GeoIP_new(0); } EOF $CC -o $TMPDIR/geoiptest $TMPDIR/geoiptest.c -lGeoIP >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/geoiptest ] ; then echo "[NO]" MISSING_DEFS=1 else echo "[YES]" fi } check_libnf_ct() { echo -n "[*] Checking libnetfilter-conntrack ... " cat > $TMPDIR/nfcttest.c << EOF #include #include #include #include void main(void) { struct nf_conntrack *ct; const uint32_t id = nfct_get_attr_u32(ct, ATTR_ID); } EOF $CC -o $TMPDIR/nfcttest $TMPDIR/nfcttest.c -lnetfilter_conntrack >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/nfcttest ] ; then echo "[NO]" MISSING_DEFS=1 else echo "[YES]" fi } check_zlib() { echo -n "[*] Checking libz ... " cat > $TMPDIR/ztest.c << EOF #include "zlib.h" void main(void) { gzFile fp; fp = gzopen("foo.gz", "rb"); } EOF $CC -o $TMPDIR/ztest $TMPDIR/ztest.c -lz >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/ztest ] ; then echo "[NO]" MISSING_DEFS=1 else echo "[YES]" fi } check_urcu() { echo -n "[*] Checking liburcu ... " cat > $TMPDIR/urcutest.c << EOF #include void main(void) { rcu_init(); synchronize_rcu(); } EOF $CC -o $TMPDIR/urcutest $TMPDIR/urcutest.c -lurcu >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/urcutest ] ; then echo "[NO]" MISSING_DEFS=1 else echo "[YES]" fi } echo "# This file is autogenerated by the configure script" > Config check_pkg_config if [ "$MISSING_PKG_CONFIG" == "1" ] ; then echo "[!] pkg-config is not installed on your system or not in the PATH" exit 1 fi check_ccache check_nacl check_libnl check_tpacket check_libnf_ct check_ncurses check_libgeoip check_zlib check_urcu if [ "$MISSING_DEFS" == "1" ] ; then echo "[!] Some libraries or header definitions are missing or too old." echo " Please refer to the INSTALL file for the libraries needed to" echo " build netsniff-ng." exit 1 fi if [ "$MISSING_NACL" == "1" ] ; then echo "[!] The NaCl crypto library is currently not present on your" echo " system or could not be found. Either install it from your" echo " distro or build it manually using 'make nacl' and make sure" echo " that the NACL_INC_DIR and NACL_LIB_DIR variables are set" echo " appropriately." exit 1 fi echo "CONFIG_OK=1" >> Config exit 0 iv>
Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/Kconfig')