Changeset 32ceb14 in rtems-libbsd for libbsd_waf.py


Ignore:
Timestamp:
Jun 16, 2016, 3:32:28 AM (3 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
fd86c091b97759106da7355ce1dd81ebe030e285, freebsd-9.3, f020f08430150c1656a0ad0a1de13699db9b980b
Children:
616be5c
Parents:
5851034
git-author:
Chris Johns <chrisj@…> (06/16/16 03:32:28)
git-committer:
Chris Johns <chrisj@…> (06/16/16 03:33:06)
Message:

Add support for long command lines and fix some shell rules on Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libbsd_waf.py

    r5851034 r32ceb14  
    99from __future__ import print_function
    1010
     11import os
    1112import os.path
    1213import rtems_waf.rtems as rtems
     14
     15windows = os.name == "nt"
     16
     17if windows:
     18    host_shell = "sh -c "
     19else:
     20    host_shell = ""
    1321
    1422def init(ctx):
     
    114122    bld(target = "rtemsbsd/rtems/rtems-kernel-kvm-symbols.c",
    115123        source = "rtemsbsd/rtems/generate_kvm_symbols",
    116         rule = "./${SRC} > ${TGT}",
     124        rule = host_shell + "./${SRC} > ${TGT}",
    117125        update_outputs = True)
    118126    bld.objects(target = "kvmsymbols",
     
    128136        bld(target = "freebsd/include/rpc/rpcb_prot.h",
    129137            source = "freebsd/include/rpc/rpcb_prot.x",
    130             rule = "${RPCGEN} -h -o ${TGT} ${SRC}")
     138            rule = host_shell + "${RPCGEN} -h -o ${TGT} ${SRC}")
    131139
    132140    # Route keywords
    133141    if bld.env.AUTO_REGEN:
    134         rkw_rule = "cat ${SRC} | awk 'BEGIN { r = 0 } { if (NF == 1) printf \"#define\\tK_%%s\\t%%d\\n\\t{\\\"%%s\\\", K_%%s},\\n\", toupper($1), ++r, $1, toupper($1)}' > ${TGT}"
     142        rkw_rule = host_shell + "cat ${SRC} | awk 'BEGIN { r = 0 } { if (NF == 1) printf \"#define\\tK_%%s\\t%%d\\n\\t{\\\"%%s\\\", K_%%s},\\n\", toupper($1), ++r, $1, toupper($1)}' > ${TGT}"
    135143        bld(target = "freebsd/sbin/route/keywords.h",
    136144            source = "freebsd/sbin/route/keywords",
     
    141149        bld(target = "freebsd/contrib/libpcap/scanner.c",
    142150            source = "freebsd/contrib/libpcap/scanner.l",
    143             rule = "${LEX} -P pcap -t ${SRC} | sed -e '/YY_BUF_SIZE/s/16384/1024/' > ${TGT}")
     151            rule = host_shell + "${LEX} -P pcap -t ${SRC} | sed -e '/YY_BUF_SIZE/s/16384/1024/' > ${TGT}")
    144152    bld.objects(target = "lex_pcap",
    145153                features = "c",
     
    153161        bld(target = "freebsd/lib/libc/net/nslexer.c",
    154162            source = "freebsd/lib/libc/net/nslexer.l",
    155             rule = "${LEX} -P _nsyy -t ${SRC} | sed -e '/YY_BUF_SIZE/s/16384/1024/' > ${TGT}")
     163            rule = host_shell + "${LEX} -P _nsyy -t ${SRC} | sed -e '/YY_BUF_SIZE/s/16384/1024/' > ${TGT}")
    156164    bld.objects(target = "lex__nsyy",
    157165                features = "c",
     
    165173        bld(target = "freebsd/lib/libipsec/policy_token.c",
    166174            source = "freebsd/lib/libipsec/policy_token.l",
    167             rule = "${LEX} -P __libipsecyy -t ${SRC} | sed -e '/YY_BUF_SIZE/s/16384/1024/' > ${TGT}")
     175            rule = host_shell + "${LEX} -P __libipsecyy -t ${SRC} | sed -e '/YY_BUF_SIZE/s/16384/1024/' > ${TGT}")
    168176    bld.objects(target = "lex___libipsecyy",
    169177                features = "c",
     
    178186        bld(target = "freebsd/contrib/libpcap/grammar.c",
    179187            source = "freebsd/contrib/libpcap/grammar.y",
    180             rule = "${YACC} -b pcap -d -p pcap ${SRC} && sed -e '/YY_BUF_SIZE/s/16384/1024/' < pcap.tab.c > ${TGT} && rm -f pcap.tab.c && mv pcap.tab.h freebsd/contrib/libpcap/tokdefs.h")
     188            rule = host_shell + "${YACC} -b pcap -d -p pcap ${SRC} && sed -e '/YY_BUF_SIZE/s/16384/1024/' < pcap.tab.c > ${TGT} && rm -f pcap.tab.c && mv pcap.tab.h freebsd/contrib/libpcap/tokdefs.h")
    181189    bld.objects(target = "yacc_pcap",
    182190                features = "c",
     
    189197        bld(target = "freebsd/lib/libc/net/nsparser.c",
    190198            source = "freebsd/lib/libc/net/nsparser.y",
    191             rule = "${YACC} -b _nsyy -d -p _nsyy ${SRC} && sed -e '/YY_BUF_SIZE/s/16384/1024/' < _nsyy.tab.c > ${TGT} && rm -f _nsyy.tab.c && mv _nsyy.tab.h freebsd/lib/libc/net/nsparser.h")
     199            rule = host_shell + "${YACC} -b _nsyy -d -p _nsyy ${SRC} && sed -e '/YY_BUF_SIZE/s/16384/1024/' < _nsyy.tab.c > ${TGT} && rm -f _nsyy.tab.c && mv _nsyy.tab.h freebsd/lib/libc/net/nsparser.h")
    192200    bld.objects(target = "yacc__nsyy",
    193201                features = "c",
     
    200208        bld(target = "freebsd/lib/libipsec/policy_parse.c",
    201209            source = "freebsd/lib/libipsec/policy_parse.y",
    202             rule = "${YACC} -b __libipsecyy -d -p __libipsecyy ${SRC} && sed -e '/YY_BUF_SIZE/s/16384/1024/' < __libipsecyy.tab.c > ${TGT} && rm -f __libipsecyy.tab.c && mv __libipsecyy.tab.h freebsd/lib/libipsec/y.tab.h")
     210            rule = host_shell + "${YACC} -b __libipsecyy -d -p __libipsecyy ${SRC} && sed -e '/YY_BUF_SIZE/s/16384/1024/' < __libipsecyy.tab.c > ${TGT} && rm -f __libipsecyy.tab.c && mv __libipsecyy.tab.h freebsd/lib/libipsec/y.tab.h")
    203211    bld.objects(target = "yacc___libipsecyy",
    204212                features = "c",
Note: See TracChangeset for help on using the changeset viewer.