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 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.
|
||||
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
|
||||
# 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/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"
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
|
@ -272,6 +261,7 @@ do
|
|||
echo "Cleaning..."
|
||||
rm -rf ${OUTPUT_DIRS}
|
||||
print_success "Done"
|
||||
true
|
||||
;;
|
||||
|
||||
# bad Kdevelop! bad!
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
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.docs.doxygen
|
||||
build.files.none
|
||||
build.firmware.gpasm
|
||||
build.firmware.sdcc
|
||||
build.lib.c
|
||||
build.lib.c++
|
||||
build.tests.c
|
||||
build.tests.c++
|
||||
module-create.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)
|
||||
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
|
||||
|
@ -20,16 +20,20 @@ install_symlink "${BASE}" "${MAJOR}" "${LIBDIR}"
|
|||
echo "Installing header file '${libCStreamedXML_HEADER}' into ${INCLUDEDIR}"
|
||||
install_header ${libCStreamedXML_HEADER} ${INCLUDEDIR} 0644 || return 1
|
||||
|
||||
# install pkgconfig file
|
||||
echo "Installing package config file into ${PKGCONFDIR}"
|
||||
PKGCONFFILE=${PKGCONFDIR}/libCStreamedXML.pc
|
||||
do_cmd rm -f ${PKGCONFFILE}
|
||||
do_cmd_redir ${PKGCONFFILE} sed \
|
||||
# install config script
|
||||
echo "Installing config script into ${BINDIR}"
|
||||
CONFFILE="${BINDIR}/libCStreamedXML-config"
|
||||
|
||||
do_cmd rm -f "${CONFFILE}"
|
||||
do_cmd_redir "${CONFFILE}" sed \
|
||||
-e "s,@VERSION@,${VERSION}," \
|
||||
-e "s,@LIBDIR@,${FINALLIBDIR}," \
|
||||
-e "s,@INCLUDEDIR@,${FINALINCLUDEDIR}," \
|
||||
src/libCStreamedXML/pkgconf.in
|
||||
do_cmd chmod 0644 ${PKGCONFFILE}
|
||||
-e "s,@DEP_CFLAGS@,${libCStreamedXML_DEP_CFLAGS}," \
|
||||
-e "s,@DEP_LIBS@,${libCStreamedXML_DEP_LIBS}," \
|
||||
-e "s,@LIB_DIR@,${FINALLIBDIR}," \
|
||||
-e "s,@INCLUDE_DIR@,${FINALINCLUDEDIR}," \
|
||||
src/libCStreamedXML/config-script
|
||||
|
||||
do_cmd chmod 0755 "${CONFFILE}"
|
||||
print_success "Done"
|
||||
|
||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
# libCStreamedXML_BUILT
|
||||
# libCStreamedXML_HEADER
|
||||
# libCStreamedXML_BASE
|
||||
# libCStreamedXML_DEP_CFLAGS
|
||||
# libCStreamedXML_DEP_LIBS
|
||||
|
||||
if [ -z ${libCStreamedXML_BUILT} ]
|
||||
then
|
||||
|
@ -10,7 +12,9 @@ then
|
|||
source src/libCStreamedXML/soversion
|
||||
|
||||
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}..."
|
||||
|
||||
|
|
|
@ -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 <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if(argc == 2 && !strcmp(argv[1], "--print-summary")) {
|
||||
printf("One line summary.\n");
|
||||
return 0;
|
||||
|
@ -22,8 +25,6 @@ int main(int argc, char* argv[])
|
|||
// empty argument list
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
|
||||
// TODO
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue