Changeset 1912


Ignore:
Timestamp:
Dec 5, 2010 3:36:16 PM (9 years ago)
Author:
stefan
Message:

more tweaks for cygwin/cl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r1910 r1912  
    40294029      [ m4_tolower(coin_has_$1)=yes
    40304030        AC_MSG_RESULT([yes: $m4_toupper($1)_VERSIONS])
    4031         coin_foreach_w([myvar], [$3], [m4_toupper(myvar)_PCREQUIRES="$2 $m4_toupper(myvar)_PCREQUIRES"
     4031
     4032        # adjust linker flags for (i)cl compiler
     4033        # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl)
     4034        if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ;
     4035        then
     4036          m4_toupper($1_LIBS)=`echo " $m4_toupper($1_LIBS) " | [sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g']`
     4037        fi
     4038   
     4039        # augment X_PCREQUIRES, X_CFLAGS, and X_LIBS for each build target X in $3
     4040        coin_foreach_w([myvar], [$3], [
     4041          m4_toupper(myvar)_PCREQUIRES="$2 $m4_toupper(myvar)_PCREQUIRES"
     4042          m4_toupper(myvar)_CFLAGS="$m4_toupper($1)_CFLAGS $m4_toupper(myvar)_CFLAGS"
     4043          m4_toupper(myvar)_LIBS="$m4_toupper($1)_LIBS $m4_toupper(myvar)_LIBS"
    40324044        ])
    40334045      ],
     
    40394051    PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH"
    40404052    export PKG_CONFIG_PATH
    4041    
    4042     # augment X_CFLAGS and X_LIBS for each build target X in $3
    4043     coin_foreach_w([myvar], [$3], [
    4044       m4_toupper(myvar)_CFLAGS="$m4_toupper($1)_CFLAGS $m4_toupper(myvar)_CFLAGS"
    4045       m4_toupper(myvar)_LIBS="$m4_toupper($1)_LIBS $m4_toupper(myvar)_LIBS"
    4046     ])
     4053
    40474054  else
    40484055    AC_MSG_RESULT([skipped check via pkg-config, redirect to fallback])
     
    40604067  # construct dependencies variables from LIBS variables
    40614068  # we add an extra space in LIBS so we can substitute out everything starting with " -"
    4062   m4_toupper($1)_DEPENDENCIES=`echo " $m4_toupper($1)_LIBS" | [sed -e 's/ -[^ ]*//g']`
     4069  # also substitute out everything of the form `xxx`yyy (may have been added for cygwin/cl)
     4070  m4_toupper($1)_DEPENDENCIES=`echo " $m4_toupper($1)_LIBS" | [sed -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g']`
    40634071  coin_foreach_w([myvar], [$3], [
    4064     m4_toupper(myvar)_DEPENDENCIES=`echo " $m4_toupper(myvar)_LIBS" | [sed -e 's/ -[^ ]*//g']`
     4072    m4_toupper(myvar)_DEPENDENCIES=`echo " $m4_toupper(myvar)_LIBS " | [sed -e 's/ -[^ ]*//g' -e 's/\`[^\`]*\`[^ ]* //g']`
    40654073  ])
    40664074
     
    43334341
    43344342  # adjust linker flags for (i)cl compiler
     4343  # for the LIBS, we replace everything of the form "/somepath/name.lib" by "`$(CYGPATH_W) /somepath/`name.lib | sed -e s|\|/|g" (where we have to use excessive many \ to get the \ into the command line for cl),
     4344  # for the LIBS_INSTALLED, we replace everything of the form "/somepath/" by "`$(CYGPATH_W) /somepath/`",
     4345  #    everything of the form "-Lpath" by "/libpath:`$(CYGPATH_W) path`, and
     4346  #    everything of the form "-lname" by "libname.lib"
    43354347  if test x$coin_cxx_is_cl = xtrue || test x$coin_cc_is_cl = xtrue ;
    43364348  then
     4349    m4_toupper($1_LIBS)=`echo " $m4_toupper($1_LIBS) " | [sed -e 's/ \(\/[^ ]*\/\)\([^ ]*\)\.lib / \`$(CYGPATH_W) \1 | sed -e "s|\\\\\\\\\\\\\\\\\\\\|\/|g"\`\2.lib /g']`
    43374350    m4_toupper($1_LIBS_INSTALLED)=`echo " $m4_toupper($1_LIBS_INSTALLED)" | [sed -e 's/ \(\/[^ ]*\/\)/ \`$(CYGPATH_W) \1\`/g' -e 's/ -L\([^ ]*\)/ \/libpath:\`$(CYGPATH_W) \1\`/g' -e 's/ -l\([^ ]*\)/ lib\1.lib/g']`
    43384351  fi
Note: See TracChangeset for help on using the changeset viewer.