From eedca3cc8f1a408e4a3ea9d1acc53815f9b07c6f Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Tue, 13 Oct 2009 10:22:29 +0000 Subject: [PATCH] Update build system --- .gitignore | 1 + README | 6 +- config | 36 ++++++++ libutf8.kdevelop | 168 ---------------------------------- libutf8.kdevelop.filelist | 4 - make.sh | 80 ++++++++-------- run-test.sh | 10 +- scripts/.gitignore | 28 ++++-- scripts/functions.sh | 3 +- scripts/paths | 64 +++++++++++++ src/docs/Doxyfile.in | 139 ++++++++++++++++++++-------- src/docs/MainPage.dox | 5 +- src/docs/build.docs | 2 +- src/docs/build.install-docs | 2 +- src/libutf8/build.install-lib | 34 +++---- src/libutf8/build.lib | 17 ++-- src/libutf8/build.monolithic | 6 +- src/libutf8/config-script | 98 ++++++++++++++++++++ src/libutf8/pkgconf.in | 21 ----- src/libutf8/soversion | 12 +-- src/tests/build.default | 2 +- src/tests/build.tests | 8 +- src/tests/template | 8 +- version | 8 +- 24 files changed, 423 insertions(+), 339 deletions(-) create mode 100644 config delete mode 100644 libutf8.kdevelop delete mode 100644 libutf8.kdevelop.filelist create mode 100644 scripts/paths create mode 100644 src/libutf8/config-script delete mode 100644 src/libutf8/pkgconf.in diff --git a/.gitignore b/.gitignore index d025740..2156e01 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ obj html +.*.swp diff --git a/README b/README index 0c06817..e5079d9 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ libutf8 ======================================================================== (c)2006-2009, Laurence Withers, . -Released under the GNU GPLv2. See file COPYING or +Released under the GNU GPLv3. See file COPYING or http://www.gnu.org/copyleft/gpl.html for details. Really Quick Instructions @@ -12,6 +12,10 @@ To install: ./make.sh install (you might want to set PREFIX, by default it's /usr/local) Documentation is automatically built using doxygen. +You might want to edit 'config' first. You might also want to set +'INSTALL_PREFIX', which is prepended onto the destination of any +installed file. + Project Homepage ---------------- diff --git a/config b/config new file mode 100644 index 0000000..a9ce5e7 --- /dev/null +++ b/config @@ -0,0 +1,36 @@ +# libutf8/config +# kate: replace-trailing-space-save true; space-indent true; tab-width 4; +# vim: syntax=sh:expandtab:ts=4:sw=4 +# +# (c)2009, Laurence Withers, . +# Released under the GNU GPLv3. See file COPYING or +# http://www.gnu.org/copyleft/gpl.html for details. +# +# This file contains options used to build libutf8. + + +# PREFIX is the most important option. Many other paths are derived from it, as follows: +# +# PREFIX | / | /usr | /usr/local | /opt/* +# ------------+-------------------+-------------------+-------------------+----------------- +# BINDIR | /bin | /usr/bin | /usr/local/bin | /opt/*/bin +# SBINDIR | /sbin | /usr/sbin | /usr/local/sbin | /opt/*/sbin +# LIBDIR | /lib | /usr/lib | /usr/local/lib | /opt/*/lib +# INCLUDEDIR | /usr/include | /usr/include | /usr/local/include| /opt/*/include +# CONFIGDIR | /etc | /etc | /usr/local/etc | /etc/opt/* +# VARDIR | /var | /var | /var | /var/opt/* +# SHAREDIR | /usr/share | /usr/share | /usr/local/share | /opt/*/share +# DOCSDIR | /usr/share/doc | /usr/share/doc | /usr/local/share/doc, /opt/*/doc +# WEBDIR | /srv/http | /srv/http | /srv/http | /opt/*/http +# +# Specific notes: +# When installing, all paths are prepended with INSTALL_PREFIX. +# Any parameter can be overridden by setting an environment variable. +# CGIDIR is set to ${WEBDIR}/cgi-bin . +# +[ -z "${PREFIX}" ] && PREFIX="/usr/local" +source "scripts/paths" + +# Project-specific variables below. +[ -z "${CC}" ] && CC="gcc" +[ -z "${CFLAGS}" ] && CFLAGS="-g -O2 -W -Wall" diff --git a/libutf8.kdevelop b/libutf8.kdevelop deleted file mode 100644 index 2ddbc5e..0000000 --- a/libutf8.kdevelop +++ /dev/null @@ -1,168 +0,0 @@ - - - - Laurence Withers - l@lwithers.me.uk - $VERSION$ - KDevCustomProject - C++ - - . - false - - - - - - /bin/true - executable - / - - false - true - - - - make - - - - false - 1 - 0 - false - ./make.sh - default - - default - - - - - - - - - - - - - - - - - true - false - false - - - false - true - 10 - - - - - ada - ada_bugs_gcc - bash - bash_bugs - clanlib - fortran_bugs_gcc - gnome1 - gnustep - gtk - gtk_bugs - haskell - haskell_bugs_ghc - java_bugs_gcc - java_bugs_sun - kde2book - opengl - pascal_bugs_fp - php - php_bugs - perl - perl_bugs - python - python_bugs - qt-kdev3 - ruby - ruby_bugs - sdl - sw - w3c-dom-level2-html - w3c-svg - w3c-uaag10 - wxwidgets_bugs - - - Guide to the Qt Translation Tools - Qt Assistant Manual - Qt Designer Manual - Qt Reference Documentation - qmake User Guide - - - KDE Libraries (Doxygen) - - - - - - - - - - - - .h - .cpp - - - - - true - true - true - false - true - true - true - 1 - 1 - 250 - - - - set - m_,_ - theValue - true - true - - - - - - - - - - - - - false - false - - - *.o,*.lo,CVS - false - false - - - - - - - diff --git a/libutf8.kdevelop.filelist b/libutf8.kdevelop.filelist deleted file mode 100644 index 81bce2d..0000000 --- a/libutf8.kdevelop.filelist +++ /dev/null @@ -1,4 +0,0 @@ -# KDevelop Custom Project File List -src/lib/BottomHeader.h -src/lib/TopHeader.h -src/lib/TopSource.cpp diff --git a/make.sh b/make.sh index a05ae2c..2aae9c8 100755 --- a/make.sh +++ b/make.sh @@ -2,47 +2,32 @@ # libutf8/make.sh # # (c)2006-2009, Laurence Withers, . -# Released under the GNU GPLv2. See file COPYING or +# Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # # This file is the script used to build libutf8. There are some -# options that can be edited; these are set below (or you can pass them -# in as variables). -[ -z "${CC}" ] && CC="gcc" -[ -z "${CXX}" ] && CXX="g++" -[ -z "${CFLAGS}" ] && CFLAGS="-g -O2 -W -Wall" -[ -z "${PREFIX}" ] && PREFIX="/usr/local" -[ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib" -[ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin" -[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include" -[ -z "${DOCSDIR}" ] && DOCSDIR="${PREFIX}/share/doc/libutf8" - -# for pkg-config -[ -z "${PKGCONFDIR}" ] && PKGCONFDIR="${LIBDIR}/pkgconfig" -[ -z "${FINALLIBDIR}" ] && FINALLIBDIR="${LIBDIR}" -[ -z "${FINALINCLUDEDIR}" ] && FINALINCLUDEDIR="${INCLUDEDIR}" - -# for SDCC-built firmware -[ -z "${HEXDIR}" ] && HEXDIR="${PREFIX}/share/firmware" -[ -z "${SDCC}" ] && SDCC="sdcc" +# options that can be edited; these are set in the file 'config' (or you +# can pass them in as environment variables). +if [ ! -e "config" ] +then + echo "Configuration file not found???" + exit 1 +fi +source "./config" # don't fail on error, since last command in config might return false # Get version information -source version || exit 1 +source "./version" || exit 1 VERSION="${VERMAJOR}.${VERMINOR}.${VERMICRO}" -if [ ! -z "${VEREXTRA}" ] -then - VERSION="${VERSION}-${VEREXTRA}" -fi # Get standard functions [ -z "${VERBOSE}" ] && VERBOSE="0" -source scripts/functions.sh || exit 1 +source "./scripts/functions.sh" || exit 1 # List of directories which will be emptied by clean. @@ -59,6 +44,8 @@ OUTPUT_DIRS="obj html" # MONOLITHIC_TESTS if any file mentioned in this list is newer # than the output file, then we recreate it # MONOLITHIC_SOURCE a list (in order) of the source files +# MONOLITHIC_OPTIONS will #define the options to match the respective +# environment variables. # # Recognised formats are: # none no special processing happens before each file @@ -79,18 +66,21 @@ make_monolithic() { # extract options HASHLINE=0 VERDEFINE=0 + HASHDEFINE=0 if [ "$2" == "C" ] then HASHLINE=1 VERDEFINE=1 + HASHDEFINE=1 elif [ "$2" == "Ch" ] then HASHLINE=1 + HASHDEFINE=1 elif [ "$2" == "none" ] then - HASHLINE=0 # dummy command + HASHLINE=0 # dummy command else - print_failure "make_monolithic() called with unknown format $2" + print_failure "make_monolithic() called with unknown format $2" return 1 fi @@ -126,6 +116,14 @@ make_monolithic() { do_cmd_redir ${MONOLITHIC_OUT} echo "#define VEREXTRA \"${VEREXTRA}\"" || return 1 fi + if [ ${HASHDEFINE} -ne 0 ] + then + for opt in ${MONOLITHIC_OPTIONS} + do + do_cmd_redir ${MONOLITHIC_OUT} echo "#define ${opt} ${!opt}" || return 1 + done + fi + for FILE in ${MONOLITHIC_SOURCE} do if [ ${HASHLINE} -ne 0 ] @@ -153,6 +151,10 @@ build_dir_tree() { return 1 fi + build_dir_tree_recurse "${INSTALL_PREFIX}$1" +} + +build_dir_tree_recurse() { local DIR="$1" # if the directory already exists, return success @@ -171,8 +173,9 @@ build_dir_tree() { mkdir "${DIR}" >& /dev/null if [ $? -ne 0 ] then - build_dir_tree $(dirname "${DIR}") || return 1 - mkdir "${DIR}" + build_dir_tree_recurse $(dirname "${DIR}") || return 1 + echo " Creating directory '${DIR}'" + do_cmd mkdir "${DIR}" if [ $? -ne 0 ] then print_failure "Failed to create directory '${DIR}'" @@ -191,10 +194,10 @@ build_dir_tree() { # second is the destination. The third is the octal mode. install_file() { # figure out if $2 is a directory or not - DEST_FILE="$2" - [ -d "$2" ] && DEST_FILE="$2/$(basename $1)" + DEST_FILE="${INSTALL_PREFIX}$2" + [ -d "${DEST_FILE}" ] && DEST_FILE="${INSTALL_PREFIX}$2/$(basename $1)" - echo " Installing: '$1' -> '$2'" + echo " Installing: '$1' -> '${DEST_FILE}'" do_cmd cp -fP "$1" "${DEST_FILE}" || return 1 do_cmd chmod "$3" "${DEST_FILE}" || return 1 @@ -206,10 +209,10 @@ install_file() { # This will install a header file. It is basically similar to # install_file(), only we strip out the #line directives. install_header() { - DEST_FILE="$2" - [ -d "$2" ] && DEST_FILE="$2/$(basename $1)" + DEST_FILE="${INSTALL_PREFIX}$2" + [ -d "${DEST_FILE}" ] && DEST_FILE="${INSTALL_PREFIX}$2/$(basename $1)" - echo " Installing header: '$1' -> '$2'" + echo " Installing: '$1' -> '${DEST_FILE}'" do_cmd rm -f ${DEST_FILE} || exit 1 do_cmd_redir ${DEST_FILE} sed -e "s,^#line.*,," $1 || exit 1 do_cmd chmod "$3" "${DEST_FILE}" || return 1 @@ -223,9 +226,9 @@ install_header() { # second the symlink's source filename, and the third is the directory # in which to create the symlink. install_symlink() { - echo " Installing symlink: '$3/$2' -> '$1'" + echo " Installing symlink: '${INSTALL_PREFIX}$3/$1' -> '$2'" - ( do_cmd cd $3; ln -sf $2 $1 ) || return 1 + ( do_cmd ln -sf $2 ${INSTALL_PREFIX}$3/$1 ) || return 1 return 0 } @@ -272,6 +275,7 @@ do echo "Cleaning..." rm -rf ${OUTPUT_DIRS} print_success "Done" + true ;; # bad Kdevelop! bad! diff --git a/run-test.sh b/run-test.sh index 9fe22b2..bd44834 100755 --- a/run-test.sh +++ b/run-test.sh @@ -2,7 +2,7 @@ # libutf8/test.sh # # (c)2006-2009, Laurence Withers, . -# Released under the GNU GPLv2. See file COPYING or +# Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # @@ -21,7 +21,7 @@ run_test() { return 1 fi - LD_LIBRARY_PATH="obj" ${EXE} "$@" || return 1 + LD_LIBRARY_PATH="obj" "${EXE}" "$@" || return 1 return 0 } @@ -33,10 +33,10 @@ print_tests() { echo "---------------------------------------------------------------------" for EXE in obj/tests/* do - [ -x ${EXE} ] || continue - NAME=$(echo ${EXE} | sed 's,obj/tests/,,') + [ -x "${EXE}" ] || continue + NAME="$(echo "${EXE}" | sed 's,obj/tests/,,')" echo -ne "${NAME}\t" - LD_LIBRARY_PATH="obj" ${EXE} --print-summary + LD_LIBRARY_PATH="obj" "${EXE}" --print-summary done } diff --git a/scripts/.gitignore b/scripts/.gitignore index a540f48..edcbbeb 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1,12 +1,20 @@ -build.c++.app -build.c++.lib -build.c++.qtapp -build.c++.tests -build.c.app -build.c.lib -build.c.tests -build.doxygen.docs -build.none.files -build.sdcc.firmware +build.app.c +build.app.c++ +build.app.c++-qt +build.app.sh +build.docs.doxygen +build.docs.none +build.files.none +build.firmware.gpasm +build.firmware.sdcc +build.lib.c +build.lib.c++ +build.make.none +build.module.c +build.tests.c +build.tests.c++ + +config-printflags.sh module-create.sh release.sh +version.sh diff --git a/scripts/functions.sh b/scripts/functions.sh index 44855f0..3ef7004 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -1,8 +1,7 @@ -#!/bin/bash # libutf8/scripts/functions.sh # # (c)2006-2009, Laurence Withers, . -# Released under the GNU GPLv2. See file COPYING or +# Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # diff --git a/scripts/paths b/scripts/paths new file mode 100644 index 0000000..e258c1f --- /dev/null +++ b/scripts/paths @@ -0,0 +1,64 @@ +# libutf8/scripts/paths +# +# (c)2009, Laurence Withers, . +# Released under the GNU GPLv3. See file COPYING or +# http://www.gnu.org/copyleft/gpl.html for details. +# +# Default path setup. Not meant for editing; use environment variables +# to override values if needed. +# + +MY_PREFIX="${PREFIX}" +[ "${MY_PREFIX}" == "/" ] && MY_PREFIX="" + +[ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin" +[ -z "${SBINDIR}" ] && SBINDIR="${PREFIX}/sbin" +[ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib" + +if [ -z "${INCLUDEDIR}" ] +then + case "${PREFIX}" in + /) INCLUDEDIR="/usr/include" ;; + *) INCLUDEDIR="${PREFIX}/include" ;; + esac +fi + +if [ -z "${CONFIGDIR}" ] +then + case "${PREFIX}" in + / | /usr) CONFIGDIR="/etc" ;; + /opt*) CONFIGDIR="/etc${PREFIX}" ;; + *) CONFIGDIR="${PREFIX}/etc" ;; + esac +fi + +if [ -z "${VARDIR}" ] +then + case "${PREFIX}" in + / | /usr | /usr/local) VARDIR="/var" ;; + /opt*) VARDIR="/var${PREFIX}" ;; + *) VARDIR="${PREFIX}/var" ;; + esac +fi + +if [ -z "${SHAREDIR}" ] +then + case "${PREFIX}" in + /) SHAREDIR="/usr/share" ;; + *) SHAREDIR="${PREFIX}/share" ;; + esac +fi +[ -z "${DOCSDIR}" ] && DOCSDIR="${SHAREDIR}/doc" + +if [ -z "${SRVDIR}" ] +then + case "${PREFIX}" in + / | /usr | /usr/local) SRVDIR="/srv" ;; + *) SRVDIR="${PREFIX}/srv" ;; + esac +fi +[ -z "${WEBDIR}" ] && WEBDIR="${SRVDIR}/http" +[ -z "${CGIDIR}" ] && CGIDIR="${WEBDIR}/cgi-bin" + +# kate: replace-trailing-space-save true; space-indent true; tab-width 4; +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/docs/Doxyfile.in b/src/docs/Doxyfile.in index 9a80364..a0a59c5 100644 --- a/src/docs/Doxyfile.in +++ b/src/docs/Doxyfile.in @@ -1,39 +1,49 @@ # libutf8/src/docs/Doxyfile.in # # (c)2006-2009, Laurence Withers, . -# Released under the GNU GPLv2. See file COPYING or +# Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # +DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = libutf8 -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = YES FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = YES -DETAILS_AT_TOP = YES INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO +SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 EXTRACT_ALL = NO EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = YES @@ -43,86 +53,137 @@ CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = NO INLINE_INFO = YES -SORT_MEMBER_DOCS = YES +SORT_MEMBER_DOCS = NO SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = NO SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = +SHOW_FILES = NO +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = QUIET = YES WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = YES WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -FILE_PATTERNS = +WARN_LOGFILE = +INPUT = +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = RECURSIVE = NO -EXCLUDE = +EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = src/docs -INPUT_FILTER = -FILTER_PATTERNS = +INPUT_FILTER = +FILTER_PATTERNS = FILTER_SOURCE_FILES = NO SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO VERBATIM_HEADERS = NO ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = +IGNORE_PREFIX = GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES +HTML_DYNAMIC_SECTIONS = YES +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO +CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHG_LOCATION = DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 +FORMULA_FONTSIZE = 10 GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = DOXYGEN -EXPAND_AS_DEFINED = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = DOXYGEN \ + __attribute__()= +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES -TAGFILES = -GENERATE_TAGFILE = +TAGFILES = +GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES +MSCGEN_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES +DOT_FONTNAME = FreeSans +DOT_FONTSIZE = 10 +DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = NO @@ -131,13 +192,13 @@ TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = NO INCLUDED_BY_GRAPH = NO CALL_GRAPH = NO +CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = NO DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = YES DOT_MULTI_TARGETS = YES diff --git a/src/docs/MainPage.dox b/src/docs/MainPage.dox index 96f364a..a4d8877 100644 --- a/src/docs/MainPage.dox +++ b/src/docs/MainPage.dox @@ -1,7 +1,7 @@ /* libutf8/src/docs/MainPage.dox * * (c)2006-2009, Laurence Withers, . - * Released under the GNU GPLv2. See file COPYING or + * Released under the GNU GPLv3. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -10,10 +10,9 @@ \c libutf8 provides a C API for encoding and decoding UTF-8. It uses the C type \c wchar_t as its internal character representation. \c libutf8 is a "safe" decoder — it will not accept overlong byte sequences. - */ /* options for text editors kate: replace-trailing-space-save true; space-indent true; tab-width 4; -vim: expandtab:ts=4:sw=4 +vim: expandtab:ts=4:sw=4:syntax=doxygen */ diff --git a/src/docs/build.docs b/src/docs/build.docs index 653c323..98d0570 100644 --- a/src/docs/build.docs +++ b/src/docs/build.docs @@ -40,4 +40,4 @@ then fi # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/docs/build.install-docs b/src/docs/build.install-docs index 66167d3..28f5f18 100644 --- a/src/docs/build.install-docs +++ b/src/docs/build.install-docs @@ -18,4 +18,4 @@ done print_success "Documentation installed" # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/libutf8/build.install-lib b/src/libutf8/build.install-lib index c6c6365..634c29b 100644 --- a/src/libutf8/build.install-lib +++ b/src/libutf8/build.install-lib @@ -2,35 +2,37 @@ build_target libutf8 # make paths (this is for Gentoo in particular) build_dir_tree "${LIBDIR}" || return 1 -build_dir_tree "${PKGCONFDIR}" || return 1 +build_dir_tree "${BINDIR}" || return 1 build_dir_tree "${INCLUDEDIR}" || return 1 # install library echo "Installing libraries into '${LIBDIR}'" +source src/libutf8/soversion install_file ${libutf8} ${LIBDIR} 0755 || return 1 BASE="${libutf8_BASE}.so" MAJOR="${BASE}.${SOMAJOR}" -MINOR="${MAJOR}.${SOMINOR}" -MICRO="${MINOR}.${SOMICRO}" -install_symlink "${MINOR}" "${MICRO}" "${LIBDIR}" -install_symlink "${MAJOR}" "${MINOR}" "${LIBDIR}" -install_symlink "${BASE}" "${MAJOR}" "${LIBDIR}" +MICRO="${MAJOR}.${SOMICRO}" +install_symlink "${BASE}" "${MICRO}" "${LIBDIR}" # install header echo "Installing header file '${libutf8_HEADER}' into ${INCLUDEDIR}" install_header ${libutf8_HEADER} ${INCLUDEDIR} 0644 || return 1 -# install pkgconfig file -echo "Installing package config file into ${PKGCONFDIR}" -PKGCONFFILE=${PKGCONFDIR}/libutf8.pc -do_cmd rm -f ${PKGCONFFILE} -do_cmd_redir ${PKGCONFFILE} sed \ +# install config script +echo "Installing config script into ${BINDIR}" +CONFFILE="${INSTALL_PREFIX}${BINDIR}/libutf8-config" + +do_cmd rm -f "${CONFFILE}" +do_cmd_redir "${CONFFILE}" sed \ -e "s,@VERSION@,${VERSION}," \ - -e "s,@LIBDIR@,${FINALLIBDIR}," \ - -e "s,@INCLUDEDIR@,${FINALINCLUDEDIR}," \ - src/libutf8/pkgconf.in -do_cmd chmod 0644 ${PKGCONFFILE} + -e "s,@DEP_CFLAGS@,${libutf8_DEP_CFLAGS}," \ + -e "s,@DEP_LIBS@,${libutf8_DEP_LIBS}," \ + -e "s,@LIB_DIR@,${LIBDIR}," \ + -e "s,@INCLUDE_DIR@,${INCLUDEDIR}," \ + src/libutf8/config-script + +do_cmd chmod 0755 "${CONFFILE}" print_success "Done" # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/libutf8/build.lib b/src/libutf8/build.lib index 9d9fe7e..45351d9 100644 --- a/src/libutf8/build.lib +++ b/src/libutf8/build.lib @@ -3,14 +3,18 @@ # libutf8_BUILT # libutf8_HEADER # libutf8_BASE +# libutf8_DEP_CFLAGS +# libutf8_DEP_LIBS if [ -z ${libutf8_BUILT} ] then libutf8_BASE=libutf8 source src/libutf8/soversion - libutf8="obj/${libutf8_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}" - SO_EXTRA="-lc" + libutf8="obj/${libutf8_BASE}.so.${SOMAJOR}.${SOMICRO}" + libutf8_DEP_CFLAGS="" # @TODO@ cflags + libutf8_DEP_LIBS="" # @TODO@ libs + SO_EXTRA="${libutf8_DEP_CFLAGS} ${libutf8_DEP_LIBS} -lc" echo "Building library ${libutf8}..." @@ -30,13 +34,14 @@ then then echo " Compiling" - SONAME="${libutf8_BASE}.so.${SOMAJOR}.${SOMINOR}" + SONAME="${libutf8_BASE}.so.${SOMAJOR}" do_cmd ${CC} ${CFLAGS} -Iobj -shared -fpic -o "${libutf8}" \ -Wl,-soname,${SONAME} \ ${SRC} ${SO_EXTRA} || return 1 - # make tests work - do_cmd ln -sf $(basename ${libutf8}) obj/${SONAME} || return 1 + # make tests and linking work + do_cmd ln -sf "$(basename "${libutf8}")" "obj/${SONAME}" || return 1 + do_cmd ln -sf "$(basename "${libutf8}")" "obj/${libutf8_BASE}.so" || return 1 print_success "Library built" else @@ -48,4 +53,4 @@ then fi # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/libutf8/build.monolithic b/src/libutf8/build.monolithic index 4fbd93e..c41ff0d 100644 --- a/src/libutf8/build.monolithic +++ b/src/libutf8/build.monolithic @@ -8,14 +8,14 @@ MONOLITHIC_TESTS="src/libutf8/build.lib src/libutf8/build.monolithic" if [ -z "${libutf8_MONOLITHIC}" ] then - MONOLITHIC_SOURCE="$(echo src/libutf8/{TopHeader,ForwardDeclare,ctype,{de,en}code{,_state},BottomHeader}.h)" + MONOLITHIC_SOURCE="$(find src/libutf8/ -name '*.h' | sort)" make_monolithic ${HDR} Ch || return 1 - MONOLITHIC_SOURCE="$(echo src/libutf8/{TopSource,ctype,{de,en}code{,_state}}.c)" + MONOLITHIC_SOURCE="$(find src/libutf8/ -name '*.c' | sort)" make_monolithic ${SRC} C || return 1 libutf8_MONOLITHIC=1 MONOLITHIC_DOC="${MONOLITHIC_DOC} ${HDR}" fi # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/libutf8/config-script b/src/libutf8/config-script new file mode 100644 index 0000000..4203883 --- /dev/null +++ b/src/libutf8/config-script @@ -0,0 +1,98 @@ +#!/bin/bash +# libutf8/src/libutf8/config-script +# +# libutf8-config template. Variables are finalised at install time. +# +dep_cflags="@DEP_CFLAGS@" +dep_libs="@DEP_LIBS@" +include_dir="@INCLUDE_DIR@" +include_dir_set="no" +lib_dir="@LIB_DIR@" +lib_dir_set="no" + + + +usage() { + cat <&2 + + + +while [ $# -gt 0 ] +do + case "$1" in + -*=*) + optarg="$(echo "$1" | sed 's/[-_a-zA-Z0-9]*=//')" + ;; + + *) + optarg="" + ;; + esac + + case "$1" in + --libdir=*) + lib_dir="${optarg}" + lib_dir_set="yes" + ;; + + --libdir) + echo_lib_dir="yes" + ;; + + --includedir=*) + include_dir="${optarg}" + include_dir_set="yes" + ;; + + --includedir) + echo_include_dir="yes" + ;; + + --version) + echo "@VERSION@" + exit 0 + ;; + + --cflags) + [ "${include_dir}" != "/usr/include" ] && includes="-I${include_dir}" + echo_cflags="yes" + ;; + + --libs) + echo_libs="yes" + ;; + + *) + usage 1 1>&2 + ;; + esac + + shift +done + + + +[ "${echo_prefix}" == "yes" ] && echo "${prefix}" +[ "${echo_exec_prefix}" == "yes" ] && echo "${exec_prefix}" +[ "${echo_cflags}" == "yes" ] && echo "${dep_cflags} ${includes}" +[ "${echo_libs}" == "yes" ] && echo "${dep_libs} -L${lib_dir} -lutf8" +true + + + +# vim: syntax=sh:expandtab:ts=4:sw=4 +# kate: replace-trailing-space-save true; space-indent true; tab-width 4; diff --git a/src/libutf8/pkgconf.in b/src/libutf8/pkgconf.in deleted file mode 100644 index 090336e..0000000 --- a/src/libutf8/pkgconf.in +++ /dev/null @@ -1,21 +0,0 @@ -# libutf8/src/lib/clib/pkgconf.in -# -# Metadata file for pkg-config -# ( http://www.freedesktop.org/software/pkgconfig/ ) -# -# (c)2006-2009, Laurence Withers, . -# Released under the GNU GPLv2. See file COPYING or -# http://www.gnu.org/copyleft/gpl.html for details. -# - -# Name, description -Name: @TODO@ -Description: @TODO@ -Version: @VERSION@ - -# Requirements -Requires: - -# Compilation information -Libs: -L@LIBDIR@ -lutf8 -Cflags: -I@INCLUDEDIR@ diff --git a/src/libutf8/soversion b/src/libutf8/soversion index 7ff8ee4..b2e6d0a 100644 --- a/src/libutf8/soversion +++ b/src/libutf8/soversion @@ -1,17 +1,15 @@ # libutf8/src/libutf8/soversion # -# (c)2006-2009, Laurence Withers, . -# Released under the GNU GPLv2. See file COPYING or +# (c)2009, Laurence Withers, . +# Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # -# SOMAJOR and SOMINOR are included in the library's soname. They need to -# be bumped on a binary-incompatible release. They are both single -# integers. +# SOMAJOR is included in the library's soname, and needs to be bumped +# after a binary-incompatible release. It is a single integer. SOMAJOR=0 -SOMINOR=0 # SOMICRO is bumped every time there is a binary-compatible release. -SOMICRO=1 +SOMICRO=0 diff --git a/src/tests/build.default b/src/tests/build.default index 2d979e2..1f0ae49 100644 --- a/src/tests/build.default +++ b/src/tests/build.default @@ -1,3 +1,3 @@ source src/tests/build.tests # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/tests/build.tests b/src/tests/build.tests index f484dab..4b08134 100644 --- a/src/tests/build.tests +++ b/src/tests/build.tests @@ -6,15 +6,15 @@ build_target libutf8 || return 1 if [ -z ${tests_BUILT} ] then - LIBS="${libutf8} " - EXTRAS="" + LIBS="${libutf8} ${libutf8_DEP_CFLAGS} ${libutf8_DEP_LIBS} " + EXTRAS="" # @TODO@ libs, cflags echo "Building test programs..." do_cmd mkdir -p obj/tests || return 1 for SRC in src/tests/*.c do - TEST="obj/tests/$(basename ${SRC} | sed -e 's,.c$,,')" + TEST="obj/tests/$(basename "${SRC}" ".c")" MODIFIED=0 for file in ${LIBS} ${SRC} src/tests/build.tests do @@ -40,4 +40,4 @@ then fi # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: syntax=sh:expandtab:ts=4:sw=4 diff --git a/src/tests/template b/src/tests/template index cbaff73..484666e 100644 --- a/src/tests/template +++ b/src/tests/template @@ -1,7 +1,7 @@ /* libutf8/src/tests/???.c * * (c)2006-2009, Laurence Withers, . - * Released under the GNU GPLv2. See file COPYING or + * Released under the GNU GPLv3. See file COPYING or * http://www.gnu.org/copyleft/gpl.html for details. */ @@ -17,15 +17,15 @@ int main(int argc, char* argv[]) int ret = 0; if(argc == 2 && !strcmp(argv[1], "--print-summary")) { - printf("One line summary.\n"); + fputs("One line summary.\n", stdout); return 0; } if(argc == 1) { - // empty argument list + /* empty argument list */ } - // TODO + /* TODO */ return ret; } diff --git a/version b/version index b1425bf..d60d37d 100644 --- a/version +++ b/version @@ -1,19 +1,17 @@ # libutf8/version # # (c)2006-2009, Laurence Withers, . -# Released under the GNU GPLv2. See file COPYING or +# Released under the GNU GPLv3. See file COPYING or # http://www.gnu.org/copyleft/gpl.html for details. # # VERSION contains the full version number of the library, which is -# expected to be in 'major.minor.micro' format. It can optionally be -# suffixed with a string. +# expected to be in 'major.minor.micro' format. VERMAJOR=1 VERMINOR=2 VERMICRO=1 -VEREXTRA="" # kate: replace-trailing-space-save true; space-indent true; tab-width 4; -# vim: expandtab:ts=4:sw=4 +# vim: expandtab:ts=4:sw=4:syntax=sh