VirtualBox

Changeset 48178 in vbox for trunk/src


Ignore:
Timestamp:
Aug 30, 2013 3:54:49 AM (11 years ago)
Author:
vboxsync
Message:

Do not hardcode lwip location in lwip makefile. Provide functions for
"calling" makefiles to add lwip to its sources and use these functions
in Devices and NAT.

XXX: It's still icky that Devices pulls in lwip makefile and then NAT
(which is included later) inherits it. But this commit allows
inclusion problem (and possible move of the lwip directory) to be
addressed separately.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Makefile.kmk

    r48169 r48178  
    324324
    325325 ifdef VBOX_WITH_INIP
     326  VBoxDD_DEFS           += VBOX_WITH_INIP
     327  VBoxDD_SOURCES        += \
     328        Network/DevINIP.cpp
    326329  ifndef VBOX_WITH_NEW_LWIP
    327330    include $(PATH_SUB_CURRENT)/Network/lwip/Makefile.kmk
     331    VBoxDD_INCS         += $(LWIP_INCS)
     332    VBoxDD_SOURCES      += $(LWIP_SOURCES)
    328333  else
     334    # XXX: Ancestor makefile includes us before NAT service, so NAT
     335    #      makefile depends on lwip Makefile included here...
    329336    include $(PATH_SUB_CURRENT)/Network/lwip-new/Makefile.kmk
    330   endif
    331   VBoxDD_DEFS           += VBOX_WITH_INIP
    332   VBoxDD_INCS           += $(LWIP_INCS)
    333   VBoxDD_SOURCES        += $(LWIP_SOURCES)
    334   VBoxDD_SOURCES        += \
    335         Network/DevINIP.cpp
    336   ifdef VBOX_WITH_NEW_LWIP
     337
    337338    Network/DevINIP.cpp_DEFS += VBOX_WITH_NEW_LWIP
    338   endif
    339  endif
     339    $(eval $(call def_vbox_lwip_private, \
     340                      VBoxDD, Network/lwip-new))
     341    $(eval $(call def_vbox_lwip_flags, \
     342                      Network/DevINIP.cpp, Network/lwip-new))
     343  endif
     344 endif # VBOX_WITH_INIP
    340345
    341346 ifdef VBOX_WITH_E1000
     
    407412
    408413 ifdef VBOX_WITH_ISCSI
    409   Storage/DrvVD.cpp_INCS = $(LWIP_INCS)
    410414  ifdef VBOX_WITH_NEW_LWIP
    411415    Storage/DrvVD.cpp_DEFS += VBOX_WITH_NEW_LWIP
     416    $(eval $(call def_vbox_lwip_flags, \
     417                      Storage/DrvVD.cpp, Network/lwip-new))
     418  else
     419    Storage/DrvVD.cpp_INCS = $(LWIP_INCS)
    412420  endif
    413421 endif
  • trunk/src/VBox/Devices/Network/lwip-new/Makefile.kmk

    r48169 r48178  
    2424
    2525LWIP_INCS += \
    26     Network/lwip-new/src/include \
    27     Network/lwip-new/src/include/ipv4 \
    28     Network/lwip-new/src/include/ipv6 \
    29     Network/lwip-new/vbox/include \
    30     Network/lwip-new/vbox
     26    src/include \
     27    src/include/ipv4 \
     28    src/include/ipv6 \
     29    vbox/include \
     30    vbox
    3131
    3232LWIP_SOURCES += \
    33     Network/lwip-new/src/api/api_lib.c \
    34     Network/lwip-new/src/api/api_msg.c \
    35     Network/lwip-new/src/api/err.c \
    36     Network/lwip-new/src/api/netbuf.c \
    37     Network/lwip-new/src/api/netdb.c \
    38     Network/lwip-new/src/api/netifapi.c \
    39     Network/lwip-new/src/api/sockets.c \
    40     Network/lwip-new/src/api/tcpip.c \
    41     Network/lwip-new/src/core/def.c \
    42     Network/lwip-new/src/core/dhcp.c \
    43     Network/lwip-new/src/core/dns.c \
    44     Network/lwip-new/src/core/inet_chksum.c \
    45     Network/lwip-new/src/core/init.c \
    46     Network/lwip-new/src/core/ipv4/autoip.c \
    47     Network/lwip-new/src/core/ipv4/icmp.c \
    48     Network/lwip-new/src/core/ipv4/igmp.c \
    49     Network/lwip-new/src/core/ipv4/ip4.c \
    50     Network/lwip-new/src/core/ipv4/ip4_addr.c \
    51     Network/lwip-new/src/core/ipv4/ip_frag.c \
    52     Network/lwip-new/src/core/ipv6/dhcp6.c \
    53     Network/lwip-new/src/core/ipv6/ethip6.c \
    54     Network/lwip-new/src/core/ipv6/icmp6.c \
    55     Network/lwip-new/src/core/ipv6/inet6.c \
    56     Network/lwip-new/src/core/ipv6/ip6.c \
    57     Network/lwip-new/src/core/ipv6/ip6_addr.c \
    58     Network/lwip-new/src/core/ipv6/ip6_frag.c \
    59     Network/lwip-new/src/core/ipv6/mld6.c \
    60     Network/lwip-new/src/core/ipv6/nd6.c \
    61     Network/lwip-new/src/core/mem.c \
    62     Network/lwip-new/src/core/memp.c \
    63     Network/lwip-new/src/core/netif.c \
    64     Network/lwip-new/src/core/pbuf.c \
    65     Network/lwip-new/src/core/raw.c \
    66     Network/lwip-new/src/core/stats.c \
    67     Network/lwip-new/src/core/sys.c \
    68     Network/lwip-new/src/core/tcp.c \
    69     Network/lwip-new/src/core/tcp_in.c \
    70     Network/lwip-new/src/core/tcp_out.c \
    71     Network/lwip-new/src/core/timers.c \
    72     Network/lwip-new/src/core/udp.c \
    73     Network/lwip-new/src/netif/etharp.c \
    74     Network/lwip-new/vbox/sys_arch.c \
    75     Network/lwip-new/vbox/VBoxLwipCore.cpp
     33    src/api/api_lib.c \
     34    src/api/api_msg.c \
     35    src/api/err.c \
     36    src/api/netbuf.c \
     37    src/api/netdb.c \
     38    src/api/netifapi.c \
     39    src/api/sockets.c \
     40    src/api/tcpip.c \
     41    src/core/def.c \
     42    src/core/dhcp.c \
     43    src/core/dns.c \
     44    src/core/inet_chksum.c \
     45    src/core/init.c \
     46    src/core/ipv4/autoip.c \
     47    src/core/ipv4/icmp.c \
     48    src/core/ipv4/igmp.c \
     49    src/core/ipv4/ip4.c \
     50    src/core/ipv4/ip4_addr.c \
     51    src/core/ipv4/ip_frag.c \
     52    src/core/ipv6/dhcp6.c \
     53    src/core/ipv6/ethip6.c \
     54    src/core/ipv6/icmp6.c \
     55    src/core/ipv6/inet6.c \
     56    src/core/ipv6/ip6.c \
     57    src/core/ipv6/ip6_addr.c \
     58    src/core/ipv6/ip6_frag.c \
     59    src/core/ipv6/mld6.c \
     60    src/core/ipv6/nd6.c \
     61    src/core/mem.c \
     62    src/core/memp.c \
     63    src/core/netif.c \
     64    src/core/pbuf.c \
     65    src/core/raw.c \
     66    src/core/stats.c \
     67    src/core/sys.c \
     68    src/core/tcp.c \
     69    src/core/tcp_in.c \
     70    src/core/tcp_out.c \
     71    src/core/timers.c \
     72    src/core/udp.c \
     73    src/netif/etharp.c \
     74    vbox/sys_arch.c \
     75    vbox/VBoxLwipCore.cpp
    7676
    7777# LWIP_SOURCES += \
    78 #     Network/lwip-new/src/core/snmp/asn1_dec.c \
    79 #     Network/lwip-new/src/core/snmp/asn1_enc.c \
    80 #     Network/lwip-new/src/core/snmp/mib2.c \
    81 #     Network/lwip-new/src/core/snmp/mib_structs.c \
    82 #     Network/lwip-new/src/core/snmp/msg_in.c \
    83 #     Network/lwip-new/src/core/snmp/msg_out.c \
     78#     src/core/snmp/asn1_dec.c \
     79#     src/core/snmp/asn1_enc.c \
     80#     src/core/snmp/mib2.c \
     81#     src/core/snmp/mib_structs.c \
     82#     src/core/snmp/msg_in.c \
     83#     src/core/snmp/msg_out.c \
    8484
    8585# LWIP_SOURCES += \
    86 #     Network/lwip-new/src/netif/slipif.c \
     86#     src/netif/slipif.c \
    8787
    8888# LWIP_SOURCES += \
    89 #     Network/lwip-new/src/netif/ppp/auth.c \
    90 #     Network/lwip-new/src/netif/ppp/chap.c \
    91 #     Network/lwip-new/src/netif/ppp/chpms.c \
    92 #     Network/lwip-new/src/netif/ppp/fsm.c \
    93 #     Network/lwip-new/src/netif/ppp/ipcp.c \
    94 #     Network/lwip-new/src/netif/ppp/lcp.c \
    95 #     Network/lwip-new/src/netif/ppp/magic.c \
    96 #     Network/lwip-new/src/netif/ppp/md5.c \
    97 #     Network/lwip-new/src/netif/ppp/pap.c \
    98 #     Network/lwip-new/src/netif/ppp/ppp.c \
    99 #     Network/lwip-new/src/netif/ppp/ppp_oe.c \
    100 #     Network/lwip-new/src/netif/ppp/randm.c \
    101 #     Network/lwip-new/src/netif/ppp/vj.c
     89#     src/netif/ppp/auth.c \
     90#     src/netif/ppp/chap.c \
     91#     src/netif/ppp/chpms.c \
     92#     src/netif/ppp/fsm.c \
     93#     src/netif/ppp/ipcp.c \
     94#     src/netif/ppp/lcp.c \
     95#     src/netif/ppp/magic.c \
     96#     src/netif/ppp/md5.c \
     97#     src/netif/ppp/pap.c \
     98#     src/netif/ppp/ppp.c \
     99#     src/netif/ppp/ppp_oe.c \
     100#     src/netif/ppp/randm.c \
     101#     src/netif/ppp/vj.c
     102
     103
     104define def_vbox_lwip_flags # VAR_BaseName, path/to/lwip/dir
     105  $(strip $1)_INCS += $(foreach incdir, $(LWIP_INCS), $(strip $2)/$(incdir))
     106endef
     107
     108define _def_vbox_lwip_use # VAR_BaseName, path/to/lwip/dir
     109  $(strip $1)_SOURCES += \
     110        $(foreach file, $(LWIP_SOURCES), $(strip $2)/$(file))
     111
     112  # if individual lwip files need special settings, add them here:
     113  # $(strip $2)/src/foo/bar.c_CFLAGS += -magic
     114endef
     115
     116###
     117### Call this if you want to expose lwip to your component as a whole.
     118### In this case individual lwip files (added to _SOURCES of your
     119### component) will pick up lwip includes etc from your component
     120### settings.
     121###
     122### This is, for example, how NetworkServices/NAT uses it.
     123###
     124define def_vbox_lwip_public # VAR_BaseName, path/to/lwip/dir
     125  $(eval $(call _def_vbox_lwip_use, $1, $2))
     126  $(eval $(call def_vbox_lwip_flags, $1, $2))
     127endef
     128
     129###
     130### Call this if you want to expose lwip only to a few selected files.
     131### In this case each lwip file is configured with lwip includes etc
     132### separately and you are supposed to call def_vbox_lwip_flags
     133### yourself for those of your files that use lwip.
     134###
     135### This is, for example, how Devices uses it.
     136###
     137define def_vbox_lwip_private # VAR_BaseName, path/to/lwip/dir
     138  $(eval $(call _def_vbox_lwip_use, $1, $2))
     139  $(foreach file, $(LWIP_SOURCES), \
     140    $(eval $(call def_vbox_lwip_flags, $(strip $2)/$(file), $2)))
     141endef
    102142
    103143
  • trunk/src/VBox/NetworkServices/NAT/Makefile.kmk

    r48110 r48178  
    1818include $(KBUILD_PATH)/subheader.kmk
    1919
    20 define def_vbox_nat_network_service_sources
    21     $(1)_SOURCES += $2/$3
    22 endef
    23 
    24 define def_vbox_nat_network_service_incs
    25     $(1)_INCS += $2/$3
    26 endef
    27 
    2820ifdef VBOX_WITH_LWIP_NAT
     21# XXX: This file depends on lwip makefile already included by Devices,
     22#      which is included by ancestor makefile before us...
     23#if !defined(LWIP_SOURCES) # ???
     24#  include ../../Devices/Network/lwip-new/Makefile.kmk
     25#endif
    2926
    3027ifdef VBOX_WITH_HARDENING
     
    7875    RTWinSocketPair.cpp
    7976
    80 #
    81 # Note: not spaces please in "Devices,$("
    82 #
    83 $(foreach file,$(LWIP_SOURCES),$(eval $(call def_vbox_nat_network_service_sources, VBoxNetLwipNAT, ../../Devices,$(file))))
    84 
    85 $(foreach incs,$(LWIP_INCS),$(eval $(call def_vbox_nat_network_service_incs, VBoxNetLwipNAT, ../../Devices,$(incs))))
    86 
     77$(eval $(call def_vbox_lwip_public, \
     78    VBoxNetLwipNAT, ../../Devices/Network/lwip-new))
    8779endif
    8880
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