Changeset 2376


Ignore:
Timestamp:
Dec 20, 2010, 2:17:21 AM (11 years ago)
Author:
Peter
Message:

closes #496

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat_lt_link_ifelse.m4

    r2346 r2376  
    3232
    3333#
    34 # serial 1
     34# serial 2
    3535#
    3636
     37# YAT_LT_LINK_IFELSE(PROG, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
     38# -------------------------------------------------------------
     39# Same as AC_LINK_IFELSE but linking via libtool
    3740AC_DEFUN([YAT_LT_LINK_IFELSE],
    3841[
     
    4245]) # YAT_LT_LINK_IFELSE
    4346
     47# YAT_USE_LIBTOOL_PUSH
     48# --------------------
     49# Assign `$ac_link' and `$ac_compile' to use libtool. Variables are
     50# saved so they can be restored with YAT_USE_LIBTOOL_POP
    4451AC_DEFUN([YAT_USE_LIBTOOL_PUSH],
    4552[
    4653m4_defn([LT_INIT])
    47 m4_ifdef([_YAT_USE_LIBTOOL],,
     54m4_ifdef([_YAT_USE_LIBTOOL], [],
    4855  [m4_define([_YAT_USE_LIBTOOL], [yes])
    4956   LT_OUTPUT
     
    5158   ac_compile="./libtool --mode=compile --tag=_YAT_USE_LIBTOOL_TAG $ac_link";
    5259   yat_use_libtool_ac_link=$ac_link;
    53    ac_link="./libtool --mode=link --tag=CXX $ac_link"; dnl
     60   ac_link="./libtool --mode=link --tag=_YAT_USE_LIBTOOL_TAG $ac_link";
    5461  ]) dnl
    5562]) # YAT_USE_LIBTOOL_PUSH
    5663
     64# YAT_USE_LIBTOOL_POP
     65# --------------------
     66
     67# Restore values of `$ac_link' and `$ac_compile' to what they were
     68# prior YAT_USE_LIBTOOL_PUSH
    5769AC_DEFUN([YAT_USE_LIBTOOL_POP],
    5870[
     
    6476]) # YAT_USE_LIBTOOL_POP
    6577
     78
     79# _YAT_USE_LIBTOOL_TAG
     80# --------------------
     81# internal macro to select tag depending on active library
    6682m4_define([_YAT_USE_LIBTOOL_TAG],
    67 [AC_LANG_CASE([C], [CC],
    68               [C++], [CXX],
    69               [Fortran 77], [F77],
    70               [Fortran], [FC])
     83[AC_LANG_CASE([C], [CC], dnl
     84              [C++], [CXX], dnl
     85              [Fortran 77], [F77], dnl
     86              [Fortran], [FC]) dnl
    7187])
  • trunk/test/yat_lt_link_ifelse_test.sh

    r2245 r2376  
    3030
    3131cat >> configure.ac <<EOF
     32AC_MSG_CHECKING([libtool linking])
     33YAT_LT_LINK_IFELSE([AC_LANG_PROGRAM],
     34                   [],
     35                   [AC_MSG_ERROR([cannot libtool link simple program])])
     36AC_MSG_RESULT([ok])
     37
     38AC_MSG_CHECKING([libtool linking against -lrapakalja])
     39LIBS=-lrapakalja
     40YAT_LT_LINK_IFELSE([AC_LANG_PROGRAM],
     41                   [AC_MSG_ERROR([unexpectedly succesful linking with $LIBS])])
     42AC_MSG_RESULT([no (as expected)])
     43
    3244YAT_FIND_YAT
    3345m4_define([PROG],
     
    4355                           ])
    4456           ])
    45 LIBS=-lrapakalja
    46 YAT_LT_LINK_IFELSE([PROG],
    47                    [AC_MSG_ERROR([unexpectedly succesful linking with $LIBS])])
     57AC_MSG_CHECKING([libtool linking against -lyat])
    4858LIBS=\`\$yat_config --link-libtool\`;
    4959YAT_LT_LINK_IFELSE([PROG],
    5060                   [test_result=ok; AC_SUBST(test_result)],
    5161                   [AC_MSG_ERROR([cannot libtool link yat])])
     62AC_MSG_CHECKING([ok])
    5263AC_CONFIG_FILES([Makefile])
    5364AC_OUTPUT
     
    5970    echo OK;
    6071else
    61     tail -n 30 config.log;
     72    tail -n 500 config.log;
    6273    exit 1;
    6374fi
Note: See TracChangeset for help on using the changeset viewer.