Эх сурвалжийг харах

Use config.h in Waf compilation

- simpler wscript_build files
- reuse VERSION
- add path to config.h
Stéphane Raimbault 16 жил өмнө
parent
commit
62d8e2f69f
6 өөрчлөгдсөн 27 нэмэгдсэн , 29 устгасан
  1. 1 1
      src/modbus.c
  2. 0 8
      src/wscript
  3. 8 0
      src/wscript_build
  4. 0 16
      tests/wscript
  5. 15 0
      tests/wscript_build
  6. 3 4
      wscript

+ 1 - 1
src/modbus.c

@@ -28,7 +28,6 @@
    http://copyleft.free.fr/wordpress/index.php/libmodbus/
 */
 
-#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -49,6 +48,7 @@
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
 
+#include "config.h"
 #include "modbus.h"
 
 #define UNKNOWN_ERROR_MSG "Not defined in modbus specification"

+ 0 - 8
src/wscript

@@ -1,8 +0,0 @@
-def build(bld):
-    obj = bld.new_task_gen(
-        features='cc cshlib',
-        source='modbus.c',
-        target = 'modbus',
-        vnum='2.2.0')
-
-    bld.install_files('${PREFIX}/include/modbus', 'modbus.h')

+ 8 - 0
src/wscript_build

@@ -0,0 +1,8 @@
+obj = bld.new_task_gen(
+    features='cc cshlib',
+    source='modbus.c',
+    target='modbus',
+    vnum=VERSION,
+    includes='. ..')
+
+bld.install_files('${PREFIX}/include/modbus', 'modbus.h')

+ 0 - 16
tests/wscript

@@ -1,16 +0,0 @@
-def build(bld):
-    programs = ('random-test-slave',
-                'unit-test-slave',
-                'unit-test-master',
-                'bandwidth-slave-one',
-                'bandwidth-slave-many-up',
-                'bandwidth-master')
-
-    for program in programs:
-        obj = bld.new_task_gen(
-            features = 'cc cprogram',
-            source = program + '.c',
-            target = program,
-            includes = '. ../src',
-            uselib_local = 'modbus',
-            install_path='')

+ 15 - 0
tests/wscript_build

@@ -0,0 +1,15 @@
+programs = ('random-test-slave',
+            'unit-test-slave',
+            'unit-test-master',
+            'bandwidth-slave-one',
+            'bandwidth-slave-many-up',
+            'bandwidth-master')
+
+for program in programs:
+    obj = bld.new_task_gen(
+        features = 'cc cprogram',
+        source = program + '.c',
+        target = program,
+        includes = '. ../src',
+        uselib_local = 'modbus',
+        install_path='')

+ 3 - 4
wscript

@@ -1,8 +1,8 @@
 #! /usr/bin/env python
 # encoding: utf-8
 
-VERSION='2.0.3'
-APPNAME='libmodbus'
+VERSION = '2.2.0'
+APPNAME = 'libmodbus'
 
 # these variables are mandatory ('/' are converted automatically)
 srcdir = '.'
@@ -40,8 +40,7 @@ def configure(conf):
 
      conf.define('VERSION', VERSION)
      conf.define('PACKAGE', 'libmodbus')
-
-     conf.write_config_header()
+     conf.write_config_header('config.h')
 
 def build(bld):
      import misc