Upgrade to new build system
This commit is contained in:
parent
8c470e4039
commit
076e58ccd7
4
README
4
README
|
@ -9,6 +9,8 @@ Really Quick Instructions
|
||||||
|
|
||||||
To build: ./make.sh
|
To build: ./make.sh
|
||||||
To install: ./make.sh install
|
To install: ./make.sh install
|
||||||
(you might want to set PREFIX, by default it's /usr/local)
|
|
||||||
|
|
||||||
This library has no dependencies other than the C library.
|
This library has no dependencies other than the C library.
|
||||||
|
You might want to edit 'config' first.
|
||||||
|
|
||||||
|
@TODO@
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
# libCStreamedXML/config
|
||||||
|
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||||
|
# vim: expandtab:ts=4:sw=4
|
||||||
|
#
|
||||||
|
# (c)2006, Laurence Withers, <l@lwithers.me.uk>.
|
||||||
|
# Released under the GNU GPLv2. See file COPYING or
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html for details.
|
||||||
|
#
|
||||||
|
# This file contains options used to build libCStreamedXML.
|
||||||
|
#
|
||||||
|
|
||||||
|
[ -z "${PREFIX}" ] && PREFIX="/usr/local"
|
||||||
|
[ -z "${CC}" ] && CC="gcc"
|
||||||
|
[ -z "${CFLAGS}" ] && CFLAGS="-g -O2 -W -Wall"
|
||||||
|
[ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin"
|
||||||
|
[ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib"
|
||||||
|
[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include"
|
||||||
|
[ -z "${FINALLIBDIR}" ] && FINALLIBDIR="${LIBDIR}"
|
||||||
|
[ -z "${FINALINCLUDEDIR}" ] && FINALINCLUDEDIR="${INCLUDEDIR}"
|
28
make.sh
28
make.sh
|
@ -8,25 +8,14 @@
|
||||||
|
|
||||||
|
|
||||||
# This file is the script used to build libCStreamedXML. There are some
|
# This file is the script used to build libCStreamedXML. There are some
|
||||||
# options that can be edited; these are set below (or you can pass them
|
# options that can be edited; these are set in the file 'config' (or you
|
||||||
# in as variables).
|
# can pass them in as environment variables).
|
||||||
[ -z "${CC}" ] && CC="gcc"
|
if [ ! -e "config" ]
|
||||||
[ -z "${CXX}" ] && CXX="g++"
|
then
|
||||||
[ -z "${CFLAGS}" ] && CFLAGS="-g -O2 -W -Wall"
|
echo "Configuration file not found???"
|
||||||
[ -z "${PREFIX}" ] && PREFIX="/usr/local"
|
exit 1
|
||||||
[ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib"
|
fi
|
||||||
[ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin"
|
source "config" # don't fail on error, since last command in config might return false
|
||||||
[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include"
|
|
||||||
[ -z "${DOCSDIR}" ] && DOCSDIR="${PREFIX}/share/doc/libCStreamedXML"
|
|
||||||
|
|
||||||
# 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"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -272,6 +261,7 @@ do
|
||||||
echo "Cleaning..."
|
echo "Cleaning..."
|
||||||
rm -rf ${OUTPUT_DIRS}
|
rm -rf ${OUTPUT_DIRS}
|
||||||
print_success "Done"
|
print_success "Done"
|
||||||
|
true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# bad Kdevelop! bad!
|
# bad Kdevelop! bad!
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
build.c++.app
|
build.app.c
|
||||||
build.c++.lib
|
build.app.c++
|
||||||
build.c++.qtapp
|
build.app.c++-qt
|
||||||
build.c++.tests
|
build.docs.doxygen
|
||||||
build.c.app
|
build.files.none
|
||||||
build.c.lib
|
build.firmware.gpasm
|
||||||
build.c.tests
|
build.firmware.sdcc
|
||||||
build.doxygen.docs
|
build.lib.c
|
||||||
build.none.files
|
build.lib.c++
|
||||||
build.sdcc.firmware
|
build.tests.c
|
||||||
|
build.tests.c++
|
||||||
module-create.sh
|
module-create.sh
|
||||||
release.sh
|
release.sh
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
doxygen docs docs
|
docs doxygen docs
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
c lib libCStreamedXML StreamedXML.h
|
lib c libCStreamedXML StreamedXML.h
|
||||||
|
|
|
@ -2,7 +2,7 @@ build_target libCStreamedXML
|
||||||
|
|
||||||
# make paths (this is for Gentoo in particular)
|
# make paths (this is for Gentoo in particular)
|
||||||
build_dir_tree "${LIBDIR}" || return 1
|
build_dir_tree "${LIBDIR}" || return 1
|
||||||
build_dir_tree "${PKGCONFDIR}" || return 1
|
build_dir_tree "${BINDIR}" || return 1
|
||||||
build_dir_tree "${INCLUDEDIR}" || return 1
|
build_dir_tree "${INCLUDEDIR}" || return 1
|
||||||
|
|
||||||
# install library
|
# install library
|
||||||
|
@ -20,16 +20,20 @@ install_symlink "${BASE}" "${MAJOR}" "${LIBDIR}"
|
||||||
echo "Installing header file '${libCStreamedXML_HEADER}' into ${INCLUDEDIR}"
|
echo "Installing header file '${libCStreamedXML_HEADER}' into ${INCLUDEDIR}"
|
||||||
install_header ${libCStreamedXML_HEADER} ${INCLUDEDIR} 0644 || return 1
|
install_header ${libCStreamedXML_HEADER} ${INCLUDEDIR} 0644 || return 1
|
||||||
|
|
||||||
# install pkgconfig file
|
# install config script
|
||||||
echo "Installing package config file into ${PKGCONFDIR}"
|
echo "Installing config script into ${BINDIR}"
|
||||||
PKGCONFFILE=${PKGCONFDIR}/libCStreamedXML.pc
|
CONFFILE="${BINDIR}/libCStreamedXML-config"
|
||||||
do_cmd rm -f ${PKGCONFFILE}
|
|
||||||
do_cmd_redir ${PKGCONFFILE} sed \
|
do_cmd rm -f "${CONFFILE}"
|
||||||
|
do_cmd_redir "${CONFFILE}" sed \
|
||||||
-e "s,@VERSION@,${VERSION}," \
|
-e "s,@VERSION@,${VERSION}," \
|
||||||
-e "s,@LIBDIR@,${FINALLIBDIR}," \
|
-e "s,@DEP_CFLAGS@,${libCStreamedXML_DEP_CFLAGS}," \
|
||||||
-e "s,@INCLUDEDIR@,${FINALINCLUDEDIR}," \
|
-e "s,@DEP_LIBS@,${libCStreamedXML_DEP_LIBS}," \
|
||||||
src/libCStreamedXML/pkgconf.in
|
-e "s,@LIB_DIR@,${FINALLIBDIR}," \
|
||||||
do_cmd chmod 0644 ${PKGCONFFILE}
|
-e "s,@INCLUDE_DIR@,${FINALINCLUDEDIR}," \
|
||||||
|
src/libCStreamedXML/config-script
|
||||||
|
|
||||||
|
do_cmd chmod 0755 "${CONFFILE}"
|
||||||
print_success "Done"
|
print_success "Done"
|
||||||
|
|
||||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
# libCStreamedXML_BUILT
|
# libCStreamedXML_BUILT
|
||||||
# libCStreamedXML_HEADER
|
# libCStreamedXML_HEADER
|
||||||
# libCStreamedXML_BASE
|
# libCStreamedXML_BASE
|
||||||
|
# libCStreamedXML_DEP_CFLAGS
|
||||||
|
# libCStreamedXML_DEP_LIBS
|
||||||
|
|
||||||
if [ -z ${libCStreamedXML_BUILT} ]
|
if [ -z ${libCStreamedXML_BUILT} ]
|
||||||
then
|
then
|
||||||
|
@ -10,7 +12,9 @@ then
|
||||||
source src/libCStreamedXML/soversion
|
source src/libCStreamedXML/soversion
|
||||||
|
|
||||||
libCStreamedXML="obj/${libCStreamedXML_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}"
|
libCStreamedXML="obj/${libCStreamedXML_BASE}.so.${SOMAJOR}.${SOMINOR}.${SOMICRO}"
|
||||||
SO_EXTRA="-lc"
|
libCStreamedXML_DEP_CFLAGS=""
|
||||||
|
libCStreamedXML_DEP_LIBS=""
|
||||||
|
SO_EXTRA="${libCStreamedXML_DEP_CFLAGS} ${libCStreamedXML_DEP_LIBS} -lc"
|
||||||
|
|
||||||
echo "Building library ${libCStreamedXML}..."
|
echo "Building library ${libCStreamedXML}..."
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# libCStreamedXML/src/libCStreamedXML/config-script
|
||||||
|
#
|
||||||
|
# libCStreamedXML-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: libCStreamedXML-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} -lCStreamedXML"
|
||||||
|
true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# vim: expandtab:ts=4:sw=4
|
||||||
|
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
|
@ -1,21 +0,0 @@
|
||||||
# libCStreamedXML/src/lib/libCStreamedXML/pkgconf.in
|
|
||||||
#
|
|
||||||
# Metadata file for pkg-config
|
|
||||||
# ( http://www.freedesktop.org/software/pkgconfig/ )
|
|
||||||
#
|
|
||||||
# (c)2006, Laurence Withers, <l@lwithers.me.uk>.
|
|
||||||
# Released under the GNU GPLv2. See file COPYING or
|
|
||||||
# http://www.gnu.org/copyleft/gpl.html for details.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Name, description
|
|
||||||
Name: libCStreamedXML
|
|
||||||
Description: C library for parsing Streamed XML
|
|
||||||
Version: @VERSION@
|
|
||||||
|
|
||||||
# Requirements
|
|
||||||
Requires:
|
|
||||||
|
|
||||||
# Compilation information
|
|
||||||
Libs: -L@LIBDIR@ -lCStreamedXML
|
|
||||||
Cflags: -I@INCLUDEDIR@
|
|
|
@ -1 +1 @@
|
||||||
c tests tests libCStreamedXML
|
tests c tests libCStreamedXML
|
||||||
|
|
|
@ -8,11 +8,14 @@
|
||||||
#include "StreamedXML.h"
|
#include "StreamedXML.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if(argc == 2 && !strcmp(argv[1], "--print-summary")) {
|
if(argc == 2 && !strcmp(argv[1], "--print-summary")) {
|
||||||
printf("One line summary.\n");
|
printf("One line summary.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -22,8 +25,6 @@ int main(int argc, char* argv[])
|
||||||
// empty argument list
|
// empty argument list
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue