Changeset 2058 for trunk/configure.in


Ignore:
Timestamp:
Jan 24, 2011 8:04:31 PM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.in

    r2038 r2058  
     1
    12AC_INIT([Rappture],[1.1],[rappture@nanohub.org])
    23dnl AC_CONFIG_HEADER(src/core/RpConfig.h)
     
    120121        [location of tclsh @<:@default=yes@:>@])],
    121122    [],
    122     [rp_with_tclsh=yes])
     123    [rp_with_tclsh=$withval])
    123124
    124125TCLSH=
    125 if test "$rp_with_tclsh" != "no" ; then
    126     AC_MSG_CHECKING([for tclsh])
    127     if test -x "$rp_with_tclsh/bin/tclsh"
     126if test "${rp_with_tclsh}" != "no" ; then
     127  AC_MSG_CHECKING([for tclsh])
     128  if test -x "${rp_with_tclsh}/bin/tclsh"
     129  then
     130    TCLSH="${rp_with_tclsh}/bin/tclsh"
     131  else
     132    if test -x "${rp_with_tclsh}"
    128133    then
    129         echo Found tclsh in $rp_with_tclsh/bin/tclsh
    130         TCLSH="$rp_with_tclsh/bin/tclsh"
     134      TCLSH="${rp_with_tclsh}"
    131135    else
    132        if test -x "$rp_with_tclsh"
    133         then
    134             echo Found tclsh in $rp_with_tclsh
    135             TCLSH="$rp_with_tclsh"
    136         else
    137             if test -x "${exec_prefix}/bin/tclsh"
    138             then
    139                 echo Found tclsh in ${exec_prefix}/bin/tclsh
    140                 TCLSH="${exec_prefix}/bin/tclsh"
    141             else
    142                 for v in 8.4 8.5 8.6 ; do
    143                     if test -x "${exec_prefix}/bin/tclsh${v}"
    144                     then
    145                         echo Found tclsh in ${exec_prefix}/bin/tclsh${v}
    146                         TCLSH="${exec_prefix}/bin/tclsh${v}"
    147                         break
    148                     fi
    149                 done
    150             fi
    151         fi
     136      if test -x "${exec_prefix}/bin/tclsh"
     137      then
     138        TCLSH="${exec_prefix}/bin/tclsh"
     139      else
     140        for v in 8.4 8.5 8.6 ; do
     141          if test -x "${exec_prefix}/bin/tclsh${v}"
     142          then
     143            TCLSH="${exec_prefix}/bin/tclsh${v}"
     144            break
     145          fi
     146        done
     147      fi
    152148    fi
    153     if ! test -x ${TCLSH}
    154     then
    155         AC_PATH_PROG(TCLSH, tclsh)
    156     fi
    157 fi
    158 
     149  fi
     150  if ! test -x ${TCLSH} ; then
     151    AC_PATH_PROG(TCLSH, tclsh)
     152  fi
     153fi
    159154AC_MSG_RESULT([${TCLSH}])
    160155AC_SUBST(TCLSH)
     
    284279MKOCTFILE3=
    285280if test "$rp_with_octave" != "no" ; then
    286   AC_MSG_CHECKING([for octave and mkoctfile])
    287281  if test "$rp_with_octave" = "yes" ; then
    288282    AC_PATH_PROG(OCTAVE, octave)
     
    316310if test "$rp_with_octave2" != "no" ; then
    317311  if test "$rp_with_octave2" = "yes" ; then
    318     AC_MSG_CHECKING([for octave and mkoctfile])
    319312    AC_PATH_PROG(octave2, octave)
    320313    AC_PATH_PROG(mkoctfile2, mkoctfile)
     
    342335    [rp_with_octave3=no])
    343336
    344 echo rp_with_octave3=$rp_with_octave3
    345337if test "$rp_with_octave3" != "no" ; then
    346338  if test "$rp_with_octave3" = "yes" ; then
    347     AC_MSG_CHECKING([for octave and mkoctfile])
    348339    AC_PATH_PROG(octave3, octave)
    349340    AC_PATH_PROG(mkoctfile3, mkoctfile)
     
    354345fi
    355346
    356 echo octave3=$octave3
    357347if test "x${octave3}" != "x" ; then
    358   echo version="${octave3} -v | grep version | cut -d' ' -f4"
    359348  version=`${octave3} -v | grep version | cut -d' ' -f4`
    360   echo version=$version
    361349  version_major=`echo ${version} | cut -d'.' -f1`
    362   echo version_major=$version_major
    363350  if test "$version_major" = "3" ; then
    364351    OCTAVE3=$rp_with_octave3
     
    394381PERL_LIBSPEC=
    395382if test "$rp_with_perl" != "no" ; then
    396   AC_MSG_CHECKING([for perl])
    397383  if test "$rp_with_perl" != "yes" ; then
    398384    AC_PATH_PROG(PERL, perl, [], [$rp_with_perl/bin:$rp_with_perl])
     
    410396    PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'`
    411397    PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2`
    412     echo perllib="${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}"
    413 
    414398    # libperl may or may not be installed.  Check for its existence.
    415399    if test -f "${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" ; then
     
    418402  fi
    419403fi
    420 AC_MSG_RESULT([${PERL}])
    421404AC_SUBST(PERL)
    422405AC_SUBST(PERL_INCLUDES)
     
    435418PYTHON_CFLAGS=""
    436419PYTHON_CPPFLAGS=""
    437 HAVE_PYTHON_DISTUTILS=""
     420PYTHON_DISTUTILS=""
    438421PYTHON_INCLUDES=""
    439422PYTHON_LDFLAGS=""
     
    451434
    452435if test "$rp_with_python" != "no" ; then
    453   AC_MSG_CHECKING([for python])
    454   if test -x "$rp_with_python/bin/python"; then
    455     echo Found python in $rp_with_python/bin/python
    456     PYTHON="$rp_with_python/bin/python"
    457   elif test -x "$rp_with_python"; then
    458     echo Found python in $rp_with_python
    459     PYTHON="$rp_with_python"
     436  if test "$rp_with_python" = "yes" ; then
     437    AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
    460438  else
    461     AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
    462   fi
     439    AC_PATH_PROG(PYTHON, python, [], [${rp_with_python}/bin:${rp_with_python}])
     440  fi
     441  AC_MSG_CHECKING([for Python version])
    463442  if test "x${PYTHON}" != "x"; then
    464     PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
    465     echo Using python version $PYTHON_VERSION
    466   fi
    467   if test "x${PYTHON_VERSION}" != "x"; then
    468     if test -r $rp_with_python/include/python$PYTHON_VERSION/Python.h -a \
    469      -d $rp_with_python/lib/python$PYTHON_VERSION/site-packages; then
    470       PYTHON_INCLUDES=$rp_with_python/include/python$PYTHON_VERSION
    471       PYTHON_SITE_PACKAGES=$rp_with_python/lib/python$PYTHON_VERSION/site-packages
    472     else
    473       if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then
    474         PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
    475         PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
    476       else
    477         if test -r /usr/include/python$PYTHON_VERSION/Python.h; then
    478           PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
    479           PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
    480         else
    481           echo could not find python$PYTHON_VERSION/Python.h
    482         fi
    483       fi
    484       if test ! -d "$PYTHON_SITE_PACKAGES"; then
    485         PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
    486       fi
    487     fi
    488   fi
    489   if test "x$rp_with_python" != "x" ;  then
    490     pythondir='$(PYTHON_SITE_PACKAGES)'
    491   else
    492     pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
    493   fi
    494 
    495   AC_MSG_CHECKING([for python distutils])
     443    PYTHON_VERSION=`${PYTHON} -c "import sys; print sys.version[[0:3]]"`
     444  fi
     445  AC_MSG_RESULT([$PYTHON_VERSION])
     446fi
     447
     448if test "x${PYTHON_VERSION}" != "x"; then
     449  PYTHON_INCLUDES=$incdir
     450  AC_MSG_CHECKING([for Python distutils])
     451  PYTHON_DISTUTILS=""
    496452  ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \
    497453        build build_ext 2>&1 > /dev/null
    498454  if test $? = 0 ; then
    499     HAVE_PYTHON_DISTUTILS="yes"
    500   else
    501      HAVE_PYTHON_DISTUTILS="no"
    502   fi
    503   AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS])
    504 
    505   if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then
     455    PYTHON_DISTUTILS="yes"
     456  fi
     457  AC_MSG_RESULT([$PYTHON_DISTUTILS])
     458  if test "${PYTHON_DISTUTILS}" = "yes" ; then
     459    PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
    506460    #
    507461    # Check for Python include path
    508462    #
    509     AC_MSG_CHECKING([for Python include path])
    510     if test "x${PYTHON_CPPFLAGS}" = "x"; then
    511       incdir_path=`${PYTHON} -c "import distutils.sysconfig; \
    512        print distutils.sysconfig.get_python_inc();"`
    513       if test -n "${incdir}"; then
    514         python_path="-I${incdir}"
    515       fi
    516       PYTHON_CPPFLAGS=$python_path
    517     fi
    518     AC_MSG_RESULT([$PYTHON_CPPFLAGS])
    519     AC_SUBST([PYTHON_CPPFLAGS])
     463    AC_MSG_CHECKING([path to Python headers])
     464    PYTHON_INCDIR=`${PYTHON} -c "import distutils.sysconfig; \
     465     print distutils.sysconfig.get_python_inc();"`
     466    AC_MSG_RESULT([$PYTHON_INCDIR])
    520467    #
    521     # python distutils found, get settings from python directly
     468    # Python distutils found, get settings from python directly
    522469    #
    523     AC_MSG_CHECKING([location of site-packages])
    524470    PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`"
    525 
     471   
    526472    PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print \" \".join(flags);'`"
    527473    PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print \" \".join(libs);'`"
    528474    PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`"
    529475    PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`"
    530   fi
    531 fi 
    532 AC_SUBST(pythondir)
     476    save_CPPFLAGS=$CPPFLAGS
     477    CPPFLAGS="$CPPFLAGS -I${PYTHON_INCDIR}"
     478    AC_CHECK_HEADERS([Python.h], [found=yes], [found=no])
     479    CPPFLAGS=$save_CPPFLAGS
     480    if test "$found" = "no" ; then
     481      PYTHON_DISTUTILS=""
     482    fi
     483  fi
     484fi
    533485
    534486AC_SUBST(PYTHON)
    535487AC_SUBST(PYTHON_VERSION)
    536488AC_SUBST(PYTHON_INCLUDES)
     489AC_SUBST(PYTHON_CFLAGS)
     490AC_SUBST(PYTHON_INCDIR)
     491AC_SUBST(PYTHON_LDFLAGS)
     492AC_SUBST(PYTHON_LIB)
     493AC_SUBST(PYTHON_SITE_DIR)
     494AC_SUBST(PYTHON_LIBDIR)
    537495AC_SUBST(PYTHON_SITE_PACKAGES)
    538 AC_SUBST(HAVE_PYTHON_DISTUTILS)
     496AC_SUBST(PYTHON_DISTUTILS)
    539497
    540498rp_with_ruby="yes"
     
    543501RUBY_DEV_PKG="no"
    544502
    545 AC_ARG_WITH(ruby,
    546   AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]),
    547   [rp_with_ruby=$withval])
     503AC_ARG_WITH(
     504    [ruby],
     505    [AS_HELP_STRING([--with-ruby=DIR], [location of ruby @<:@default=yes@:>@])],
     506    [rp_with_ruby=$withval])
     507
    548508if test "${rp_with_ruby}" != "no" ; then
    549509  if test "${rp_with_ruby}" = "yes" ; then
     
    576536JAVAC=""
    577537JAVA_DEV_PKG="no"
    578 
    579 AC_ARG_WITH(java,
    580   AS_HELP_STRING([--with-java=PATH], [absolute path to java executable]),
    581   [rp_with_java=$withval])
     538AC_ARG_WITH(
     539    [java],
     540    [AS_HELP_STRING([--with-java=DIR], [location of java @<:@default=yes@:>@])],
     541    [rp_with_java=$withval])
    582542
    583543if test "${rp_with_java}" != "no" ; then
    584544  if test "${rp_with_java}" = "yes" ; then
    585     AC_PATH_PROG(JAVA, java)
     545    AC_PATH_PROG(JAVA,  java)
    586546    AC_PATH_PROG(JAVAC, javac)
    587547    AC_PATH_PROG(JAVAH, javah)
     
    818778    examples/app-fermi/matlab/compiled/Makefile
    819779    examples/app-fermi/matlab/uncompiled/Makefile
    820     examples/app-fermi/octave/Makefile
    821780    examples/app-fermi/octave/2/Makefile
    822781    examples/app-fermi/octave/3/Makefile
     782    examples/app-fermi/octave/Makefile
    823783    examples/app-fermi/perl/Makefile
    824784    examples/app-fermi/python/Makefile
     
    856816    examples/zoo/binary/Makefile
    857817    examples/zoo/boolean/Makefile
    858     examples/zoo/parallelepiped/Makefile
    859818    examples/zoo/choice/Makefile
    860819    examples/zoo/cloud/Makefile
     
    877836    examples/zoo/number/Makefile
    878837    examples/zoo/number2/Makefile
     838    examples/zoo/parallelepiped/Makefile
    879839    examples/zoo/periodicelement/Makefile
    880840    examples/zoo/phase/Makefile
Note: See TracChangeset for help on using the changeset viewer.