Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
9931e89679
|
|||
|
43cb9f19de
|
|||
|
f707214d24
|
|||
|
4c1cf7d02c
|
8
build.sh
8
build.sh
@@ -26,12 +26,12 @@ TARGET_SYSTEM=linux
|
||||
|
||||
# CMake Settings
|
||||
CMAKEDIR="${SRCDIR}/cmake"
|
||||
CMAKETAG="v4.2.0"
|
||||
CMAKETAG="v4.4.3"
|
||||
CMAKEVCS="https://gitlab.kitware.com/cmake/cmake.git"
|
||||
|
||||
# LLVM Settings
|
||||
LLVMDIR="${SRCDIR}/llvm"
|
||||
LLVMTAG="llvmorg-22.1.2"
|
||||
LLVMTAG="llvmorg-23.1.2"
|
||||
LLVMVCS="https://github.com/llvm/llvm-project.git"
|
||||
|
||||
# Mtools Settings
|
||||
@@ -408,9 +408,9 @@ xtchain_build()
|
||||
echo ">>> Building XTchain tools ..."
|
||||
mkdir -p ${BINDIR}/bin
|
||||
mkdir -p ${BINDIR}/lib/xtchain
|
||||
for EXEC in bin2c diskimg exetool xtadkgen xtcspecc; do
|
||||
for EXEC in bin2c diskimg exetool xtadkgen xtcspecc xtnlsc; do
|
||||
if [ ! -e ${BINDIR}/bin/${EXEC} ]; then
|
||||
${CCOMPILER} ${WRKDIR}/tools/${EXEC}.c -o ${BINDIR}/bin/${EXEC}
|
||||
${CCOMPILER} -I${WRKDIR}/tools/includes ${WRKDIR}/tools/${EXEC}.c -o ${BINDIR}/bin/${EXEC}
|
||||
fi
|
||||
done
|
||||
cp ${WRKDIR}/scripts/xtclib* ${BINDIR}/lib/xtchain/
|
||||
|
||||
55616
tools/includes/unicode.h
Normal file
55616
tools/includes/unicode.h
Normal file
File diff suppressed because it is too large
Load Diff
1803
tools/includes/xtchain.h
Normal file
1803
tools/includes/xtchain.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,8 @@ void ProcessSourceFile(FILE* InFile, FILE* OutFile)
|
||||
}
|
||||
|
||||
/* Generate the corresponding C-preprocessor macro definition */
|
||||
fprintf(OutFile, "#define %s %s\n", SymbolName, ValuePointer);
|
||||
fprintf(OutFile, "#undef %s\n", SymbolName);
|
||||
fprintf(OutFile, "#define %s %s\n\n", SymbolName, ValuePointer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
134
tools/xtchain.h
134
tools/xtchain.h
@@ -1,134 +0,0 @@
|
||||
/**
|
||||
* PROJECT: XTchain
|
||||
* LICENSE: See COPYING.md in the top level directory
|
||||
* FILE: tools/xtchain.h
|
||||
* DESCRIPTION: Common header for XTchain tools
|
||||
* DEVELOPERS: Martin Storsjo <martin@martin.st>
|
||||
* Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#include <dirent.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#define PATH_SEP '\\'
|
||||
#else
|
||||
#define PATH_SEP '/'
|
||||
#endif
|
||||
|
||||
#define SECTOR_SIZE 512
|
||||
#define _T(x) x
|
||||
|
||||
typedef struct MBR_PARTITION {
|
||||
uint8_t BootFlag; // 0x80 = bootable, 0x00 = non-boot
|
||||
uint8_t StartCHS [3]; // CHS address
|
||||
uint8_t Type; // Partition type
|
||||
uint8_t EndCHS[3]; // CHS address
|
||||
uint32_t StartLBA; // Start sector
|
||||
uint32_t Size; // Sectors count
|
||||
} MBR_PARTITION, *PMBR_PARTITION;
|
||||
|
||||
typedef struct _RESERVED_SECTOR_INFO
|
||||
{
|
||||
int SectorNumber;
|
||||
const char* Description;
|
||||
} RESERVED_SECTOR_INFO, *PRESERVED_SECTOR_INFO;
|
||||
|
||||
static
|
||||
inline
|
||||
char *
|
||||
_tcsrchrs(const char *str,
|
||||
char char1,
|
||||
char char2)
|
||||
{
|
||||
char *ptr1 = strrchr(str, char1);
|
||||
char *ptr2 = strrchr(str, char2);
|
||||
|
||||
if(!ptr1)
|
||||
{
|
||||
return ptr2;
|
||||
}
|
||||
|
||||
if(!ptr2)
|
||||
{
|
||||
return ptr1;
|
||||
}
|
||||
|
||||
if(ptr1 < ptr2)
|
||||
{
|
||||
return ptr2;
|
||||
}
|
||||
|
||||
return ptr1;
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
void
|
||||
split_argv(const char *argv0,
|
||||
char **dir_ptr,
|
||||
char **basename_ptr,
|
||||
char **target_ptr,
|
||||
char **exe_ptr)
|
||||
{
|
||||
const char *sep = _tcsrchrs(argv0, '/', '\\');
|
||||
const char *basename_ptr_const = argv0;
|
||||
char *dir = strdup(_T(""));
|
||||
|
||||
if(sep)
|
||||
{
|
||||
dir = strdup(argv0);
|
||||
dir[sep + 1 - argv0] = '\0';
|
||||
basename_ptr_const = sep + 1;
|
||||
}
|
||||
|
||||
char *basename = strdup(basename_ptr_const);
|
||||
char *period = strchr(basename, '.');
|
||||
|
||||
if(period)
|
||||
{
|
||||
*period = '\0';
|
||||
}
|
||||
|
||||
char *target = strdup(basename);
|
||||
char *dash = strrchr(target, '-');
|
||||
char *exe = basename;
|
||||
|
||||
if(dash)
|
||||
{
|
||||
*dash = '\0';
|
||||
exe = dash + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
target = NULL;
|
||||
}
|
||||
|
||||
if(dir_ptr)
|
||||
{
|
||||
*dir_ptr = dir;
|
||||
}
|
||||
|
||||
if(basename_ptr)
|
||||
{
|
||||
*basename_ptr = basename;
|
||||
}
|
||||
|
||||
if(target_ptr)
|
||||
{
|
||||
*target_ptr = target;
|
||||
}
|
||||
|
||||
if(exe_ptr)
|
||||
{
|
||||
*exe_ptr = exe;
|
||||
}
|
||||
}
|
||||
3416
tools/xtnlsc.c
Normal file
3416
tools/xtnlsc.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user