Check-in [9e75cf906d]
Overview
Comment:Updated to set tcc_lib_path sooner, needed for setting library_paths correctly
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9e75cf906d9f54b511f72b9bedfccecafb1e1467
User & Date: rkeene on 2014-05-04 04:26:45
Other Links: manifest | tags
Context
2014-05-04
04:27
Updated to search library_paths for libtcc1.a for ELF as is done for PE check-in: 84c0812a1d user: rkeene tags: trunk
04:26
Updated to set tcc_lib_path sooner, needed for setting library_paths correctly check-in: 9e75cf906d user: rkeene tags: trunk
04:25
Updated to clean temporary test directory more frequently check-in: 59936cb094 user: rkeene tags: trunk
Changes

Added build/tcc-patches/0.9.26/tcc-0.9.26-setlibpathsooner.diff version [cf9c3b4d2d].

            1  +diff -uNr tcc-0.9.26.orig/libtcc.c tcc-0.9.26-1setlibpathsooner/libtcc.c
            2  +--- tcc-0.9.26.orig/libtcc.c	2013-02-15 08:24:00.000000000 -0600
            3  ++++ tcc-0.9.26-1setlibpathsooner/libtcc.c	2014-05-03 23:19:00.965640003 -0500
            4  +@@ -888,7 +888,7 @@
            5  +     macro_ptr = NULL;
            6  + }
            7  + 
            8  +-LIBTCCAPI TCCState *tcc_new(void)
            9  ++LIBTCCAPI TCCState *tcc_new(const char *init_lib_path)
           10  + {
           11  +     TCCState *s;
           12  +     char buffer[100];
           13  +@@ -900,11 +900,15 @@
           14  +     if (!s)
           15  +         return NULL;
           16  +     tcc_state = s;
           17  ++    if (init_lib_path == NULL) {
           18  + #ifdef _WIN32
           19  +-    tcc_set_lib_path_w32(s);
           20  ++        tcc_set_lib_path_w32(s);
           21  + #else
           22  +-    tcc_set_lib_path(s, CONFIG_TCCDIR);
           23  ++        tcc_set_lib_path(s, CONFIG_TCCDIR);
           24  + #endif
           25  ++    } else {
           26  ++        tcc_set_lib_path(s, init_lib_path);
           27  ++    }
           28  +     s->output_type = TCC_OUTPUT_MEMORY;
           29  +     preprocess_new();
           30  +     s->include_stack_ptr = s->include_stack;
           31  +diff -uNr tcc-0.9.26.orig/libtcc.h tcc-0.9.26-1setlibpathsooner/libtcc.h
           32  +--- tcc-0.9.26.orig/libtcc.h	2013-02-15 08:24:00.000000000 -0600
           33  ++++ tcc-0.9.26-1setlibpathsooner/libtcc.h	2014-05-03 23:20:14.785640003 -0500
           34  +@@ -14,7 +14,7 @@
           35  + typedef struct TCCState TCCState;
           36  + 
           37  + /* create a new TCC compilation context */
           38  +-LIBTCCAPI TCCState *tcc_new(void);
           39  ++LIBTCCAPI TCCState *tcc_new(const char *init_lib_path);
           40  + 
           41  + /* free a TCC compilation context */
           42  + LIBTCCAPI void tcc_delete(TCCState *s);

Modified tcc4tcl.c from [fc16e20c80] to [aa505b066c].

   248    248   		index = TCC_OUTPUT_MEMORY;
   249    249   	} else {
   250    250   		if (Tcl_GetIndexFromObj(interp, objv[2], types, "type", 0, &index) != TCL_OK) {
   251    251   			return TCL_ERROR;
   252    252   		}
   253    253   	}
   254    254   
   255         -	s = tcc_new();
          255  +	s = tcc_new(Tcl_GetString(objv[1]));
   256    256   	if (s == NULL) {
   257    257   		return(TCL_ERROR);
   258    258   	}
   259    259   
   260         -	s->tcc_lib_path = tcc_strdup(Tcl_GetString(objv[1]));
   261         -
   262    260   	tcc_set_error_func(s, interp, (void *)&Tcc4tclErrorFunc);
   263    261   
   264    262   	ts = (void *) ckalloc(sizeof(*ts));
   265    263   	ts->s = s;
   266    264       	ts->relocated = 0;
   267    265   
   268    266   	/*printf("type: %d\n", index); */