Commit f120dd32 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

rename src/ as spot/ and use include <spot/...>

* NEWS: Mention the change.
* src/: Rename as ...
* spot/: ... this, adjust all headers to include <spot/...> instead of
"...", and adjust all Makefile.am to search headers from the top-level
directory.
* HACKING: Add conventions about #include.
* spot/sanity/style.test: Add a few more grep to catch cases
that do not follow these conventions.
* .gitignore, Makefile.am, README, bench/stutter/Makefile.am,
bench/stutter/stutter_invariance_formulas.cc,
bench/stutter/stutter_invariance_randomgraph.cc, configure.ac,
debian/rules, doc/Doxyfile.in, doc/Makefile.am,
doc/org/.dir-locals.el.in, doc/org/g++wrap.in, doc/org/init.el.in,
doc/org/tut01.org, doc/org/tut02.org, doc/org/tut03.org,
doc/org/tut10.org, doc/org/tut20.org, doc/org/tut21.org,
doc/org/tut22.org, doc/org/tut30.org, iface/ltsmin/Makefile.am,
iface/ltsmin/kripke.test, iface/ltsmin/ltsmin.cc,
iface/ltsmin/ltsmin.hh, iface/ltsmin/modelcheck.cc,
wrap/python/Makefile.am, wrap/python/ajax/spotcgi.in,
wrap/python/spot_impl.i, wrap/python/tests/ltl2tgba.py,
wrap/python/tests/randgen.py, wrap/python/tests/run.in: Adjust.
parent 1fddfe60
...@@ -48,7 +48,7 @@ cachegrind.* ...@@ -48,7 +48,7 @@ cachegrind.*
ltdl ltdl
config.h config.h
config.h.in config.h.in
src/src/misc/_config.h spot/misc/_config.h
_configs.sed _configs.sed
stamp-h1 stamp-h1
*.trs *.trs
...@@ -78,4 +78,3 @@ GTAGS ...@@ -78,4 +78,3 @@ GTAGS
*.deb *.deb
*.changes *.changes
*.dsc *.dsc
...@@ -283,6 +283,26 @@ Encoding ...@@ -283,6 +283,26 @@ Encoding
In emacs the simplest way to convert the file is to add a comment In emacs the simplest way to convert the file is to add a comment
with -*- coding: utf-8 -*- at the top or bottom of the file. with -*- coding: utf-8 -*- at the top or bottom of the file.
Includes
--------
* Use #include with angle-brackets to refer to public headers
of Spot; i.e., those that will be installed, or system
headers that are already installed. E.g.,
#include <spot/misc/version.hh>
#include <iostream>
* Use #include with double quotes to refer to private headers.
Those can be from Spot, or from third-party libraries that
we ship. E.g.,
#include "utf8/utf8.hh"
#include "spot/priv/trim.hh"
#include "config.h"
This style of #include should never occur in public headers.
Exporting symbols Exporting symbols
----------------- -----------------
......
...@@ -28,7 +28,7 @@ if NEVER ...@@ -28,7 +28,7 @@ if NEVER
NEVER_SUBDIRS = bench elisp NEVER_SUBDIRS = bench elisp
endif endif
SUBDIRS = buddy lib src wrap ltdl iface doc $(NEVER_SUBDIRS) SUBDIRS = buddy lib spot wrap ltdl iface doc $(NEVER_SUBDIRS)
UTF8 = utf8/doc/ReleaseNotes utf8/doc/utf8cpp.html utf8/utf8.h \ UTF8 = utf8/doc/ReleaseNotes utf8/doc/utf8cpp.html utf8/utf8.h \
utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h
......
...@@ -4,6 +4,22 @@ New in spot 1.99.6a (not yet released) ...@@ -4,6 +4,22 @@ New in spot 1.99.6a (not yet released)
Library: Library:
* Installed headers now assume that they will be included as
#include <spot/subdir/header.hh>
instead of
#include <subdir/header.hh>
This implies that when Spot headers are installed in
/usr/include/spot/... (the default when using the Debian packages)
or /usr/local/include/spot/... (the default when compiling from
source), then it is no longuer necessary to add
-I/usr/include/spot or -I/usr/local/include/spot when compiling.
Inside the source distribution, the subdirectory src/ has been
renamed to spot/, so that the root of the source tree can also be
put on the preprocessor's search path to compile against a
non-installed version of Spot.
Python: Python:
Bug fixes: Bug fixes:
......
...@@ -122,7 +122,7 @@ Some documentation can be found in the doc/ directory. ...@@ -122,7 +122,7 @@ Some documentation can be found in the doc/ directory.
logic operators supported by Spot logic operators supported by Spot
"make install" will install man pages for command-line tools. (These "make install" will install man pages for command-line tools. (These
man pages can also be found in the src/bin/man/ subdirectory of the man pages can also be found in the spot/bin/man/ subdirectory of the
source tree.) Additional documentation about these tools can be found source tree.) Additional documentation about these tools can be found
in doc/userdoc/, or on-line at http://spot.lrde.lip6.fr/tools.html in doc/userdoc/, or on-line at http://spot.lrde.lip6.fr/tools.html
...@@ -134,7 +134,7 @@ Layout of the source tree ...@@ -134,7 +134,7 @@ Layout of the source tree
Core directories Core directories
---------------- ----------------
src/ Sources for libspot. spot/ Sources for libspot.
bin/ User tools built using the Spot library. bin/ User tools built using the Spot library.
man/ Man pages for the above tools. man/ Man pages for the above tools.
graph/ Graph representations. graph/ Graph representations.
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
## You should have received a copy of the GNU General Public License ## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src $(BUDDY_CPPFLAGS) \ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(BUDDY_CPPFLAGS) \
-I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_builddir)/lib -I$(top_srcdir)/lib
AM_CXXFLAGS = $(WARNING_CXXFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS)
LDADD = $(top_builddir)/src/bin/libcommon.a ../../lib/libgnu.la \ LDADD = $(top_builddir)/spot/bin/libcommon.a ../../lib/libgnu.la \
../../src/libspot.la ../../spot/libspot.la
bin_PROGRAMS = stutter_invariance_randomgraph \ bin_PROGRAMS = stutter_invariance_randomgraph \
stutter_invariance_formulas stutter_invariance_formulas
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "bin/common_sys.hh" #include "spot/bin/common_sys.hh"
#include "bin/common_setup.hh" #include "spot/bin/common_setup.hh"
#include "bin/common_finput.hh" #include "spot/bin/common_finput.hh"
#include "bin/common_output.hh" #include "spot/bin/common_output.hh"
#include "twaalgos/translate.hh" #include <spot/twaalgos/translate.hh>
#include "twaalgos/stutter.hh" #include <spot/twaalgos/stutter.hh>
#include "twaalgos/stats.hh" #include <spot/twaalgos/stats.hh>
#include "tl/apcollect.hh" #include <spot/tl/apcollect.hh>
#include "misc/timer.hh" #include <spot/misc/timer.hh>
#include <argp.h> #include <argp.h>
const char argp_program_doc[] =""; const char argp_program_doc[] ="";
......
...@@ -17,18 +17,18 @@ ...@@ -17,18 +17,18 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "misc/timer.hh" #include <spot/misc/timer.hh>
#include "tl/apcollect.hh" #include <spot/tl/apcollect.hh>
#include "twaalgos/complement.hh" #include <spot/twaalgos/complement.hh>
#include "twaalgos/remfin.hh" #include <spot/twaalgos/remfin.hh>
#include "twaalgos/randomgraph.hh" #include <spot/twaalgos/randomgraph.hh>
#include "twaalgos/dot.hh" #include <spot/twaalgos/dot.hh>
#include "twaalgos/product.hh" #include <spot/twaalgos/product.hh>
#include "twaalgos/stutter.hh" #include <spot/twaalgos/stutter.hh>
#include "twaalgos/stats.hh" #include <spot/twaalgos/stats.hh>
#include "twa/twagraph.hh" #include <spot/twa/twagraph.hh>
#include "twa/bdddict.hh" #include <spot/twa/bdddict.hh>
#include "misc/random.hh" #include <spot/misc/random.hh>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <vector> #include <vector>
......
...@@ -26,7 +26,7 @@ AC_CONFIG_AUX_DIR([tools]) ...@@ -26,7 +26,7 @@ AC_CONFIG_AUX_DIR([tools])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 gnu tar-ustar color-tests parallel-tests]) AM_INIT_AUTOMAKE([1.11 gnu tar-ustar color-tests parallel-tests])
AC_CONFIG_HEADERS([config.h])dnl Private config, not to be used in .hh files. AC_CONFIG_HEADERS([config.h])dnl Private config, not to be used in .hh files.
AX_PREFIX_CONFIG_H([src/misc/_config.h])dnl Public config, for .hh files. AX_PREFIX_CONFIG_H([spot/misc/_config.h])dnl Public config, for .hh files.
# If the user didn't supply a CFLAGS value, # If the user didn't supply a CFLAGS value,
# set an empty one to prevent autoconf to stick -O2 -g here. # set an empty one to prevent autoconf to stick -O2 -g here.
...@@ -202,24 +202,24 @@ AC_CONFIG_FILES([ ...@@ -202,24 +202,24 @@ AC_CONFIG_FILES([
iface/ltsmin/Makefile iface/ltsmin/Makefile
iface/Makefile iface/Makefile
lib/Makefile lib/Makefile
src/bin/Makefile spot/bin/Makefile
src/bin/man/Makefile spot/bin/man/Makefile
src/graph/Makefile spot/graph/Makefile
src/kripke/Makefile spot/kripke/Makefile
src/Makefile spot/Makefile
src/misc/Makefile spot/misc/Makefile
src/parseaut/Makefile spot/parseaut/Makefile
src/parsetl/Makefile spot/parsetl/Makefile
src/priv/Makefile spot/priv/Makefile
src/sanity/Makefile spot/sanity/Makefile
src/taalgos/Makefile spot/taalgos/Makefile
src/ta/Makefile spot/ta/Makefile
src/tests/defs spot/tests/defs
src/tests/Makefile spot/tests/Makefile
src/tl/Makefile spot/tl/Makefile
src/twaalgos/gtec/Makefile spot/twaalgos/gtec/Makefile
src/twaalgos/Makefile spot/twaalgos/Makefile
src/twa/Makefile spot/twa/Makefile
wrap/Makefile wrap/Makefile
wrap/python/ajax/Makefile wrap/python/ajax/Makefile
wrap/python/Makefile wrap/python/Makefile
......
...@@ -50,8 +50,8 @@ PYOTHERS=$(filter-out $(PYDEFAULT), $(shell py3versions --supported)) ...@@ -50,8 +50,8 @@ PYOTHERS=$(filter-out $(PYDEFAULT), $(shell py3versions --supported))
# compiled with -flto, the exception never traverses argp. Moving # compiled with -flto, the exception never traverses argp. Moving
# the try/catch block inside parse_opt() also fixes this praticular # the try/catch block inside parse_opt() also fixes this praticular
# problem, but who knows about other exceptions? So as a workaround, # problem, but who knows about other exceptions? So as a workaround,
# we simply disable -flto in src/bin/. # we simply disable -flto in spot/bin/.
FLTOWORKAROUND = perl -pi -e s/-flto// src/bin/Makefile FLTOWORKAROUND = perl -pi -e s/-flto// spot/bin/Makefile
# We want to build Spot twice: once to get profile data, and a second # We want to build Spot twice: once to get profile data, and a second
# time to use it. # time to use it.
......
...@@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES ...@@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started. # will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES. # This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH = @top_srcdir@/src/ \ STRIP_FROM_PATH = @top_srcdir@/ \
@top_srcdir@/iface/ \ @top_srcdir@/iface/ \
@srcdir@ @srcdir@
...@@ -163,7 +163,7 @@ STRIP_FROM_PATH = @top_srcdir@/src/ \ ...@@ -163,7 +163,7 @@ STRIP_FROM_PATH = @top_srcdir@/src/ \
# specify the list of include paths that are normally passed to the compiler # specify the list of include paths that are normally passed to the compiler
# using the -I flag. # using the -I flag.
STRIP_FROM_INC_PATH = @top_srcdir@/src/ \ STRIP_FROM_INC_PATH = @top_srcdir@/ \
@top_srcdir@/iface/ @top_srcdir@/iface/
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
...@@ -762,7 +762,7 @@ WARN_LOGFILE = ...@@ -762,7 +762,7 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = @srcdir@/mainpage.dox \ INPUT = @srcdir@/mainpage.dox \
@top_srcdir@/src \ @top_srcdir@/spot \
@top_srcdir@/iface @top_srcdir@/iface
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
...@@ -1992,7 +1992,7 @@ SEARCH_INCLUDES = YES ...@@ -1992,7 +1992,7 @@ SEARCH_INCLUDES = YES
# preprocessor. # preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES. # This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH = @top_srcdir@/src INCLUDE_PATH = @top_srcdir@
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the # patterns (like *.h and *.hpp) to filter out the header-files in the
......
...@@ -58,7 +58,7 @@ org: ...@@ -58,7 +58,7 @@ org:
org-man: org-man:
mkdir -p $(srcdir)/userdoc/man mkdir -p $(srcdir)/userdoc/man
$(top_srcdir)/tools/man2html.pl $(top_srcdir)/src/bin/man $(srcdir)/userdoc/man $(top_srcdir)/tools/man2html.pl $(top_srcdir)/spot/bin/man $(srcdir)/userdoc/man
ORG_FILES = \ ORG_FILES = \
org/.dir-locals.el.in \ org/.dir-locals.el.in \
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
(eval . (eval .
(progn (progn
(setenv "PATH" (setenv "PATH"
(concat "@abs_top_builddir@/src/bin" (concat "@abs_top_builddir@/spot/bin"
path-separator path-separator
(getenv "PATH"))) (getenv "PATH")))
(setenv "PYTHONPATH" (setenv "PYTHONPATH"
(concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/wrap/python:@abs_top_srcdir@/wrap/python:" (concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/wrap/python:@abs_top_srcdir@/wrap/python:"
(getenv "PYTHONPATH"))) (getenv "PYTHONPATH")))
(setenv "DYLD_LIBRARY_PATH" (setenv "DYLD_LIBRARY_PATH"
(concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/src/.libs:@abs_top_builddir@/buddy/src/.libs:" (concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/spot/.libs:@abs_top_builddir@/buddy/spot/.libs:"
(getenv "DYLD_LIBRARY_PATH"))) (getenv "DYLD_LIBRARY_PATH")))
(setenv "SPOT_DOTDEFAULT" "Brf(Lato)") (setenv "SPOT_DOTDEFAULT" "Brf(Lato)")
(setenv "SPOT_DOTEXTRA" "node[style=filled, fillcolor=\"#ffffa0\"] edge[arrowhead=vee, arrowsize=.7]") (setenv "SPOT_DOTEXTRA" "node[style=filled, fillcolor=\"#ffffa0\"] edge[arrowhead=vee, arrowsize=.7]")
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
# This is a wrapper around the compiler, to ensure that the code # This is a wrapper around the compiler, to ensure that the code
# example run from the org-mode file are all linked with Spot. # example run from the org-mode file are all linked with Spot.
exec @top_builddir@/libtool link @CXX@ -std=c++11 -Wall \ exec @top_builddir@/libtool link @CXX@ -std=c++11 -Wall \
-I@abs_top_srcdir@/src -I@abs_top_srcdir@/buddy/src \ -I@abs_top_builddir@ -I@abs_top_srcdir@ -I@abs_top_srcdir@/buddy/src \
-I@abs_top_builddir@/src "$@" @abs_top_builddir@/src/libspot.la "$@" @abs_top_builddir@/spot/libspot.la
...@@ -31,12 +31,12 @@ ...@@ -31,12 +31,12 @@
(setq shell-file-name "@SHELL@") (setq shell-file-name "@SHELL@")
(setenv "PATH" (setenv "PATH"
(concat "@abs_top_builddir@/src/bin" path-separator (getenv "PATH"))) (concat "@abs_top_builddir@/spot/bin" path-separator (getenv "PATH")))
(setenv "PYTHONPATH" (setenv "PYTHONPATH"
(concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/wrap/python:@abs_top_srcdir@/wrap/python:" (concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/wrap/python:@abs_top_srcdir@/wrap/python:"
(getenv "PYTHONPATH"))) (getenv "PYTHONPATH")))
(setenv "DYLD_LIBRARY_PATH" (setenv "DYLD_LIBRARY_PATH"
(concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/src/.libs:@abs_top_builddir@/buddy/src/.libs:" (concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/spot/.libs:@abs_top_builddir@/buddy/spot/.libs:"
(getenv "DYLD_LIBRARY_PATH"))) (getenv "DYLD_LIBRARY_PATH")))
(setenv "SPOT_DOTDEFAULT" "Brf(Lato)") (setenv "SPOT_DOTDEFAULT" "Brf(Lato)")
(setenv "SPOT_DOTEXTRA" (setenv "SPOT_DOTEXTRA"
......
...@@ -69,8 +69,8 @@ exceptions. ...@@ -69,8 +69,8 @@ exceptions.
#+BEGIN_SRC C++ :results verbatim :exports both #+BEGIN_SRC C++ :results verbatim :exports both
#include <iostream> #include <iostream>
#include "tl/parse.hh" #include <spot/tl/parse.hh>
#include "tl/print.hh" #include <spot/tl/print.hh>
int main() int main()
{ {
...@@ -110,8 +110,8 @@ Here is how to call the infix parser explicitly: ...@@ -110,8 +110,8 @@ Here is how to call the infix parser explicitly:
#+BEGIN_SRC C++ :results verbatim :exports both #+BEGIN_SRC C++ :results verbatim :exports both
#include <string> #include <string>
#include <iostream> #include <iostream>
#include "tl/parse.hh" #include <spot/tl/parse.hh>
#include "tl/print.hh" #include <spot/tl/print.hh>
int main() int main()
{ {
...@@ -152,8 +152,8 @@ with the "fixed" formula if you wish. Here is an example: ...@@ -152,8 +152,8 @@ with the "fixed" formula if you wish. Here is an example:
#+BEGIN_SRC C++ :results verbatim :exports both #+BEGIN_SRC C++ :results verbatim :exports both
#include <string> #include <string>
#include <iostream> #include <iostream>
#include "tl/parse.hh"