[reorg] Fix check-* scripts to work with sources files in directories.
diff --git a/src/Makefile.sources b/src/Makefile.sources
index 40fbd99..77fa85b 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -88,6 +88,10 @@
 	hb-ot-layout-gdef-table.hh \
 	hb-ot-layout-gpos-table.hh \
 	hb-ot-layout-gsub-table.hh \
+	OT/Layout/GSUB/Common.hh \
+	OT/Layout/GSUB/SingleSubstFormat1.hh \
+	OT/Layout/GSUB/SingleSubstFormat2.hh \
+	OT/Layout/GSUB/SingleSubst.hh \
 	hb-ot-layout-gsubgpos.hh \
 	hb-ot-layout-jstf-table.hh \
 	hb-ot-layout.cc \
diff --git a/src/OT/Layout/GSUB/Common.hh b/src/OT/Layout/GSUB/Common.hh
index 951c278..f023757 100644
--- a/src/OT/Layout/GSUB/Common.hh
+++ b/src/OT/Layout/GSUB/Common.hh
@@ -1,5 +1,5 @@
-#ifndef OT_LAYOUT_GSUB_COMMON
-#define OT_LAYOUT_GSUB_COMMON
+#ifndef OT_LAYOUT_GSUB_COMMON_HH
+#define OT_LAYOUT_GSUB_COMMON_HH
 
 #include "hb-serialize.hh"
 
@@ -17,4 +17,4 @@
 }
 }
 
-#endif
+#endif /* OT_LAYOUT_GSUB_COMMON_HH */
diff --git a/src/OT/Layout/GSUB/SingleSubst.hh b/src/OT/Layout/GSUB/SingleSubst.hh
index f1e88b3..c30d860 100644
--- a/src/OT/Layout/GSUB/SingleSubst.hh
+++ b/src/OT/Layout/GSUB/SingleSubst.hh
@@ -1,5 +1,5 @@
-#ifndef OT_LAYOUT_GSUB_SINGLE_SUBST
-#define OT_LAYOUT_GSUB_SINGLE_SUBST
+#ifndef OT_LAYOUT_GSUB_SINGLESUBST_HH
+#define OT_LAYOUT_GSUB_SINGLESUBST_HH
 
 #include "Common.hh"
 #include "SingleSubstFormat1.hh"
@@ -71,4 +71,4 @@
 }
 }
 
-#endif
+#endif /* OT_LAYOUT_GSUB_SINGLESUBST_HH */
diff --git a/src/OT/Layout/GSUB/SingleSubstFormat1.hh b/src/OT/Layout/GSUB/SingleSubstFormat1.hh
index dc59e97..4528094 100644
--- a/src/OT/Layout/GSUB/SingleSubstFormat1.hh
+++ b/src/OT/Layout/GSUB/SingleSubstFormat1.hh
@@ -1,5 +1,5 @@
-#ifndef OT_LAYOUT_GSUB_SINGLE_SUBST_FORMAT_1
-#define OT_LAYOUT_GSUB_SINGLE_SUBST_FORMAT_1
+#ifndef OT_LAYOUT_GSUB_SINGLESUBSTFORMAT1_HH
+#define OT_LAYOUT_GSUB_SINGLESUBSTFORMAT1_HH
 
 #include "Common.hh"
 #include "hb-ot-layout-gsubgpos.hh"
@@ -122,4 +122,4 @@
 }
 
 
-#endif
+#endif /* OT_LAYOUT_GSUB_SINGLESUBSTFORMAT1_HH */
diff --git a/src/OT/Layout/GSUB/SingleSubstFormat2.hh b/src/OT/Layout/GSUB/SingleSubstFormat2.hh
index 654167e..a827535 100644
--- a/src/OT/Layout/GSUB/SingleSubstFormat2.hh
+++ b/src/OT/Layout/GSUB/SingleSubstFormat2.hh
@@ -1,5 +1,5 @@
-#ifndef OT_LAYOUT_GSUB_SINGLE_SUBST_FORMAT_2
-#define OT_LAYOUT_GSUB_SINGLE_SUBST_FORMAT_2
+#ifndef OT_LAYOUT_GSUB_SINGLESUBSTFORMAT2_HH
+#define OT_LAYOUT_GSUB_SINGLESUBSTFORMAT2_HH
 
 #include "Common.hh"
 #include "hb-ot-layout-gsubgpos.hh"
@@ -120,4 +120,4 @@
 }
 }
 
-#endif
+#endif /* OT_LAYOUT_GSUB_SINGLESUBSTFORMAT2_HH */
diff --git a/src/check-c-linkage-decls.py b/src/check-c-linkage-decls.py
index b7532a7..49cd296 100755
--- a/src/check-c-linkage-decls.py
+++ b/src/check-c-linkage-decls.py
@@ -4,11 +4,19 @@
 
 os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
 
+def removeprefix(s, prefix):
+    if s.startswith(prefix):
+        return s[len(prefix):]
+    else:
+        return s[:]
+
 HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
 	[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
-HBSOURCES = [os.path.basename (x) for x in os.getenv ('HBSOURCES', '').split ()] or \
-	[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))]
-
+HBSOURCES = [
+    removeprefix(x, 'src%s' % os.path.sep) for x in os.getenv ('HBSOURCES', '').split ()
+] or [
+    x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))
+]
 stat = 0
 
 for x in HBHEADERS:
diff --git a/src/check-header-guards.py b/src/check-header-guards.py
index 0ad42cd..b45ffe1 100755
--- a/src/check-header-guards.py
+++ b/src/check-header-guards.py
@@ -4,19 +4,30 @@
 
 os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
 
+def removeprefix(s, prefix):
+    if s.startswith(prefix):
+        return s[len(prefix):]
+    else:
+        return s[:]
+
+
 HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
 	[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
-HBSOURCES = [os.path.basename (x) for x in os.getenv ('HBSOURCES', '').split ()] or \
-	[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))]
+HBSOURCES = [
+    removeprefix(x, 'src%s' % os.path.sep) for x in os.getenv ('HBSOURCES', '').split ()
+] or [
+    x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))
+]
+
 
 stat = 0
 
 for x in HBHEADERS + HBSOURCES:
 	if not x.endswith ('h') or x == 'hb-gobject-structs.h': continue
-	tag = x.upper ().replace ('.', '_').replace ('-', '_')
+	tag = x.upper ().replace ('.', '_').replace ('-', '_').replace(os.path.sep, '_').replace('/', '_')
 	with open (x, 'r', encoding='utf-8') as f: content = f.read ()
 	if len (re.findall (tag + r'\b', content)) != 3:
-		print ('Ouch, header file %s does not have correct preprocessor guards' % x)
+		print ('Ouch, header file %s does not have correct preprocessor guards. Expected: %s' % (x, tag))
 		stat = 1
 
 sys.exit (stat)
diff --git a/src/check-includes.py b/src/check-includes.py
index 88eaa2e..ed201aa 100755
--- a/src/check-includes.py
+++ b/src/check-includes.py
@@ -4,10 +4,21 @@
 
 os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
 
+def removeprefix(s, prefix):
+    if s.startswith(prefix):
+        return s[len(prefix):]
+    else:
+        return s[:]
+
 HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
 	[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
-HBSOURCES = [os.path.basename (x) for x in os.getenv ('HBSOURCES', '').split ()] or \
-	[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))]
+
+HBSOURCES = [
+    removeprefix(x, 'src%s' % os.path.sep) for x in os.getenv ('HBSOURCES', '').split ()
+] or [
+    x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))
+]
+
 
 stat = 0
 
@@ -25,7 +36,7 @@
 	with open (x, 'r', encoding='utf-8') as f: content = f.read ()
 	includes = re.findall (r'#.*include.*', content)
 	if includes:
-		if not len (re.findall (r'"hb.*\.hh"', includes[0])):
+		if not len (re.findall (r'".*\.hh"', includes[0])):
 			print ('failure on %s' % x)
 			stat = 1