#!/bin/sh

. config/options $1

# link against librt because of undefined reference to 'clock_gettime'
  LDFLAGS="$LDFLAGS -lrt -lrtmp"

cd $PKG_BUILD
./configure --host=$TARGET_NAME \
            --build=$HOST_NAME \
            --prefix=/usr \
            --disable-static \
            --enable-shared \
            --disable-debug \
            --enable-optimize \
            --enable-warnings \
            --disable-curldebug \
            --disable-ares \
            --enable-largefile \
            --enable-http \
            --enable-ftp \
            --enable-file \
            --disable-ldap \
            --disable-ldaps \
            --disable-rtsp \
            --enable-proxy \
            --disable-dict \
            --enable-telnet \
            --enable-tftp \
            --disable-pop3 \
            --disable-imap \
            --disable-smtp \
            --disable-gophper \
            --disable-manual \
            --enable-libgcc \
            --disable-ipv6 \
            --enable-nonblocking \
            --enable-threaded-resolver \
            --enable-verbose \
            --disable-sspi \
            --enable-crypto-auth \
            --enable-cookies \
            --enable-hidden-symbols \
            --disable-soname-bump \
            --with-gnu-ld \
            --without-krb4 \
            --without-spnego \
            --without-gssapi \
            --with-ssl \
            --with-zlib \
            --without-egd-socket \
            --enable-thread \
            --with-random=/dev/urandom \
            --without-gnutls \
            --without-polarssl \
            --without-nss \
            --with-ca-bundle="/etc/ssl/certs/ca-bundle.crt" \
            --without-ca-path \
            --without-libssh2 \
            --with-librtmp="$SYSROOT_PREFIX/usr" \
            --without-libidn \

make

$MAKEINSTALL
