#! /bin/sh # defaults cc=cc cross_prefix= shared= prefix=/usr/local exec_prefix='${prefix}' bindir='${exec_prefix}/bin' libdir='${exec_prefix}/lib' includedir='${prefix}/include' for opt in "$@"; do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case "$opt" in --cross-prefix=*) cross_prefix="$optarg" ;; --enable-shared) shared=yes ;; --disable-shared) shared=no ;; --prefix=*) prefix="$optarg" ;; --exec-prefix=*) exec_prefix="$optarg" ;; --libdir=*) libdir="$optarg" ;; --includedir=*) includedir="$optarg" ;; --libexecdir=*|\ --mandir=*|\ --datadir=*|\ --docdir=*|\ --sysconfdir=*|\ --localstatedir=*|\ --sbindir=*|\ --sharedstatedir=*|\ --oldincludedir=*|\ --datarootdir=*|\ --infodir=*|\ --localedir=*|\ --htmldir=*|\ --dvidir=*|\ --pdfdir=*|\ --psdir=*) ;; # These autoconf switches are silently ignored --help) cat <&2; exit 1 ;; esac done # Preferred compiler if [ -z "${CC}${cross_prefix}" ]; then CC="$cc" else : ${CC:-${cross_prefix}gcc} fi : ${LD:='${CC}'} : ${LIBTOOL:=${cross_prefix}libtool} : ${PKG_CONFIG:=${cross_prefix}pkg-config} cleanup() { rm -f conftest.* libconftest.la } cleanup rm -f config.log exec 3>config.log error() { echo "E: $*" >&2 echo "E: $*" >&3 cleanup exit 1 } warning() { echo "W: $*" >&2 echo "W: $*" >&3 } has() { type "$1" >/dev/null 2>&1 } pkg_config() { # Run pkg-config, capturing its output to the log echo "== running: $PKG_CONFIG $@" >&3 $PKG_CONFIG "$@" >&3 2>&1 } if ! has $PKG_CONFIG ; then error "pkg-config binary $PKG_CONFIG not found" fi glib=glib-2.0 min_glib_ver=2.22 if ! pkg_config --atleast-version=$min_glib_ver $glib ; then error "required glib-$min_glib_ver not found" fi GLIB_CFLAGS=`$PKG_CONFIG --cflags $glib` GLIB_LIBS=`$PKG_CONFIG --libs $glib` # check for smartcard support if ! pkg_config --atleast-version=3.12.8 nss ; then error "NSS package not found" fi NSS_CFLAGS=`$PKG_CONFIG --cflags nss` NSS_LIBS=`$PKG_CONFIG --libs nss` do_libtool() { tmp=$1; shift # Run the compiler under libtool, capturing its output to the log. echo "$LIBTOOL $tmp --tag=CC $CC $@" >&3 $LIBTOOL $tmp --tag=CC $CC "$@" >&3 2>&1 } if [ "$shared" = no ]; then LIBTOOL= else cat > conftest.c <Makefile.tmp - Makefile.in <