Ignore:
Timestamp:
May 8, 2010 9:54:35 AM (11 years ago)
Author:
stefan
Message:

copy over pkg-config setup and making thirdparty projects installable projects from split branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ThirdParty/Glpk/trunk/configure.ac

    r1471 r1548  
    1 # Copyright (C) 2007-2009 Stefan Vigerske and others.
     1# Copyright (C) 2007-2010 Stefan Vigerske and others.
    22# All Rights Reserved.
    33# This file is distributed under the Common Public License.
     
    1414
    1515AC_COPYRIGHT([
    16 Copyright 2007-2009 Stefan Vigerske and others.
     16Copyright 2007-2010 Stefan Vigerske and others.
    1717All Rights Reserved.
    1818This file is part of the open source package Coin which is distributed
     
    2121# List one file in the package so that the configure script can test
    2222# whether the package is actually there
    23 AC_CONFIG_SRCDIR(Makefile.am)
     23AC_CONFIG_SRCDIR(glpk/include/glpk.h)
    2424
    2525# Where should everything be installed by default?  Here, we want it
     
    4848AC_COIN_PROG_CC
    4949
     50# Check if pkg-config is available (to setup addlibs file)
     51AC_COIN_HAS_PKGCONFIG
     52
    5053# Initialize automake
    5154AC_COIN_INIT_AUTO_TOOLS
    5255
    5356###########################################################################
    54 #                            COIN_HAS_GLPK                                #
    55 ###########################################################################
    56 
    57 # This macro checks for a library containing the GLPK library.  It
    58 # checks if the user has provided an argument for the GLPK library,
    59 # and if not, it checks whether the GLPK ThirdParty/GLPK directory has
    60 # been configured.  It adds to ADDLIBS any flags required to link with
    61 # an externally provided GLPK.  It defines the makefile conditional
    62 # and preprocessor macro COIN_HAS_GLPK, if GLPK is available, and it
    63 # defines the makefile conditional COIN_BUILD_GLPK, if GLPK is
    64 # compiled within COIN.
    65 
    66 ## Check if GLPK is already provided by user
    67 AC_COIN_HAS_GLPK(Glpk)
    68 
    69 rm -f $MAKEOKFILE
    70 if test x"$use_thirdpartyglpk" = xbuild ; then
    71   touch $MAKEOKFILE
    72   AC_MSG_CHECKING([GLPK version])
    73   majorver=`awk '/define GLP_MAJOR_VERSION/ {print $3}' ${GLPKINCDIR}/glpk.h`
    74   minorver=`awk '/define GLP_MINOR_VERSION/ {print $3}' ${GLPKINCDIR}/glpk.h`
    75   AC_MSG_RESULT([${majorver}.${minorver}])
    76   if test x$majorver != x4 || test x$minorver != x43 ; then
    77     AC_MSG_ERROR(["Incorrect GLPK version. This build system is made for GLPK 4.43. Please update by rerunning get.GLPK"])
    78   fi
    79 else
    80   if test x$coin_has_glpk = xtrue ; then
    81     AC_MSG_NOTICE([The Glpk sources don't need to be compiled])
    82   else
    83     AC_MSG_WARN([Glpk source is available but will not be built. No valid external library is detected. Are you sure this is what you want?])
    84   fi
    85   MAKEOKFILE=
    86 fi
    87 AC_SUBST(MAKEOKFILE)
     57#                            check GLPK version                           #
     58###########################################################################
     59
     60AC_MSG_CHECKING([GLPK version])
     61glpkmajorver=`awk '/define GLP_MAJOR_VERSION/ {print $3}' $srcdir/glpk/include/glpk.h`
     62glpkminorver=`awk '/define GLP_MINOR_VERSION/ {print $3}' $srcdir/glpk/include/glpk.h`
     63AC_MSG_RESULT([${glpkmajorver}.${glpkminorver}])
     64if test x$glpkmajorver != x4 || test x$glpkminorver != x43 ; then
     65  AC_MSG_ERROR(["Incorrect GLPK version. This build system is made for GLPK 4.43. Please update by rerunning get.GLPK"])
     66fi
     67AC_SUBST(glpkmajorver)
     68AC_SUBST(glpkminorver)
    8869
    8970###########################################################################
     
    132113
    133114if test "$enable_dl" = "no"; then
    134 AC_COIN_CHECK_HEADER([ltdl.h],[enable_dl=yes])
     115  AC_COIN_CHECK_HEADER([ltdl.h],[enable_dl=yes])
    135116  if test "$enable_dl" = "yes"; then
    136117    #if ltdl.h is there, check also if libltdl is there; if so, set corresponding define for GLPK
     
    150131
    151132AC_ARG_ENABLE(odbc,
    152         AC_HELP_STRING([--enable-odbc],[enable MathProg ODBC support [[default=auto]]]),
    153         [case $enableval in
    154            yes | unix)
     133  AC_HELP_STRING([--enable-odbc],[enable MathProg ODBC support [[default=auto]]]),
     134  [case $enableval in
     135     yes | unix)
    155136       AC_COIN_CHECK_HEADER([sql.h],,[AC_MSG_ERROR(["need sql.h to enable ODBC support"])])
    156137       enable_odbc="$enableval"
     
    159140       enable_odbc="no"
    160141     ;;
    161            *)
    162              AC_MSG_ERROR([invalid value '$enableval' for --enable-odbc])
    163            ;;
     142     *)
     143       AC_MSG_ERROR([invalid value '$enableval' for --enable-odbc])
     144     ;;
    164145   esac],
    165         [AC_COIN_CHECK_HEADER([sql.h],[enable_odbc=yes],[enable_odbc=no])]
     146  [AC_COIN_CHECK_HEADER([sql.h],[enable_odbc=yes],[enable_odbc=no])]
    166147)
    167148
    168149AC_ARG_ENABLE(mysql,
    169         AC_HELP_STRING([--enable-mysql],[enable MathProg MySQL support [[default=auto]]]),
    170         [case $enableval in
    171            yes)
     150  AC_HELP_STRING([--enable-mysql],[enable MathProg MySQL support [[default=auto]]]),
     151  [case $enableval in
     152     yes)
    172153       AC_COIN_CHECK_HEADER([mysql.h mysql/mysql.h],,[AC_MSG_ERROR(["need mysql.h to enable MySQL support"])])
    173154       enable_mysql="$enableval"
     
    176157       enable_mysql="no"
    177158     ;;
    178            *)
    179              AC_MSG_ERROR([invalid value '$enableval' for --enable-mysql])
    180            ;;
     159     *)
     160       AC_MSG_ERROR([invalid value '$enableval' for --enable-mysql])
     161     ;;
    181162   esac],
    182         [AC_COIN_CHECK_HEADER([mysql.h mysql/mysql.h],[enable_mysql=yes],[enable_mysql=no])]
     163  [AC_COIN_CHECK_HEADER([mysql.h mysql/mysql.h],[enable_mysql=yes],[enable_mysql=no])]
    183164)
    184165
    185166AC_LANG_POP(C)
    186        
     167
    187168if test "$enable_dl" = "yes" && ( test "$enable_odbc" = "yes" || test "$enable_odbc" = "unix"); then
    188169  AC_MSG_CHECKING([checking name of ODBC library])
     
    267248AC_SUBST(GLPKDIR)
    268249
    269 AC_CONFIG_FILES([Makefile glpk_addlibs.txt])
     250AC_CONFIG_FILES([Makefile coinglpk.pc coinglpk-uninstalled.pc])
    270251AC_CONFIG_HEADER([config_glpk.h])
    271252
Note: See TracChangeset for help on using the changeset viewer.