#!/bin/sh usage() { echo "Use environment variables to pass values: CC - compiler (default: cc) CFLAGS - flags for compiler LDFLAGS - flags for linker DESTDIR - path to make install (default: /usr/local) NOSOCK - set to cut part of libhttpc that works with sockets" exit 1 } while test $# -gt 0; do case "$1" in -h) usage ;; --help) usage ;; esac shift done CC=${CC:-cc} CFLAGS=${CFLAGS:-} LDFLAGS=${LDFLAGS:-} DESTDIR=${DESTDIR:-/usr/local} echo "Configuration: Compiler: $CC CFLAGS: $CFLAGS LDFLAGS: $LDFLAGS DESTDIR: $DESTDIR" if [ -z "${NOSOCK+x}" ]; then echo " Will be built with sockets" else echo " Will be built without sockets" fi echo " CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS DESTDIR=$DESTDIR " > config.mk echo "#ifndef __LIBHTTPC_CONFIG_H__ #define __LIBHTTPC_CONFIG_H__ " > include/config.h if [ -z "${NOSOCK+x}" ]; then echo "#define LibHTTPC_SOCK" >> include/config.h fi echo " #endif" >> include/config.h