2006-07-25 19:00:04 +01:00
|
|
|
# These are external variables, and shouldn't clash with anything else
|
|
|
|
# @CNAME@
|
|
|
|
# @CNAME@_BUILT
|
|
|
|
# @CNAME@_HEADER
|
|
|
|
# @CNAME@_BASE
|
2006-12-08 15:08:09 +00:00
|
|
|
# @CNAME@_DEP_CFLAGS
|
|
|
|
# @CNAME@_DEP_LIBS
|
2006-07-25 19:00:04 +01:00
|
|
|
|
|
|
|
if [ -z ${@CNAME@_BUILT} ]
|
|
|
|
then
|
|
|
|
@CNAME@_BASE=@NAME@
|
|
|
|
source src/@NAME@/soversion
|
|
|
|
|
2007-09-11 23:21:05 +01:00
|
|
|
@CNAME@="obj/${@CNAME@_BASE}.so.${SOMAJOR}.${SOMICRO}"
|
2006-12-08 15:08:09 +00:00
|
|
|
@CNAME@_DEP_CFLAGS="" # @TODO@ cflags
|
|
|
|
@CNAME@_DEP_LIBS="" # @TODO@ libs
|
|
|
|
SO_EXTRA="${@CNAME@_DEP_CFLAGS} ${@CNAME@_DEP_LIBS} -lc"
|
2006-07-25 19:00:04 +01:00
|
|
|
|
|
|
|
echo "Building library ${@CNAME@}..."
|
|
|
|
|
|
|
|
do_cmd source src/@NAME@/build.monolithic || return 1
|
|
|
|
|
|
|
|
MODIFIED=0
|
|
|
|
for test in ${MONOLITHIC_TESTS} ${HDR} ${SRC}
|
|
|
|
do
|
|
|
|
if [ ${test} -nt ${@CNAME@} ]
|
|
|
|
then
|
|
|
|
MODIFIED=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ${MODIFIED} -ne 0 ]
|
|
|
|
then
|
|
|
|
echo " Compiling"
|
|
|
|
|
2007-09-11 23:21:05 +01:00
|
|
|
SONAME="${@CNAME@_BASE}.so.${SOMAJOR}"
|
2006-08-10 17:02:05 +01:00
|
|
|
do_cmd ${CC} ${CFLAGS} -Iobj -shared -fpic -o "${@CNAME@}" \
|
2006-07-25 19:00:04 +01:00
|
|
|
-Wl,-soname,${SONAME} \
|
|
|
|
${SRC} ${SO_EXTRA} || return 1
|
|
|
|
|
2008-10-30 00:40:45 +00:00
|
|
|
# make tests and linking work
|
|
|
|
do_cmd ln -sf "$(basename "${@CNAME@}")" "obj/${SONAME}" || return 1
|
|
|
|
do_cmd ln -sf "$(basename "${@CNAME@}")" "obj/${@CNAME@_BASE}.so" || return 1
|
2006-07-25 19:00:04 +01:00
|
|
|
|
|
|
|
print_success "Library built"
|
|
|
|
else
|
|
|
|
print_success "Library up to date"
|
|
|
|
fi
|
|
|
|
|
|
|
|
@CNAME@_BUILT=1
|
|
|
|
@CNAME@_HEADER=${HDR}
|
|
|
|
|
|
|
|
fi
|
2006-07-25 19:19:59 +01:00
|
|
|
# kate: @KATE_MODELINE@
|
2007-08-08 13:03:18 +01:00
|
|
|
# vim: syntax=sh:@VIM_MODELINE@
|