forked from KolibriOS/kolibrios
- Added compress target to Makefile.linux32 (Uses UPX)
- Fixed TCC for linux bug: does not find library and headers as well as start.o - Updated kos32-tcc git-svn-id: svn://kolibrios.org@8272 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
712b555519
commit
dbc1c764b1
Binary file not shown.
@ -9,5 +9,7 @@ all:
|
|||||||
$(CC) $(CFLAGS) $(LFLAGS) $(SRC) -o $(NAME)
|
$(CC) $(CFLAGS) $(LFLAGS) $(SRC) -o $(NAME)
|
||||||
install:
|
install:
|
||||||
cp $(NAME) ../bin
|
cp $(NAME) ../bin
|
||||||
|
compress:
|
||||||
|
upx $(NAME)
|
||||||
clean:
|
clean:
|
||||||
rm -f $(NAME)
|
rm -f $(NAME)
|
||||||
|
@ -71,6 +71,10 @@ ST_DATA struct TCCState *tcc_state;
|
|||||||
#ifdef TCC_TARGET_MEOS
|
#ifdef TCC_TARGET_MEOS
|
||||||
#include "tccmeos.c"
|
#include "tccmeos.c"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef TCC_TARGET_MEOS_LINUX
|
||||||
|
#include <libgen.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* ONE_SOURCE */
|
#endif /* ONE_SOURCE */
|
||||||
|
|
||||||
@ -140,7 +144,7 @@ BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
#if defined TCC_TARGET_MEOS && ! TCC_TARGET_MEOS_LINUX
|
#if defined TCC_TARGET_MEOS
|
||||||
/* on Kolibri host, we suppose the lib and includes are at the location of 'tcc' /lib, /include */
|
/* on Kolibri host, we suppose the lib and includes are at the location of 'tcc' /lib, /include */
|
||||||
static void tcc_set_lib_path_kos(TCCState *s)
|
static void tcc_set_lib_path_kos(TCCState *s)
|
||||||
{
|
{
|
||||||
@ -152,9 +156,19 @@ static void tcc_set_lib_path_kos(TCCState *s)
|
|||||||
*p = 0;
|
*p = 0;
|
||||||
tcc_set_lib_path(s, path);
|
tcc_set_lib_path(s, path);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#if defined TCC_TARGET_MEOS_LINUX
|
||||||
|
static void tcc_set_lib_path_linux(TCCState *s)
|
||||||
|
{
|
||||||
|
char buff[4096+1];
|
||||||
|
readlink("/proc/self/exe", buff, 4096);
|
||||||
|
const char *path = dirname(buff);
|
||||||
|
tcc_set_lib_path(s, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
/********************************************************/
|
/********************************************************/
|
||||||
/* copy a string and truncate it. */
|
/* copy a string and truncate it. */
|
||||||
PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
|
PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
|
||||||
@ -1092,11 +1106,17 @@ LIBTCCAPI TCCState *tcc_new(void)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
tcc_set_lib_path_w32(s);
|
tcc_set_lib_path_w32(s);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined TCC_TARGET_MEOS && ! TCC_TARGET_MEOS_LINUX
|
#if defined TCC_TARGET_MEOS && ! TCC_TARGET_MEOS_LINUX
|
||||||
tcc_set_lib_path_kos(s);
|
tcc_set_lib_path_kos(s);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#ifdef TCC_TARGET_MEOS_LINUX
|
||||||
|
tcc_set_lib_path_linux(s);
|
||||||
|
#else
|
||||||
tcc_set_lib_path(s, CONFIG_TCCDIR);
|
tcc_set_lib_path(s, CONFIG_TCCDIR);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
s->output_type = 0;
|
s->output_type = 0;
|
||||||
preprocess_new();
|
preprocess_new();
|
||||||
|
Loading…
Reference in New Issue
Block a user