1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#!/usr/bin/env python
#
# sizes -- explore the sizes of static gpsd binaries
#
import os
# NMEA variants other than vanilla NMEA
nmea_variants = [
"fv18=no",
"mtk3301=no",
"tnt=no",
"oceanserver=no",
"gpsclock=no",
]
# Binary GPS protocols
binary_gps = [
"oncore=no",
"sirf=no",
"superstar2=no",
"tsip=no",
"tripmate=no",
"earthmate=no",
"itrax=no",
"ashtech=no",
"navcom=no",
"garmin=no",
"garmintxt=no",
"ubx=no",
"geostar=no",
"evermore=no",
]
# Differential correction and AIVDM
non_gps = [
"rtcm104v2=no",
"rtcm104v3=no",
"ntrip=no",
"aivdm=no",
]
# Time service
time_service = ["ntpshm=no", "pps=no"]
# Debugging and profiling
debugging = [
"timing=no",
"clientdebug=no",
"oldstyle=no",
]
def sizeit(legend, tag, options):
print legend + ":"
print "Options:", " ".join(options)
os.system("scons -c > /dev/null; rm -fr .scons*")
os.system("scons shared=no " + " ".join(options) + " gpsd >/dev/null")
os.rename("gpsd", "gpsd-" + tag + "-build")
os.rename("gpsd_config.h", "gpsd_config.h-" + tag)
# Main sequence
os.system("uname -a")
sizeit("Minimalist build, stripped to NMEA only with shm interface",
"minimalist",
["socket_export=no",
"control_socket=no",
"ipv6=no",
"netfeed=no",
"passthrough=no",
"fixed_port_speed=9600",
"limited_max_devices=1",
] + nmea_variants + binary_gps + non_gps + time_service + debugging)
sizeit("Normal build, configure options defaulted", "normal", [])
os.system("size gpsd-*-build")
#os.system("rm gpsd-*-build gpsd.h-*")
os.system("scons -c > /dev/null; rm -fr .scons*")
#end
|