Changeset 1843 for trunk


Ignore:
Timestamp:
Nov 22, 2010 5:12:50 PM (9 years ago)
Author:
stefan
Message:

merge chgset 1842 from stable/0.6: rewrite fallback to fix order of libraries once again

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/coin.m4

    r1840 r1843  
    41034103# initial list of dependencies is "$2", but we need to filter out version number specifications (= x, <= x, >= x)
    41044104projtoprocess="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
     4109allproj=""
     4110allpcfiles=""
     4111while test "x$projtoprocess" != x ; do
    41104112
    41114113  for proj in $projtoprocess ; do
    4112     # if $proj has been processed already, skip this round
    4113     if test "x$projprocessed" != x ; then
    4114       for projdone in $projprocessed ; do
    4115         if test $projdone = $proj ; then
    4116           continue 2
    4117         fi
    4118       done
    4119     fi
    4120 
    41214114    # if $proj is available and configured, then a project-uninstalled.pc file should have been created, so search for it
    41224115    pcfile=""
     
    41274120      if test -r "$dir/$proj-uninstalled.pc" ; then
    41284121        pcfile="$dir/$proj-uninstalled.pc"
    4129         pcfiledir="$dir"
    41304122        break
    41314123      fi
     
    41344126
    41354127    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
    41554135      # 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 ; then
     4136      if test "x$allproj" = x ; then
    41574137        m4_toupper($1_DATA)=`sed -n -e 's/datadir=//gp' "$pcfile"`
    41584138      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
    41674143    else
    41684144      AC_MSG_RESULT([no, dependency $proj not available])
     4145      allproj=fail
    41694146      break 2
    41704147    fi
    41714148
     4149    break
    41724150  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
     4155done
     4156
     4157if 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
    41824226    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])
    41864229    ])
    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
     4232fi
    42054233
    42064234AM_CONDITIONAL(m4_toupper(COIN_HAS_$1),
  • trunk/compile_f2c

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.