Ignore:
File:
1 edited

Legend:

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

    r29 r15  
    128128# ===========================================================================
    129129
    130 
    131 
    132 
    133130AC_ARG_WITH([python],
    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 
    138 if test -z "$PYTHON_ENABLED"
    139 then
    140         PYTHON_FILE=""
    141 else
    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],
     131        [AS_HELP_STRING([--with-python=PATH], [specify an alternative directory for python installation])],
     132        [PYTHONCONFIG="$withval/bin/python-config"], [PYTHONCONFIG=""])
     133
     134if 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
     142else
     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
     153fi
     154
     155
     156# Extract the linker and include flags
     157PYTHON_LDFLAGS=`$PYTHONCONFIG --libs`
     158PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
     159
     160# Check headers file
     161CPPFLAGS_SAVE="$CPPFLAGS"
     162CPPFLAGS="$PYTHON_CPPFLAGS"
     163AC_CHECK_HEADERS([Python.h],
    160164                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
    161165
    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])
    169 fi
    170 
    171 AC_SUBST([PYTHON_ENABLED])
    172 AC_SUBST([PYTHON_FILE])
     166# Ensure we can link against libpython
     167LIBS_SAVE="$LIBS"
     168LIBS="$PYTHON_LDFLAGS"
     169# Shouldn't we get python here rather than python2.6 :) ??
     170PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
     171AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
     172
     173AC_SUBST([PYTHON_CPPFLAGS])
     174AC_SUBST([PYTHON_LDFLAGS])
    173175
    174176# ===========================================================================
     
    180182
    181183AC_ARG_WITH([php],
    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 
    186 if test -z "$PHP_ENABLED"
    187 then
    188         PHP_FILE=""
    189 else
     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=""])
     186if test "$PHP_PATH" != "no";
     187then
    190188        PHPCONFIG="$PHP_PATH/bin/php-config"
     189        PHP_ENABLED="-DUSE_PHP"
    191190        PHP_FILE="service_internal_php.o"
    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 
     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
    200215        # Extract the linker and include flags
    201216        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
     
    215230        AC_SUBST([PHP_CPPFLAGS])
    216231        AC_SUBST([PHP_LDFLAGS])
     232else
     233        PHP_ENABLED=""
     234        PHP_FILE=""
    217235fi
    218236
     
    226244
    227245
     246
     247
    228248AC_ARG_WITH([perl],
    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 
    233 if test -z "$PERL_ENABLED"
    234 then
    235         PERL_FILE=""
    236 else
    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
     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=""])
     251if test "$PERL_PATH" != "no";
     252then
     253        if test "x$PERL_PATH" = "xyes";
     254        then
    242255                AC_PATH_PROG([PERLCONFIG], [perl])
    243256        else
     
    245258        fi
    246259
     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       
    247270        # Extract the linker and include flags
    248271        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
     
    257280        AC_SUBST([PERL_CPPFLAGS])
    258281        AC_SUBST([PERL_LDFLAGS])
     282else
     283        PERL_ENABLED=""
     284        PERL_FILE=""
    259285fi
    260286
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