Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5254 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99329 invoked by uid 1010); 5 Nov 2003 17:57:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99304 invoked by uid 1007); 5 Nov 2003 17:57:38 -0000 Message-ID: <20031105175737.99303.qmail@pb1.pair.com> To: internals@lists.php.net Reply-To: "Justin Hannus" References: <20031103202553.62539.qmail@pb1.pair.com> Date: Wed, 5 Nov 2003 12:53:45 -0500 Lines: 88 Organization: vci X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Posted-By: 209.244.152.156 Subject: Re: help with config.m4 for ext's From: jhannus@visualconceptsinc.com ("Justin Hannus") Maybe this was the wrong list to post to...... but for those of you who come across the same problem, I fixed it by removing the array subscripts and using scalar values instead. AC_DEFINE* and probably all the m4 macros strip all ['s and ]'s from your config.m4 file. -JH "Justin Hannus" wrote in message news:20031103202553.62539.qmail@pb1.pair.com... > 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>/ \1 / > }'\ > -e '/-$/N > { > s/\(.*\)<\/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