# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../lua/lua.conf # Copyright (C) 2004 - 2011 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- T2-COPYRIGHT-NOTE-END --- # inherit variables like myCFLAGS, myLIBS . $base/package/*/*/lua-conf.in # latest, official Lua patch, unfortunatly unversioned and not -p1 :-( lpatch="`match_source_file -p .patch`" if [ "$lpatch" ]; then hook_add prepatch 5 "(cd src; patch -p0 < $lpatch)" fi # adjust installation path var_append makeopt ' ' "INSTALL_TOP=/$prefix INSTALL_LIB=$libdir generic" var_append makeinstopt ' ' "INSTALL_TOP=$root/$prefix INSTALL_LIB=$root$libdir" # configure: # -enable dynamic module loading # -enable CLI with readline var_append makeopt ' ' "MYCFLAGS=\"$myCFLAGS\"" var_append makeopt ' ' "MYLIBS=\"-Wl,-E $myLIBS\"" # adjust luaconf.h header lua_conf() { if ! atstage toolchain; then LUA_ROOT="/$prefix" else LUA_ROOT="$root/$prefix" fi sed -i "s,^#define LUA_ROOT.*,#define LUA_ROOT \"$LUA_ROOT/\"," src/luaconf.h sed -i "s,^\(#define LUA_CDIR.*\)lib\(/.*\),\1${libdir##*/}\2," src/luaconf.h } hook_add premake 3 lua_conf # create a lua-config script lua_config_postmake() { sde_substitute $confdir/lua-config | sed -e "s,@LIBS@,$myLIBS," \ -e "s,@CFLAGS@,$myCFLAGS," \ -e "s,@pkglibdir@,$root/$pkglibdir," \ -e "s,@pkgdatadir@,$root/$pkgdatadir," \ -e "s,//,/,g" > $root/$bindir/lua-config chmod 0755 $root/$bindir/lua-config } hook_add postmake 3 lua_config_postmake # create a lua.pc pkgconfig file if pkginstalled pkgconfig; then lua_pc_postmake() { sde_substitute $confdir/lua.pc | sed -e "s,@LIBS@,$myLIBS," \ -e "s,@CFLAGS@,$myCFLAGS," \ -e "s,@pkglibdir@,$root/$pkglibdir," \ -e "s,@pkgdatadir@,$root/$pkgdatadir," \ -e "s,//,/,g" > $root$libdir/pkgconfig/lua.pc } hook_add postmake 3 lua_pc_postmake fi # create missing directories and copy documentation lua_postmake() { mkdir -p $root/$pkglibdir/ mkdir -p $root/$pkgdatadir/ mkdir -p $root/usr/share/doc/lua cp -v doc/* $root/usr/share/doc/lua/ } hook_add postmake 3 lua_postmake # shared object [ "$SDECFG_STATIC" != 1 ] && var_append patchfiles ' ' "$confdir/shared-object.diff" # cross build var_append AR ' ' rc