Changeset 1614 for trunk/coin.m4


Ignore:
Timestamp:
Jul 18, 2010 11:07:59 AM (10 years ago)
Author:
stefan
Message:

do not touch ADDLIBS variable in COIN_HAS_MODULE*; instead, assemble variable PCADDLIBS with linker flags that are not found via pkg-config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r1611 r1614  
    296296AC_SUBST(ADDLIBS)
    297297
     298# Initialize the PCADDLIBS variable.
     299# This variable is used to setup library flags for the "Libs:" section in a .pc file.
     300# In certain cases, it may contain more flags than the ADDLIBS variable.
     301PCADDLIBS=""
     302AC_SUBST(PCADDLIBS)
     303
    298304# As backup, we make sure we don't loose an FLIBS if it has been set
    299305# by the user
     
    21472153    ADDLIBS="$ADDLIBS $FLIBS"
    21482154  fi
     2155  PCADDLIBS="$PCADDLIBS $ADDLIBS"
    21492156
    21502157  # library extension
     
    37663773# It is also possible to specify a preinstalled version of this module
    37673774# or to specify only the linker and compiler flags and data directory.
    3768 # If the flag 'required' (which is on by default) is set, then the user-given linker flags are added to
    3769 # the ADDLIBS variable, which can be used to setup a .pc file.
     3775# If the flag 'required' (which is on by default) is set, then user-given linker flags are added to
     3776# the PCADDLIBS variable, which can be used to setup a .pc file.
    37703777
    37713778AC_DEFUN([AC_COIN_HAS_MODULE],
     
    37923799AC_SUBST(REQUIREDPACKAGES)
    37933800
    3794 #check if user provided LIBS, CFLAGS, and DATA for module
     3801#check if user provided LIBS, CFLAGS, or DATA for module
    37953802if test $m4_tolower(coin_has_$1) != skipping; then
    37963803
     
    38003807      [m4_tolower(coin_has_$1)=yes
    38013808       m4_toupper($1_LIBS)="$withval"
    3802        m4_bmatch($3, [required=0], [], [ADDLIBS="$withval $ADDLIBS"])
     3809       m4_bmatch($3, [required=0], [], [PCADDLIBS="$withval $PCADDLIBS"])
    38033810      ],
    38043811      [])
     
    38853892# and the directory where the module data resists.
    38863893# Further, tolower(coin_has_$1) is set to "yes" and a COIN_HAS_MODULE preprocessor macro and
    3887 # makefile conditional are defined. Further, the linker flags are added to the ADDLIBS variable.
     3894# makefile conditional are defined.
    38883895# If the flag 'required' is set (which is on by default), then the module package is added to
    38893896# the REQUIREDPACKAGES variable, which can be used to setup a .pc file.
     
    39393946
    39403947    m4_bmatch($4, [required=0], [],
    3941       [ADDLIBS="$m4_toupper($1_LIBS) $ADDLIBS"
    3942        REQUIREDPACKAGES="$2 $REQUIREDPACKAGES"
     3948      [REQUIREDPACKAGES="$2 $REQUIREDPACKAGES"
    39433949      ])
    39443950
     
    39783984# The makefile conditional and preprocessor macro COIN_HAS_BLAS is defined.
    39793985# BLAS_LIBS is set to the flags required to link with a Blas library.
    3980 # In case 3 and 4, the flags to link to Blas are added to ADDLIBS.
     3986# In case 3 and 4, the flags to link to Blas are added to PCADDLIBS too.
    39813987# In case 5, Blas is added to REQUIREDPACKAGES
    39823988
     
    40014007    LIBS="$use_blas $LIBS"
    40024008    AC_COIN_TRY_FLINK([daxpy],
    4003                       [AC_MSG_RESULT([yes])
    4004                        ADDLIBS="$use_blas $ADDLIBS"],
     4009                      [AC_MSG_RESULT([yes])],
    40054010                      [AC_MSG_RESULT([no])
    40064011                       AC_MSG_ERROR([user supplied BLAS library \"$use_blas\" does not work])])
     
    40184023      AC_COIN_TRY_FLINK([daxpy],
    40194024                        [AC_MSG_RESULT([yes])
    4020                          use_blas=-lcomplib.sgimath;
    4021                          ADDLIBS="-lcomplib.sgimath $ADDLIBS"],
     4025                         use_blas="-lcomplib.sgimath"],
    40224026                        [AC_MSG_RESULT([no])
    40234027                         SAVE_LIBS="$LIBS"])
     
    40374041                        [AC_MSG_RESULT([yes])
    40384042                         use_blas='-lsunperf'
    4039                          ADDLIBS="-lsunperf $ADDLIBS"
    40404043                         coin_need_flibs=yes],
    40414044                        [AC_MSG_RESULT([no])
     
    40554058          AC_COIN_TRY_FLINK([daxpy],
    40564059                            [AC_MSG_RESULT([yes])
    4057                              use_blas='mkl_intel_c.lib mkl_sequential.lib mkl_core.lib'
    4058                              ADDLIBS="mkl_intel_c.lib mkl_sequential.lib mkl_core.lib $ADDLIBS"],
     4060                             use_blas='mkl_intel_c.lib mkl_sequential.lib mkl_core.lib'],
    40594061                            [AC_MSG_RESULT([no])
    40604062                             LIBS="$SAVE_LIBS"])
     
    40704072    AC_COIN_TRY_FLINK([daxpy],
    40714073                      [AC_MSG_RESULT([yes])
    4072                        ADDLIBS="-lblas $ADDLIBS"
    40734074                       use_blas='-lblas'],
    40744075                      [AC_MSG_RESULT([no])
     
    41014102  AC_SUBST(BLAS_CFLAGS)
    41024103  AC_SUBST(BLAS_DATA)
     4104  PCADDLIBS="$use_blas $PCADDLIBS"
    41034105 
    41044106else
     
    41224124# The makefile conditional and preprocessor macro COIN_HAS_LAPACK is defined.
    41234125# LAPACK_LIBS is set to the flags required to link with a Lapack library.
    4124 # In case 3 and 4, the flags to link to Lapack are added to ADDLIBS.
     4126# In case 3 and 4, the flags to link to Lapack are added to PCADDLIBS too.
    41254127# In case 5, Lapack is added to REQUIREDPACKAGES
    41264128
     
    41454147    LIBS="$use_lapack $LIBS"
    41464148    AC_COIN_TRY_FLINK([dsyev],
    4147                       [AC_MSG_RESULT([yes])
    4148                        ADDLIBS="$use_lapack $ADDLIBS"],
     4149                      [AC_MSG_RESULT([yes])],
    41494150                      [AC_MSG_RESULT([no])
    41504151                       AC_MSG_ERROR([user supplied LAPACK library \"$use_lapack\" does not work])])
     
    41564157    AC_MSG_CHECKING([whether LAPACK is already available with BLAS library])
    41574158    coin_save_LIBS="$LIBS"
    4158     LIBS="$ADDLIBS $LIBS"
     4159    LIBS="$BLAS_LIBS $LIBS"
    41594160    AC_COIN_TRY_FLINK([dsyev],
    41604161                      [AC_MSG_RESULT([yes]); use_lapack="$BLAS_LIBS"],
     
    41724173        AC_COIN_TRY_FLINK([dsyev],
    41734174                          [AC_MSG_RESULT([yes])
    4174                            use_lapack=-lcomplib.sgimath;
    4175                            ADDLIBS="-lcomplib.sgimath $ADDLIBS"],
     4175                           use_lapack="-lcomplib.sgimath;"],
    41764176                          [AC_MSG_RESULT([no])
    41774177                           SAVE_LIBS="$LIBS"])
     
    41854185      AC_COIN_TRY_FLINK([dsyev],
    41864186                        [AC_MSG_RESULT([yes])
    4187                          use_blas='-lsunperf'
    4188                          ADDLIBS="-lsunperf $ADDLIBS"
     4187                         use_lapack='-lsunperf'
    41894188                         coin_need_flibs=yes],
    41904189                        [AC_MSG_RESULT([no])
     
    42074206    AC_COIN_TRY_FLINK([dsyev],
    42084207                      [AC_MSG_RESULT([yes])
    4209                        ADDLIBS="-llapack $ADDLIBS"
    42104208                       use_lapack='-llapack'],
    42114209                      [AC_MSG_RESULT([no])
     
    42394237  AC_SUBST(LAPACK_CFLAGS)
    42404238  AC_SUBST(LAPACK_DATA)
     4239  if test "x$LAPACK_LIBS" != "x$BLAS_LIBS"; then
     4240    PCADDLIBS="$LAPACK_LIBS $PCADDLIBS"
     4241  fi
    42414242 
    42424243else
Note: See TracChangeset for help on using the changeset viewer.