VirtualBox

Ignore:
Timestamp:
Jan 27, 2015 5:50:17 PM (10 years ago)
Author:
vboxsync
Message:

VBoxDTrace: Morphing it into an extension pack, adding a wrapper binary, VBoxDTrace, that calls dtrace or the extension pack depending on what it finds. Build fixes for recent linux.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk

    r53972 r53974  
    11# $Id$
    22## @file
    3 # Sub-makefile for VBoxDTraceR0.
     3# Sub-makefile for VBoxDTrace.
    44#
    55# Contributed by: bird
     
    1818#
    1919
    20 SUB_DEPTH = ../../../../../
     20SUB_DEPTH = ../../../../
    2121include $(KBUILD_PATH)/subheader.kmk
    2222
     23
     24#
     25# The generic wrapper that selects native or extpack dtrace cmd and adds our
     26# library path to the command line.
     27#
     28# Note! This is not installed as part of the extension pack, but always shipped
     29#       with the base VBox installation.
     30#
    2331PROGRAMS += VBoxDTrace
    24 VBoxDTrace_TEMPLATE = VBOXR3NPEXE
    25 VBoxDTrace_DEFS = RTMEM_WRAP_TO_EF_APIS
    26 #VBoxDTrace_DEFS += YYDEBUG
    27 VBoxDTrace_SDKS = VBOX_ZLIB
     32VBoxDTrace_TEMPLATE := VBOXR3EXE
     33VBoxDTrace_SOURCES := VBoxDTraceWrapper.cpp
     34VBoxDTrace_LIBS = $(LIB_RUNTIME)
     35
     36
     37#
     38# Install the description.
     39#
     40INSTALLS += VBoxDTraceIns
     41VBoxDTraceIns_TEMPLATE = VBoxInsExtPackDTrace
     42VBoxDTraceIns_SOURCES = \
     43        $(VBoxDTraceIns_0_OUTDIR)/ExtPack.xml \
     44        COPYING=>ExtPack-SourceCodeLicense.txt
     45$(call VBOX_EDIT_VERSION_RULE_FN,VBoxDTraceIns,ExtPack.xml)
     46
     47
     48#
     49# The ring-3 VBoxDTrace command implementation (library).
     50#
     51DLLS += VBoxDTraceCmd
     52VBoxDTraceCmd_TEMPLATE = VBoxR3ExtPackDTrace
     53VBoxDTraceCmd_DEFS = RTMEM_WRAP_TO_EF_APIS
     54#VBoxDTraceCmd_DEFS += YYDEBUG
     55VBoxDTraceCmd_SDKS = VBOX_ZLIB
    2856ifn1of ($(KBUILD_TARGET), win)
    29  VBoxDTrace_CFLAGS = -Wno-format
     57 VBoxDTraceCmd_CFLAGS = -Wno-format -Wno-overlength-strings -Wno-sign-compare -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-shadow
    3058endif
    31 VBoxDTrace_INCS = \
    32         ../include \
     59VBoxDTraceCmd_INCS = \
     60        include \
    3361        $(VBOXDT_PATH_UTS)/common \
    3462        $(VBOXDT_PATH_LIBCTF)/common \
    3563        $(VBOXDT_PATH_LIBDTRACE)/common \
    3664        $(VBOXDT_PATH_CMN_CTF)
    37 VBoxDTrace_SOURCES = \
     65VBoxDTraceCmd_SOURCES = \
    3866        $(VBOXDT_PATH_CMD)/dtrace/dtrace.c \
    3967        \
     
    7098        $(VBOXDT_PATH_LIBDTRACE)/common/dt_xlator.c \
    7199        \
    72         $(VBoxDTrace_0_OUTDIR)/dt_errtags.c \
    73         $(VBoxDTrace_0_OUTDIR)/dt_names.c \
     100        $(VBoxDTraceCmd_0_OUTDIR)/dt_errtags.c \
     101        $(VBoxDTraceCmd_0_OUTDIR)/dt_names.c \
    74102        \
    75103        $(VBOXDT_PATH_CMN_CTF)/ctf_create.c \
     
    87115
    88116if 1
    89  USES                += yacc
    90  VBoxDTrace_USES     += yacc
    91  VBoxDTrace_YACCTOOL  = BISON
    92  VBoxDTrace_YACCFLAGS = -d -y
    93  VBoxDTrace_SOURCES  += \
     117 USES                   += yacc
     118 VBoxDTraceCmd_USES     += yacc
     119 VBoxDTraceCmd_YACCTOOL  = BISON
     120 VBoxDTraceCmd_YACCFLAGS = -d -y
     121 VBoxDTraceCmd_SOURCES  += \
    94122        $(VBOXDT_PATH_LIBDTRACE)/common/dt_grammar.y
    95  VBoxDTrace_INCS     += $(VBoxDTrace_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common
     123 VBoxDTraceCmd_INCS     += $(VBoxDTraceCmd_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common
    96124else
    97125 # TODO: generate these.
     
    99127
    100128if 1
    101  USES                += lex
    102  VBoxDTrace_USES     += lex
    103  VBoxDTrace_LEXTOOL   = FLEX
    104  VBoxDTrace_LEXFLAGS  = -l -B #-d -T
    105  VBoxDTrace_DEFS     += USING_FLEX
    106  VBoxDTrace_SOURCES  += \
     129 USES                   += lex
     130 VBoxDTraceCmd_USES     += lex
     131 VBoxDTraceCmd_LEXTOOL   = FLEX
     132 VBoxDTraceCmd_LEXFLAGS  = -l -B #-d -T
     133 VBoxDTraceCmd_DEFS     += USING_FLEX
     134 VBoxDTraceCmd_SOURCES  += \
    107135        $(VBOXDT_PATH_LIBDTRACE)/common/dt_lex.l
    108136else
     
    110138endif
    111139
    112 VBoxDTrace_LIBS = \
     140VBoxDTraceCmd_LIBS = \
    113141        $(LIB_RUNTIME)
    114142
    115143
    116144# Generate sources
    117 $$(VBoxDTrace_0_OUTDIR)/dt_errtags.c: \
     145$$(VBoxDTraceCmd_0_OUTDIR)/dt_errtags.c: \
    118146                $(VBOXDT_PATH_LIBDTRACE)/common/dt_errtags.h \
    119147                $(VBOXDT_PATH_LIBDTRACE)/common/mkerrtags.sed \
    120148                | $$(dir $$@)
    121         $(MSG_GENERATE,VBoxDTrace,$@,$<)
     149        $(MSG_GENERATE,VBoxDTraceCmd,$@,$<)
    122150        $(SED) -n -f $(VBOXDT_PATH_LIBDTRACE)/common/mkerrtags.sed --output $@ $<
    123151
    124 $$(VBoxDTrace_0_OUTDIR)/dt_names.c: \
     152$$(VBoxDTraceCmd_0_OUTDIR)/dt_names.c: \
    125153                $(VBOXDT_PATH_UTS)/common/sys/dtrace.h \
    126154                $(VBOXDT_PATH_LIBDTRACE)/common/mknames.sed \
    127155                | $$(dir $$@)
    128         $(MSG_GENERATE,VBoxDTrace,$@,$<)
     156        $(MSG_GENERATE,VBoxDTraceCmd,$@,$<)
    129157        $(SED) -n -f $(VBOXDT_PATH_LIBDTRACE)/common/mknames.sed --output $@ $<
    130158
    131159
    132160#
    133 # Sournce not used or wanted: \
     161# Source not used or wanted: \
    134162#       $(VBOXDT_PATH_LIBDTRACE)/common/dt_link.c
    135163#       $(VBOXDT_PATH_LIBDTRACE)/common/dt_pid.c
    136164#
    137165
     166
     167#
     168# The ring-0 part of VBoxDTrace.
     169#
     170SYSMODS += VBoxDTraceR0
     171VBoxDTraceR0_TEMPLATE = VBoxR0ExtPackDTrace
     172VBoxDTraceR0_DEFS = IN_VBOXDTRACE_R0 IN_RT_R0
     173ifeq ($(VBOX_LDR_FMT),elf)
     174 VBoxDTraceR0_LDFLAGS = -e ModuleInit
     175endif
     176VBoxDTraceR0_INCS = \
     177        include \
     178        $(VBOXDT_PATH_UTS)/common
     179VBoxDTraceR0_SOURCES = \
     180        VBoxDTraceR0.cpp \
     181        VBoxDTraceR0A.asm \
     182        $(VBOXDT_PATH_UTS)/common/dtrace/dtrace.c
     183VBoxDTraceR0_LIBS = \
     184        $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
     185ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
     186 VBoxDTraceR0_LIBS += \
     187        $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
     188endif
     189
     190
    138191include $(FILE_KBUILD_SUB_FOOTER)
    139192
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette