Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/configure.ac

    r15 r29  
    128128# ===========================================================================
    129129
     130
     131
     132
    130133AC_ARG_WITH([python],
    131         [AS_HELP_STRING([--with-python=PATH], [specify an alternative directory for python installation])],
    132         [PYTHONCONFIG="$withval/bin/python-config"], [PYTHONCONFIG=""])
    133 
    134 if test "x$PYTHONCONFIG" = "x"; then
    135         # PYTHON was not specified, so search within the current path
    136         AC_PATH_PROG([PYTHONCONFIG], [python-config])
    137 
    138         # If we couldn't find python-config, display a warning
    139         if test "x$PYTHONCONFIG" = "x"; then
    140                 AC_MSG_ERROR([could not find python-config from libpython within the current path. You may need to try re-running configure with a --with-python parameter.])
    141         fi
    142 else
    143         # PYTHON was specified; display a message to the user
    144         if test "x$PYTHON" = "xyes"; then
    145                 AC_MSG_ERROR([you must specify a parameter to --with-python, e.g. --with-python=/path/to/python])
    146         else
    147                 if test -f $PYTHONCONFIG; then
    148                         AC_MSG_RESULT([Using user-specified python-config file: $PYTHONCONFIG])
    149                 else
    150                         AC_MSG_ERROR([the user-specified python-config file $PYTHONCONFIG does not exist])
    151                 fi     
    152         fi
    153 fi
    154 
    155 
    156 # Extract the linker and include flags
    157 PYTHON_LDFLAGS=`$PYTHONCONFIG --libs`
    158 PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
    159 
    160 # Check headers file
    161 CPPFLAGS_SAVE="$CPPFLAGS"
    162 CPPFLAGS="$PYTHON_CPPFLAGS"
    163 AC_CHECK_HEADERS([Python.h],
     134        [AS_HELP_STRING([--with-python=PATH], [To enabled python support or specify an alternative directory for python installation,  disabled by default])],
     135        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
     136
     137
     138if test -z "$PYTHON_ENABLED"
     139then
     140        PYTHON_FILE=""
     141else
     142        PYTHONCONFIG="$PYTHON_PATH/bin/python-config"
     143        PYTHON_FILE="service_internal_python.o"
     144        if test  "$PYTHON_PATH" = "yes"
     145        then
     146                # PHP was not specified, so search within the current path
     147                AC_PATH_PROG([PYTHONCONFIG], [python-config])
     148        else
     149                PYTHONCONFIG="$PYTHON_PATH/bin/python-config"
     150        fi
     151
     152        # Extract the linker and include flags
     153        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
     154        PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
     155
     156        # Check headers file
     157        CPPFLAGS_SAVE="$CPPFLAGS"
     158        CPPFLAGS="$PYTHON_CPPFLAGS"
     159        AC_CHECK_HEADERS([Python.h],
    164160                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
    165161
    166 # Ensure we can link against libpython
    167 LIBS_SAVE="$LIBS"
    168 LIBS="$PYTHON_LDFLAGS"
    169 # Shouldn't we get python here rather than python2.6 :) ??
    170 PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
    171 AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
    172 
    173 AC_SUBST([PYTHON_CPPFLAGS])
    174 AC_SUBST([PYTHON_LDFLAGS])
     162        # Ensure we can link against libphp
     163        LIBS_SAVE="$LIBS"
     164        LIBS="$PYTHON_LDFLAGS"
     165        PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
     166        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
     167        AC_SUBST([PYTHON_CPPFLAGS])
     168        AC_SUBST([PYTHON_LDFLAGS])
     169fi
     170
     171AC_SUBST([PYTHON_ENABLED])
     172AC_SUBST([PYTHON_FILE])
    175173
    176174# ===========================================================================
     
    182180
    183181AC_ARG_WITH([php],
    184         [AS_HELP_STRING([--with-php=PATH], [specify an alternative directory for php installation or --with-php=no  to disable php support])],
    185         [PHP_PATH="$withval"], [PHP_PATH=""])
    186 if test "$PHP_PATH" != "no";
    187 then
     182        [AS_HELP_STRING([--with-php=PATH], [To enabled php support or specify an alternative directory for php installation,  disabled by default])],
     183        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
     184
     185
     186if test -z "$PHP_ENABLED"
     187then
     188        PHP_FILE=""
     189else
    188190        PHPCONFIG="$PHP_PATH/bin/php-config"
    189         PHP_ENABLED="-DUSE_PHP"
    190191        PHP_FILE="service_internal_php.o"
    191         if test "x$PHPCONFIG" = "x";
    192         then
    193         # PHP was not specified, so search within the current path
    194         AC_PATH_PROG([PHPCONFIG], [php-config])
    195 
    196         # If we couldn't find php-config, display a warning
    197         if test "x$PHPCONFIG" = "x";
    198         then
    199                 AC_MSG_ERROR([could not find php-config from libphp within the current path. You may need to try re-running configure with a --with-php parameter.])
    200         fi
    201         else
    202                 # PHP was specified; display a message to the user
    203                 if test "x$PHP" = "xyes";
    204                 then
    205                         AC_MSG_ERROR([you must specify a parameter to --with-php, e.g. --with-php=/path/to/php])
    206                 else
    207                         if test -f $PHPCONFIG;
    208                         then
    209                                 AC_MSG_RESULT([Using user-specified php-config file: $PHPCONFIG])
    210                         else
    211                                 AC_MSG_ERROR([the user-specified php-config file $PHPCONFIG does not exist])
    212                         fi     
    213                 fi
    214         fi
     192        if test  "$PHP_PATH" = "yes"
     193        then
     194                # PHP was not specified, so search within the current path
     195                AC_PATH_PROG([PHPCONFIG], [php-config])
     196        else
     197                PHPCONFIG="$PHP_PATH/bin/php-config"
     198        fi
     199
    215200        # Extract the linker and include flags
    216201        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
     
    230215        AC_SUBST([PHP_CPPFLAGS])
    231216        AC_SUBST([PHP_LDFLAGS])
    232 else
    233         PHP_ENABLED=""
    234         PHP_FILE=""
    235217fi
    236218
     
    244226
    245227
    246 
    247 
    248228AC_ARG_WITH([perl],
    249         [AS_HELP_STRING([--with-perl=PATH], [specify an alternative directory for perl installation or --with-perl=no  to disable perl support])],
    250         [PERL_PATH="$withval"], [PERL_PATH=""])
    251 if test "$PERL_PATH" != "no";
    252 then
    253         if test "x$PERL_PATH" = "xyes";
    254         then
     229        [AS_HELP_STRING([--with-perl=PATH], [To enabled perl support or specify an alternative directory for perl installation,  disabled by default])],
     230        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
     231
     232
     233if test -z "$PERL_ENABLED"
     234then
     235        PERL_FILE=""
     236else
     237        PERLCONFIG="$PERL_PATH/bin/perl"
     238        PHP_FILE="service_internal_perl.o"
     239        if test  "$PERL_PATH" = "yes"
     240        then
     241                # PHP was not specified, so search within the current path
    255242                AC_PATH_PROG([PERLCONFIG], [perl])
    256243        else
     
    258245        fi
    259246
    260         if test -f $PERLCONFIG;
    261         then
    262                 AC_MSG_RESULT([Using user-specified perl file: $PERLCONFIG])
    263         else
    264                 AC_MSG_ERROR([the user-specified perl file $PERLCONFIG does not exist])
    265         fi
    266 
    267         PERL_ENABLED="-DUSE_PERL"
    268         PERL_FILE="service_internal_perl.o"
    269        
    270247        # Extract the linker and include flags
    271248        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
     
    280257        AC_SUBST([PERL_CPPFLAGS])
    281258        AC_SUBST([PERL_LDFLAGS])
    282 else
    283         PERL_ENABLED=""
    284         PERL_FILE=""
    285259fi
    286260
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png