Ticket #50288: patch-SConstruct.diff
File patch-SConstruct.diff, 8.2 KB (added by fhgwright (Fred Wright), 9 years ago) |
---|
-
SConstruct
old new 162 162 ("manbuild", True, "build help in man and HTML formats"), 163 163 ("leapfetch", True, "fetch up-to-date data on leap seconds."), 164 164 ("minimal", False, "turn off every option not set on the command line"), 165 ("xgps", True, "include xgps and xgpsspeed."), 165 166 # Test control 166 167 ("slow", False, "run tests with realistic (slow) delays"), 167 168 ) … … 186 187 ("fixed_stop_bits", 0, "fixed serial port stop bits"), 187 188 ("target", "", "cross-development target"), 188 189 ("sysroot", "", "cross-development system root"), 190 ("qt_versioned", "", "version for versioned Qt"), 189 191 ) 190 192 for (name, default, help) in nonboolopts: 191 193 opts.Add(name, help, default) … … 744 746 typedef int clockid_t; 745 747 #define CLOCKID_T_DEFINED 746 748 # endif 747 /* OS X uses _STRUCT_TIMESPEC, but no clock_gettime*/748 #if ndef _STRUCT_TIMESPEC749 /* OS X 10.5 and later use _STRUCT_TIMESPEC; 10.4 uses _TIMESPEC; 10.3 and earlier use _TIMESPEC_DEFINED */ 750 #if !defined _STRUCT_TIMESPEC && !defined _TIMESPEC && !defined _TIMESPEC_DEFINED 749 751 struct timespec { 750 752 time_t tv_sec; 751 753 long tv_nsec; 752 754 }; 755 #define _STRUCT_TIMESPEC 753 756 #endif 757 /* OS X does not have clock_gettime */ 754 758 #define CLOCK_REALTIME 0 755 759 int clock_gettime(clockid_t, struct timespec *); 756 760 # ifdef __cplusplus … … 785 789 src_suffix=".xml", suffix=".html") 786 790 787 791 # Determine if Qt network libraries are present, and if not, force qt to off 788 qt_network = config.CheckPKG('QtNetwork') 792 qt_net_name = 'Qt%sNetwork' % env["qt_versioned"] 793 qt_network = config.CheckPKG(qt_net_name) 789 794 if not qt_network: 790 795 env["qt"] = False 791 796 … … 813 818 qt_env.MergeFlags('-DUSE_QT') 814 819 qt_env.Append(OBJPREFIX='qt-') 815 820 try: 816 qt_env.MergeFlags(pkg_config( 'QtNetwork'))821 qt_env.MergeFlags(pkg_config(qt_net_name)) 817 822 except OSError: 818 announce("pkg_config is confused about the state of QtNetwork.") 823 announce("pkg_config is confused about the state of %s." 824 % qt_net_name) 819 825 qt_env = None 820 826 else: 821 827 qt_env = None … … 985 991 ## Production programs 986 992 987 993 gpsd = env.Program('gpsd', gpsd_sources, 988 LIBS=['gpsd', 'gps_static'], LIBPATH='.',994 LIBS=['gpsd', 'gps_static'], 989 995 parse_flags=gpsdflags+gpsflags) 990 996 gpsdecode = env.Program('gpsdecode', ['gpsdecode.c'], 991 LIBS=['gpsd', 'gps_static'], LIBPATH='.',997 LIBS=['gpsd', 'gps_static'], 992 998 parse_flags=gpsdflags+gpsflags) 993 999 gpsctl = env.Program('gpsctl', ['gpsctl.c'], 994 LIBS=['gpsd', 'gps_static'], LIBPATH='.',1000 LIBS=['gpsd', 'gps_static'], 995 1001 parse_flags=gpsdflags+gpsflags) 996 1002 gpsmon = env.Program('gpsmon', gpsmon_sources, 997 LIBS=['gpsd', 'gps_static'], LIBPATH='.',1003 LIBS=['gpsd', 'gps_static'], 998 1004 parse_flags=gpsdflags + gpsflags + ncurseslibs) 999 1005 gpsdctl = env.Program('gpsdctl', ['gpsdctl.c'], 1000 LIBS=['gps_static'], LIBPATH='.',1006 LIBS=['gps_static'], 1001 1007 parse_flags=gpsflags) 1002 1008 gpspipe = env.Program('gpspipe', ['gpspipe.c'], 1003 LIBS=['gps_static'], LIBPATH='.',1009 LIBS=['gps_static'], 1004 1010 parse_flags=gpsflags) 1005 1011 gps2udp = env.Program('gps2udp', ['gps2udp.c'], 1006 LIBS=['gps_static'], LIBPATH='.',1012 LIBS=['gps_static'], 1007 1013 parse_flags=gpsflags) 1008 1014 gpxlogger = env.Program('gpxlogger', ['gpxlogger.c'], 1009 LIBS=['gps_static'], LIBPATH='.',1015 LIBS=['gps_static'], 1010 1016 parse_flags=gpsflags) 1011 1017 lcdgps = env.Program('lcdgps', ['lcdgps.c'], 1012 LIBS=['gps_static'], LIBPATH='.',1018 LIBS=['gps_static'], 1013 1019 parse_flags=gpsflags) 1014 1020 cgps = env.Program('cgps', ['cgps.c'], 1015 LIBS=['gps_static'], LIBPATH='.',1021 LIBS=['gps_static'], 1016 1022 parse_flags=gpsflags + ncurseslibs) 1017 1023 ntpshmmon = env.Program('ntpshmmon', ['ntpshmmon.c'], 1018 LIBS=['gps_static'], LIBPATH='.',1024 LIBS=['gps_static'], 1019 1025 parse_flags=gpsflags) 1020 1026 1021 1027 binaries = [gpsd, gpsdecode, gpsctl, gpsdctl, gpspipe, gps2udp, gpxlogger, lcdgps, ntpshmmon] … … 1023 1029 binaries += [cgps, gpsmon] 1024 1030 1025 1031 # Test programs - always link locally and statically 1026 test_bits = env.Program('test_bits', ['test_bits.c'], 1027 LIBS=['gps_static'], LIBPATH='.') 1032 test_bits = env.Program('test_bits', ['test_bits.c'], LIBS=['gps_static']) 1028 1033 test_float = env.Program('test_float', ['test_float.c']) 1029 1034 test_geoid = env.Program('test_geoid', ['test_geoid.c'], 1030 1035 LIBS=['gpsd', 'gps_static'], 1031 LIBPATH='.',parse_flags=gpsdflags)1036 parse_flags=gpsdflags) 1032 1037 test_matrix = env.Program('test_matrix', ['test_matrix.c'], 1033 1038 LIBS=['gpsd', 'gps_static'], 1034 LIBPATH='.',parse_flags=gpsdflags)1039 parse_flags=gpsdflags) 1035 1040 test_mktime = env.Program('test_mktime', ['test_mktime.c'], 1036 LIBS=['gps_static'], LIBPATH='.',parse_flags=["-lm"])1041 LIBS=['gps_static'], parse_flags=["-lm"]) 1037 1042 test_packet = env.Program('test_packet', ['test_packet.c'], 1038 1043 LIBS=['gpsd', 'gps_static'], 1039 LIBPATH='.',parse_flags=gpsdflags)1044 parse_flags=gpsdflags) 1040 1045 test_timespec = env.Program('test_timespec', ['test_timespec.c'], 1041 1046 LIBS=['gpsd', 'gps_static'], 1042 LIBPATH='.',parse_flags=gpsdflags)1047 parse_flags=gpsdflags) 1043 1048 test_trig = env.Program('test_trig', ['test_trig.c'], parse_flags=["-lm"]) 1044 1049 # test_libgps for glibc older than 2.17 1045 1050 test_libgps = env.Program('test_libgps', ['test_libgps.c'], 1046 LIBS=['gps_static'], LIBPATH='.', parse_flags=["-lm"] + rtlibs + dbusflags) 1051 LIBS=['gps_static'], 1052 parse_flags=["-lm"] + rtlibs + dbusflags) 1047 1053 1048 1054 if not env['socket_export']: 1049 1055 announce("test_json not building because socket_export is disabled") … … 1051 1057 else: 1052 1058 test_json = env.Program( 1053 1059 'test_json', ['test_json.c'], 1054 LIBS=['gps_static'], LIBPATH='.',1060 LIBS=['gps_static'], 1055 1061 parse_flags=["-lm"] + rtlibs + usbflags + dbusflags) 1056 1062 1057 1063 test_gpsmm = env.Program('test_gpsmm', ['test_gpsmm.cpp'], 1058 LIBS=['gps_static'], LIBPATH='.',parse_flags=["-lm"])1064 LIBS=['gps_static'], parse_flags=["-lm"]) 1059 1065 testprogs = [test_bits, test_float, test_geoid, test_libgps, test_matrix, test_mktime, test_packet, test_timespec, test_trig] 1060 1066 if env['socket_export']: 1061 1067 testprogs.append(test_json) … … 1068 1074 python_targets = [] 1069 1075 python_progs = [] 1070 1076 else: 1071 python_progs = ["gpscat", "gpsfake", "gpsprof", "xgps", "xgpsspeed", "gegps"] 1077 python_progs = ["gpscat", "gpsfake", "gpsprof", "gegps"] 1078 if env['xgps']: 1079 python_progs.extend(["xgps", "xgpsspeed"]) 1072 1080 python_modules = Glob('gps/*.py') 1073 1081 1074 1082 # Build Python binding … … 1114 1122 else: 1115 1123 python_env['CXX'] = ' '.join([env['CXX']] + cxx.split()[1:]) 1116 1124 1125 ldshared=ldshared.replace(cc, env['CC']) 1117 1126 ldshared=ldshared.replace('-fPIE', '') 1118 1127 ldshared=ldshared.replace('-pie', '') 1119 1128 python_env.Replace(SHLINKFLAGS=[], … … 1307 1316 "gpsprof.1" : "gpsprof.xml", 1308 1317 "gpsfake.1" : "gpsfake.xml", 1309 1318 "gpscat.1" : "gpscat.xml", 1310 "xgpsspeed.1" : "gps.xml",1311 "xgps.1" : "gps.xml",1312 1319 "gegps.1" : "gps.xml", 1313 1320 } 1321 if env['xgps']: 1322 python_manpages.update({ 1323 "xgpsspeed.1" : "gps.xml", 1324 "xgps.1" : "gps.xml", 1325 }) 1314 1326 1315 1327 manpage_targets = [] 1316 1328 if manbuilder: