help with config.m4 for ext's

From: Date: Mon, 03 Nov 2003 20:22:05 +0000
Subject: help with config.m4 for ext's
Groups: php.internals 
Request: Send a blank email to internals+get-5177@lists.php.net to get a copy of this message
I have an extension that I'm trying to get the config.m4 to read from a file and use AC_DEFINE* to define some macros in the main/php_config.h for use with my extension. My question is, how can I get AC_DEFINE() to expand shell variable passes as arguments? Here is my config.m4: (Note: I've tried many different combo's with AC_DEFINE and AC_DEFINE_UNQUOTED with different expanion styles but just can't get it to evaluate as it does when run seperately) dnl $Id$ dnl config.m4 for extension directoryservices PHP_ARG_WITH(directoryservices, for directoryservices support, [ --with-directoryservices Include directoryservices support]) if test "$PHP_DIRECTORYSERVICES" != "no"; then PHP_NEW_EXTENSION(directoryservices, directoryservices.c, $ext_shared) AC_DEFINE(HAVE_DIRECTORYSERVICES, 1, [ ]) AC_CHECK_HEADERS([DirectoryService/DirServices.h DirectoryService/DirServicesUtils.h DirectoryService/DirServicesConst.h]) ds_path="/System/Library/Frameworks/DirectoryService.framework/Versions/Curr ent/Resources" ds_plist=( $(cat $ds_path/version.plist | \ sed \ -e '/-$/N { s/<key>\(.*\)<\/key>/ \1 / }'\ -e '/-$/N { s/<string>\(.*\)<\/string>/ \1 / }'\ -e '/-$/N { s/<\(.*\)>/ / }') ); for (( i = 0; i < ${#ds_plist[@]}; i+=2 )); do case $ds_plist[$i] in *CFBundleVersion*) AC_DEFINE_UNQUOTED(DS_CFBUNDLEVERSION, "$ds_plist[$((i+1))]", [DS version.plist value CFBundleVersion]);; *ReleaseStatus*) AC_DEFINE_UNQUOTED(DS_RELEASESTATUS, "$ds_plist[$((i+1))]", [DS version.plist value ReleaseStatus]);; *SourceVersion*) AC_DEFINE_UNQUOTED(DS_SOURCEVERSION, "$ds_plist[$((i+1))]", [DS version.plist value SourceVersion]);; *BuildVersion*) AC_DEFINE_UNQUOTED(DS_BUILDVERSION, "$ds_plist[$((i+1))]", [DS version.plist value BuildVersion]);; esac done PHP_ADD_FRAMEWORK(DirectoryService) fi -- Justin Hannus Lead Programmer/Web Development jhannus@visualconceptsinc.com www.visualconceptsinc.com [860] 242.1150 ext.125 [860] 242.1446 fax

« previous php.internals (#5177) next »