author | Lorenzo Bettini <bettini@dsi.unifi.it> | 2009年12月03日 22:00:47 +0100 |
---|---|---|
committer | Lorenzo Bettini <bettini@dsi.unifi.it> | 2009年12月03日 22:00:47 +0100 |
commit | 25453e3b809e57aa57d9ffe97cab49ef4d92e6f1 (patch) | |
tree | 416d21a278b56afa823a8726313873503561d16e | |
parent | 8d3510c735e74d0c88a18d0c78c918232255ab72 (diff) | |
download | src-highlite-25453e3b809e57aa57d9ffe97cab49ef4d92e6f1.tar.gz |
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | ChangeLog | 90 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | TODO.txt | 20 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | defines.pri | 59 | ||||
-rw-r--r-- | gl/.cvsignore | 1 | ||||
-rw-r--r-- | gl/m4/.cvsignore | 6 | ||||
-rw-r--r-- | lib/Makefile.am | 4 | ||||
-rw-r--r-- | lib/lib.pro | 4 | ||||
-rw-r--r-- | lib/srchilite/Makefile.am | 3 | ||||
-rw-r--r-- | source-highlight.pro | 32 | ||||
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/cmdline.c | 2 | ||||
-rw-r--r-- | src/source-highlight-settings.cpp | 12 | ||||
-rw-r--r-- | src/source-highlight-settings.pro | 21 | ||||
-rw-r--r-- | src/source-highlight.cc | 32 | ||||
-rw-r--r-- | src/source-highlight.pro | 39 | ||||
-rw-r--r-- | src/src.pro | 3 |
@@ -12,4 +12,5 @@ build_cygwin build_msys build build_static -*~
\ No newline at end of file +*~ +*.pro.user
\ No newline at end of file @@ -1,3 +1,93 @@ +2009年11月23日 bettini <bettini@dellbettini> + + * defines.pri: use version number for dynamically linking in mingw + forces CONFIG+=static in case of msvc + +2009年11月22日 bettini <bettini@dellbettini> + + * lib\compat\compat_dirent.cpp: Needed only for compilation with msvc. + * lib\compat\compat_dirent.h: Ditto. + * lib\compat\getopt.c: Ditto. + * lib\compat\getopt.h: Ditto. + * lib\compat\getopt1.c: Ditto. + * lib\compat\getopt_int.h: Ditto. + * lib\compat\Makefile.am: Ditto. + * lib\compat\unistd.h: Ditto. + * defines.pri: check for msvc + * lib\srchilite\ctagscollector.h: forward declaration to a struct is + NOT expressed with a class + * lib\srchilite\ctagsformatter.h: Ditto. + * lib\srchilite\debuglistener.h: Ditto. + * lib\srchilite\formatter.h: Ditto. + * lib\srchilite\highlightbuilderexception.h: Ditto. + * lib\srchilite\highlightevent.h: Ditto. + * lib\srchilite\highlighteventlistener.h: Ditto. + * lib\srchilite\highlightrule.h: Ditto. + * lib\srchilite\highlightstate.h: Ditto. + * lib\srchilite\highlightstateprinter.h: Ditto. + * lib\srchilite\langdefparser.yy: Ditto. + * lib\srchilite\parserexception.h: Ditto. + * lib\srchilite\sourcehighlighter.h: Ditto. + * lib\srchilite\settings.cpp: Deal with opendir, mkdir for msvc + * lib\srchilite\sourcehighlightutils.cpp: Ditto. + * src\source-highlight.pro: boost regex library is linked as the last + * src\source-highlight-settings.pro: Ditto. + * src\cmdline.c (update_arg): removed FIX_UNUSED, which does not + compile in msvc + * src\source-highlight.cc (print_copyright): inserted string + (print_reportbugs): Ditto. + +2009年11月19日 bettini <bettini@dellbettini> + + * lib\srchilite\fileinfo.h: include parserinfo.h with "" instead of <> + * lib\srchilite\settings.cpp (Settings::Settings): + (findHomeDirectory): searches for home directory in other + standard windows environment variable besides HOME + * defines.pri: use CONFIG += console otherwise no output is + shown + +2009年11月18日 bettini <bettini@dellbettini> + + * defines.pri: additional libraries variable (boost_regex) + check the variable USE_MINGW + * lib\srchilite\settings.cpp: try to do a manual fix when compiling + with qmake and using mingw + * lib\srchilite\srchilite.pro: + * src\source-highlight-settings.pro: + * src\source-highlight.pro: + +2009年11月18日 bettini <bettini@bettini-laptop> + + * src/source-highlight-settings.pro: New file. + * src/source-highlight.pro: New file. + * src/source-highlight-settings.cpp: deal with progname.h when compiling + with qmake + +2009年11月17日 bettini <bettini@bettini-laptop> + + * defines.pri: New file. + * lib/lib.pro: qmake pro file. + * source-highlight.pro: New file. + * src/src.pro: New file. + * lib/srchilite/langdefparser.cc: bison and flex generated files + are in the CVS now + * lib/srchilite/langdefparser.h: New file. + * lib/srchilite/langdefscanner.cc: New file. + * lib/srchilite/outlangdefparser.cc: New file. + * lib/srchilite/outlangdefparser.h: New file. + * lib/srchilite/outlangdefscanner.cc: New file. + * lib/srchilite/srchilite.pro: New file. + * lib/srchilite/stylecssparser.cc: New file. + * lib/srchilite/stylecssparser.h: New file. + * lib/srchilite/stylecssscanner.cc: New file. + * lib/srchilite/styleparser.cc: New file. + * lib/srchilite/styleparser.h: New file. + * lib/srchilite/stylescanner.cc: New file. + * lib/srchilite/fileutil.cc: default CHROOT_INPUT_DIR + * lib/srchilite/settings.cpp: include config.h selectively + * src/source-highlight.cc (main): deal with progname.h when compiling + with qmake + 2009年10月19日 bettini <bettini@bettini-laptop> * src/errors.lang: lang definition file for compiler output errors. diff --git a/Makefile.am b/Makefile.am index cd9c28a..45ba27d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = \ TODO.txt \ CREDITS gl/m4/gnulib-cache.m4 \ source-highlight-bash-completion \ - _sstream + _sstream \ + source-highlight.pro defines.pri source_highlightdoc_DATA = \ ChangeLog \ @@ -16,6 +16,8 @@ Version 3.1.2 (yet unreleased) * lang def file for compiler output errors * style for label and path * label element recognized in C/C++ + * qmake based build system available + * searches for home directory also on windows Version 3.1.1 @@ -84,6 +84,7 @@ Damir Perisa Simon Pieters C. Michael Pilato Elias Pipping +Matthias Pospiech Stuart Rackham Adrian Reber James Riely @@ -111,4 +111,22 @@ include "c_comment.lang" reports as file name error c_comment.lang! -if the included file cannot be found it does not report an error?
\ No newline at end of file +if the included file cannot be found it does not report an error? + +QMAKE +----- +ABSOLUTEDATADIR=\\\"/usr/local\\\" make it configurable + +PREFIX variable to pass to qmake + +BOOST_REGEX=name of the library + +texinfo generate html and put in the doc source folder + +remove copyright.c reportbugs.c + +generate bison and flex files in sourcedirectory + +common.pri for files in src + +INCREMENT REVISION diff --git a/configure.ac b/configure.ac index 4edc074..b97aa4e 100644 --- a/configure.ac +++ b/configure.ac @@ -274,6 +274,7 @@ lib/srchilite/Makefile lib/srchilite/srchilite.doxyfile lib/tests/Makefile lib/examples/Makefile +lib/compat/Makefile tests/Makefile tests/output_dir/Makefile source-highlight.spec]) diff --git a/defines.pri b/defines.pri new file mode 100644 index 0000000..34345b8 --- /dev/null +++ b/defines.pri @@ -0,0 +1,59 @@ +MAJOR_VERSION = 3 +VERSION = $${MAJOR_VERSION}.0.1 + +# better to avoid both builds (especially on windows) +CONFIG-=debug_and_release + +CONFIG -= qt +CONFIG += console warn_on +CONFIG -= thread + +# ------------------------------------------------- +# Auto select compiler +# ------------------------------------------------- +win32-g++: COMPILER = mingw +win32-msvc*: COMPILER = msvc +linux-g++: COMPILER = gcc + +DEFINES += ABSOLUTEDATADIR=\\\"/usr/local/share/source-highlight/\\\" \ + VERSION=\\\"3.1.2\\\" \ + LIBRARY_VERSION=\\\"3.0.0\\\" \ + PACKAGE=\\\"source-highlight\\\" \ + RELATIVEDATADIR=\\\"../share/source-highlight\\\" + +LIBRARY_NAME = source-highlight +LIBRARY_LIB = $${LIBRARY_NAME} + +CONFIG(static) { + BUILDING_STATIC_LIBRARY=1 +} + +contains(COMPILER, mingw) { + isEmpty(BUILDING_STATIC_LIBRARY) { + LIBRARY_LIB=$${LIBRARY_NAME}$${MAJOR_VERSION} + } +} + +contains(COMPILER, msvc) { + isEmpty(BUILDING_STATIC_LIBRARY) { + CONFIG+=static + } +} + +!isEmpty(BOOST_REGEX) { +# remove the library found with pkg-config with the one explicitly specified +ADDITIONAL_LIBRARIES += -l$$BOOST_REGEX +} else { + ADDITIONAL_LIBRARIES += -lboost_regex +} + +contains(COMPILER, msvc) { + # Special cases for MSVC + DEFINES += USE_MSVC + DEFINES += _CRT_SECURE_NO_WARNINGS +} + +contains(COMPILER, mingw) { + # Special cases for mingw + DEFINES += USE_MINGW +} diff --git a/gl/.cvsignore b/gl/.cvsignore deleted file mode 100644 index 70845e0..0000000 --- a/gl/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile.in diff --git a/gl/m4/.cvsignore b/gl/m4/.cvsignore deleted file mode 100644 index 544c899..0000000 --- a/gl/m4/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -*.lnk -libtool.m4 -lt~obsolete.m4 -ltoptions.m4 -ltversion.m4 -ltsugar.m4 diff --git a/lib/Makefile.am b/lib/Makefile.am index 2154099..7ffcc62 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -8,7 +8,9 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SUBDIRS = srchilite tests examples +SUBDIRS = srchilite tests examples compat DIST_SUBDIRS = $(SUBDIRS) +EXTRA_DIST = lib.pro + diff --git a/lib/lib.pro b/lib/lib.pro new file mode 100644 index 0000000..17e12e5 --- /dev/null +++ b/lib/lib.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs + +SUBDIRS = srchilite + diff --git a/lib/srchilite/Makefile.am b/lib/srchilite/Makefile.am index 3f82dbf..f1e7fee 100644 --- a/lib/srchilite/Makefile.am +++ b/lib/srchilite/Makefile.am @@ -152,7 +152,8 @@ INCLUDES = -I@top_srcdir@/src EXTRA_DIST = $(h_sources) \ langelemsprinter_dbtab.cc \ highlightstatebuilder_dbtab.cc \ -srchilite.doxyfile.in +srchilite.doxyfile.in \ +srchilite.pro BUILT_SOURCES = styleparser.cc styleparser.h \ stylecssparser.cc stylecssparser.h \ diff --git a/source-highlight.pro b/source-highlight.pro new file mode 100644 index 0000000..69c3c61 --- /dev/null +++ b/source-highlight.pro @@ -0,0 +1,32 @@ +include(defines.pri) + +TEMPLATE = subdirs + +CONFIG += ordered recursive + +SUBDIRS = lib src + +OTHER_FILES = TODO.txt \ + COPYING \ + AUTHORS \ + INSTALL \ + README \ + THANKS + +message(Compiler : $${COMPILER}) +message(Compiler Binary: $$QMAKE_CXX) + +isEmpty(BUILDING_STATIC_LIBRARY) { + message("dynamic library") +} else { + message("static library") +} + +message( "Libraries: " ) +message( "specified by user : " $$ADDITIONAL_LIBRARIES ) + +contains(COMPILER, msvc) { + isEmpty(BUILDING_STATIC_LIBRARY) { + warning("on msvc only static version of the library can be currently built") + } +} diff --git a/src/Makefile.am b/src/Makefile.am index 6256380..f88af4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -64,7 +64,8 @@ cpp2html.in \ src-hilite-lesspipe.sh.in \ envmapper.h \ cmdline.ggo check-regexp_cmd.ggo \ -$(source_highlightdata_DATA) +$(source_highlightdata_DATA) \ +src.pro source-highlight.pro source-highlight-settings.pro LANGFILES = \ bison.lang c.lang cpp.lang javascript.lang perl.lang ruby.lang \ diff --git a/src/cmdline.c b/src/cmdline.c index 051e485..23e15cd 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -970,7 +970,6 @@ cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog int cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) { - FIX_UNUSED (additional_error); int error = 0; /* checks for required options */ @@ -1028,7 +1027,6 @@ int update_arg(void *field, char **orig_field, const char *long_opt, char short_opt, const char *additional_error) { - FIX_UNUSED (field); char *stop_char = 0; const char *val = value; int found; diff --git a/src/source-highlight-settings.cpp b/src/source-highlight-settings.cpp index 3d866a8..9eefe6d 100644 --- a/src/source-highlight-settings.cpp +++ b/src/source-highlight-settings.cpp @@ -26,8 +26,20 @@ #include "srchilite/settings.h" #include "srchilite/versions.h" + +#ifdef HAVE_CONFIG_H +#include "config.h" + +// this is glib related so don't use it when compiling with qmake #include "progname.h" +#else + +#define set_program_name(x) ; + +#endif + + using namespace std; using namespace srchilite; diff --git a/src/source-highlight-settings.pro b/src/source-highlight-settings.pro new file mode 100644 index 0000000..5e00bbe --- /dev/null +++ b/src/source-highlight-settings.pro @@ -0,0 +1,21 @@ +include(../defines.pri) + +TEMPLATE = app + +# enable reading of this meta information in the applications that use the static library: +CONFIG += link_prl + +TARGET = source-highlight-settings + +SOURCES = source-highlight-settings.cpp + +INCLUDEPATH += . ../../lib ../lib $$INCPATH +DEPENDPATH += ../lib ../../lib . + +LIBS += -L../lib -l$$LIBRARY_LIB $$ADDITIONAL_LIBRARIES + +DESTDIR = ../bin + +target.path = /bin + +INSTALLS += target diff --git a/src/source-highlight.cc b/src/source-highlight.cc index 6617763..35f14eb 100644 --- a/src/source-highlight.cc +++ b/src/source-highlight.cc @@ -19,6 +19,14 @@ #ifdef HAVE_CONFIG_H #include "config.h" + +// this is glib related so don't use it when compiling with qmake +#include "progname.h" + +#else + +#define set_program_name(x) ; + #endif #include <cstdlib> @@ -28,8 +36,8 @@ #include "srchilite/sourcehighlight.h" -#include "srchilite/copyright.h" -#include "srchilite/reportbugs.h" +//#include "srchilite/copyright.h" +//#include "srchilite/reportbugs.h" #include "srchilite/fileutil.h" #include "srchilite/verbosity.h" #include "srchilite/langmap.h" @@ -47,8 +55,6 @@ #include "cmdline.h" -#include "progname.h" - using namespace std; using namespace srchilite; @@ -362,7 +368,7 @@ int main(int argc, char * argv[]) { InferPolicy inferPolicy = (args_info.infer_lang_given ? INFERFIRST : INFERATLAST); - RefPosition refposition; + RefPosition refposition = INLINE; string gen_references_arg = args_info.gen_references_arg; if (gen_references_arg == "inline") refposition = INLINE; @@ -450,6 +456,15 @@ int main(int argc, char * argv[]) { void print_copyright() { int i; + int copyright_text_length = 5; + const char *copyright_text[] = { + "copyright.text", + "Copyright (C) 1999-2008 Lorenzo Bettini <http://www.lorenzobettini.it>", + "This program comes with ABSOLUTELY NO WARRANTY.", + "This is free software; you may redistribute copies of the program", + "under the terms of the GNU General Public License.", + "For more information about these matters, see the file named COPYING.", + 0 }; for (i = 1; i <= copyright_text_length; ++i) cout << copyright_text[i] << endl;; @@ -457,6 +472,13 @@ void print_copyright() { void print_reportbugs() { int i; + int reportbugs_text_length = 3; + const char *reportbugs_text[] = { + "reportbugs.text", + "", + "Maintained by Lorenzo Bettini <http://www.lorenzobettini.it>", + "Report bugs to <bug-source-highlight at gnu.org>", + 0 }; for (i = 1; i <= reportbugs_text_length; ++i) cout << reportbugs_text[i] << endl; diff --git a/src/source-highlight.pro b/src/source-highlight.pro new file mode 100644 index 0000000..3567012 --- /dev/null +++ b/src/source-highlight.pro @@ -0,0 +1,39 @@ +include(../defines.pri) +TEMPLATE = app + +# enable reading of this meta information in the applications that use the static library: +CONFIG += link_prl + +TARGET = source-highlight +SOURCES = cmdline.c \ + source-highlight.cc + +INCLUDEPATH += . \ + ../../lib \ + ../lib \ + $$INCPATH +DEPENDPATH += ../lib \ + ../../lib \ + . +LIBS += -L../lib \ + -l$$LIBRARY_LIB $$ADDITIONAL_LIBRARIES +DESTDIR = ../bin + +contains(COMPILER, msvc) { +# custom implementation of getopt functions +SOURCES += ../lib/compat/getopt.c ../lib/compat/getopt1.c +INCLUDEPATH += ../lib/compat +DEPENDPATH += ../lib/compat +} + +target.path = /bin + +sourcehighlightdata.files = *.lang \ + *.outlang \ + *.style \ + *.css \ + *.map \ + *.defaults +sourcehighlightdata.path = /share/source-highlight +INSTALLS += target \ + sourcehighlightdata diff --git a/src/src.pro b/src/src.pro new file mode 100644 index 0000000..dcdb9f5 --- /dev/null +++ b/src/src.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs + +SUBDIRS = source-highlight.pro source-highlight-settings.pro
\ No newline at end of file |