Import build skeleton
This commit is contained in:
commit
679b37dc35
39 changed files with 2080 additions and 0 deletions
1
src/docs/.params
Normal file
1
src/docs/.params
Normal file
|
|
@ -0,0 +1 @@
|
|||
docs doxygen docs
|
||||
207
src/docs/Doxyfile.in
Normal file
207
src/docs/Doxyfile.in
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
# libfir/src/docs/Doxyfile.in
|
||||
#
|
||||
# Copyright: ©2014, Laurence Withers.
|
||||
# Author: Laurence Withers <l@lwithers.me.uk>
|
||||
# License: GPLv3
|
||||
#
|
||||
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = libfir
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF =
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = YES
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = YES
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 4
|
||||
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
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = NO
|
||||
INLINE_INFO = 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 =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = NO
|
||||
SHOW_DIRECTORIES = NO
|
||||
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 =
|
||||
INPUT =
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS =
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH = src/docs
|
||||
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 =
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
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 =
|
||||
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 = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = DOXYGEN \
|
||||
__attribute__()=
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
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
|
||||
UML_LOOK = NO
|
||||
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 =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
DOT_TRANSPARENT = YES
|
||||
DOT_MULTI_TARGETS = YES
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
SEARCHENGINE = NO
|
||||
14
src/docs/MainPage.dox
Normal file
14
src/docs/MainPage.dox
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* libfir/src/docs/MainPage.dox
|
||||
*
|
||||
* Copyright: ©2014, Laurence Withers.
|
||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||
* License: GPLv3
|
||||
*/
|
||||
|
||||
/*! \mainpage
|
||||
|
||||
*/
|
||||
|
||||
/* options for text editors
|
||||
vim: expandtab:ts=4:sw=4:syntax=doxygen
|
||||
*/
|
||||
1
src/docs/build.default
Normal file
1
src/docs/build.default
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/docs/build.docs
|
||||
42
src/docs/build.docs
Normal file
42
src/docs/build.docs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# These are external variables, and shouldn't clash with anything else
|
||||
# docs_BUILT
|
||||
#
|
||||
|
||||
MONOLITHIC_DOC="${MONOLITHIC_DOC} $(echo src/docs/*.dox)"
|
||||
build_target monolithic
|
||||
|
||||
if [ -z ${docs_BUILT} ]
|
||||
then
|
||||
echo "Building documentation with Doxygen..."
|
||||
|
||||
DOXYFILE=obj/Doxyfile.docs
|
||||
|
||||
if [ ! -e ${DOXYFILE} ]
|
||||
then
|
||||
do_cmd cp src/docs/Doxyfile.in ${DOXYFILE} || return 1
|
||||
echo "INPUT = ${MONOLITHIC_DOC}" >> ${DOXYFILE}
|
||||
echo "PROJECT_NUMBER = ${VERSION}" >> ${DOXYFILE}
|
||||
fi
|
||||
|
||||
MODIFIED=0
|
||||
for file in ${MONOLITHIC_DOC}
|
||||
do
|
||||
if [ ${file} -nt html/index.html ]
|
||||
then
|
||||
MODIFIED=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${MODIFIED} -ne 0 ]
|
||||
then
|
||||
do_cmd doxygen ${DOXYFILE} || return 1
|
||||
print_success "Documentation built"
|
||||
else
|
||||
print_success "Documentation is up to date"
|
||||
fi
|
||||
|
||||
docs_BUILT=1
|
||||
fi
|
||||
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
1
src/docs/build.install
Normal file
1
src/docs/build.install
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/docs/build.install-docs
|
||||
20
src/docs/build.install-docs
Normal file
20
src/docs/build.install-docs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
build_target docs
|
||||
|
||||
# create documentation directories
|
||||
echo "Installing documentation into ${DOCSDIR}"
|
||||
build_dir_tree "${DOCSDIR}/html" || return 1
|
||||
|
||||
# copy across the Doxygen-generated documentation
|
||||
for file in html/*
|
||||
do
|
||||
install_file ${file} ${DOCSDIR}/html 0644 || return 1
|
||||
done
|
||||
|
||||
# copy across the generic files
|
||||
for file in COPYING README
|
||||
do
|
||||
install_file ${file} ${DOCSDIR} 0644 || return 1
|
||||
done
|
||||
|
||||
print_success "Documentation installed"
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
1
src/libfir++/.params
Normal file
1
src/libfir++/.params
Normal file
|
|
@ -0,0 +1 @@
|
|||
lib c++ libfir++ fir++.h
|
||||
15
src/libfir++/000_TopHeader.h
Normal file
15
src/libfir++/000_TopHeader.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* libfir/src/libfir++/000_TopHeader.h
|
||||
*
|
||||
* Copyright: ©2014, Laurence Withers.
|
||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||
* License: GPLv3
|
||||
*/
|
||||
|
||||
#ifndef HEADER_libfirpp
|
||||
#define HEADER_libfirpp
|
||||
|
||||
// standard includes, or includes needed for type declarations
|
||||
|
||||
/* options for text editors
|
||||
vim: expandtab:ts=4:sw=4:syntax=cpp.doxygen
|
||||
*/
|
||||
14
src/libfir++/000_TopSource.cpp
Normal file
14
src/libfir++/000_TopSource.cpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* libfir/src/libfir++/TopSource.cpp
|
||||
*
|
||||
* Copyright: ©2014, Laurence Withers.
|
||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||
* License: GPLv3
|
||||
*/
|
||||
|
||||
#include "fir++.h"
|
||||
|
||||
// Below are all the includes used throughout the library.
|
||||
|
||||
/* options for text editors
|
||||
vim: expandtab:ts=4:sw=4
|
||||
*/
|
||||
12
src/libfir++/999_BottomHeader.h
Normal file
12
src/libfir++/999_BottomHeader.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* libfir/src/libfir++/999_BottomHeader.h
|
||||
*
|
||||
* Copyright: ©2014, Laurence Withers.
|
||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||
* License: GPLv3
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/* options for text editors
|
||||
vim: expandtab:ts=4:sw=4:syntax=cpp.doxygen
|
||||
*/
|
||||
1
src/libfir++/build.default
Normal file
1
src/libfir++/build.default
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/libfir++/build.lib
|
||||
1
src/libfir++/build.install
Normal file
1
src/libfir++/build.install
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/libfir++/build.install-lib
|
||||
35
src/libfir++/build.install-lib
Normal file
35
src/libfir++/build.install-lib
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
build_target libfir++
|
||||
|
||||
# make paths (this is for Gentoo in particular)
|
||||
build_dir_tree "${LIBDIR}" || return 1
|
||||
build_dir_tree "${BINDIR}" || return 1
|
||||
build_dir_tree "${INCLUDEDIR}" || return 1
|
||||
|
||||
# install library
|
||||
echo "Installing libraries into '${LIBDIR}'"
|
||||
install_file ${libfirpp} ${LIBDIR} 0755 || return 1
|
||||
BASE="${libfirpp_BASE}.so"
|
||||
MAJOR="${BASE}.${SOMAJOR}"
|
||||
MICRO="${MAJOR}.${SOMICRO}"
|
||||
install_symlink "${BASE}" "${MICRO}" "${LIBDIR}"
|
||||
|
||||
# install header
|
||||
echo "Installing header file '${libfirpp_HEADER}' into ${INCLUDEDIR}"
|
||||
install_header ${libfirpp_HEADER} ${INCLUDEDIR} 0644 || return 1
|
||||
|
||||
# install config script
|
||||
echo "Installing config script into ${PKGCONFDIR}"
|
||||
CONFFILE="${INSTALL_PREFIX}${BINDIR}/libfir++-config"
|
||||
|
||||
do_cmd rm -f "${CONFFILE}"
|
||||
do_cmd_redir "${CONFFILE}" sed \
|
||||
-e "s,@VERSION@,${VERSION}," \
|
||||
-e "s,@LIB_DIR@,${LIBDIR}," \
|
||||
-e "s,@INCLUDE_DIR@,${INCLUDEDIR}," \
|
||||
-e "s,@DEP_CFLAGS@,${libfirpp_DEP_CFLAGS}," \
|
||||
-e "s,@DEP_LIBS@,${libfirpp_DEP_LIBS}," \
|
||||
src/libfir++/config-script
|
||||
do_cmd chmod 0644 "${CONFFILE}"
|
||||
print_success "Done"
|
||||
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
56
src/libfir++/build.lib
Normal file
56
src/libfir++/build.lib
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# These are external variables, and shouldn't clash with anything else
|
||||
# libfirpp
|
||||
# libfirpp_BUILT
|
||||
# libfirpp_HEADER
|
||||
# libfirpp_BASE
|
||||
# libfirpp_DEP_CFLAGS
|
||||
# libfirpp_DEP_LIBS
|
||||
|
||||
if [ -z ${libfirpp_BUILT} ]
|
||||
then
|
||||
libfirpp_BASE=libfir++
|
||||
source src/libfir++/soversion
|
||||
|
||||
libfirpp="obj/${libfirpp_BASE}.so.${SOMAJOR}.${SOMICRO}"
|
||||
libfirpp_DEP_CFLAGS="" # @TODO@ cflags
|
||||
libfirpp_DEP_LIBS="" # @TODO@ libs
|
||||
SO_EXTRA="${libfirpp_DEP_CFLAGS} ${libfirpp_DEP_LIBS} -lstdc++ -lc \
|
||||
-D_GNU_SOURCE"
|
||||
|
||||
echo "Building library ${libfirpp}..."
|
||||
|
||||
do_cmd source src/libfir++/build.monolithic || return 1
|
||||
|
||||
MODIFIED=0
|
||||
for test in ${MONOLITHIC_TESTS} ${HDR} ${SRC}
|
||||
do
|
||||
if [ ${test} -nt ${libfirpp} ]
|
||||
then
|
||||
MODIFIED=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${MODIFIED} -ne 0 ]
|
||||
then
|
||||
echo " Compiling"
|
||||
|
||||
SONAME="${libfirpp_BASE}.so.${SOMAJOR}"
|
||||
do_cmd ${CXX} ${CFLAGS} -Iobj -shared -fpic -o "${libfirpp}" \
|
||||
-Wl,-soname,${SONAME} \
|
||||
${SRC} ${SO_EXTRA} || return 1
|
||||
|
||||
# make tests work
|
||||
do_cmd ln -sf $(basename ${libfirpp}) obj/${SONAME} || return 1
|
||||
|
||||
print_success "Library built"
|
||||
else
|
||||
print_success "Library up to date"
|
||||
fi
|
||||
|
||||
libfirpp_BUILT=1
|
||||
libfirpp_HEADER=${HDR}
|
||||
|
||||
fi
|
||||
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
21
src/libfir++/build.monolithic
Normal file
21
src/libfir++/build.monolithic
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# These are external variables, and shouldn't clash with anything else
|
||||
# libfirpp_MONOLITHIC
|
||||
|
||||
SRC="obj/libfir++.cpp"
|
||||
HDR="obj/fir++.h"
|
||||
|
||||
MONOLITHIC_TESTS="src/libfir++/build.lib src/libfir++/build.monolithic"
|
||||
|
||||
if [ -z "${libfirpp_MONOLITHIC}" ]
|
||||
then
|
||||
MONOLITHIC_SOURCE="$(find src/libfir++/ -name '*.h' | sort)"
|
||||
make_monolithic ${HDR} Ch || return 1
|
||||
|
||||
MONOLITHIC_SOURCE="$(find src/libfir++/ -name '*.cpp' | sort)"
|
||||
make_monolithic ${SRC} C || return 1
|
||||
|
||||
libfirpp_MONOLITHIC=1
|
||||
MONOLITHIC_DOC="${MONOLITHIC_DOC} ${HDR}"
|
||||
fi
|
||||
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
97
src/libfir++/config-script
Normal file
97
src/libfir++/config-script
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
#!/bin/bash
|
||||
# libfir/src/libfir++/config-script
|
||||
#
|
||||
# libfir++-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 <<EOF
|
||||
Usage: libfir++-config [options]
|
||||
Options:
|
||||
[--version]
|
||||
[--libs]
|
||||
[--libdir[=DIR]]
|
||||
[--cflags]
|
||||
[--includedir[=DIR]]
|
||||
EOF
|
||||
exit $1
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ $# -eq 0 ] && usage 1 1>&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} -lfir++"
|
||||
true
|
||||
|
||||
|
||||
|
||||
# kate:
|
||||
15
src/libfir++/soversion
Normal file
15
src/libfir++/soversion
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# libfir/src/libfir++/soversion
|
||||
#
|
||||
# Copyright: ©2014, Laurence Withers.
|
||||
# Author: Laurence Withers <l@lwithers.me.uk>
|
||||
# License: GPLv3
|
||||
#
|
||||
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
# SOMICRO is bumped every time there is a binary-compatible release.
|
||||
SOMICRO=0
|
||||
1
src/libfir/.params
Normal file
1
src/libfir/.params
Normal file
|
|
@ -0,0 +1 @@
|
|||
lib c libfir fir.h
|
||||
19
src/libfir/000_TopHeader.h
Normal file
19
src/libfir/000_TopHeader.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* libfir/src/libfir/000_TopHeader.h
|
||||
*
|
||||
* Copyright: ©2014, Laurence Withers.
|
||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||
* License: GPLv3
|
||||
*/
|
||||
|
||||
#ifndef HEADER_libfir
|
||||
#define HEADER_libfir
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* standard includes, or includes needed for type declarations */
|
||||
|
||||
/* options for text editors
|
||||
vim: expandtab:ts=4:sw=4:syntax=ch.doxygen
|
||||
*/
|
||||
14
src/libfir/000_TopSource.c
Normal file
14
src/libfir/000_TopSource.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* libfir/src/libfir/000_TopSource.c
|
||||
*
|
||||
* Copyright: ©2014, Laurence Withers.
|
||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||
* License: GPLv3
|
||||
*/
|
||||
|
||||
#include "fir.h"
|
||||
|
||||
/* Below are all the includes used throughout the library. */
|
||||
|
||||
/* options for text editors
|
||||
vim: expandtab:ts=4:sw=4
|
||||
*/
|
||||
16
src/libfir/999_BottomHeader.h
Normal file
16
src/libfir/999_BottomHeader.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* libfir/src/libfir/999_BottomHeader.h
|
||||
*
|
||||
* Copyright: ©2014, Laurence Withers.
|
||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||
* License: GPLv3
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* options for text editors
|
||||
vim: expandtab:ts=4:sw=4:syntax=c.doxygen
|
||||
*/
|
||||
1
src/libfir/build.default
Normal file
1
src/libfir/build.default
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/libfir/build.lib
|
||||
1
src/libfir/build.install
Normal file
1
src/libfir/build.install
Normal file
|
|
@ -0,0 +1 @@
|
|||
source src/libfir/build.install-lib
|
||||
37
src/libfir/build.install-lib
Normal file
37
src/libfir/build.install-lib
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
build_target libfir
|
||||
|
||||
# make paths (this is for Gentoo in particular)
|
||||
build_dir_tree "${LIBDIR}" || return 1
|
||||
build_dir_tree "${BINDIR}" || return 1
|
||||
build_dir_tree "${INCLUDEDIR}" || return 1
|
||||
|
||||
# install library
|
||||
echo "Installing libraries into '${LIBDIR}'"
|
||||
source src/libfir/soversion
|
||||
install_file ${libfir} ${LIBDIR} 0755 || return 1
|
||||
BASE="${libfir_BASE}.so"
|
||||
MAJOR="${BASE}.${SOMAJOR}"
|
||||
MICRO="${MAJOR}.${SOMICRO}"
|
||||
install_symlink "${BASE}" "${MICRO}" "${LIBDIR}"
|
||||
|
||||
# install header
|
||||
echo "Installing header file '${libfir_HEADER}' into ${INCLUDEDIR}"
|
||||
install_header ${libfir_HEADER} ${INCLUDEDIR} 0644 || return 1
|
||||
|
||||
# install config script
|
||||
echo "Installing config script into ${BINDIR}"
|
||||
CONFFILE="${INSTALL_PREFIX}${BINDIR}/libfir-config"
|
||||
|
||||
do_cmd rm -f "${CONFFILE}"
|
||||
do_cmd_redir "${CONFFILE}" sed \
|
||||
-e "s,@VERSION@,${VERSION}," \
|
||||
-e "s,@DEP_CFLAGS@,${libfir_DEP_CFLAGS}," \
|
||||
-e "s,@DEP_LIBS@,${libfir_DEP_LIBS}," \
|
||||
-e "s,@LIB_DIR@,${LIBDIR}," \
|
||||
-e "s,@INCLUDE_DIR@,${INCLUDEDIR}," \
|
||||
src/libfir/config-script
|
||||
|
||||
do_cmd chmod 0755 "${CONFFILE}"
|
||||
print_success "Done"
|
||||
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
56
src/libfir/build.lib
Normal file
56
src/libfir/build.lib
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# These are external variables, and shouldn't clash with anything else
|
||||
# libfir
|
||||
# libfir_BUILT
|
||||
# libfir_HEADER
|
||||
# libfir_BASE
|
||||
# libfir_DEP_CFLAGS
|
||||
# libfir_DEP_LIBS
|
||||
|
||||
if [ -z ${libfir_BUILT} ]
|
||||
then
|
||||
libfir_BASE=libfir
|
||||
source src/libfir/soversion
|
||||
|
||||
libfir="obj/${libfir_BASE}.so.${SOMAJOR}.${SOMICRO}"
|
||||
libfir_DEP_CFLAGS="" # @TODO@ cflags
|
||||
libfir_DEP_LIBS="" # @TODO@ libs
|
||||
SO_EXTRA="${libfir_DEP_CFLAGS} ${libfir_DEP_LIBS} -lc \
|
||||
-D_GNU_SOURCE -std=gnu99"
|
||||
|
||||
echo "Building library ${libfir}..."
|
||||
|
||||
do_cmd source src/libfir/build.monolithic || return 1
|
||||
|
||||
MODIFIED=0
|
||||
for test in ${MONOLITHIC_TESTS} ${HDR} ${SRC}
|
||||
do
|
||||
if [ ${test} -nt ${libfir} ]
|
||||
then
|
||||
MODIFIED=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${MODIFIED} -ne 0 ]
|
||||
then
|
||||
echo " Compiling"
|
||||
|
||||
SONAME="${libfir_BASE}.so.${SOMAJOR}"
|
||||
do_cmd ${CC} ${CFLAGS} -Iobj -shared -fpic -o "${libfir}" \
|
||||
-Wl,-soname,${SONAME} \
|
||||
${SRC} ${SO_EXTRA} || return 1
|
||||
|
||||
# make tests and linking work
|
||||
do_cmd ln -sf "$(basename "${libfir}")" "obj/${SONAME}" || return 1
|
||||
do_cmd ln -sf "$(basename "${libfir}")" "obj/${libfir_BASE}.so" || return 1
|
||||
|
||||
print_success "Library built"
|
||||
else
|
||||
print_success "Library up to date"
|
||||
fi
|
||||
|
||||
libfir_BUILT=1
|
||||
libfir_HEADER=${HDR}
|
||||
|
||||
fi
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
20
src/libfir/build.monolithic
Normal file
20
src/libfir/build.monolithic
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# These are external variables, and shouldn't clash with anything else
|
||||
# libfir_MONOLITHIC
|
||||
|
||||
SRC="obj/libfir.c"
|
||||
HDR="obj/fir.h"
|
||||
|
||||
MONOLITHIC_TESTS="src/libfir/build.lib src/libfir/build.monolithic"
|
||||
|
||||
if [ -z "${libfir_MONOLITHIC}" ]
|
||||
then
|
||||
MONOLITHIC_SOURCE="$(find src/libfir/ -name '*.h' | sort)"
|
||||
make_monolithic ${HDR} Ch || return 1
|
||||
|
||||
MONOLITHIC_SOURCE="$(find src/libfir/ -name '*.c' | sort)"
|
||||
make_monolithic ${SRC} C || return 1
|
||||
|
||||
libfir_MONOLITHIC=1
|
||||
MONOLITHIC_DOC="${MONOLITHIC_DOC} ${HDR}"
|
||||
fi
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
97
src/libfir/config-script
Normal file
97
src/libfir/config-script
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
#!/bin/bash
|
||||
# libfir/src/libfir/config-script
|
||||
#
|
||||
# libfir-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 <<EOF
|
||||
Usage: libfir-config [options]
|
||||
Options:
|
||||
[--version]
|
||||
[--libs]
|
||||
[--libdir[=DIR]]
|
||||
[--cflags]
|
||||
[--includedir[=DIR]]
|
||||
EOF
|
||||
exit $1
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ $# -eq 0 ] && usage 1 1>&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} -lfir"
|
||||
true
|
||||
|
||||
|
||||
|
||||
# vim: syntax=sh:expandtab:ts=4:sw=4
|
||||
15
src/libfir/soversion
Normal file
15
src/libfir/soversion
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# libfir/src/libfir/soversion
|
||||
#
|
||||
# Copyright: ©2014, Laurence Withers.
|
||||
# Author: Laurence Withers <l@lwithers.me.uk>
|
||||
# License: GPLv3
|
||||
#
|
||||
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
# SOMICRO is bumped every time there is a binary-compatible release.
|
||||
SOMICRO=0
|
||||
Loading…
Add table
Add a link
Reference in a new issue