[PATCH v2 7/7] Updating scripts for FREEBSD TTY support

Kevin Kirspel kevin-kirspel at idexx.com
Fri Apr 7 16:50:00 UTC 2017


---
 libbsd.py     | 77 ++++++++++++++++++++++++++++++++++++++++-------
 libbsd_waf.py | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 163 insertions(+), 11 deletions(-)
 mode change 100755 => 100644 libbsd.py

diff --git a/libbsd.py b/libbsd.py
old mode 100755
new mode 100644
index 90ba79e..3aa5610
--- a/libbsd.py
+++ b/libbsd.py
@@ -78,6 +78,7 @@ def rtems(mm):
             'rtems/rtems-bsd-shell-pfctl.c',
             'rtems/rtems-bsd-shell-ping.c',
             'rtems/rtems-bsd-shell-route.c',
+            'rtems/rtems-bsd-shell-stty.c',
             'rtems/rtems-bsd-shell-sysctl.c',
             'rtems/rtems-bsd-shell-tcpdump.c',
             'rtems/rtems-bsd-shell-vmstat.c',
@@ -393,6 +394,7 @@ def base(mm):
             'sys/libkern/jenkins_hash.c',
             'sys/libkern/murmur3_32.c',
             'sys/libkern/random.c',
+            'sys/fs/devfs/devfs_vnops.c',
             'sys/vm/uma_core.c',
             'sys/vm/uma_dbg.c',
         ],
@@ -439,6 +441,39 @@ def fdt(mm):
     return mod
 
 #
+# TTY
+#
+def tty(mm):
+    mod = builder.Module('tty')
+    mod.addKernelSpaceHeaderFiles(
+        [
+            'sys/sys/tty.h',
+            'sys/sys/ttyqueue.h',
+            'sys/sys/ttydisc.h',
+            'sys/sys/ttydevsw.h',
+            'sys/sys/ttyhook.h',
+            'sys/sys/cons.h',
+            'sys/sys/serial.h',
+        ]
+    )
+    mod.addKernelSpaceSourceFiles(
+        [
+            'sys/kern/tty.c',
+            'sys/kern/tty_inq.c',
+            'sys/kern/tty_outq.c',
+            'sys/kern/tty_ttydisc.c',
+        ],
+        mm.generator['source']()
+    )
+#    mod.addRTEMSSourceFiles(
+#        [
+#            'rtems/ofw_machdep.c',
+#        ],
+#        mm.generator['source']()
+#    )
+    return mod
+
+#
 # MMC
 #
 def mmc(mm):
@@ -656,13 +691,7 @@ def dev_usb_mouse(mm):
     mod.addDependency(mm['dev_usb'])
     mod.addKernelSpaceHeaderFiles(
         [
-            'sys/sys/tty.h',
             'sys/sys/mouse.h',
-            'sys/sys/ttyqueue.h',
-            'sys/sys/ttydefaults.h',
-            'sys/sys/ttydisc.h',
-            'sys/sys/ttydevsw.h',
-            'sys/sys/ttyhook.h',
         ]
     )
     mod.addKernelSpaceSourceFiles(
@@ -1177,11 +1206,6 @@ def dev_nic(mm):
             'sys/isa/pnpvar.h',
             'sys/sys/buf.h',
             'sys/sys/mqueue.h',
-            'sys/sys/tty.h',
-            'sys/sys/ttyqueue.h',
-            'sys/sys/ttydisc.h',
-            'sys/sys/ttydevsw.h',
-            'sys/sys/ttyhook.h',
             'sys/sys/user.h',
         ]
     )
@@ -2127,6 +2151,8 @@ def user_space(mm):
     mod = builder.Module('user_space')
     mod.addUserSpaceHeaderFiles(
         [
+            'bin/stty/extern.h',
+            'bin/stty/stty.h',
             'contrib/libxo/libxo/xo_buf.h',
             'contrib/libxo/libxo/xo_encoder.h',
             'contrib/libxo/libxo/xo.h',
@@ -2287,6 +2313,13 @@ def user_space(mm):
     mod.addUserSpaceSourceFiles(
         [
             'bin/hostname/hostname.c',
+            'bin/stty/cchar.c',
+            'bin/stty/gfmt.c',
+            'bin/stty/key.c',
+            'bin/stty/modes.c',
+            'bin/stty/print.c',
+            'bin/stty/stty.c',
+            'bin/stty/util.c',
             'contrib/libxo/libxo/libxo.c',
             'contrib/libxo/libxo/xo_encoder.c',
             'lib/lib80211/lib80211_ioctl.c',
@@ -3005,6 +3038,27 @@ def tests(mm):
     mod.addTest(mm.generator['test']('cdev01', ['test_main', 'test_cdev']))
     mod.addTest(mm.generator['test']('pf01', ['test_main']))
     mod.addTest(mm.generator['test']('pf02', ['test_main'], runTest = False))
+    mod.addTest(mm.generator['test']('termios', ['test_main',
+                                     'test_termios_driver',
+                                     'test_termios_utilities']))
+    mod.addTest(mm.generator['test']('termios01', ['test_main',
+                                     '../termios/test_termios_driver',
+                                     '../termios/test_termios_utilities']))
+    mod.addTest(mm.generator['test']('termios02', ['test_main',
+                                     '../termios/test_termios_driver',
+                                     '../termios/test_termios_utilities']))
+    mod.addTest(mm.generator['test']('termios03', ['test_main',
+                                     '../termios/test_termios_driver',
+                                     '../termios/test_termios_utilities']))
+    mod.addTest(mm.generator['test']('termios04', ['test_main',
+                                     '../termios/test_termios_driver',
+                                     '../termios/test_termios_utilities']))
+    mod.addTest(mm.generator['test']('termios05', ['test_main',
+                                     '../termios/test_termios_driver',
+                                     '../termios/test_termios_utilities']))
+    mod.addTest(mm.generator['test']('termios06', ['test_main',
+                                     '../termios/test_termios_driver',
+                                     '../termios/test_termios_utilities']))
     mod.addTest(mm.generator['test-if-header']('debugger01', 'rtems/rtems-debugger.h',
                                                ['test_main'], runTest = False, netTest = True))
     return mod
@@ -3091,6 +3145,7 @@ def sources(mm):
     mm.addModule(base(mm))
 
     mm.addModule(fdt(mm))
+    mm.addModule(tty(mm))
     mm.addModule(mmc(mm))
 
     mm.addModule(dev_usb(mm))
diff --git a/libbsd_waf.py b/libbsd_waf.py
index cba5c31..10a7ac9 100644
--- a/libbsd_waf.py
+++ b/libbsd_waf.py
@@ -247,6 +247,13 @@ def build(bld):
     libbsd_use += ["objs01"]
 
     objs02_source = ['freebsd/bin/hostname/hostname.c',
+                     'freebsd/bin/stty/cchar.c',
+                     'freebsd/bin/stty/gfmt.c',
+                     'freebsd/bin/stty/key.c',
+                     'freebsd/bin/stty/modes.c',
+                     'freebsd/bin/stty/print.c',
+                     'freebsd/bin/stty/stty.c',
+                     'freebsd/bin/stty/util.c',
                      'freebsd/contrib/libxo/libxo/libxo.c',
                      'freebsd/contrib/libxo/libxo/xo_encoder.c',
                      'freebsd/lib/lib80211/lib80211_ioctl.c',
@@ -928,6 +935,7 @@ def build(bld):
               'freebsd/sys/dev/usb/wlan/if_ural.c',
               'freebsd/sys/dev/usb/wlan/if_urtw.c',
               'freebsd/sys/dev/usb/wlan/if_zyd.c',
+              'freebsd/sys/fs/devfs/devfs_vnops.c',
               'freebsd/sys/kern/init_main.c',
               'freebsd/sys/kern/kern_condvar.c',
               'freebsd/sys/kern/kern_conf.c',
@@ -967,6 +975,10 @@ def build(bld):
               'freebsd/sys/kern/sys_generic.c',
               'freebsd/sys/kern/sys_pipe.c',
               'freebsd/sys/kern/sys_socket.c',
+              'freebsd/sys/kern/tty.c',
+              'freebsd/sys/kern/tty_inq.c',
+              'freebsd/sys/kern/tty_outq.c',
+              'freebsd/sys/kern/tty_ttydisc.c',
               'freebsd/sys/kern/uipc_accf.c',
               'freebsd/sys/kern/uipc_domain.c',
               'freebsd/sys/kern/uipc_mbuf.c',
@@ -1289,6 +1301,7 @@ def build(bld):
               'rtemsbsd/rtems/rtems-bsd-shell-pfctl.c',
               'rtemsbsd/rtems/rtems-bsd-shell-ping.c',
               'rtemsbsd/rtems/rtems-bsd-shell-route.c',
+              'rtemsbsd/rtems/rtems-bsd-shell-stty.c',
               'rtemsbsd/rtems/rtems-bsd-shell-sysctl.c',
               'rtemsbsd/rtems/rtems-bsd-shell-tcpdump.c',
               'rtemsbsd/rtems/rtems-bsd-shell-vmstat.c',
@@ -1764,6 +1777,90 @@ def build(bld):
                 lib = ["m", "z"],
                 install_path = None)
 
+    test_termios = ['testsuite/termios/test_main.c',
+                    'testsuite/termios/test_termios_driver.c',
+                    'testsuite/termios/test_termios_utilities.c']
+    bld.program(target = "termios.exe",
+                features = "cprogram",
+                cflags = cflags,
+                includes = includes,
+                source = test_termios,
+                use = ["bsd"],
+                lib = ["m", "z"],
+                install_path = None)
+
+    test_termios01 = ['testsuite/termios01/../termios/test_termios_driver.c',
+                      'testsuite/termios01/../termios/test_termios_utilities.c',
+                      'testsuite/termios01/test_main.c']
+    bld.program(target = "termios01.exe",
+                features = "cprogram",
+                cflags = cflags,
+                includes = includes,
+                source = test_termios01,
+                use = ["bsd"],
+                lib = ["m", "z"],
+                install_path = None)
+
+    test_termios02 = ['testsuite/termios02/../termios/test_termios_driver.c',
+                      'testsuite/termios02/../termios/test_termios_utilities.c',
+                      'testsuite/termios02/test_main.c']
+    bld.program(target = "termios02.exe",
+                features = "cprogram",
+                cflags = cflags,
+                includes = includes,
+                source = test_termios02,
+                use = ["bsd"],
+                lib = ["m", "z"],
+                install_path = None)
+
+    test_termios03 = ['testsuite/termios03/../termios/test_termios_driver.c',
+                      'testsuite/termios03/../termios/test_termios_utilities.c',
+                      'testsuite/termios03/test_main.c']
+    bld.program(target = "termios03.exe",
+                features = "cprogram",
+                cflags = cflags,
+                includes = includes,
+                source = test_termios03,
+                use = ["bsd"],
+                lib = ["m", "z"],
+                install_path = None)
+
+    test_termios04 = ['testsuite/termios04/../termios/test_termios_driver.c',
+                      'testsuite/termios04/../termios/test_termios_utilities.c',
+                      'testsuite/termios04/test_main.c']
+    bld.program(target = "termios04.exe",
+                features = "cprogram",
+                cflags = cflags,
+                includes = includes,
+                source = test_termios04,
+                use = ["bsd"],
+                lib = ["m", "z"],
+                install_path = None)
+
+    test_termios05 = ['testsuite/termios05/../termios/test_termios_driver.c',
+                      'testsuite/termios05/../termios/test_termios_utilities.c',
+                      'testsuite/termios05/test_main.c']
+    bld.program(target = "termios05.exe",
+                features = "cprogram",
+                cflags = cflags,
+                includes = includes,
+                source = test_termios05,
+                use = ["bsd"],
+                lib = ["m", "z"],
+                install_path = None)
+
+    test_termios06 = ['testsuite/termios06/../termios/test_termios_driver.c',
+                      'testsuite/termios06/../termios/test_termios_utilities.c',
+                      'testsuite/termios06/test_main.c']
+    bld.program(target = "termios06.exe",
+                features = "cprogram",
+                cflags = cflags,
+                includes = includes,
+                source = test_termios06,
+                use = ["bsd"],
+                lib = ["m", "z"],
+                install_path = None)
+
     test_thread01 = ['testsuite/thread01/test_main.c']
     bld.program(target = "thread01.exe",
                 features = "cprogram",
-- 
1.9.1



More information about the devel mailing list