Skip to content

Commit

Permalink
Eliminates autogeneration of gpsd.h.
Browse files Browse the repository at this point in the history
The reason for directly including the contents of gpsd_config.h in
gpsd.h is long gone, so there's no longer any reason to create the
latter by concatenation rather than just making it a normal header
which #includes gpsd_config.h.  This is a minimal rework of this form.

TESTED:
Ran "scons build-all check" on OSX 10.9 and Fedora 25 (without Qt in
the latter case, where the Qt build needs further work).
  • Loading branch information
fhgwright committed Jan 25, 2017
1 parent 2cb17f9 commit 744959a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
7 changes: 2 additions & 5 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,6 @@ timebase = env.Command(target="timebase.h",
env.AlwaysBuild(timebase)

env.Textfile(target="gpsd_config.h", source=confdefs)
env.Textfile(target="gpsd.h", source=[File("gpsd.h-head"), File("gpsd_config.h"), File("gpsd.h-tail")])

env.Command(target="gps_maskdump.c", source=["maskaudit.py", "gps.h", "gpsd.h"], action='''
rm -f $TARGET &&\
Expand All @@ -1396,7 +1395,7 @@ env.Command(target="ais_json.i", source="jsongen.py", action='''\
$SC_PYTHON $SOURCE --ais --target=parser >$TARGET &&\
chmod a-w $TARGET''')

generated_sources = ['packet_names.h', 'timebase.h', 'gpsd.h', "ais_json.i",
generated_sources = ['packet_names.h', 'timebase.h', "ais_json.i",
'gps_maskdump.c', 'revision.h', 'gpsd.php',
'gpsd_config.h']

Expand Down Expand Up @@ -1424,8 +1423,7 @@ if 'dev' in gpsd_version:
(st, rev) = _getstatusoutput('git describe --tags')
if st != 0:
# Use timestamp from latest relevant file
files = FileList(['*.c', '*.cpp', '*.h', '*.in',
'gpsd.h-*', 'SConstruct'],
files = FileList(['*.c', '*.cpp', '*.h', '*.in', 'SConstruct'],
generated_sources)
timestamps = map(GetMtime, files)
if timestamps:
Expand Down Expand Up @@ -2231,7 +2229,6 @@ if os.path.exists("gpsd.c") and os.path.exists(".gitignore"):
distfiles.remove(".gitignore")
distfiles += generated_sources
distfiles += base_manpages.keys() + python_manpages.keys()
distfiles.remove("gpsd.h")
if "packaging/rpm/gpsd.spec" not in distfiles:
distfiles.append("packaging/rpm/gpsd.spec")

Expand Down
18 changes: 15 additions & 3 deletions gpsd.h-tail → gpsd.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/* Feature configuration switches end here
/* gpsd.h -- fundamental types and structures for the gpsd library
*
* This file is Copyright (c) 2010 by the GPSD project
* This file is Copyright (c) 2017 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
#endif /* GPSD_CONFIG_H */

#ifndef _GPSD_H_
#define _GPSD_H_

# ifdef __cplusplus
extern "C" {
# endif

#include <stdbool.h>
#include <stdio.h>
#include <time.h> /* for time_t */

#include "gpsd_config.h"

#include <stdint.h>
#include <stdarg.h>
Expand Down
19 changes: 0 additions & 19 deletions gpsd.h-head

This file was deleted.

0 comments on commit 744959a

Please sign in to comment.