[wpdev-commits] wolfpack configure,1.35,1.36
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-08-05 22:19:49
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2877 Modified Files: configure Log Message: Old script was depreciated, so I made configure a link to configure.py Consider it a shortcut :) Index: configure =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** configure 4 Aug 2004 23:17:35 -0000 1.35 --- configure 5 Aug 2004 22:19:39 -0000 1.36 *************** *** 1,532 **** #!/bin/sh - ################################################################# - # ) (\_ # Wolfpack 13.0.0 Build Script # - # (( _/{ "-; # Created by: Wolfpack Development Team # - # )).-" {{ ;"` # Revised by: Wolfpack Development Team # - # ( ( ;._ \\ ctr # Last Modification: check cvs logs # - ################################################################# - - # BIG FAT TODO: write clean functions instead of that blown up - # include/library search routines. - - ##### make_newlines [string] - # replacement of echo -e for newlines - make_newlines () - { - for i in $(echo "$1"|sed -e 's/ /^/g;s/\\n/ /g'); - do - echo "$i"|tr '^' ' '; - done; - } - - ##### normalize_path [path] - # strips off unneeded slashes - normalize_path () - { - echo "$1"|sed -e 's/\/\/\+/\//g;s/\/\+$//;s/\/\.\//\//g'; - } - - ##### regexp_exist [path/regexp] - # check if a file exists which matches the regular expression - # and return 0 upon existance of the file - regexp_exist () - { - PATH_EXACT="$(normalize_path "$(dirname "$1")")"; - FILE_REGEXP="$(basename "$1")"; - - [ "$(ls -1 "$PATH_EXACT" 2> /dev/null|grep "^${FILE_REGEXP}$")" ] && return 0; - - return 1; - } - - ##### get_best_lib - # reads libs from stdin and gets the most useable one - # currently hust the one with the shortest path length - get_best_lib () - { - read LINE; - SHORTEST_LEN="$(echo -n "$LINE"|wc -c)"; - SHORTEST_LINE="$LINE"; - - while read LINE; - do - LINE_LEN="$(echo -n "$LINE"|wc -c)"; - - if [ "$LINE_LEN" -lt "$SHORTEST_LEN" ]; - then - SHORTEST_LEN="$LINE_LEN"; - SHORTEST_LINE="$LINE"; - fi; - done; - - echo "$SHORTEST_LINE"; - } - - ##### ask_path [regexp] - # asks the user to submit a new path - # the regexp is to check the validity of the user's input - ask_path () - { - [ "$2" != "skip" ] && echo "not found." >&2; - SUPPLIED_PATH=""; - - [ "$(echo "$1"|grep 'so$')" ] && LIB_OR_INC="library" || LIB_OR_INC="include"; - - while [ ! -d "$SUPPLIED_PATH" ] && ! regexp_exist "${SUPPLIED_PATH}/${1}"; - do - echo "Please enter the correct $LIB_OR_INC directory," >&2; - echo -n "or just press enter to skip: " >&2; - read SUPPLIED_PATH; - echo >&2; - - if [ ! "$SUPPLIED_PATH" ]; - then - break; - fi - done; - - echo "$SUPPLIED_PATH"; - } - - ##### check_version [package] [path] - # check version of package using the file/dir in path - check_version () - { - if [ ! "$2" ]; - then - echo "Error! You can't skip required stuff!" >&2; - LIB_PATH="(skipped)"; - else - LIB_PATH="$2"; - fi; - - case "$1" in - python-inc) - VERSION_REGEXP='^[ ]*#[ ]*define[ ]*PY_VERSION[^"]*"\([^"]*\)".*$'; - VERSION="$(grep "$VERSION_REGEXP" "${LIB_PATH}/patchlevel.h" 2> /dev/null|sed -e "s/$VERSION_REGEXP/\1/")"; - [ ! "$VERSION" ] && VERSION="not available"; - if [ ! "$(echo "$VERSION"|grep '^2\.3')" ]; - then - cat >&2 <<-EOF - Python version is ${VERSION}, but should be 2.3.x! - Please install the appropriate version from: - http://www.python.org/2.3.4/ - or use ${0} --help for help with specifying the correct path. - EOF - exit 1; - fi; - ;; - python-lib) - if [ ! -e "${LIB_PATH}/libpython2.3.so" ] && [ ! -e "${LIB_PATH}/libpython2.3.a" ]; - then - cat >&2 <<-EOF - Python 2.3.x library files not found in ${LIB_PATH}! - Please install the appropriate version from: - http://www.python.org/2.3.3/ - or use ${0} --help for help with specifying the correct path. - EOF - exit 1; - fi; - ;; - qt) - VERSION_REGEXP='^.*version:[^(]*([^ ]*[ ]*\([^)]*\)).*$'; - VERSION="$(eval "${LIB_PATH} -v" 2>&1|grep "$VERSION_REGEXP"|sed -e "s/$VERSION_REGEXP/\1/")"; - [ ! "$VERSION" ] && VERSION="not available"; - if [ ! "$(echo "$VERSION"|grep '^3\.')" ]; - then - cat >&2 <<-EOF - error! - Your Qt version is ${VERSION} and hence too old. - Please install version 3.x.x from: - http://www.trolltech.com/download/qt/x11.html - or use ${0} --help for help with specifying the correct path. - - Please note, that Qt has to be installed multi threaded! - To compile qt multi threaded, use -thread there as a ./configure option. - EOF - exit 1; - fi; - ;; - esac; - } - - ##### print_usage - # prints usage information - print_usage () - { - cat <<-EOF - Usage: ${0} [options] - where options are: - - --enable-mysql Enable MySQL support. - --mysql-includes=dir The MySQL include directory. - --mysql-libraries=dir The MySQL library path. - - --python-includes=dir Python include directory. - --python-libraries=dir Python library path. - - --qt-directory=dir Base directory of Qt. - - --static Static linking. - - enforcement options: - - --force-python * Disable Python version check. - --force-qt * Disable Qt version check. - --force-stlport Enforce usage of stlport. - - --force-all Enforce all options marked with *. - - options for developers: - - --enable-debug Enable debugging. - --cscriptdebug Debug into ${0}. - - EOF - exit 1; - } - - while [ "$1" ]; - do - if [ "$(echo "$1"|grep '^--[^=]\+=')" ]; - then - ITEM="$(echo "$1"|sed -e 's/\([^-]*-\)\+\([^-]\+-[^=]\+=.\+\)$/\2/')"; - else - ITEM="$(echo "$1"|sed -e 's/^--\([^-]\+-\)\?//')"; - fi; - - if [ "x$ITEM" == "x$1" ]; - then - echo "Unknown option \"$1\"!" >&2; - print_usage >&2; - - elif [ "x$1" == "x--help" ]; - then - print_usage; - fi; - - if [ "$(echo "$ITEM"|grep '^[^-]\+-inc[^=]*=.\+$')" ]; - then - CUR_INC="$(echo "$ITEM"|sed -e 's/^[^=]\+=\(.*\)$/\1/')"; - CUR_INC="$(normalize_path "$CUR_INC")"; - ITEM="$(echo "$ITEM"|sed -e 's/^\([^-]\+-\).*$/\1inc/')"; - - elif [ "$(echo "$ITEM"|grep '^[^-]\+-\(path\|dir\)[^=]*=.\+$')" ]; - then - CUR_PATH="$(echo "$ITEM"|sed -e 's/^[^=]\+=\(.*\)$/\1/')"; - CUR_PATH="$(normalize_path "$CUR_PATH")"; - ITEM="$(echo "$ITEM"|sed -e 's/^\([^-]\+-\).*$/\1path/')"; - - elif [ "$(echo "$ITEM"|grep '^[^-]\+-lib[^=]*=.\+$')" ]; - then - CUR_LIB="$(echo "$ITEM"|sed -e 's/^[^=]\+=\(.*\)$/\1/')"; - CUR_LIB="$(normalize_path "$CUR_LIB")"; - ITEM="$(echo "$ITEM"|sed -e 's/^\([^-]\+-\).*$/\1lib/')"; - fi; - - YES_NO="$(echo "$1"|grep -q '^--\(enable-\|[^-]*$\)' && echo 'y' || echo 'n')"; - - FORCE=""; - FORCE="$(echo "$1"|grep -q '^--force-' && echo 'y' || echo 'n')"; - [ "$FORCE" = "y" ] && ITEM="${1#--}"; - - case "$ITEM" in - cscriptdebug) _CONFIGURE_DEBUG="$YES_NO";; - debug) _DEBUG="$YES_NO";; - mysql) _MYSQL="$YES_NO";; - mysql-inc) _MYSQL_INC="$CUR_INC";; - mysql-lib) _MYSQL_LIB="$CUR_LIB";; - python-inc) _PYTHON_INC="$CUR_INC";; - python-lib) _PYTHON_LIB="$CUR_LIB";; - qt-path) _QT_PATH="$CUR_PATH";; - static) _STATIC="$YES_NO";; - force-python) _FORCE_PYTHON="$FORCE";; - force-qt) _FORCE_QT="$FORCE";; - force-stlport) _FORCE_STLPORT="$FORCE";; - force-all) - _FORCE_PYTHON="$FORCE"; - _FORCE_QT="$FORCE"; - ;; - *) - echo "Unknown option \"$1\"!" >&2; - print_usage >&2; - ;; - esac; - - shift; - done; - - [ "${_CONFIGURE_DEBUG}" = "y" ] && set -x; - - # first of all, let's assassinate the Makefile ;) - rm -f Makefile; - - if [ "${_STATIC}" = "y" ]; - then - QMAKE_LFLAGS="-static"; - fi; - - if [ "${_DEBUG}" = "y" ]; - then - echo "Debug: Yes"; - DEFINES="_DEBUG"; - QMAKE_CXXFLAGS="-g"; - QMAKE_CFLAGS="-g"; - CONFIG="warn_on"; - fi; - - if [ "${_MYSQL}" = "y" ]; - then - # <mysql> - MYSQL_DISABLED="n"; - - echo -n "Searching for MySQL includes... "; - - if [ "${_MYSQL_INC}" ]; - then - if ! regexp_exist "${_MYSQL_INC}/mysql\.h"; - then - MYSQL_INC="$(ask_path 'mysql\.h')"; - if [ ! "$MYSQL_INC" ]; - then - echo "MySQL support disabled."; - MYSQL_DISABLED="y"; - fi; - else - MYSQL_INC="${_MYSQL_INC}"; - echo "( $MYSQL_INC )"; - fi; - - else - MYSQL_INC="$(mysql_config --cflags|sed -e "s/^\([^-]*-I\)*['\"]\?\([^ '\"$]*\).*$/\2/")"; - - if ! [ "$MYSQL_INC" ]; - then - MYSQL_INC="$(ask_path 'mysql\.h')"; - if [ ! "$MYSQL_INC" ]; - then - echo "MySQL support disabled."; - MYSQL_DISABLED="y"; - fi; - else - [ "$MYSQL_DISABLED" != "y" ] && echo "( $MYSQL_INC )"; - fi; - fi; - - echo -n "Searching for MySQL libraries... "; - if [ "${_MYSQL_LIB}" ]; - then - if ! regexp_exist "${_MYSQL_LIB}/libmysqlclient.*\.so"; - then - MYSQL_LIB="$(ask_path 'libmysqlclient.*\.so')"; - if [ ! "$MYSQL_LIB" ]; - then - echo "MySQL support disabled."; - MYSQL_DISABLED="y"; - fi; - else - MYSQL_LIB="${_MYSQL_LIB}"; - echo "( $MYSQL_LIB )"; - fi; - else - MYSQL_LIB="$(mysql_config --libs|sed -e "s/^\([^-]*-L\)*['\"]\?\([^ '\"$]*\).*$/\2/")"; - - if ! [ "$MYSQL_LIB" ] && [ "$MYSQL_DISABLED" != "y" ]; - then - MYSQL_LIB="$(ask_path 'libmysqlclient.*\.so')"; - if [ ! "$MYSQL_LIB" ]; - then - echo "MySQL support disabled."; - MYSQL_DISABLED="y"; - fi; - else - [ "$MYSQL_DISABLED" != "y" ] && echo "( $MYSQL_LIB )"; - fi; - fi; - - if [ "$MYSQL_DISABLED" != "y" ]; - then - MYSQL_LIB="-L$MYSQL_LIB -lmysqlclient"; - DEFINES="$DEFINES MYSQL_DRIVER"; - fi; - # </mysql> - fi; - - # <python> - echo -n "Searching for Python includes... "; - - if [ ! "${_PYTHON_INC}" ]; - then - for py_incpath in \ - /usr/local/include/[Pp]ython*/Python.h \ - /usr/include/[Pp]ython*/Python.h \ - ; - do - if [ -e "$py_incpath" ]; - then - py_pathes="$py_pathes\n$py_incpath"; - fi; - done; ! py_pathes="$(make_newlines "$py_pathes")"; ! ! [ "$py_pathes" ] && PYTHON_INC="$(echo "$py_pathes"|sort -nr|get_best_lib|sed -e 's/^\(\([^\/]*\/\)*\).*$/\1/;s/\/\+$//')"; ! ! if [ ! "$PYTHON_INC" ]; ! then ! PYTHON_INC="$(ask_path 'Python.h')"; ! else ! echo "( $PYTHON_INC )"; ! fi; ! else ! if ! regexp_exist "${_PYTHON_INC}/Python\.h"; ! then ! PYTHON_INC="$(ask_path 'Python.h')"; ! else ! PYTHON_INC="${_PYTHON_INC}"; ! echo "( $PYTHON_INC )"; ! fi; ! fi; ! ! [ "${_FORCE_PYTHON}" != "y" ] && check_version "python-inc" "${PYTHON_INC}"; ! ! echo -n "Searching for Python library.... "; ! ! STATIC_PRESENT=""; ! if [ ! "${_PYTHON_LIB}" ]; ! then ! for py_libpath in \ ! /usr/local/lib/libpython*.so \ ! /usr/local/lib/libpython*.a \ ! /usr/local/lib/[Pp]ython*/libpython*.so \ ! /usr/local/lib/[Pp]ython*/libpython*.a \ ! /usr/lib/libpython*.so \ ! /usr/lib/libpython*.a \ ! /usr/lib/[Pp]ython*/libpython*.so \ ! /usr/lib/[Pp]ython*/libpython*.a \ ! /usr/lib/[Pp]ython*/config/libpython*.so \ ! /usr/lib/[Pp]ython*/config/libpython*.a \ ! /usr/local/lib/[Pp]ython*/config/libpython*.so \ ! /usr/local/lib/[Pp]ython*/config/libpython*.a \ ! ; ! do ! if [ -e "$py_libpath" ]; ! then ! if [ "${py_libpath%%*.so}" ]; ! then ! STATIC_PRESENT="y"; ! else ! py_libs="$py_libs\n$py_libpath"; ! fi; ! fi; ! done; ! ! py_libs="$(make_newlines "$py_libs")"; ! ! [ "$py_libs" ] && PYTHON_LIB="$(echo "$py_libs"|sort -nr|get_best_lib|sed -e 's/^\(\([^\/]*\/\)*\).*$/\1/;s/\/\+$//')"; ! ! if [ ! "$PYTHON_LIB" ]; ! then ! if [ "$STATIC_PRESENT" = "y" ]; ! then ! echo "error:" >&2; ! echo "No dynamically linked Python libraries were found." >&2; ! echo "Please make sure that .so files are available!" >&2; ! echo "You can do this using --enable-shared at the Python" >&2; ! echo "./configure script." >&2; ! fi; ! PYTHON_LIB="$(ask_path 'libpython.*\.so' 'skip')"; ! else ! echo "( $PYTHON_LIB )"; ! fi; ! else ! if ! regexp_exist "${_PYTHON_LIB}/libpython.*\.so"; ! then ! PYTHON_LIB="$(ask_path 'libpython.*\.so')"; ! else ! PYTHON_LIB="${_PYTHON_LIB}"; ! echo "( $PYTHON_LIB )"; ! fi; ! fi; ! ! [ "${_FORCE_PYTHON}" != "y" ] && check_version "python-lib" "${PYTHON_LIB}"; ! PYTHON_LIB="-L$PYTHON_LIB -lpython2.3"; ! # </python> ! ! # <stlport> ! echo -n "Checking if we need to add stlport... "; ! ! # this check is currently disabled. ! #CC=""; ! #CC="$(which g++)"; ! #[ ! "$CC" ] && CC="$(which c++)"; ! ! #CC_VERSION="$(eval "$CC -dumpversion")"; ! ! if [ "${_FORCE_STLPORT}" != "y" ] #&& [ "$(echo "$CC_VERSION"|cut -d. -f1)" -ge "3" ]; ! then ! echo -n "no"; ! else ! echo -n "yes"; ! [ -x "/usr/include/stlport" ] && STLPORT_INC="/usr/include/stlport" || STLPORT_INC="/usr/local/include/stlport"; ! STLPORT_LIB="-lstlport"; ! fi; ! ! echo "."; ! # </stlport> ! ! PASSED_VARIABLES=""; ! for i in MYSQL_INC MYSQL_LIB PYTHON_INC PYTHON_LIB STLPORT_INC STLPORT_LIB DEFINES QMAKE_CXXFLAGS QMAKE_CFLAGS QMAKE_LFLAGS CONFIG; ! do ! PASSED_VARIABLES="$PASSED_VARIABLES $i+='$(eval "echo \$$i")'"; ! done; ! ! echo -n "Creating Makefile using qmake... "; ! ! if [ -d "${_QT_PATH}" ]; ! then ! QTDIR="${_QT_PATH}"; ! export QTDIR; ! fi; ! ! if [ -x "$QTDIR/bin/qmake" ]; ! then ! QMAKE_BIN="$QTDIR/bin/qmake"; ! else ! QMAKE_BIN="$(which qmake)"; ! fi; ! ! if [ -x "$QMAKE_BIN" ]; ! then ! [ "${_FORCE_QT}" != "y" ] && check_version "qt" "$QMAKE_BIN"; ! ! QMAKE_OUTPUT="$(eval "$QMAKE_BIN -o Makefile $PASSED_VARIABLES wolfpack.pro" 2>&1)"; ! if [ "$?" -gt "0" ]; ! then ! echo "failed:" >&2; ! echo "$QMAKE_OUTPUT" >&2; ! exit 1; ! fi; ! else ! echo "not found." >&2; ! exit 1; ! fi; ! ! if [ ! "$(grep '^LIBS' Makefile | grep -- '-lqt-mt')" ]; ! then ! echo "failed!" >&2; ! cat >&2 <<-EOF ! Sorry, Qt has to be installed multi threaded. ! To compile qt multi threaded, use -thread there as a ./configure option. ! EOF ! if [ "${_FORCE_QT}" != "y" ]; ! then ! rm -f Makefile; ! exit 1; ! fi; ! fi; ! echo "done."; - echo "Configure finished. Please run make now."; --- 1,12 ---- #!/bin/sh ! echo "This is a link to configure.py" ! echo "Your system requires Python-2.3 for this to work." ! echo "Executing: python2.3 ./configure.py ${@}" ! echo "" ! python2.3 configure.py $@ ! echo "" ! echo "Now please execute 'make' to compile Wolfpack." |