Changeset 2965 for trunk


Ignore:
Timestamp:
Feb 13, 2007, 10:04:40 PM (18 years ago)
Author:
bird
Message:

messing about...

Location:
trunk/kLdr
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/Makefile.kmk

    r2960 r2965  
    5050 TEMPLATE_TST_SDKS = WINPSDK W2K3DDK
    5151
    52 else 
     52else
    5353 ifeq ($(BUILD_TARGET),os2)
    5454  TEMPLATE_TST_TOOL = GCC3OMF
    5555  TEMPLATE_TST_ASFLAGS = -f obj
    5656  TEMPLATE_TST_LIBS = os2 gcc end
     57 else ifeq ($(BUILD_TARGET),darwin)
     58  TEMPLATE_TST_TOOL = GCC4MACHO
     59  TEMPLATE_TST_ASFLAGS = -f macho
     60  TEMPLATE_TST_LIBS = #os2 gcc end
    5761 else
    5862  TEMPLATE_TST_TOOL = GCC3
     
    8286 else
    8387  kLdr_TOOL = VCC80AMD64
     88  kLdr_ASTOOL = YASM
    8489  kLdr_CFLAGS = -W3 -Zl -MT
    8590  kLdr_LDFLAGS = -Entry:DllMain -Debug
     
    97102  kLdr_ASFLAGS = -f obj
    98103  kLdr_LIBS = os2 gcc end
     104 else ifeq ($(BUILD_TARGET),darwin)
     105  kLdr_TOOL = GCC4MACHO
     106  kLdr_ASFLAGS = -f macho
     107  kLdr_LIBS = #os2 gcc end
    99108 else
    100109  kLdr_TOOL = GCC3
     
    216225                -e '/^#define  *\(KLDR_ERR_[^ ()]*\) .*$$/!d' \
    217226                -e 's/^#define  *\(KLDR_ERR_[^ ()]*\) .*$$/ERR_CONST(\1)/' \
     227                -e '/KLDR_ERR_BASE/d' \
    218228                -e '/KLDR_ERR_[^_]*_BASE/d' \
    219229                kLdr.h > $@
  • trunk/kLdr/kLdr.h

    r2964 r2965  
    11951195 * @{
    11961196 */
    1197 #ifdef __OS2__
    1198 # define KLDR_ERR_BASE          420000
    1199 #elif defined(__WIN__)
    1200 # define KLDR_ERR_BASE          420000
    1201 #else
    1202 # error "port me"
    1203 #endif
     1197
     1198#define KLDR_ERR_BASE                                       420000
     1199
    12041200/** The image format is unknown. */
    1205 #define KLDR_ERR_UNKNOWN_FORMAT         (KLDR_ERR_BASE + 0)
     1201#define KLDR_ERR_UNKNOWN_FORMAT                             (KLDR_ERR_BASE + 0)
    12061202/** The MZ image format isn't supported by this kLdr build. */
    1207 #define KLDR_ERR_MZ_NOT_SUPPORTED       (KLDR_ERR_BASE + 1)
     1203#define KLDR_ERR_MZ_NOT_SUPPORTED                           (KLDR_ERR_BASE + 1)
    12081204/** The NE image format isn't supported by this kLdr build. */
    1209 #define KLDR_ERR_NE_NOT_SUPPORTED       (KLDR_ERR_BASE + 2)
     1205#define KLDR_ERR_NE_NOT_SUPPORTED                           (KLDR_ERR_BASE + 2)
    12101206/** The LX image format isn't supported by this kLdr build. */
    1211 #define KLDR_ERR_LX_NOT_SUPPORTED       (KLDR_ERR_BASE + 3)
     1207#define KLDR_ERR_LX_NOT_SUPPORTED                           (KLDR_ERR_BASE + 3)
    12121208/** The LE image format isn't supported by this kLdr build. */
    1213 #define KLDR_ERR_LE_NOT_SUPPORTED       (KLDR_ERR_BASE + 4)
     1209#define KLDR_ERR_LE_NOT_SUPPORTED                           (KLDR_ERR_BASE + 4)
    12141210/** The PE image format isn't supported by this kLdr build. */
    1215 #define KLDR_ERR_PE_NOT_SUPPORTED       (KLDR_ERR_BASE + 5)
     1211#define KLDR_ERR_PE_NOT_SUPPORTED                           (KLDR_ERR_BASE + 5)
    12161212/** The ELF image format isn't supported by this kLdr build. */
    1217 #define KLDR_ERR_ELF_NOT_SUPPORTED      (KLDR_ERR_BASE + 6)
     1213#define KLDR_ERR_ELF_NOT_SUPPORTED                          (KLDR_ERR_BASE + 6)
    12181214/** The mach-o image format isn't supported by this kLdr build. */
    1219 #define KLDR_ERR_MACHO_NOT_SUPPORTED    (KLDR_ERR_BASE + 7)
     1215#define KLDR_ERR_MACHO_NOT_SUPPORTED                        (KLDR_ERR_BASE + 7)
    12201216/** The FAT image format isn't supported by this kLdr build or
    12211217 * a direct open was attempt without going thru the FAT file provider.
    12221218 * FAT images are also known as Universal Binaries. */
    1223 #define KLDR_ERR_FAT_NOT_SUPPORTED      (KLDR_ERR_BASE + 8)
     1219#define KLDR_ERR_FAT_NOT_SUPPORTED                          (KLDR_ERR_BASE + 8)
    12241220/** The a.out image format isn't supported by this kLdr build. */
    1225 #define KLDR_ERR_AOUT_NOT_SUPPORTED     (KLDR_ERR_BASE + 9)
     1221#define KLDR_ERR_AOUT_NOT_SUPPORTED                         (KLDR_ERR_BASE + 9)
    12261222
    12271223/** Invalid parameter to a kLdr API. */
  • trunk/kLdr/testcase/Makefile.kmk

    r2960 r2965  
    6060
    6161else
     62 TEMPLATE_TST_CFLAGS = -Wall -pedantic -g
     63 TEMPLATE_TST_CFLAGS.release = -O2
     64 TEMPLATE_TST_LDFLAGS =
    6265 ifneq ($(filter os2,$(BUILD_TARGET)),)
    6366  TEMPLATE_TST_TOOL = GCC3OMF
    6467  TEMPLATE_TST_ASFLAGS = -f obj
    6568  TEMPLATE_TST_LIBS = os2 gcc end
     69 else ifneq ($(filter darwin,$(BUILD_TARGET)),)
     70  TEMPLATE_TST_TOOL = GCC4MACHO
     71  TEMPLATE_TST_ASFLAGS = -f macho
     72  TEMPLATE_TST_DEFS = __DARWIN__
     73  TEMPLATE_TST_LIBS =
    6674 else
    6775  TEMPLATE_TST_TOOL = GCC3
     
    6977  TEMPLATE_TST_LIBS = gcc
    7078 endif
    71  TEMPLATE_TST_CFLAGS = -Wall -pedantic -g
    72  TEMPLATE_TST_CFLAGS.release = -O2
    73  TEMPLATE_TST_LDFLAGS =
    7479endif
    7580TEMPLATE_TST_INCS = . ..
     
    101106
    102107else
    103  ifneq ($(filter os2,$(BUILD_TARGET)),)
     108 TEMPLATE_TSTBARE_CFLAGS = -Wall -pedantic -g
     109 TEMPLATE_TSTBARE_CFLAGS.release = -O2
     110 TEMPLATE_TSTBARE_LDFLAGS = -nostdlib -lgcc
     111 ifeq ($(filter-out os2,$(BUILD_TARGET)),)
    104112  TEMPLATE_TSTBARE_TOOL = GCC3OMF
    105113  TEMPLATE_TSTBARE_ASFLAGS = -f obj
     
    107115  TEMPLATE_TSTBARE_DEFS = main=main_wrapped
    108116  TEMPLATE_TSTBARE_LIBS = os2
     117 else ifeq ($(filter-out darwin,$(BUILD_TARGET)),)
     118  TEMPLATE_TSTBARE_TOOL = GCC4MACHO
     119  TEMPLATE_TSTBARE_ASFLAGS = -f macho
     120  TEMPLATE_TSTBARE_ASTOOL = NASM
     121  TEMPLATE_TSTBARE_DEFS = __DARWIN__
     122  TEMPLATE_TSTBARE_LIBS =
     123  TEMPLATE_TSTBARE_CFLAGS += -static
     124  TEMPLATE_TSTBARE_LDFLAGS += -nostdlib -r
    109125 else
    110126  TEMPLATE_TSTBARE_TOOL = GCC3
     
    112128  TEMPLATE_TSTBARE_LIBS = gcc
    113129 endif
    114  TEMPLATE_TSTBARE_CFLAGS = -Wall -pedantic -g
    115  TEMPLATE_TSTBARE_CFLAGS.release = -O2
    116  TEMPLATE_TSTBARE_LDFLAGS = -nostdlib -lgcc
    117130endif
    118131TEMPLATE_TSTBARE_INCS = . ..
     
    129142TEMPLATE_TSTBAREDLL = Bare bone testcase dll template
    130143TEMPLATE_TSTBAREDLL_EXTENDS = TSTBARE
    131 ifneq ($(filter win nt win32 win64,$(BUILD_TARGET)),)
    132 TEMPLATE_TSTBAREDLL_LDFLAGS += -Entry:DllMain
    133 else
     144ifeq ($(BUILD_TARGET),win)
     145 TEMPLATE_TSTBAREDLL_LDFLAGS += -Entry:DllMain
     146else ifeq ($(BUILD_TARGET),darwin)
     147# TEMPLATE_TSTBAREDLL_CFLAGS += -dynamiclib
     148# TEMPLATE_TSTBAREDLL_LDFLAGS += -dynamiclib
    134149endif
    135150
     
    168183tst-0_SOURCES.os2= tstExeMainStub-os2.asm
    169184
    170 ifeq ($(filter-out nt win win32 win64,$(BUILD_TARGET)),)
     185ifeq ($(BUILD_TARGET),win)
    171186tst-0-driver_LIBS= $(PATH_LIB)/kLdr.lib
    172187tst-0-a_LIBS     = $(PATH_TARGET)/tst-0-d/tst-0-d.lib
     
    175190tst-0_LIBS       = $(TARGET_tst-0-a:.dll=.lib) $(TARGET_tst-0-b:.dll=.lib) $(TARGET_tst-0-c:.dll=.lib)
    176191else
    177 tst-0-driver_LIBS.os2 = $(PATH_DLL)/kLdr.dll
     192tst-0-driver_LIBS= $(PATH_DLL)/kLdr$(SUFF_DLL)
    178193tst-0-a_LIBS     = $(subst -a,-d,$(TARGET_tst-0-a))
    179194tst-0-b_LIBS     = $(subst -b,-d,$(TARGET_tst-0-b))
     
    204219tst-1_SOURCES    = tst-1.c
    205220
    206 ifeq ($(filter-out nt win win32 win64,$(BUILD_TARGET)),)
     221ifeq ($(BUILD_TARGET),win)
    207222tst-1-a_LIBS     = $(PATH_TARGET)/tst-1-d/tst-1-d.lib
    208223tst-1-b_LIBS     = $(PATH_TARGET)/tst-1-d/tst-1-d.lib
     
    238253tst-2_SOURCES    = tst-2.c
    239254
    240 ifeq ($(filter-out nt win win32 win64,$(BUILD_TARGET)),)
     255ifeq ($(BUILD_TARGET),win)
    241256tst-2-b_LIBS     = $(PATH_TARGET)/tst-2-a/tst-2-a.lib
    242257tst-2-c_LIBS     = $(PATH_TARGET)/tst-2-a/tst-2-a.lib
     
    251266
    252267
     268#
     269# tst-3: Single module.
     270#
     271PROGRAMS += tst-3-driver
     272DLLS += tst-3
     273
     274tst-3_TEMPLATE = TSTBAREDLL
     275tst-3_SOURCES  = tst-3.c tstDllMainStub.c
     276tst-3_SOURCES.os2= tstDllMainStub-os2.asm
     277
     278tst-3-driver_TEMPLATE = TSTPROG
     279tst-3-driver_SOURCES  = tst-3-driver.c
     280
     281ifeq ($(BUILD_TARGET),win)
     282tst-3-driver_LIBS = $(PATH_LIB)/kLdr.lib
     283else
     284tst-3-driver_LIBS = $(PATH_DLL)/kLdr$(SUFF_DLL)
     285endif
     286
    253287
    254288# generate rules.
  • trunk/kLdr/testcase/tst-0-driver.c

    r2878 r2965  
    6161    g_cErrors++;
    6262
    63     printf("tstLdrMod: ");
     63    printf("tst-0-driver: ");
    6464    va_start(va, pszFormat);
    6565    vprintf(pszFormat, va);
  • trunk/kLdr/testcase/tst.h

    r2885 r2965  
    4242#endif
    4343
    44 #if defined(__OS2__)
     44#if defined(__OS2__) || defined(__DARWIN__)
    4545# define MY_NAME(a) "_" a
    4646#else
  • trunk/kLdr/testcase/tstDllMain.c

    r2885 r2965  
    4040# include <string.h>
    4141
     42#elif defined(__DARWIN__)
     43# include <unistd.h>
     44# include <string.h>
     45
    4246#else
    4347# error "port me"
    4448#endif
    4549
     50
    4651/*******************************************************************************
    4752*   Internal Functions                                                         *
    4853*******************************************************************************/
    49 static void tstWrite(const char *psz);
     54void tstWrite(const char *psz);
    5055
    5156
     
    120125}
    121126
     127#elif defined(__DARWIN__)
     128/* later */
     129
    122130#else
    123131# error "port me"
     
    130138 * @param   pszMsg  The string.
    131139 */
    132 static void tstWrite(const char *pszMsg)
     140void tstWrite(const char *pszMsg)
    133141{
    134142#if defined(__OS2__) || defined(__WIN__)
     
    171179    }
    172180
     181#elif defined(__DARWIN__)
     182    write(STDERR_FILENO, pszMsg, strlen(pszMsg));
     183
    173184#else
    174185# error "port me"
  • trunk/kLdr/testcase/tstDllMainStub.c

    r2878 r2965  
    3838# include <windows.h>
    3939
     40#elif defined(__DARWIN__)
     41/* later */
     42
    4043#else
    4144# error "port me"
     
    6265}
    6366
     67#elif defined(__DARWIN__)
     68/* later */
     69
    6470#else
    6571# error "port me"
Note: See TracChangeset for help on using the changeset viewer.