From 636a6a1e8ea45db8384b830f716e260fe56a1c10 Mon Sep 17 00:00:00 2001 From: paulc Date: Wed, 10 Jun 2009 13:43:42 +0000 Subject: [PATCH] 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 --- Makefile.in | 4 +-- autogen.sh | 17 ++++++++++-- yate-config.in => yate-config.sh | 44 +++++++++++++++++++++++--------- 3 files changed, 49 insertions(+), 16 deletions(-) rename yate-config.in => yate-config.sh (73%) mode change 100644 => 100755 diff --git a/Makefile.in b/Makefile.in index 073598eb..20b75d4a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/autogen.sh b/autogen.sh index e324997a..34634336 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 diff --git a/yate-config.in b/yate-config.sh old mode 100644 new mode 100755 similarity index 73% rename from yate-config.in rename to yate-config.sh index 1ef5a8a4..e53c874c --- a/yate-config.in +++ b/yate-config.sh @@ -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 \ No newline at end of file