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://yate.null.ro/svn/yate/trunk@2697 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-06-10 13:43:42 +00:00
parent dd1ee45b73
commit 636a6a1e8e
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 distclean: check-topdir clean clean-config-files
cvsclean: check-topdir clean clean-tables clean-apidocs 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 .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) engine: tables library libyate.so $(PROGS)
@ -307,7 +307,7 @@ revision: check-topdir
$(COMPILE) -c $< $(COMPILE) -c $<
@srcdir@/configure: @srcdir@/configure.in @srcdir@/configure: @srcdir@/configure.in
cd @srcdir@ && autoconf cd @srcdir@ && ./autogen.sh --silent
config.status: @srcdir@/configure config.status: @srcdir@/configure
./config.status --recheck ./config.status --recheck

View File

@ -3,7 +3,7 @@
# Run this to generate a new configure script # Run this to generate a new configure script
if [ -s engine/tables/a2s.h ]; then 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 else
if [ -z `which sox 2>/dev/null` ]; then if [ -z `which sox 2>/dev/null` ]; then
echo "Please install sox to be able to build from CVS version." >&2 echo "Please install sox to be able to build from CVS version." >&2
@ -14,7 +14,20 @@ fi
ac=`which autoconf 2>/dev/null` ac=`which autoconf 2>/dev/null`
test -z "$ac" && ac=/usr/local/gnu-autotools/bin/autoconf test -z "$ac" && ac=/usr/local/gnu-autotools/bin/autoconf
if [ -x "$ac" ]; then 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 else
echo "Please install Gnu autoconf to build from CVS." >&2 echo "Please install Gnu autoconf to build from CVS." >&2
exit 1 exit 1

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

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