#!/bin/sh

prefix="/usr"
exec_prefix="/usr"
VERSION="1.8.3"
CFLAGS="-DOPENSSL_API_COMPAT=10100 -O2  -g -grecord-gcc-switches -pipe -fstack-protector-strong -fgcc-compatible -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/generic-hardened-clang.cfg -fasynchronous-unwind-tables -fstack-clash-protection -fPIC"
CPPFLAGS=" "
LDFLAGS=" -Wl,-z,now -pie "
PYTHON_CPPFLAGS="-I/usr/include/python3.11"
PYTHON_LDFLAGS="@PYTHON_LDFLAGS@"
LIBS=" -lssl  -lcrypto"
LIBDIR="/usr/lib64"
INCLUDEDIR="/usr/include"
LIBVERSION="8:0:5"


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