noGNU/lua-5.3/compile.c

300 lines
19 KiB
C

// Put this script in the src directory of Lua 5.3, compile it, then run it.
#ifndef ENV_CC
#define ENV_CC "tcc"
#endif
/*
#define ENV_SPATH "C:\\tinycc"
#define ENV_CC ENV_SPATH"\\tcc.exe","-I"ENV_SPATH"\\win32\\include","-I"ENV_SPATH"\\win32\\include\\sec_api","-I"ENV_SPATH"\\win32\\include\\sys","-I"ENV_SPATH"\\win32\\include\\tcc","-I"ENV_SPATH"\\win32\\include\\winapi","-I"ENV_SPATH"\\include","-I"ENV_SPATH,"-L"ENV_SPATH"\\win32\\lib","-L"ENV_SPATH"\\lib","-L"ENV_SPATH
*/
#ifndef ENV_CFLAGS
#define ENV_CFLAGS "-D__MTC_NONE"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#if PLATFORM_LINUX
#define ENV_PLATFORM "linux"
#include <unistd.h>
#include <sys/wait.h>
#elif PLATFORM_WINDOWS
#define ENV_PLATFORM "windows"
#include <windows.h>
#else
#warning "ERROR: Please define a platform with -DPLATFORM_*."
#warning ""
#warning "Available platforms:"
#warning "* LINUX"
#warning "* WINDOWS"
#warning ""
#warning "Example: -DPLATFORM_LINUX"
#error "Compilation failed."
#endif
int _call_proc(char * argv[]) {
#if PLATFORM_LINUX
pid_t pid;
int status;
pid = fork();
if (pid == -1) {
return -1;
}
if (pid == 0) { // Child process
execvp(argv[0],argv);
// execvp only returns if an error occurs.
return -1;
} else { // Parent process
waitpid(pid,&status,0);
if (WIFEXITED(status) != 1) { return -1; }
return WEXITSTATUS(status);
}
return -1;
#elif PLATFORM_WINDOWS
char * command;
long commandLength = 0;
int i;
for (i = 0; argv[i] != NULL; i++) {
commandLength += strlen(argv[i]) + 3;
int si;
for (si = 0; argv[i][si] != 0; si++) {
if (argv[i][si] == '"') {
commandLength++;
}
}
}
commandLength += 1;
command = malloc(commandLength);
command[0] = 0;
for (i = 0; argv[i] != NULL; i++) {
int si;
strcat(command,"\"");
for (si = 0; argv[i][si] != 0; si++) {
if (argv[i][si] == '"') {
strcat(command,"\\");
}
strncat(command,(char *)&argv[i][si],1);
}
strcat(command,"\" ");
}
command[commandLength - 2] = 0;
// windows-specific section
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si,sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi,sizeof(pi));
BOOL b = CreateProcess(NULL,command,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
free(command);
if (b == 0) {
return -1;
}
WaitForSingleObject(pi.hProcess,INFINITE);
DWORD status;
if (!GetExitCodeProcess(pi.hProcess,&status)) {
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return -1;
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return status;
#endif
}
int call_proc(char * file, ...) {
char ** argv = malloc(sizeof(char *));
argv[0] = file;
int i = 1;
char * str = file;
va_list args;
va_start(args,file);
while (str != NULL) {
str = va_arg(args, char *);
argv = realloc(argv,sizeof(char *) * (i + 1));
argv[i] = str;
i++;
}
int code = _call_proc(argv);
free(argv);
va_end(args);
return code;
}
void call_proc_error(char * file, ...) {
char ** argv = malloc(sizeof(char *));
argv[0] = file;
int i = 1;
char * str = file;
va_list args;
va_start(args,file);
while (str != NULL) {
str = va_arg(args, char *);
argv = realloc(argv,sizeof(char *) * (i + 1));
argv[i] = str;
i++;
}
printf("* ");
int di;
for (di = 0; argv[di] != NULL; di++) {
printf("\"");
printf("%s",argv[di]);
printf("\" ");
}
printf("\n");
fflush(stdout);
int code = _call_proc(argv);
free(argv);
va_end(args);
if (code != 0) {
printf("Error %d, quitting.\n",code);
exit(code);
}
}
int main (int argc, const char * argv[]) {
/*printf("* ENV_PLATFORM: '"ENV_PLATFORM"'\n");
printf("* ENV_CC: '"ENV_CC"'\n");
printf("* ENV_CFLAGS: '"ENV_CFLAGS"'\n");
printf("\n");*/
#if PLATFORM_LINUX
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lapi.o","lapi.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lcode.o","lcode.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lctype.o","lctype.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","ldebug.o","ldebug.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","ldo.o","ldo.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","ldump.o","ldump.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lfunc.o","lfunc.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lgc.o","lgc.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","llex.o","llex.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lmem.o","lmem.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lobject.o","lobject.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lopcodes.o","lopcodes.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lparser.o","lparser.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lstate.o","lstate.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lstring.o","lstring.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","ltable.o","ltable.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","ltm.o","ltm.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lundump.o","lundump.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lvm.o","lvm.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lzio.o","lzio.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lauxlib.o","lauxlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lbaselib.o","lbaselib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lbitlib.o","lbitlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lcorolib.o","lcorolib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","ldblib.o","ldblib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","liolib.o","liolib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lmathlib.o","lmathlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","loslib.o","loslib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lstrlib.o","lstrlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","ltablib.o","ltablib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lutf8lib.o","lutf8lib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","loadlib.o","loadlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","linit.o","linit.c",NULL);
call_proc_error(ENV_CC,ENV_CFLAGS,"-shared","-o","liblua.a","lapi.o","lcode.o","lctype.o","ldebug.o","ldo.o","ldump.o","lfunc.o","lgc.o","llex.o","lmem.o","lobject.o","lopcodes.o","lparser.o","lstate.o","lstring.o","ltable.o","ltm.o","lundump.o","lvm.o","lzio.o","lauxlib.o","lbaselib.o","lbitlib.o","lcorolib.o","ldblib.o","liolib.o","lmathlib.o","loslib.o","lstrlib.o","ltablib.o","lutf8lib.o","loadlib.o","linit.o",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","lua.o","lua.c",NULL);
call_proc_error(ENV_CC,ENV_CFLAGS,"-o","lua","lua.o","liblua.a","-lm","-Wl,","-ldl","-lreadline",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_USE_LINUX",ENV_CFLAGS,"-c","-o","luac.o","luac.c",NULL);
call_proc_error(ENV_CC,ENV_CFLAGS,"-o","luac","luac.o","liblua.a","-lm","-Wl,","-ldl","-lreadline",NULL);
#endif
#if PLATFORM_WINDOWS
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lua.o","lua.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lapi.o","lapi.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lcode.o","lcode.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lctype.o","lctype.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","ldebug.o","ldebug.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","ldo.o","ldo.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","ldump.o","ldump.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lfunc.o","lfunc.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lgc.o","lgc.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","llex.o","llex.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lmem.o","lmem.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lobject.o","lobject.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lopcodes.o","lopcodes.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lparser.o","lparser.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lstate.o","lstate.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lstring.o","lstring.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","ltable.o","ltable.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","ltm.o","ltm.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lundump.o","lundump.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lvm.o","lvm.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lzio.o","lzio.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lauxlib.o","lauxlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lbaselib.o","lbaselib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lbitlib.o","lbitlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lcorolib.o","lcorolib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","ldblib.o","ldblib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","liolib.o","liolib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lmathlib.o","lmathlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","loslib.o","loslib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lstrlib.o","lstrlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","ltablib.o","ltablib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","lutf8lib.o","lutf8lib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","loadlib.o","loadlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2","-DLUA_BUILD_AS_DLL",ENV_CFLAGS,"-c","-o","linit.o","linit.c",NULL);
call_proc_error(ENV_CC,ENV_CFLAGS,"-shared","-o","lua53.dll","lapi.o","lcode.o","lctype.o","ldebug.o","ldo.o","ldump.o","lfunc.o","lgc.o","llex.o","lmem.o","lobject.o","lopcodes.o","lparser.o","lstate.o","lstring.o","ltable.o","ltm.o","lundump.o","lvm.o","lzio.o","lauxlib.o","lbaselib.o","lbitlib.o","lcorolib.o","ldblib.o","liolib.o","lmathlib.o","loslib.o","lstrlib.o","ltablib.o","lutf8lib.o","loadlib.o","linit.o",NULL);
//call_proc_error(ENV_CC,ENV_CFLAGS,"-o","lua.exe","-s","lua.o","lua53.dll","-lm",NULL);
call_proc_error(ENV_CC,ENV_CFLAGS,"-o","lua.exe","-s","lua.o","lua53.dll",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","luac.o","luac.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lapi.o","lapi.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lcode.o","lcode.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lctype.o","lctype.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","ldebug.o","ldebug.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","ldo.o","ldo.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","ldump.o","ldump.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lfunc.o","lfunc.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lgc.o","lgc.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","llex.o","llex.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lmem.o","lmem.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lobject.o","lobject.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lopcodes.o","lopcodes.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lparser.o","lparser.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lstate.o","lstate.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lstring.o","lstring.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","ltable.o","ltable.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","ltm.o","ltm.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lundump.o","lundump.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lvm.o","lvm.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lzio.o","lzio.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lauxlib.o","lauxlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lbaselib.o","lbaselib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lbitlib.o","lbitlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lcorolib.o","lcorolib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","ldblib.o","ldblib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","liolib.o","liolib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lmathlib.o","lmathlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","loslib.o","loslib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lstrlib.o","lstrlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","ltablib.o","ltablib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","lutf8lib.o","lutf8lib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","loadlib.o","loadlib.c",NULL);
call_proc_error(ENV_CC,"-O2","-Wall","-Wextra","-DLUA_COMPAT_5_2",ENV_CFLAGS,"-c","-o","linit.o","linit.c",NULL);
//call_proc_error(ENV_CC,ENV_CFLAGS,"-shared","-o","liblua.a","lapi.o","lcode.o","lctype.o","ldebug.o","ldo.o","ldump.o","lfunc.o","lgc.o","llex.o","lmem.o","lobject.o","lopcodes.o","lparser.o","lstate.o","lstring.o","ltable.o","ltm.o","lundump.o","lvm.o","lzio.o","lauxlib.o","lbaselib.o","lbitlib.o","lcorolib.o","ldblib.o","liolib.o","lmathlib.o","loslib.o","lstrlib.o","ltablib.o","lutf8lib.o","loadlib.o","linit.o",NULL);
////call_proc_error(ENV_CC,ENV_CFLAGS,"-o","luac.exe","luac.o","liblua.a","-lm",NULL);
//call_proc_error(ENV_CC,ENV_CFLAGS,"-o","luac.exe","luac.o","liblua.a",NULL);
#endif
return 0;
}