X-Git-Url: https://develop.uap-core.de/gitweb/mizunara.git/blobdiff_plain/ff25b54c9f837ace420a178541b136fa4b0b1eee..HEAD:/configure diff --git a/configure b/configure index 44f8e8a..6f2b13a 100755 --- a/configure +++ b/configure @@ -20,21 +20,21 @@ OS=`uname -s` OS_VERSION=`uname -r` TEMP_DIR=".tmp-`uname -n`" -mkdir -p $TEMP_DIR +mkdir -p "$TEMP_DIR" if [ $? -ne 0 ]; then - echo "Cannot create tmp dir" - echo "Abort" + echo "Cannot create tmp dir" + echo "Abort" fi -touch $TEMP_DIR/options -touch $TEMP_DIR/features +touch "$TEMP_DIR/options" +touch "$TEMP_DIR/features" # features # help text printhelp() { - echo "Usage: $0 [OPTIONS]..." - cat << __EOF__ + echo "Usage: $0 [OPTIONS]..." + cat << __EOF__ Installation directories: --prefix=PREFIX path prefix for architecture-independent files [/usr] @@ -61,63 +61,63 @@ __EOF__ } # -# parse arguments +# parse arguments # -for ARG in $@ +for ARG in "$@" do case "$ARG" in - "--prefix="*) PREFIX=${ARG#--prefix=} ;; - "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; - "--bindir="*) BINDIR=${ARG#----bindir=} ;; - "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; - "--libdir="*) LIBDIR=${ARG#--libdir=} ;; - "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; - "--datadir="*) DATADIR=${ARG#--datadir=} ;; - "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; - "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; - "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; - "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; - "--infodir="*) INFODIR=${ARG#--infodir=} ;; - "--mandir"*) MANDIR=${ARG#--mandir} ;; - "--help"*) printhelp; exit 1 ;; - "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;; - "-"*) echo "unknown option: $ARG"; exit 1 ;; - esac + "--prefix="*) PREFIX=${ARG#--prefix=} ;; + "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; + "--bindir="*) BINDIR=${ARG#----bindir=} ;; + "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; + "--libdir="*) LIBDIR=${ARG#--libdir=} ;; + "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; + "--datadir="*) DATADIR=${ARG#--datadir=} ;; + "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; + "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; + "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; + "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; + "--infodir="*) INFODIR=${ARG#--infodir=} ;; + "--mandir"*) MANDIR=${ARG#--mandir} ;; + "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;; + "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;; + "-"*) echo "unknown option: $ARG"; rm -Rf "$TEMP_DIR"; exit 1 ;; + esac done # set dir variables if [ -z "$BINDIR" ]; then - BINDIR=$EPREFIX/bin + BINDIR=$EPREFIX/bin fi if [ -z "$SBINDIR" ]; then - SBINDIR=$EPREFIX/sbin + SBINDIR=$EPREFIX/sbin fi if [ -z "$LIBDIR" ]; then - LIBDIR=$EPREFIX/lib + LIBDIR=$EPREFIX/lib fi if [ -z "$LIBEXEC" ]; then - LIBEXECDIR=$EPREFIX/libexec + LIBEXECDIR=$EPREFIX/libexec fi if [ -z "$DATADIR" ]; then - DATADIR=$PREFIX/share + DATADIR=$PREFIX/share fi if [ -z "$SYSCONFDIR" ]; then - SYSCONFDIR=$PREFIX/etc + SYSCONFDIR=$PREFIX/etc fi if [ -z "$SHAREDSTATEDIR" ]; then - SHAREDSTATEDIR=$PREFIX/com + SHAREDSTATEDIR=$PREFIX/com fi if [ -z "$LOCALSTATEDIR" ]; then - LOCALSTATEDIR=$PREFIX/var + LOCALSTATEDIR=$PREFIX/var fi if [ -z "$INCLUDEDIR" ]; then - INCLUDEDIR=$PREFIX/include + INCLUDEDIR=$PREFIX/include fi if [ -z "$INFODIR" ]; then - INFODIR=$PREFIX/info + INFODIR=$PREFIX/info fi if [ -z "$MANDIR" ]; then - MANDIR=$PREFIX/man + MANDIR=$PREFIX/man fi which pkg-config > /dev/null @@ -130,19 +130,19 @@ fi # Simple uname based platform detection # $PLATFORM is used for platform dependent dependency selection printf "detect platform... " -if [ $OS = SunOS ]; then +if [ "$OS" = "SunOS" ]; then PLATFORM="solaris sunos unix svr4" fi -if [ $OS = Linux ]; then +if [ "$OS" = "Linux" ]; then PLATFORM="linux unix" fi -if [ $OS = FreeBSD ]; then +if [ "$OS" = "FreeBSD" ]; then PLATFORM="freebsd bsd unix" fi -if [ $OS = Darwin ]; then +if [ "$OS" = "Darwin" ]; then PLATFORM="macos osx bsd unix" fi -echo $OS | grep "MINGW" > /dev/null +echo "$OS" | grep -i "MINGW" > /dev/null if [ $? -eq 0 ]; then PLATFORM="windows mingw" fi @@ -153,8 +153,8 @@ fi for p in $PLATFORM do - PLATFORM_NAME=$p - break + PLATFORM_NAME=$p + break done echo $PLATFORM_NAME @@ -162,7 +162,7 @@ isplatform() { for p in $PLATFORM do - if [ $p = $1 ]; then + if [ "$p" = "$1" ]; then return 0 fi done @@ -172,7 +172,7 @@ isnotplatform() { for p in $PLATFORM do - if [ $p = $1 ]; then + if [ "$p" = "$1" ]; then return 1 fi done @@ -180,7 +180,7 @@ isnotplatform() } # generate config.mk and config.h -cat > $TEMP_DIR/config.mk << __EOF__ +cat > "$TEMP_DIR/config.mk" << __EOF__ # # config.mk generated by configure # @@ -204,7 +204,7 @@ MANDIR=$MANDIR __EOF__ -echo > $TEMP_DIR/make.mk +echo > "$TEMP_DIR/make.mk" ENV_CFLAGS=$CFLAGS ENV_LDFLAGS=$LDFLAGS @@ -215,15 +215,15 @@ ENV_CXXFLAGS=$CXXFLAGS . make/toolchain.sh # add user specified flags to config.mk -echo >> $TEMP_DIR/config.mk -if [ ! -z "${ENV_CFLAGS}" ]; then - echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk +echo "# project specific flags" >> "$TEMP_DIR/config.mk" +if [ -n "${ENV_CFLAGS}" ]; then + echo "CFLAGS += $ENV_CFLAGS" >> "$TEMP_DIR/config.mk" fi -if [ ! -z "${ENV_CXXFLAGS}" ]; then - echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk +if [ -n "${ENV_CXXFLAGS}" ]; then + echo "CXXFLAGS += $ENV_CXXFLAGS" >> "$TEMP_DIR/config.mk" fi -if [ ! -z "${ENV_LDFLAGS}" ]; then - echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk +if [ -n "${ENV_LDFLAGS}" ]; then + echo "LDFLAGS += $ENV_LDFLAGS" >> "$TEMP_DIR/config.mk" fi # @@ -236,102 +236,102 @@ dependency_curl() # dependency curl platform="windows" while true do - if isnotplatform "windows"; then + if isnotplatform "windows"; then break fi - CFLAGS="$CFLAGS -I/mingw/include" - LDFLAGS="$LDFLAGS -lcurl" - echo yes + TEMP_CFLAGS="$TEMP_CFLAGS -I/mingw/include" + TEMP_LDFLAGS="$TEMP_LDFLAGS -lcurl" + echo yes return 0 done - + # dependency curl platform="macos" while true do - if isnotplatform "macos"; then + if isnotplatform "macos"; then break fi curl-config --cflags > /dev/null if [ $? -eq 0 ]; then - CFLAGS="$CFLAGS `curl-config --cflags`" + TEMP_CFLAGS="$TEMP_CFLAGS `curl-config --cflags`" else break fi curl-config --ldflags > /dev/null if [ $? -eq 0 ]; then - LDFLAGS="$LDFLAGS `curl-config --ldflags`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `curl-config --ldflags`" else break fi - echo yes + echo yes return 0 done - - # dependency curl + + # dependency curl while true do if [ -z "$PKG_CONFIG" ]; then - break + break fi - $PKG_CONFIG libcurl + $PKG_CONFIG libcurl if [ $? -ne 0 ] ; then break fi - CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libcurl`" - LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libcurl`" - echo yes + TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libcurl`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libcurl`" + echo yes return 0 done - - # dependency curl + + # dependency curl while true do + which curl-config > /dev/null + if [ $? -ne 0 ]; then + break + fi curl-config --cflags > /dev/null if [ $? -eq 0 ]; then - CFLAGS="$CFLAGS `curl-config --cflags`" + TEMP_CFLAGS="$TEMP_CFLAGS `curl-config --cflags`" else break fi curl-config --ldflags > /dev/null if [ $? -eq 0 ]; then - LDFLAGS="$LDFLAGS `curl-config --ldflags`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `curl-config --ldflags`" else break fi - which curl-config > /dev/null - if [ $? -ne 0 ]; then - break - fi - echo yes + echo yes return 0 done - - echo no - return 1 + + echo no + return 1 } dependency_gtk3() { printf "checking for gtk3... " - # dependency gtk3 + # dependency gtk3 while true do if [ -z "$PKG_CONFIG" ]; then - break + break fi - $PKG_CONFIG gtk+-3.0 + $PKG_CONFIG gtk+-3.0 if [ $? -ne 0 ] ; then break fi - CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtk+-3.0`" - LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs gtk+-3.0`" - CFLAGS="$CFLAGS -DUI_GTK3" - LDFLAGS="$LDFLAGS -lpthread" - echo yes + TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags gtk+-3.0`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs gtk+-3.0`" + TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK3" + TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" + echo yes return 0 done - - echo no - return 1 + + echo no + return 1 } dependency_openssl() { @@ -339,72 +339,57 @@ dependency_openssl() # dependency openssl platform="windows" while true do - if isnotplatform "windows"; then + if isnotplatform "windows"; then break fi - LDFLAGS="$LDFLAGS -lssl -lcrypto" - echo yes + TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" + echo yes return 0 done - + # dependency openssl platform="macos" while true do - if isnotplatform "macos"; then + if isnotplatform "macos"; then break fi - LDFLAGS="$LDFLAGS -framework CoreFoundation" - echo yes + TEMP_LDFLAGS="$TEMP_LDFLAGS -framework CoreFoundation" + echo yes return 0 done - + # dependency openssl platform="bsd" while true do - if isnotplatform "bsd"; then + if isnotplatform "bsd"; then break fi - if isplatform "macos"; then + if isplatform "macos"; then break fi - LDFLAGS="$LDFLAGS -lssl -lcrypto" - echo yes + TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto" + echo yes return 0 done - - # dependency openssl + + # dependency openssl while true do if [ -z "$PKG_CONFIG" ]; then - break + break fi - $PKG_CONFIG openssl + $PKG_CONFIG openssl if [ $? -ne 0 ] ; then break fi - CFLAGS="$CFLAGS `$PKG_CONFIG --cflags openssl`" - LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs openssl`" - echo yes + TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags openssl`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs openssl`" + echo yes return 0 done - - echo no - return 1 -} -dependency_motif() -{ - printf "checking for motif... " - # dependency motif - while true - do - CFLAGS="$CFLAGS -DUI_MOTIF" - LDFLAGS="$LDFLAGS -lXm -lXt -lX11 -lpthread" - echo yes - return 0 - done - - echo no - return 1 + + echo no + return 1 } dependency_libxml2() { @@ -412,91 +397,106 @@ dependency_libxml2() # dependency libxml2 platform="windows" while true do - if isnotplatform "windows"; then + if isnotplatform "windows"; then break fi xml2-config --cflags > /dev/null if [ $? -eq 0 ]; then - CFLAGS="$CFLAGS `xml2-config --cflags`" + TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`" else break fi xml2-config --libs > /dev/null if [ $? -eq 0 ]; then - LDFLAGS="$LDFLAGS `xml2-config --libs`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `xml2-config --libs`" else break fi - echo yes + echo yes return 0 done - + # dependency libxml2 platform="macos" while true do - if isnotplatform "macos"; then + if isnotplatform "macos"; then break fi xml2-config --cflags > /dev/null if [ $? -eq 0 ]; then - CFLAGS="$CFLAGS `xml2-config --cflags`" + TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`" else break fi xml2-config --libs > /dev/null if [ $? -eq 0 ]; then - LDFLAGS="$LDFLAGS `xml2-config --libs`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `xml2-config --libs`" else break fi - echo yes + echo yes return 0 done - - # dependency libxml2 + + # dependency libxml2 while true do if [ -z "$PKG_CONFIG" ]; then - break + break fi - $PKG_CONFIG libxml-2.0 + $PKG_CONFIG libxml-2.0 if [ $? -ne 0 ] ; then break fi - CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libxml-2.0`" - LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libxml-2.0`" - echo yes + TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libxml-2.0`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libxml-2.0`" + echo yes return 0 done - - # dependency libxml2 + + # dependency libxml2 while true do xml2-config --cflags > /dev/null if [ $? -eq 0 ]; then - CFLAGS="$CFLAGS `xml2-config --cflags`" + TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`" else break fi xml2-config --libs > /dev/null if [ $? -eq 0 ]; then - LDFLAGS="$LDFLAGS `xml2-config --libs`" + TEMP_LDFLAGS="$TEMP_LDFLAGS `xml2-config --libs`" else break fi - echo yes + echo yes + return 0 + done + + echo no + return 1 +} +dependency_motif() +{ + printf "checking for motif... " + # dependency motif + while true + do + TEMP_CFLAGS="$TEMP_CFLAGS -DUI_MOTIF" + TEMP_LDFLAGS="$TEMP_LDFLAGS -lXm -lXt -lX11 -lpthread" + echo yes return 0 done - - echo no - return 1 + + echo no + return 1 } DEPENDENCIES_FAILED= ERROR=0 # general dependencies -CFLAGS= -LDFLAGS= +TEMP_CFLAGS= +TEMP_LDFLAGS= while true do if isnotplatform "unix"; then @@ -507,29 +507,29 @@ do fi while true do - - cat >> $TEMP_DIR/make.mk << __EOF__ + + cat >> "$TEMP_DIR/make.mk" << __EOF__ OBJ_EXT = o LIB_EXT = a PACKAGE_SCRIPT = package_unix.sh __EOF__ - + break done - + break done while true do while true do - - LDFLAGS="$LDFLAGS -lpthread" - + + TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread" + break done - + break done while true @@ -542,26 +542,26 @@ do fi while true do - - CFLAGS="$CFLAGS -I/usr/local/include" - LDFLAGS="$LDFLAGS -L/usr/local/lib" - + + TEMP_CFLAGS="$TEMP_CFLAGS -I/usr/local/include" + TEMP_LDFLAGS="$TEMP_LDFLAGS -L/usr/local/lib" + break done - + break done # add general dependency flags to config.mk -echo >> $TEMP_DIR/config.mk -if [ ! -z "${CFLAGS}" ]; then - echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk +echo >> "$TEMP_DIR/config.mk" +if [ -n "${TEMP_CFLAGS}" ]; then + echo "CFLAGS += $TEMP_CFLAGS" >> $TEMP_DIR/config.mk fi -if [ ! -z "${CXXFLAGS}" ]; then - echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk +if [ -n "${TEMP_CXXFLAGS}" ]; then + echo "CXXFLAGS += $TEMP_CXXFLAGS" >> $TEMP_DIR/config.mk fi -if [ ! -z "${LDFLAGS}" ]; then - echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk +if [ -n "${TEMP_LDFLAGS}" ]; then + echo "LDFLAGS += $TEMP_LDFLAGS" >> $TEMP_DIR/config.mk fi # @@ -569,149 +569,153 @@ fi # checkopt_toolkit_gtk3() { - VERR=0 - dependency_gtk3 - if [ $? -ne 0 ]; then - VERR=1 - fi - if [ $VERR -ne 0 ]; then - return 1 - fi - cat >> $TEMP_DIR/make.mk << __EOF__ + VERR=0 + dependency_gtk3 + if [ $? -ne 0 ]; then + VERR=1 + fi + if [ $VERR -ne 0 ]; then + return 1 + fi + cat >> "$TEMP_DIR/make.mk" << __EOF__ TOOLKIT = gtk GTKOBJ = draw_cairo.o +MZUI = gtk_pathbar.c +MZUI += gtk_browser.c __EOF__ - return 0 + return 0 } checkopt_toolkit_motif() { - VERR=0 - dependency_motif - if [ $? -ne 0 ]; then - VERR=1 - fi - if [ $VERR -ne 0 ]; then - return 1 - fi - cat >> $TEMP_DIR/make.mk << __EOF__ + VERR=0 + dependency_motif + if [ $? -ne 0 ]; then + VERR=1 + fi + if [ $VERR -ne 0 ]; then + return 1 + fi + cat >> "$TEMP_DIR/make.mk" << __EOF__ TOOLKIT = motif +MZUI = motif_pathbar.c +MZUI += motif_browser.c __EOF__ - return 0 + return 0 } # # TARGETS # -CFLAGS= -CXXFLAGS= -LDFLAGS= +TEMP_CFLAGS= +TEMP_CXXFLAGS= +TEMP_LDFLAGS= # Target: tk -CFLAGS= -LDFLAGS= -CXXFLAGS= +TEMP_CFLAGS= +TEMP_LDFLAGS= +TEMP_CXXFLAGS= # Features # Option: --toolkit if [ -z $OPT_TOOLKIT ]; then - SAVED_ERROR=$ERROR - SAVED_DEPENDENCIES_FAILED=$DEPENDENCIES_FAILED - ERROR=0 - while true - do - checkopt_toolkit_motif - if [ $? -eq 0 ]; then - echo " toolkit: motif" >> $TEMP_DIR/options - ERROR=0 - break - fi - checkopt_toolkit_gtk3 - if [ $? -eq 0 ]; then - echo " toolkit: gtk3" >> $TEMP_DIR/options - ERROR=0 - break - fi - break - done - if [ $ERROR -ne 0 ]; then - SAVED_ERROR=1 - fi - ERROR=$SAVED_ERROR - DEPENDENCIES_FAILED=$SAVED_DEPENDENCIES_FAILED= + SAVED_ERROR="$ERROR" + SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" + ERROR=0 + while true + do + checkopt_toolkit_motif + if [ $? -eq 0 ]; then + echo " toolkit: motif" >> "$TEMP_DIR/options" + ERROR=0 + break + fi + checkopt_toolkit_gtk3 + if [ $? -eq 0 ]; then + echo " toolkit: gtk3" >> "$TEMP_DIR/options" + ERROR=0 + break + fi + break + done + if [ $ERROR -ne 0 ]; then + SAVED_ERROR=1 + fi + ERROR="$SAVED_ERROR" + DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" else - if false; then - false - elif [ $OPT_TOOLKIT = "gtk3" ]; then - echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options - checkopt_toolkit_gtk3 - if [ $? -ne 0 ]; then - ERROR=1 - fi - elif [ $OPT_TOOLKIT = "motif" ]; then - echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options - checkopt_toolkit_motif - if [ $? -ne 0 ]; then - ERROR=1 - fi - fi -fi - -echo >> $TEMP_DIR/config.mk -if [ ! -z "${CFLAGS}" ]; then - echo "TK_CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk -fi -if [ ! -z "${CXXFLAGS}" ]; then - echo "TK_CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk -fi -if [ ! -z "${LDFLAGS}" ]; then - echo "TK_LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk + if false; then + false + elif [ "$OPT_TOOLKIT" = "gtk3" ]; then + echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options + checkopt_toolkit_gtk3 + if [ $? -ne 0 ]; then + ERROR=1 + fi + elif [ "$OPT_TOOLKIT" = "motif" ]; then + echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options + checkopt_toolkit_motif + if [ $? -ne 0 ]; then + ERROR=1 + fi + fi +fi + +echo >> "$TEMP_DIR/config.mk" +if [ -n "${TEMP_CFLAGS}" ]; then + echo "TK_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" +fi +if [ -n "${TEMP_CXXFLAGS}" ]; then + echo "TK_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk" +fi +if [ -n "${TEMP_LDFLAGS}" ]; then + echo "TK_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" fi # Target: dav -CFLAGS= -LDFLAGS= -CXXFLAGS= +TEMP_CFLAGS= +TEMP_LDFLAGS= +TEMP_CXXFLAGS= dependency_curl if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED curl " - ERROR=1 + DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED curl " + ERROR=1 fi dependency_libxml2 if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " - ERROR=1 + DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " + ERROR=1 fi dependency_openssl if [ $? -ne 0 ]; then - DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " - ERROR=1 + DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " + ERROR=1 fi # Features -echo >> $TEMP_DIR/config.mk -if [ ! -z "${CFLAGS}" ]; then - echo "DAV_CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk +echo >> "$TEMP_DIR/config.mk" +if [ -n "${TEMP_CFLAGS}" ]; then + echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" fi -if [ ! -z "${CXXFLAGS}" ]; then - echo "DAV_CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk +if [ -n "${TEMP_CXXFLAGS}" ]; then + echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk" fi -if [ ! -z "${LDFLAGS}" ]; then - echo "DAV_LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk +if [ -n "${TEMP_LDFLAGS}" ]; then + echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" fi if [ $ERROR -ne 0 ]; then - echo - echo "Error: Unresolved dependencies" - echo $DEPENDENCIES_FAILED - rm -Rf $TEMP_DIR - exit 1 + echo + echo "Error: Unresolved dependencies" + echo "$DEPENDENCIES_FAILED" + rm -Rf "$TEMP_DIR" + exit 1 fi echo "configure finished" @@ -720,9 +724,9 @@ echo "Build Config:" echo " PREFIX: $PREFIX" echo " TOOLCHAIN: $TOOLCHAIN_NAME" echo "Options:" -cat $TEMP_DIR/options +cat "$TEMP_DIR/options" echo -cat $TEMP_DIR/config.mk $TEMP_DIR/make.mk > config.mk -rm -Rf $TEMP_DIR +cat "$TEMP_DIR/config.mk" "$TEMP_DIR/make.mk" > config.mk +rm -Rf "$TEMP_DIR"