Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7648 in orxonox.OLD


Ignore:
Timestamp:
May 17, 2006, 2:02:57 PM (19 years ago)
Author:
bensch
Message:

script_engine: link again

Location:
branches/script_engine
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/acinclude.m4

    r6274 r7648  
    1919
    2020
    21 dnl AX_CHECK_REQUIRED_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
     21dnl AX_CHECK_REQUIRED_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE], [CFLAGS], [OTHER_LIBS])
    2222AC_DEFUN([AX_CHECK_REQUIRED_HEADER_LIB], [
    2323    _header_check=""
    2424    _lib_check=""
     25    LAST_FOUND_LIB=""
     26
     27    _lib_USED=""
     28    _header_USED=""
    2529
    2630    for _header in $1
    2731    do
    28       AC_CHECK_HEADER([$_header], [_header_check="yes"], [_header_check="no"])
    29       if  test "x$_header_check" = "xyes" ; then
     32      AC_CHECK_HEADER([${_header}], [_header_check="yes" ; _header_USED=${_header}], [_header_check="no"], $7)
     33      if  test "x${_header_check}" = "xyes" ; then
    3034        break
    3135      fi
    3236    done
    33     AC_CHECK_LIB([$2], [$3], [_lib_check="yes"], [_lib_check="no"])
    34     if [test x$_header_check = "xyes" && test "x$_lib_check" = "xyes"] ; then
    35          LIBS="$LIBS -l$2"
    36          $4
     37    for _check_library in $2
     38    do
     39      AC_CHECK_LIB([${_check_library}], [$3], [_lib_check="yes"; _lib_USED=${_check_library}], [_lib_check="no"], $8)
     40      if test "x${_lib_check}" = "xyes" ; then
     41        LAST_FOUND_LIB=${_lib_USED}
     42        break
     43      fi
     44    done
     45    if [test "x${_header_check}" = "xyes" && test "x${_lib_check}" = "xyes"] ; then
     46        m4_ifval([$4], [$4], [
     47         LIBS="${LIBS} -l${_lib_USED}"])
    3748    else
     49        m4_ifval([$5], [$5], [
    3850         echo "------------------"
    3951         echo "LIBRARY $2 not found."
    4052         echo "please install the $2-LIBRARY-package which can be found at $6"
    4153         echo "------------------"
    42          $5
    43          exit -1
     54         exit -1])
    4455    fi
    4556])
     57
     58
     59
     60
     61dnl AX_CHECK_LUA([LUA_DIR])
     62AC_DEFUN([AX_CHECK_LUA], [
     63#dnl checking for LUA.
     64LUA_LIBS=
     65LUA_INCLUDES=
     66dnl Check for Lua.
     67
     68LUA_INCLUDE_DIRECTORY="/usr/include"
     69LUA_COMMON_INCLUDE_DIRECTORIES="
     70      `ls -dr $1                       2>/dev/null`
     71      /usr/include
     72      `ls -dr /usr/include/lua*        2>/dev/null`
     73      `ls -dr /usr/lib/lua/include     2>/dev/null`
     74      `ls -dr /usr/local/include/lua   2>/dev/null`
     75      `ls -dr /opt/lua*/include        2>/dev/null`
     76      `ls -dr /Developer/lua*/include  2>/dev/null`
     77    "
     78
     79  for _lua_include_directory in ${LUA_COMMON_INCLUDE_DIRECTORIES}
     80    do
     81      if test -e ${_lua_include_directory}/lua.h ; then
     82        LUA_INCLUDE_DIRECTORY=${_lua_include_directory}
     83        CPPFLAGS="${CPPFLAGS} -I${LUA_INCLUDE_DIRECTORY}"
     84        break
     85      fi
     86  done
     87    if test -n ${LUA_INCLUDE_DIRECTORY} ; then
     88      echo "Lua-Include Directory is: ${LUA_INCLUDE_DIRECTORY}"
     89    else
     90      AC_MSG_ERROR([Lua Headers not found])
     91    fi
     92
     93
     94AC_CHECK_LIB([dl], [dlopen])
     95AX_CHECK_REQUIRED_HEADER_LIB([lua.h], [lua lua50], [lua_open],
     96dnl libLUA found
     97     [LUA_LIBS="${LUA_LIBS} -l${LAST_FOUND_LIB}"  AX_CHECK_REQUIRED_HEADER_LIB([lualib.h], [lualib lualib50], [luaopen_base],
     98dnl liblualib found
     99      [LUA_LIBS="${LUA_LIBS} -l${LAST_FOUND_LIB}"],,
     100      [http://www.lua.org],, [${LUA_LIBS} -ldl -lm])],
     101dnl liblua not found (download it)
     102       [AX_GET_INSTALL_NECESSARY_LIB([http://www.lua.org/ftp], [lua-5.0.tar.gz], [lua-5.0], [extern_libs/], [include/*.h lib/*.a])
     103       LUA_LIBS="-llualib -llua"  LUA_INCLUDES="-I$(top_build_dir)/extern_libs" ], [http://www.lua.org])
     104
     105AC_SUBST([LUA_LIBS])
     106AC_SUBST([LUA_INCLUDES])
     107])
     108
     109
     110
     111
     112
     113dnl AX_GET_INSTALL_NECESSARY_LIB([FTP-DIR], [DIST-FILE], [DIST-DIR], [INSTALL-DIR], [INSTALL-FILES], [CONFIG-FLAGS], [MAKE-OPTS])
     114AC_DEFUN([AX_GET_INSTALL_NECESSARY_LIB], [
     115
     116   _get_install_FTP=$1
     117   _get_install_DISTFILE=$2
     118   _get_install_DISTDIR=$3
     119   _get_install_INSTALLDIR=$4
     120   dnl $5 is left out (inegrated bellow)
     121   _get_install_CONFIGFLAGS=$6
     122   _get_install_MAKEOPTS=$7
     123
     124dnl DOWNLOADING THE FILE
     125   if test -f "${_get_install_DISTFILE}" ; then
     126     echo "${_get_install_DISTFILE} already downloaded"
     127   else
     128     echo "Getting ${_get_install_DISTFILE} from ${_get_install_FTP}/${_get_install_DISTFILE}"
     129     echo `wget ${_get_install_FTP}/${_get_install_DISTFILE}`
     130   fi
     131
     132dnl UNCOMPRESS STAGE
     133   echo "Uncompressing ${_get_install_DISTFILE}"
     134   echo `tar xzvf ${_get_install_DISTFILE}`
     135
     136dnl ENTER DIRECTORY AND EXECUTE CONFIGURE AND MAKE
     137   _get_install_PWD=`pwd`
     138   cd ${_get_install_DISTDIR}
     139dnl configure
     140   if test -x "configure" ; then
     141    ./configure ${_get_install_CONFIGFLAGS}
     142   fi
     143   make ${_get_install_MAKEOPTS}
     144   cd ${_get_install_PWD}
     145
     146dnl INSTALL STAGE
     147   echo "Installing Libraries and Headers into ${_get_install_INSTALLDIR} local directory"
     148
     149   mkdir -p ${_get_install_INSTALLDIR}
     150   for _get_install_installfile in $5
     151    do
     152     echo "copy  ${_get_install_DISTDIR}/${_get_install_installfile} to ${_get_install_INSTALLDIR}/"
     153     cp `ls -dr ${_get_install_DISTDIR}/${_get_install_installfile}` "${_get_install_INSTALLDIR}/"
     154    done
     155
     156#cleaning up
     157  echo "rm -rf ${_get_install_DISTDIR}"
     158  rm -rf ${_get_install_DISTDIR}
     159  echo "rm ${_get_install_DISTFILE}"
     160  rm ${_get_install_DISTFILE}
     161])
  • branches/script_engine/config.h.in

    r6838 r7648  
    3939/* Define to 1 if you have the <inttypes.h> header file. */
    4040#undef HAVE_INTTYPES_H
     41
     42/* Define to 1 if you have the `dl' library (-ldl). */
     43#undef HAVE_LIBDL
    4144
    4245/* Define to 1 if you have the `m' library (-lm). */
  • branches/script_engine/configure.ac

    r7256 r7648  
    3838AM_INIT_AUTOMAKE
    3939
    40 AC_CONFIG_SRCDIR([./src])
     40AC_CONFIG_SRCDIR([./src/orxonox.cc])
    4141AC_CONFIG_HEADER([config.h])
    4242
     
    571571AM_CONDITIONAL(HAVE_CURL, test "x$have_curl" = "xyes")
    572572
     573#-----#
     574# LUA #
     575#-----#
     576LUA_DIR="/usr/include/lua"
     577AX_CHECK_LUA([${LUA_DIR}])
     578
    573579#--------#
    574580# efence #
     
    643649                 src/lib/gui/gtk_gui/Makefile
    644650                 src/lib/gui/gl_gui/Makefile
     651                 src/lib/script_engine/Makefile
    645652                 src/lib/parser/Makefile
    646653                 src/lib/parser/tinyxml/Makefile
    647654                 src/lib/parser/ini_parser/Makefile
    648655                 src/lib/parser/cmdline_parser/Makefile
    649                 src/lib/parser/preferences/Makefile
     656                src/lib/parser/preferences/Makefile
    650657                 src/util/Makefile
    651658                 src/world_entities/Makefile
  • branches/script_engine/src/lib/Makefile.am

    r7422 r7648  
    7171        parser \
    7272        shell \
     73        script_engine \
    7374        gui
  • branches/script_engine/src/lib/script_engine/Makefile.am

    r7645 r7648  
     1
     2INCLUDES= -I../../../extern_libs
     3
     4noinst_LIBRARIES = libORXscript.a
     5
     6libORXscript_a_SOURCES = \
     7                Script.cc \
     8                scriptable.cc\
     9                VirtualMachine.cc
     10
     11AM_CPPFLAGS= @LUA_INCLUDES@
    112
    213bin_PROGRAMS = main
     14main_SOURCES = \
     15                main.cc
     16main_LDADD = libORXscript.a -L../../../extern_libs @LUA_LIBS@
    317
    4 main_SOURCES = \
    5                 Script.cc \
    6                 scriptable.cc\
    7                 VirtualMachine.cc \
    8                 main.cc
     18main_LDFLAGS =
    919
    10 main_LDADD = @LUA_LIBS@
    1120
    1221noinst_HEADERS = \
Note: See TracChangeset for help on using the changeset viewer.