Changeset 59323be in tol


Ignore:
Timestamp:
Dec 15, 2015, 1:10:30 PM (11 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
da2804ff
Parents:
ada6d64
Message:

fixes #1903, nos apoyamos en un script auxiliar para que tk se inicialice en modo no interactivo, para ello hacemos uso de la función Tcl_SetStartupScript, por ahora WIN32 sigue como antes pero hay que validar como responde cuando se invoca con argumentos por linea de comandos, cambiamos /bin/sh por /bin/bash

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7119 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tolbase
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • tolbase/bin/CMakeLists.txt

    rada6d64 r59323be  
    55                GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE
    66                WORLD_EXECUTE )
     7install( FILES tolbase.tcl DESTINATION "bin"
     8    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ
     9                GROUP_WRITE WORLD_READ WORLD_WRITE )
  • tolbase/bin/tolbase.sh

    rada6d64 r59323be  
    1 #!/bin/sh
     1#!/bin/bash
    22# Shell wrapper for TOL executable.
    33
    … …  
    1212fi
    1313
    14 exec ${SCRIPTPATH}/tolbase "${@}"
     14#TFILE="/tmp/$(basename $0).$$.tmp.tcl"
     15#echo lappend auto_path file normalize [file join [ file dir [info script] ] .. lib ] ]
     16#echo package require TolbaseApp > ${TFILE}
     17#echo after idle {file delete ${TFILE}} >> ${TFILE}
     18
     19${SCRIPTPATH}/tolbase ${SCRIPTPATH}/tolbase.tcl "${@}"
  • tolbase/generic/tolbase.c

    rada6d64 r59323be  
    1616#ifdef WIN32
    1717#include <windows.h>
     18#endif
     19
     20// Tcl_SetStartupScript
     21#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 5
     22//#include "tclIntDecls.h"
    1823#endif
    1924
    … …  
    130135        return TCL_ERROR;
    131136    }
    132     Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
    133 #ifdef TK_TEST
    134     if (Tktest_Init(interp) == TCL_ERROR) {
    135         return TCL_ERROR;
    136     }
    137     Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
    138             (Tcl_PackageInitProc *) NULL);
    139 #endif /* TK_TEST */
     137    // Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
    140138
    141139
    … …  
    163161     */
    164162
     163#if defined(WIN32)
    165164    SetupArgv( interp );
    166165    Tcl_VarEval( interp, "lappend", " auto_path", " [file join",
    … …  
    173172      }
    174173    //Tcl_PkgRequire( interp, "TolbaseApp", TOLBASE_VERSION, 1);
     174#else
     175    const char* exeName = Tcl_GetNameOfExecutable();
     176    Tcl_VarEval( interp, "file join",
     177                 " [ file dir ", Tcl_GetNameOfExecutable(),
     178                 " ] tolbase.tcl", NULL );
     179    Tcl_Obj *objPath = Tcl_GetObjResult( interp );
     180    Tcl_SetStartupScript( Tcl_GetObjResult( interp ), NULL );
     181#endif
    175182    return TCL_OK;
    176183}
Note: See TracChangeset for help on using the changeset viewer.