#!/bin/sh

prefix="/usr"
exec_prefix="/usr"
VERSION="1.7.0"
CFLAGS="-Wunused-function -Wstrict-prototypes -Wwrite-strings -W -Wall -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16  -mfloat-abi=hard -fPIC"
CPPFLAGS="  -I/usr/include/python2.7"
LDFLAGS="  -L/usr/lib -lpython2.7"
LIBS="  -lcrypto -lssl"
LIBDIR="/usr/lib"
INCLUDEDIR="/usr/include"
LIBVERSION="2:0:0"
ARCH="`uname -m`"

case $ARCH in
       x86_64 | amd64 | sparc64 | s390x | ppc64)

               LIBDIR="/usr/lib64"
               LIBDIR_SEC="/usr/lib"
               ;;
       * )
               LIBDIR="/usr/lib"
               LIBDIR_SEC="/usr/lib64"
               ;;
esac

LDFLAGS="  -L$LIBDIR -lpython2.7"
LDFLAGS_SEC="  -L$LIBDIR_SEC -lpython2.7"

for arg in $@
do
    if [ $arg = "--cflags" ]
    then
        echo "-I${INCLUDEDIR}"
    fi
    if [ $arg = "--libs" ]
    then
        echo "${LDFLAGS} -L${LIBDIR} ${LIBS} -lldns"
    fi
    if [ $arg = "--libs_sec" ]
    then
        echo "${LDFLAGS_SEC} -L${LIBDIR_SEC} ${LIBS} -lldns"
    fi
    if [ $arg = "-h" ] || [ $arg = "--help" ]
    then
        echo "Usage: $0 [--cflags] [--libs] [--libs_sec] [--version]"
    fi
    if [ $arg = "--version" ]
    then
        echo "${VERSION}"
    fi
    if [ $arg = "--libversion" ]
    then
        echo "${LIBVERSION}"
    fi
done
