Revert "doc: Use a separate directory for new modules we add to PATH"
authorMartin Liska <mliska@suse.cz>
Sun, 13 Nov 2022 20:56:21 +0000 (21:56 +0100)
committerMartin Liska <mliska@suse.cz>
Mon, 14 Nov 2022 08:35:03 +0000 (09:35 +0100)
This reverts commit 70f1c41061b2b55ed4cdc2e83c7cf326c7ebe7a4.

doc/baseconf.py
doc/gcc_sphinx.py [new file with mode: 0644]
doc/modules/gcc_sphinx.py [deleted file]

index d85659e45408e189e502452f1230dc01661970d7..47e3a1264165f89067c3135c8437b800b97bca1a 100644 (file)
@@ -13,6 +13,7 @@
 import os
 import time
 import sys
+# sys.path.insert(0, os.path.abspath('.'))
 
 # gccint needs a deeper stack limit
 sys.setrecursionlimit(2000)
@@ -22,11 +23,8 @@ sys.setrecursionlimit(2000)
 # The full version, including alpha/beta/rc tags
 
 folder = os.path.dirname(os.path.realpath(__file__))
-doc_modules = os.path.join(folder, 'modules')
 gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-sys.path.insert(0, doc_modules)
-
 def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
diff --git a/doc/gcc_sphinx.py b/doc/gcc_sphinx.py
new file mode 100644 (file)
index 0000000..2ef15ae
--- /dev/null
@@ -0,0 +1,44 @@
+# GCC Sphinx customization
+
+__version__ = '1.0'
+
+
+def setup(app):
+    app.add_object_type('gcc-attr', 'gcc-attr', objname='GCC attribute',
+                        indextemplate='pair: %s; attribute')
+    app.add_object_type('fn-attr', 'fn-attr', objname='function attribute',
+                        indextemplate='pair: %s; function attribute')
+    app.add_object_type('var-attr', 'var-attr', objname='variable attribute',
+                        indextemplate='pair: %s; variable attribute')
+    app.add_object_type('type-attr', 'type-attr', objname='type attribute',
+                        indextemplate='pair: %s; variable attribute')
+    app.add_object_type('enum-attr', 'enum-attr', objname='Enumerator attribute',
+                        indextemplate='pair: %s; enumerator attribute')
+    app.add_object_type('label-attr', 'label-attr', objname='Label attribute',
+                        indextemplate='pair: %s; label attribute')
+    app.add_object_type('gcc-param', 'gcc-param', objname='GCC parameter',
+                        indextemplate='pair: %s; parameter')
+
+    targets = (('AArch64 ', 'aarch64'), ('AMD GCN ', 'amd-gcn'), ('ARC ', 'arc'), ('ARM ', 'arm'), ('AVR ', 'avr'),
+               ('Blackfin ', 'blackfin'), ('BPF ', 'bpf'), ('C-SKY ', 'c-sky'),
+               ('Epiphany ', 'epiphany'), ('H8/300 ', 'h8-300'), ('IA-64 ', 'ia-64'), ('LoongArch', 'loongarch'), ('M32C ', 'm32c'),
+               ('M32R/D ', 'm32r-d'), ('m68k ', 'm68k'), ('MCORE ', 'mcore'), ('MeP ', 'mep'),
+               ('MicroBlaze ', 'microblaze'), ('Microsoft Windows ', 'microsoft-windows'), ('MIPS ', 'mips'),
+               ('MSP430 ', 'msp430'), ('NDS32 ', 'nds32'), ('Nios II ', 'nios-ii'), ('Nvidia PTX ', 'nvidia-ptx'),
+               ('PowerPC ', 'powerpc'), ('RISC-V ', 'risc-v'), ('RL78 ', 'rl78'), ('RX ', 'rx'), ('S/390 ', 's-390'),
+               ('SH ', 'sh'), ('Symbian OS ', 'symbian-os'), ('V850 ', 'v850'), ('Visium ', 'visium'), ('x86 ', 'x86'),
+               ('Xstormy16 ', 'xstormy16'))
+
+    for target_name, target in targets:
+        app.add_object_type(f'{target}-fn-attr', f'{target}-fn-attr', objname=f'{target_name} function attribute',
+                            indextemplate=f'pair: %s; {target_name} function attribute')
+        app.add_object_type(f'{target}-var-attr', f'{target}-var-attr', objname=f'{target_name} variable attribute',
+                            indextemplate=f'pair: %s; {target_name} variable attribute')
+        app.add_object_type(f'{target}-type-attr', f'{target}-type-attr', objname=f'{target_name} type attribute',
+                            indextemplate=f'pair: %s; {target_name} type attribute')
+
+    return dict(
+        version=__version__,
+        parallel_read_safe=True,
+        parallel_write_safe=True
+    )
diff --git a/doc/modules/gcc_sphinx.py b/doc/modules/gcc_sphinx.py
deleted file mode 100644 (file)
index 2ef15ae..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# GCC Sphinx customization
-
-__version__ = '1.0'
-
-
-def setup(app):
-    app.add_object_type('gcc-attr', 'gcc-attr', objname='GCC attribute',
-                        indextemplate='pair: %s; attribute')
-    app.add_object_type('fn-attr', 'fn-attr', objname='function attribute',
-                        indextemplate='pair: %s; function attribute')
-    app.add_object_type('var-attr', 'var-attr', objname='variable attribute',
-                        indextemplate='pair: %s; variable attribute')
-    app.add_object_type('type-attr', 'type-attr', objname='type attribute',
-                        indextemplate='pair: %s; variable attribute')
-    app.add_object_type('enum-attr', 'enum-attr', objname='Enumerator attribute',
-                        indextemplate='pair: %s; enumerator attribute')
-    app.add_object_type('label-attr', 'label-attr', objname='Label attribute',
-                        indextemplate='pair: %s; label attribute')
-    app.add_object_type('gcc-param', 'gcc-param', objname='GCC parameter',
-                        indextemplate='pair: %s; parameter')
-
-    targets = (('AArch64 ', 'aarch64'), ('AMD GCN ', 'amd-gcn'), ('ARC ', 'arc'), ('ARM ', 'arm'), ('AVR ', 'avr'),
-               ('Blackfin ', 'blackfin'), ('BPF ', 'bpf'), ('C-SKY ', 'c-sky'),
-               ('Epiphany ', 'epiphany'), ('H8/300 ', 'h8-300'), ('IA-64 ', 'ia-64'), ('LoongArch', 'loongarch'), ('M32C ', 'm32c'),
-               ('M32R/D ', 'm32r-d'), ('m68k ', 'm68k'), ('MCORE ', 'mcore'), ('MeP ', 'mep'),
-               ('MicroBlaze ', 'microblaze'), ('Microsoft Windows ', 'microsoft-windows'), ('MIPS ', 'mips'),
-               ('MSP430 ', 'msp430'), ('NDS32 ', 'nds32'), ('Nios II ', 'nios-ii'), ('Nvidia PTX ', 'nvidia-ptx'),
-               ('PowerPC ', 'powerpc'), ('RISC-V ', 'risc-v'), ('RL78 ', 'rl78'), ('RX ', 'rx'), ('S/390 ', 's-390'),
-               ('SH ', 'sh'), ('Symbian OS ', 'symbian-os'), ('V850 ', 'v850'), ('Visium ', 'visium'), ('x86 ', 'x86'),
-               ('Xstormy16 ', 'xstormy16'))
-
-    for target_name, target in targets:
-        app.add_object_type(f'{target}-fn-attr', f'{target}-fn-attr', objname=f'{target_name} function attribute',
-                            indextemplate=f'pair: %s; {target_name} function attribute')
-        app.add_object_type(f'{target}-var-attr', f'{target}-var-attr', objname=f'{target_name} variable attribute',
-                            indextemplate=f'pair: %s; {target_name} variable attribute')
-        app.add_object_type(f'{target}-type-attr', f'{target}-type-attr', objname=f'{target_name} type attribute',
-                            indextemplate=f'pair: %s; {target_name} type attribute')
-
-    return dict(
-        version=__version__,
-        parallel_read_safe=True,
-        parallel_write_safe=True
-    )