Changeset 1842 for stable/0.6
- Timestamp:
- Nov 22, 2010 5:11:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/0.6/coin.m4
r1838 r1842 4103 4103 # initial list of dependencies is "$2", but we need to filter out version number specifications (= x, <= x, >= x) 4104 4104 projtoprocess="m4_bpatsubsts([$2], [<?>?=[ ]*[^ ]+])" 4105 projprocessed="" 4106 4107 while test $m4_tolower(coin_has_$1) = notGiven ; do 4108 # setup list of projects that need to be processed in the next round 4109 nextprojtoprocess="" 4105 4106 # we first expand the list of projects to process by adding all dependencies just behind the project which depends on it 4107 # further, we collect the list of corresponding .pc files, but do this in reverse order, because we need this order afterwards 4108 # also, we setup the DATA variable 4109 allproj="" 4110 allpcfiles="" 4111 while test "x$projtoprocess" != x ; do 4110 4112 4111 4113 for proj in $projtoprocess ; do 4112 # if $proj has been processed already, skip this round4113 if test "x$projprocessed" != x ; then4114 for projdone in $projprocessed ; do4115 if test $projdone = $proj ; then4116 continue 24117 fi4118 done4119 fi4120 4121 4114 # if $proj is available and configured, then a project-uninstalled.pc file should have been created, so search for it 4122 4115 pcfile="" … … 4127 4120 if test -r "$dir/$proj-uninstalled.pc" ; then 4128 4121 pcfile="$dir/$proj-uninstalled.pc" 4129 pcfiledir="$dir"4130 4122 break 4131 4123 fi … … 4134 4126 4135 4127 if test "x$pcfile" != x ; then 4136 # read CFLAGS from $pcfile and add CYGPATH_W cludge into include flags 4137 projcflags=`sed -n -e 's/Cflags://p' "$pcfile"` 4138 projcflags=[`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'`] 4139 m4_toupper($1_CFLAGS)="$projcflags $m4_toupper($1_CFLAGS)" 4140 4141 # read LIBS from $pcfile and replace -L${libdir} by absolute path to build directory in linker flags 4142 # we assume that the build directory is $pcfiledir/src if this directory exists, otherwise we assume that it is $pcfiledir 4143 projlibs=`sed -n -e 's/Libs://' -e 's/-L\${libdir}//p' "$pcfile"` 4144 if test "x$projlibs" != x ; then 4145 if test -d "${pcfiledir}/src" ; then 4146 projlibs="-L`cd "${pcfiledir}/src"; pwd` $projlibs" 4147 else 4148 projlibs="-L`cd "$pcfiledir"; pwd` $projlibs" 4149 fi 4150 else 4151 projlibs=`sed -n -e 's/Libs://p' "$pcfile"` 4152 fi 4153 m4_toupper($1_LIBS)="$m4_toupper($1_LIBS) $projlibs" 4154 4128 # read dependencies from $pcfile and filter it 4129 projrequires=[`sed -n -e 's/Requires://gp' "$pcfile" | sed -e 's/<\{0,1\}>\{0,1\}=[ ]\{0,\}[^ ]\{1,\}//g'`] 4130 4131 # add projrequires to the front of the list of projects that have to be processed next 4132 # at the same time, remove $proj from this list 4133 projtoprocess=${projtoprocess/$proj/$projrequires} 4134 4155 4135 # read DATA from $pcfile, if this is the first .pc file we are processing (so assume that its the main one) 4156 if test "x$ projprocessed" = x ; then4136 if test "x$allproj" = x ; then 4157 4137 m4_toupper($1_DATA)=`sed -n -e 's/datadir=//gp' "$pcfile"` 4158 4138 fi 4159 4160 # read dependencies from $pcfile, filter it, and add to list of projects that need to be processed next 4161 projrequires=[`sed -n -e 's/Requires://gp' "$pcfile" | sed -e 's/<\{0,1\}>\{0,1\}=[ ]\{0,\}[^ ]\{1,\}//g'`] 4162 nextprojtoprocess="$nextprojtoprocess $projrequires" 4163 4164 # remember that we have processed $proj 4165 projprocessed="$projprocessed $proj" 4166 4139 4140 allproj="$allproj $proj" 4141 allpcfiles="$pcfile:$allpcfiles" 4142 4167 4143 else 4168 4144 AC_MSG_RESULT([no, dependency $proj not available]) 4145 allproj=fail 4169 4146 break 2 4170 4147 fi 4171 4148 4149 break 4172 4150 done 4173 4174 projtoprocess="$nextprojtoprocess" 4175 4176 # if there are no more projects to search for, finish up 4177 if test "x$projtoprocess" = x ; then 4178 m4_tolower(coin_has_$1)=yes 4179 AC_MSG_RESULT([yes, dependencies are$projprocessed]) 4180 AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],[Define to 1 if the $1 package is available]) 4181 4151 4152 # remove spaces on begin of $projtoprocess 4153 projtoprocess=`echo $projtoprocess | sed -e 's/^[ ]*//'` 4154 4155 done 4156 4157 if test "$allproj" != fail ; then 4158 4159 # now go through the list of .pc files and assemble compiler and linker flags 4160 # important is here to obey the reverse order that has been setup before, 4161 # since then libraries that are required by several others should be after these other libraries 4162 pcfilesprocessed="" 4163 4164 save_IFS="$IFS" 4165 IFS=":" 4166 for pcfile in $allpcfiles ; do 4167 4168 # if $pcfile has been processed already, skip this round 4169 if test "x$pcfilesprocessed" != x ; then 4170 for pcfiledone in $pcfilesprocessed ; do 4171 if test "$pcfiledone" = "$pcfile" ; then 4172 continue 2 4173 fi 4174 done 4175 fi 4176 4177 # reconstruct the directory where the .pc file is located 4178 pcfiledir=[`echo $pcfile | sed -e 's/\/[^\/]*$//'`] 4179 4180 # read CFLAGS from $pcfile and add CYGPATH_W cludge into include flags 4181 projcflags=`sed -n -e 's/Cflags://p' "$pcfile"` 4182 projcflags=[`echo "$projcflags" | sed -e 's/-I\([^ ]*\)/-I\`${CYGPATH_W} \1\`/g'`] 4183 m4_toupper($1_CFLAGS)="$projcflags $m4_toupper($1_CFLAGS)" 4184 4185 # read LIBS from $pcfile and replace -L${libdir} by absolute path to build directory in linker flags 4186 # we assume that the build directory is $pcfiledir/src if this directory exists, otherwise we assume that it is $pcfiledir 4187 projlibs=`sed -n -e 's/Libs://' -e 's/-L\${libdir}//p' "$pcfile"` 4188 if test "x$projlibs" != x ; then 4189 if test -d "${pcfiledir}/src" ; then 4190 projlibs="-L`cd "${pcfiledir}/src"; pwd` $projlibs" 4191 else 4192 projlibs="-L`cd "$pcfiledir"; pwd` $projlibs" 4193 fi 4194 else 4195 projlibs=`sed -n -e 's/Libs://p' "$pcfile"` 4196 fi 4197 m4_toupper($1_LIBS)="$projlibs $m4_toupper($1_LIBS)" 4198 4199 # remember that we have processed $pcfile 4200 pcfilesprocessed="$pcfilesprocessed:$pcfile" 4201 4202 done 4203 IFS="$save_IFS" 4204 4205 # finish up 4206 m4_tolower(coin_has_$1)=yes 4207 AC_MSG_RESULT([yes]) 4208 AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],[Define to 1 if the $1 package is available]) 4209 4210 coin_foreach_w([myvar], [$3], [ 4211 m4_toupper(myvar)_PCREQUIRES="$2 $m4_toupper(myvar)_PCREQUIRES" 4212 m4_toupper(myvar)_CFLAGS="$m4_toupper($1)_CFLAGS $m4_toupper(myvar)_CFLAGS" 4213 m4_toupper(myvar)_LIBS="$m4_toupper($1)_LIBS $m4_toupper(myvar)_LIBS" 4214 ]) 4215 4216 if test 1 = 0 ; then #change this test to enable a bit of debugging output 4217 if test -n "$m4_toupper($1)_CFLAGS" ; then 4218 AC_MSG_NOTICE([$1 CFLAGS are $m4_toupper($1)_CFLAGS]) 4219 fi 4220 if test -n "$m4_toupper($1)_LIBS" ; then 4221 AC_MSG_NOTICE([$1 LIBS are $m4_toupper($1)_LIBS]) 4222 fi 4223 if test -n "$m4_toupper($1)_DATA" ; then 4224 AC_MSG_NOTICE([$1 DATA is $m4_toupper($1)_DATA]) 4225 fi 4182 4226 coin_foreach_w([myvar], [$3], [ 4183 m4_toupper(myvar)_PCREQUIRES="$2 $m4_toupper(myvar)_PCREQUIRES" 4184 m4_toupper(myvar)_CFLAGS="$m4_toupper($1)_CFLAGS $m4_toupper(myvar)_CFLAGS" 4185 m4_toupper(myvar)_LIBS="$m4_toupper($1)_LIBS $m4_toupper(myvar)_LIBS" 4227 AC_MSG_NOTICE([myvar CFLAGS are $m4_toupper(myvar)_CFLAGS]) 4228 AC_MSG_NOTICE([myvar LIBS are $m4_toupper(myvar)_LIBS]) 4186 4229 ]) 4187 4188 if test 1 = 0 ; then #change this test to enable a bit of debugging output 4189 if test -n "$m4_toupper($1)_CFLAGS" ; then 4190 AC_MSG_NOTICE([$1 CFLAGS are $m4_toupper($1)_CFLAGS]) 4191 fi 4192 if test -n "$m4_toupper($1)_LIBS" ; then 4193 AC_MSG_NOTICE([$1 LIBS are $m4_toupper($1)_LIBS]) 4194 fi 4195 if test -n "$m4_toupper($1)_DATA" ; then 4196 AC_MSG_NOTICE([$1 DATA is $m4_toupper($1)_DATA]) 4197 fi 4198 coin_foreach_w([myvar], [$3], [ 4199 AC_MSG_NOTICE([myvar CFLAGS are $m4_toupper(myvar)_CFLAGS]) 4200 AC_MSG_NOTICE([myvar LIBS are $m4_toupper(myvar)_LIBS]) 4201 ]) 4202 fi 4203 fi 4204 done 4230 fi 4231 4232 fi 4205 4233 4206 4234 AM_CONDITIONAL(m4_toupper(COIN_HAS_$1),
Note: See TracChangeset
for help on using the changeset viewer.