Merge pull request #728 from hasufell/master

build system improvements
This commit is contained in:
TingPing 2013-08-27 02:16:12 -07:00
commit 36b84c9af3
1 changed files with 37 additions and 60 deletions

View File

@ -116,8 +116,9 @@ AC_ARG_ENABLE(xlib,
xlib=$enableval, xlib=yes) xlib=$enableval, xlib=yes)
AC_ARG_ENABLE(python, AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin (default on, python2)])], [AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin; possible values: "python2", "python3" or specific such as "python3.3" (default on, python2)])],
python=$enableval, python=python2) python=$enableval, python=python2)
AS_IF([test "x$python" = "xyes"], [python=python2])
AC_ARG_ENABLE(perl, AC_ARG_ENABLE(perl,
[AS_HELP_STRING([--disable-perl],[don\'t build the perl plugin])], [AS_HELP_STRING([--disable-perl],[don\'t build the perl plugin])],
@ -228,15 +229,14 @@ GUI_LIBS="$GUI_LIBS $GTK_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES" GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
#if test "$gnome" = yes; then #if test "$gnome" = yes; then
# AC_PATH_PROG(pkgconfigpath, pkg-config)
# AC_MSG_CHECKING(Gnome2 compile flags) # AC_MSG_CHECKING(Gnome2 compile flags)
# GNOME_CFLAGS="`$pkgconfigpath libgnome-2.0 --cflags 2>/dev/null`" # GNOME_CFLAGS="`$PKG_CONFIG libgnome-2.0 --cflags 2>/dev/null`"
# if test "_$GNOME_CFLAGS" = _ ; then # if test "_$GNOME_CFLAGS" = _ ; then
# gnome=no # gnome=no
# AC_MSG_RESULT([Gnome not found, building without it.]) # AC_MSG_RESULT([Gnome not found, building without it.])
# else # else
# GNOME_VER="`$pkgconfigpath libgnome-2.0 --modversion`" # GNOME_VER="`$PKG_CONFIG libgnome-2.0 --modversion`"
# GUI_LIBS="$GUI_LIBS `$pkgconfigpath libgnome-2.0 --libs`" # GUI_LIBS="$GUI_LIBS `$PKG_CONFIG libgnome-2.0 --libs`"
# GUI_CFLAGS="$GUI_CFLAGS $GNOME_CFLAGS" # GUI_CFLAGS="$GUI_CFLAGS $GNOME_CFLAGS"
# AC_DEFINE(USE_GNOME) # AC_DEFINE(USE_GNOME)
# AC_MSG_RESULT(ok) # AC_MSG_RESULT(ok)
@ -255,10 +255,9 @@ dnl ** XFT **************************************************************
dnl ********************************************************************* dnl *********************************************************************
if test "$xft" = yes; then if test "$xft" = yes; then
AC_PATH_PROG(pkgconfigpath, pkg-config) if $PKG_CONFIG xft --exists; then
if $pkgconfigpath xft --exists; then GUI_CFLAGS="$GUI_CFLAGS `$PKG_CONFIG xft --cflags`"
GUI_CFLAGS="$GUI_CFLAGS `$pkgconfigpath xft --cflags`" GUI_LIBS="$GUI_LIBS `$PKG_CONFIG xft --libs`"
GUI_LIBS="$GUI_LIBS `$pkgconfigpath xft --libs`"
else else
xft=no xft=no
oldCPPFLAGS=$CPPFLAGS oldCPPFLAGS=$CPPFLAGS
@ -338,47 +337,27 @@ dnl ** PYTHON ***********************************************************
dnl ********************************************************************* dnl *********************************************************************
if test "x$python" != xno ; then if test "x$python" != xno ; then
if test "$python" = yes ; then case $python in
# default dnl set python2 default here
python="python2" python2)
fi PKG_CHECK_MODULES([PY], [python-2.7], [], [AC_MSG_ERROR(Cannot find python-2.7!)])
AC_PATH_PROG(pythonpath, $python) PY_VER="`$PKG_CONFIG --modversion python-2.7`";;
if test "_$pythonpath" = _ ; then dnl set python3 default here
AC_PATH_PROG(pythonpath, python) python3)
fi PKG_CHECK_MODULES([PY], [python-3.3], [], [AC_MSG_ERROR(Cannot find python-3.3!)])
if test "_$pythonpath" = _ ; then PY_VER="`$PKG_CONFIG --modversion python-3.3`";;
python=no dnl add broken versions here
else python2.5|python2.6|python3.1|python3.2)
AC_MSG_CHECKING(Python version) AC_MSG_ERROR(Unsupported Python version ${python}!);;
changequote(<<, >>)dnl python*)
PY_VER=`$pythonpath -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("VERSION")[0]);'` python="python-${python#python}" # stay posix compliant
PY_LIB=`$pythonpath -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(standard_lib=1));'` PKG_CHECK_MODULES([PY], [${python}], [], [AC_MSG_ERROR(Cannot find "${python}.pc"!)])
PY_INC=`$pythonpath -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc());'` PY_VER="`$PKG_CONFIG --modversion ${python}`";;
PYPLAT_INC=`$pythonpath -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc(plat_specific=True));'` *)
changequote([, ])dnl AC_MSG_ERROR(Unsupported Python ${python}!)
AC_MSG_RESULT($PY_VER) esac
$pythonpath -c "import sys; float(sys.version[[:3]]) >= 2.6 and int(sys.version[[0]]) <= 3 or sys.exit(1)" AC_MSG_CHECKING(Python version)
if test "$?" != "1"; then AC_MSG_RESULT($PY_VER)
AC_MSG_CHECKING(Python compile flags)
PY_PREFIX=`$pythonpath -c 'import sys; print(sys.prefix)'`
PY_EXEC_PREFIX=`$pythonpath -c 'import sys; print(sys.exec_prefix)'`
if test -f $PY_INC/Python.h || test -f $PYPLAT_INC/Python.h; then
AS_VERSION_COMPARE($PY_VER, 3.0,
[PYL="$PY_VER"], # less than
[PYL="${PY_VER}m"], # equal
[PYL="${PY_VER}m"]) # greater than
PY_LIBS="-L$PY_LIB/config -lpython$PYL -lpthread -lutil"
PY_CFLAGS="-I$PY_INC -I$PYPLAT_INC"
AC_MSG_RESULT(ok)
else
python=no
AC_MSG_RESULT([Can\'t find Python.h])
fi
else
echo "Python is too old or too new. Only 2.6-3.x are supported."
python=no
fi
fi
fi fi
dnl ********************************************************************* dnl *********************************************************************
@ -413,11 +392,10 @@ dnl *********************************************************************
retry=no retry=no
if test "$openssl" != no; then if test "$openssl" != no; then
AC_PATH_PROG(pkgconfigpath, pkg-config)
AC_MSG_CHECKING(for openssl through pkg-config) AC_MSG_CHECKING(for openssl through pkg-config)
if $pkgconfigpath openssl --exists; then if $PKG_CONFIG openssl --exists; then
CPPFLAGS="$CPPFLAGS `$pkgconfigpath openssl --cflags`" CPPFLAGS="$CPPFLAGS `$PKG_CONFIG openssl --cflags`"
LIBS="$LIBS `$pkgconfigpath openssl --libs`" LIBS="$LIBS `$PKG_CONFIG openssl --libs`"
AC_DEFINE(USE_OPENSSL) AC_DEFINE(USE_OPENSSL)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
openssl=yes openssl=yes
@ -493,9 +471,8 @@ if test "$plugin" = yes; then
fi fi
if test "$have_dl" = yes; then if test "$have_dl" = yes; then
AC_DEFINE(USE_PLUGIN) AC_DEFINE(USE_PLUGIN)
AC_PATH_PROG(pkgconfigpath, pkg-config)
dnl we just need the -Wl,--export-dynamic, but not -lgmodule-2.0 dnl we just need the -Wl,--export-dynamic, but not -lgmodule-2.0
RDYNAMIC_FLAGS="`$pkgconfigpath gmodule-2.0 --libs | $sedpath 's/ -lgmodule-2.0//'`" RDYNAMIC_FLAGS="`$PKG_CONFIG gmodule-2.0 --libs | $sedpath 's/ -lgmodule-2.0//'`"
LIBS="$LIBS $RDYNAMIC_FLAGS" LIBS="$LIBS $RDYNAMIC_FLAGS"
if test "$LD" = ""; then if test "$LD" = ""; then
VS="`ld --help | grep version-script 2> /dev/null`" VS="`ld --help | grep version-script 2> /dev/null`"
@ -731,8 +708,8 @@ dnl *********************************************************************
if test "$shm" = yes; then if test "$shm" = yes; then
oldl=$LIBS oldl=$LIBS
oldc=$CPPFLAGS oldc=$CPPFLAGS
LIBS="$LIBS `$pkgconfigpath --libs-only-L xft`" LIBS="$LIBS `$PKG_CONFIG --libs-only-L xft`"
CPPFLAGS="$CPPFLAGS `$pkgconfigpath --cflags-only-I xft`" CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags-only-I xft`"
shm=no shm=no
AC_CHECK_LIB(Xext, XShmAttach, shm=yes) AC_CHECK_LIB(Xext, XShmAttach, shm=yes)
if test "$shm" = yes; then if test "$shm" = yes; then
@ -746,7 +723,7 @@ if test "$shm" = yes; then
LIBS=$oldl LIBS=$oldl
if test "$shm" = yes; then if test "$shm" = yes; then
GUI_LIBS="$GUI_LIBS `$pkgconfigpath --libs-only-L xft` -lX11 -lXext" GUI_LIBS="$GUI_LIBS `$PKG_CONFIG --libs-only-L xft` -lX11 -lXext"
AC_DEFINE(USE_SHM) AC_DEFINE(USE_SHM)
else else
CPPFLAGS=$oldc CPPFLAGS=$oldc
@ -1015,7 +992,7 @@ echo MS Proxy NTLM \(ISA\) ... : $have_ntlm
echo libproxy support ...... : $libproxy echo libproxy support ...... : $libproxy
echo echo
echo Perl .................. : $perl echo Perl .................. : $perl
echo Python ................ : $python echo Python ................ : python-$PY_VER
echo echo
echo Checksum .............. : $checksum echo Checksum .............. : $checksum
echo Do At ................. : $doat echo Do At ................. : $doat