Generate yate-config.in dynamically to add support for arbitrary parameters.

Run autogen.sh to regenerate configure, should detect autoconf properly.


git-svn-id: http://voip.null.ro/svn/yate@2697 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-06-10 13:43:42 +00:00
parent 7a33256e23
commit fe0c3a3fb2
3 changed files with 49 additions and 16 deletions

View File

@ -121,7 +121,7 @@ clean-apidocs: check-topdir
distclean: check-topdir clean clean-config-files
cvsclean: check-topdir clean clean-tables clean-apidocs clean-config-files
-rm -f configure
-rm -f configure yate-config.in
.PHONY: engine libs modules clients test apidocs-build apidocs-kdoc apidocs-doxygen apidocs-everything check-topdir check-ldconfig windows
engine: tables library libyate.so $(PROGS)
@ -307,7 +307,7 @@ revision: check-topdir
$(COMPILE) -c $<
@srcdir@/configure: @srcdir@/configure.in
cd @srcdir@ && autoconf
cd @srcdir@ && ./autogen.sh --silent
config.status: @srcdir@/configure
./config.status --recheck

View File

@ -3,7 +3,7 @@
# Run this to generate a new configure script
if [ -s engine/tables/a2s.h ]; then
echo "Good! Tables are generated so we don't need sox."
test "x$1" = "x--silent" || echo "Good! Tables are generated so we don't need sox."
else
if [ -z `which sox 2>/dev/null` ]; then
echo "Please install sox to be able to build from CVS version." >&2
@ -14,7 +14,20 @@ fi
ac=`which autoconf 2>/dev/null`
test -z "$ac" && ac=/usr/local/gnu-autotools/bin/autoconf
if [ -x "$ac" ]; then
"$ac" && echo "Finished! Now run configure. If in doubt run ./configure --help"
"$ac" || exit $?
./yate-config.sh || exit $?
case "x$1" in
x--silent)
;;
x--configure)
shift
./configure "$@" || exit $?
echo "Finished! Now run make."
;;
*)
echo "Finished! Now run configure. If in doubt run ./configure --help"
;;
esac
else
echo "Please install Gnu autoconf to build from CVS." >&2
exit 1

44
yate-config.in → yate-config.sh Normal file → Executable file
View File

@ -1,5 +1,15 @@
#! /bin/sh
if [ ! -f configure ]; then
echo "Cannot find configure" >&2
exit 1
fi
exec > yate-config.in < configure
shopt -u nocasematch
cat <<"EOF"
ustr='Usage: yate-config [--cflags] [--includes] [--c-all]
[--ldflags] [--libs] [--ld-all] [--ld-nostrip] [--ld-strip]
[--config] [--modules] [--share]
@ -74,24 +84,33 @@ while [ "$#" != 0 ]; do
--archlib)
echo "@ARCHLIB@"
;;
--param=QT4_VER)
echo "@QT4_VER@"
EOF
pos=__
while read REPLY; do
case "x$pos$REPLY" in
x__ac_subst_vars=*)
pos=""
;;
--param=QT4_MOC)
echo "@QT4_MOC@"
x__*)
;;
--param=QT4_INC)
echo "@QT4_INC@"
x*"'"*)
pos=__
;;
--param=QT4_LIB)
echo "@QT4_LIB@"
xPACKAGE_*|xECHO_*|xPATH_SEPARATOR|xCONFIGURE_FILES)
;;
--param=QT4_INC_NET)
echo "@QT4_INC_NET@"
xMUTEX_HACK|xTHREAD_KILL|xFDSIZE_HACK|xMUTEX_HACK)
;;
--param=QT4_LIB_NET)
echo "@QT4_LIB_NET@"
x*_alias|x*_prefix|xprogram_*)
;;
x[A-Z]*_*)
echo " --param=$REPLY)"
echo " echo \"@$REPLY@\""
echo " ;;"
esac
done
cat <<"EOF"
*)
echo "I didn't understand: $1" >&2
echo "$ustr" >&2
@ -100,3 +119,4 @@ while [ "$#" != 0 ]; do
esac
shift
done
EOF