[mapguide-commits] r9297 - in sandbox/jng/cmake_v2: . Oem

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jan 9 02:01:47 PST 2018


Author: jng
Date: 2018-01-09 02:01:47 -0800 (Tue, 09 Jan 2018)
New Revision: 9297

Added:
   sandbox/jng/cmake_v2/CMake_README.txt
   sandbox/jng/cmake_v2/cmake_bootstrap.sh
Modified:
   sandbox/jng/cmake_v2/Oem/CMakeLists.txt
   sandbox/jng/cmake_v2/cmake_build.sh
Log:
Like DbXml, I give up trying to build/manage httpd/php from within CMake, so the building of these and DbXml have been offloaded to a new cmake_bootstrap.sh. This script will build and install the required thirdparty components thus will generally require sudo elevation. Also add a basic README for the CMake build

Added: sandbox/jng/cmake_v2/CMake_README.txt
===================================================================
--- sandbox/jng/cmake_v2/CMake_README.txt	                        (rev 0)
+++ sandbox/jng/cmake_v2/CMake_README.txt	2018-01-09 10:01:47 UTC (rev 9297)
@@ -0,0 +1,107 @@
+CMake build for MapGuide
+========================
+
+This document contains instructions on how to use CMake to build MapGuide on Linux. 
+
+This is an experimental alternative build system to autotools for building MapGuide on Linux.
+
+Requirements
+============
+
+You have FDO already built and installed at /usr/local/fdo-x.y.z (where x.y.z is the current version of FDO)
+    - You should build FDO with CMake too
+
+These instructions assume an Ubuntu 14.04 LTS environment.
+
+Install the following packages:
+
+build-essential libpng-dev libjpeg62-dev libxslt-dev libfreetype6-dev libpcre3-dev openjdk-7-jdk 
+ant libldap-dev libssl-dev libcurl4-openssl-dev libexpat-dev libmysqlclient-dev unixODBC-dev 
+python-dev libpq-dev libcppunit-dev libxalan-c-dev libxerces-c-dev libboost-date-time-dev 
+libboost-thread-dev libboost-system-dev libboost-chrono-dev libboost-program-options-dev libgdal-dev 
+libjsoncpp-dev libgd-dev libace-dev libjsoncpp-dev cmake 
+
+If you wish to build with ninja instead of make, install the following:
+
+ninja-build
+
+TODO: Specify dep list for CentOS
+
+Usage
+=====
+
+1. Create a directory where internal thirdparty components will be built in
+
+    mkdir -p ~/mapguide_oem_build
+
+2. Build the internal thirdparty components specifying the directory where thirdparty components will be built in
+
+    sudo ./cmake_bootstrap.sh --oem_working_dir ~/mapguide_oem_build
+
+   This will copy the DBXML, httpd, PHP and the Tomcat connector sources to your specified directory and build it from there.
+   Once completed, an env_vars.sh script will be written to this directory that the following step will use.
+
+   This will generally require elevation (with sudo) as the default install prefix is /usr/local/mapguideopensource-x.y.z where
+   x.y.z is the current version of MapGuide.
+
+3. Start the main CMake build
+
+    ./cmake_build.sh --oem_working_dir ~/mapguide_oem_build --cmake_build_dir ~/mapguide_build_area
+
+   This will set up the CMake build using the generated env_vars.sh script and set up a CMake build tree in the directory specified
+   by --cmake_build_dir
+
+4. Install the MapGuide binaries. This will generally require elevation (with sudo) as well.
+
+    cd ~/mapguide_build_area
+    sudo make install
+
+5. Start the MapGuide Server (replace x.y.z with the current version of MapGuide)
+
+    cd /usr/local/mapguideopensource-x.y.z/server/bin
+    ./mgserver.sh
+
+6. Start the Apache Web Server (replace x.y.z with the current version of MapGuide)
+
+    cd /usr/local/mapguideopensource-x.y.z/webserverextensions/apache2/bin
+    ./apachectl start
+
+Manual CMake Build
+==================
+
+cmake_build.sh is a wrapper around calling CMake with a standard set of options. If you want to invoke CMake manually, do the following
+after running cmake_bootstrap.sh.
+
+    mkdir -p ~/mapguide_build_area
+    cd ~/mapguide_build_area
+    source ~/mapguide_oem_build/env_vars.sh
+    cmake <YOUR SOURCE DIRECTORY> -DMG_OEM_WORK_DIR=~/mapguide_oem_build -DPHP_VER=${PHP_VER} -DHTTPD_VER=${HTTPD_VER} -DCMAKE_BUILD_TYPE=$BUILD_CONFIG <other options...>
+
+The CMake build supports the following options. Prefix with "-D" in your cmake command to enable such options:
+
+ - CMAKE_BUILD_TYPE=(Debug|Release)
+    Build the source in Debug or Release configuration
+
+ - WITH_JAVA=(TRUE|FALSE)
+    Enable Java support. This will build the Java API wrappers and enable Tomcat install/integration.
+    If not set, these parts are skipped.
+ 
+ - WITH_DESKTOP=(TRUE|FALSE)
+    Enable building mg-desktop.
+
+ - SANITIZE_ADDRESS=(ON|OFF)
+    Build the source with AddressSanitizer (ASAN) support. 
+    This allows one to catch a certain class of errors during execution that previously would require an external tool like valgrind.
+    You should also be building your source in Debug configuration if you enable this option.
+
+Help/Support
+============
+
+File a ticket on https://trac.osgeo.org/mapguide or send an email to the mapguide-users mailing list.
+
+TODO
+====
+
+ - Integrate with system-provided httpd/php if available and in supported version range.
+ - Support full internal Oem build (currently only covers components we know not to be provided by Ubuntu)
+ - Windows support and vcpkg integration
\ No newline at end of file

Modified: sandbox/jng/cmake_v2/Oem/CMakeLists.txt
===================================================================
--- sandbox/jng/cmake_v2/Oem/CMakeLists.txt	2018-01-09 09:44:20 UTC (rev 9296)
+++ sandbox/jng/cmake_v2/Oem/CMakeLists.txt	2018-01-09 10:01:47 UTC (rev 9297)
@@ -4,9 +4,6 @@
 set(FUSION_WORK_DIR ${CMAKE_CURRENT_BINARY_DIR}/fusion)
 install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir ${FUSION_WORK_DIR} ant deploy -Ddeploy.home=${MG_WWWROOT}/fusion)")
 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fusionMG/templates DESTINATION ${MG_WWWROOT}/fusion)
-###### LinuxApt ######
-make_install(${MG_OEM_WORK_DIR}/LinuxApt/php-${PHP_VER})
-make_install(${MG_OEM_WORK_DIR}/LinuxApt/httpd-${HTTPD_VER})
 ###### Everything else ######
 
 # TODO: We have geos in-tree, which is CMake-enabled, so if required we can use

Added: sandbox/jng/cmake_v2/cmake_bootstrap.sh
===================================================================
--- sandbox/jng/cmake_v2/cmake_bootstrap.sh	                        (rev 0)
+++ sandbox/jng/cmake_v2/cmake_bootstrap.sh	2018-01-09 10:01:47 UTC (rev 9297)
@@ -0,0 +1,225 @@
+#!/bin/sh
+
+MG_INST_PREFIX=/usr/local/mapguideopensource-3.3.0
+CMAKE_BUILD_DIR=~/mapguide_build_area
+OEM_WORK_DIR=~/mapguide_oem_build
+BUILD_CPU=32
+BUILD_CONFIG=Release
+BUILD_DBXML=0
+BUILD_LINUXAPT=0
+HAVE_SYSTEM_XERCES=0
+while [ $# -gt 0 ]; do    # Until you run out of parameters...
+    case "$1" in
+        --prefix)
+            MG_INST_PREFIX="$2"
+            shift
+            ;;
+        --oem_working_dir)
+            OEM_WORK_DIR="$2"
+            shift
+            ;;
+        --build)
+            BUILD_CPU=$2
+            shift
+            ;;
+        --config)
+            BUILD_CONFIG=$2
+            shift
+            ;;
+        --have-system-xerces)
+            HAVE_SYSTEM_XERCES=1
+            ;;
+        --help)
+            echo "Usage: $0 (options)"
+            echo "Options:"
+            echo "  --prefix [install prefix]"
+            echo "  --oem_working_dir [installation directory]"
+            echo "  --build [32(default)|64]"
+            echo "  --config [Release(default)|Debug]"
+            echo "  --have-system-xerces [Use system-installed xerces]"
+            echo "  --help [Display usage]"
+            exit
+            ;;
+    esac
+    shift   # Check next set of parameters.
+done
+
+SOURCE_DIR=`pwd`
+
+check_build()
+{
+    error=$?
+    if [ $error -ne 0 ]; then
+        echo "$LIB_NAME: Error build failed ($error)................."
+        # Return back to this dir before bailing
+        cd $SOURCE_DIR
+        exit $error
+    fi
+}
+
+# Validate
+if test "$BUILD_CPU" != "32" -a "$BUILD_CPU" != "64"; then
+    echo "--build must be 32 or 64"
+    exit 1;
+fi
+if test "$BUILD_CONFIG" != "Release" -a "$BUILD_CONFIG" != "Debug"; then
+    echo "--config must be Release or Debug"
+    exit 1;
+fi
+
+echo "Current source dir is: $SOURCE_DIR"
+echo "Building for: $BUILD_CPU-bit"
+echo "Building in: $BUILD_CONFIG"
+echo "OEM Working Directory is: $OEM_WORK_DIR"
+
+echo "Checking if OEM working dir exists"
+if [ ! -d $OEM_WORK_DIR ]; then
+    mkdir -p $OEM_WORK_DIR
+    echo "Created OEM working dir at: $OEM_WORK_DIR"
+fi
+
+echo "Checking if we need to build DBXML"
+# Basically perform the same checks as FindDbXml.cmake
+HAS_DBXML_HEADERS=0
+HAS_DBXML_LIB=0
+HAS_DBCXX_LIB=0
+HAS_XQILLA_LIB=0
+if [ -f "${OEM_WORK_DIR}/dbxml/install/include/dbxml/DbXml.hpp" ]; then
+    HAS_DBXML_HEADERS=1
+fi
+if [ -f "${OEM_WORK_DIR}/dbxml/install/lib/libdb_cxx.so" ]; then
+    HAS_DBCXX_LIB=1
+fi
+if [ -f "${OEM_WORK_DIR}/dbxml/install/lib/libdbxml.so" ]; then
+    HAS_DBXML_LIB=1
+fi
+if [ -f "${OEM_WORK_DIR}/dbxml/install/lib/libxqilla.so" ]; then
+    HAS_XQILLA_LIB=1
+fi
+echo "Has DBXML headers: $HAS_DBXML_HEADERS"
+echo "Has DB C++ Library: $HAS_DBCXX_LIB"
+echo "Has DBXML Library: $HAS_DBXML_LIB"
+echo "Has XQilla Library: $HAS_XQILLA_LIB"
+
+# (Re)build DBXML if any of the above is false
+if test $HAS_DBXML_HEADERS -eq 0 -o $HAS_DBCXX_LIB -eq 0 -o $HAS_DBXML_LIB -eq 0 -o $HAS_XQILLA_LIB -eq 0; then
+    echo "Re-building DBXML (${BUILD_CONFIG})"
+    cp -Rf Oem/dbxml ${OEM_WORK_DIR}/dbxml
+    cd ${OEM_WORK_DIR}/dbxml
+    if test $HAVE_SYSTEM_XERCES -eq 1; then
+        echo "Building DBXML with system-installed xerces. Please wait"
+        if test $BUILD_CONFIG == "Debug"; then
+            ./buildall.sh --enable-debug --with-xerces=/usr --have-system-xerces 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
+            check_build
+        else
+            ./buildall.sh --with-xerces=/usr --have-system-xerces 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
+            check_build
+        fi
+    else
+        echo "Building DBXML with internal copy of xerces. Please wait"
+        if test $BUILD_CONFIG == "Debug"; then
+            ./buildall.sh --enable-debug 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
+            check_build
+        else
+            ./buildall.sh 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
+            check_build
+        fi
+    fi
+fi
+
+PHP_VER=5.6.23
+HTTPD_VER=2.4.18
+TC_VER=1.2.41
+
+HTTPD_PORT=8008
+TOMCAT_PORT=8009
+
+MG_INSTALL_WEB_PREFIX=$MG_INST_PREFIX/webserverextensions
+
+LA_WORKDIR=${OEM_WORK_DIR}/LinuxApt
+HTTPD_FAKE_INSTALL=${OEM_WORK_DIR}/HttpdFakeInstall
+HTTPD_WORKDIR=${LA_WORKDIR}/httpd-${HTTPD_VER}
+PHP_WORKDIR=${LA_WORKDIR}/php-${PHP_VER}
+TC_WORKDIR=${LA_WORKDIR}/tomcat-connectors-${TC_VER}-src
+
+if [ ! -d ${LA_WORKDIR} ]; then
+    mkdir -p $LA_WORKDIR
+fi
+
+echo "Checking if we need to build httpd"
+HAS_HTTPD=0
+if [ -d ${HTTPD_WORKDIR} ]; then
+    HAS_HTTPD=1
+fi
+echo "Checking if we need to build php"
+HAS_PHP=0
+if [ -d ${PHP_WORKDIR} ]; then
+    HAS_PHP=1
+fi
+echo "Checking if we need to build tomcat connector"
+HAS_TOMCAT_CONNECTOR=0
+if [ -d ${TC_WORKDIR} ]; then
+    HAS_TOMCAT_CONNECTOR=1
+fi
+echo "Has HTTPD: ${HAS_HTTPD}"
+echo "Has PHP: ${HAS_PHP}"
+echo "Has Tomcat Connector: ${HAS_TOMCAT_CONNECTOR}"
+if test $HAS_HTTPD -eq 0; then
+    cd $SOURCE_DIR/Oem/LinuxApt
+    echo "Extracting HTTPD tarballs"
+    tar -jxf httpd-${HTTPD_VER}.tar.bz2 -C ${LA_WORKDIR}
+    tar -jxf httpd-${HTTPD_VER}-deps.tar.bz2 -C ${LA_WORKDIR}
+    cd ${HTTPD_WORKDIR}
+    echo "Configuring HTTPD"
+    ./configure --prefix=${MG_INSTALL_WEB_PREFIX}/apache2 --enable-mods-shared-all --with-included-apr --with-port=${HTTPD_PORT} 2>&1 | tee $OEM_WORK_DIR/configure_httpd_fake.log
+    check_build
+    echo "Building HTTPD. Please wait"
+    make 2>&1 | tee $OEM_WORK_DIR/make_httpd_fake.log
+    check_build
+    make install 2>&1 | tee $OEM_WORK_DIR/make_install_httpd_fake.log
+    check_build
+fi
+if test $HAS_PHP -eq 0; then
+    cd $SOURCE_DIR/Oem/LinuxApt
+    echo "Extracting PHP tarball"
+    tar -jxf php-${PHP_VER}.tar.bz2 -C ${LA_WORKDIR}
+    cd ${PHP_WORKDIR}
+    echo "Configuring PHP"
+    ./configure --prefix=${MG_INSTALL_WEB_PREFIX}/php --with-apxs2=${MG_INSTALL_WEB_PREFIX}/apache2/bin/apxs --with-openssl --with-curl --enable-xml --enable-wddx --enable-shared --with-zlib --enable-zip --enable-mbstring=all --with-xsl=/usr/lib --with-gd --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-freetype-dir=/usr/lib 2>&1 | tee $OEM_WORK_DIR/configure_php.log
+    check_build
+    echo "Building PHP. Please wait"
+    make 2>&1 | tee $OEM_WORK_DIR/make_php.log
+    check_build
+    make install 2>&1 | tee $OEM_WORK_DIR/make_install_php.log
+    check_build
+fi
+if test $HAS_TOMCAT_CONNECTOR -eq 0; then
+    cd $SOURCE_DIR/Oem/LinuxApt
+    echo "Extracting Tomcat Connector tarball"
+    tar -zxf tomcat-connectors-${TC_VER}-src.tar.gz -C ${LA_WORKDIR}
+    cd ${TC_WORKDIR}/native
+    echo "Configuring Tomcat Connector"
+    ./configure--with-apxs2=${MG_INSTALL_WEB_PREFIX}/apache2/bin/apxs 2>&1 | tee $OEM_WORK_DIR/configure_tc.log
+    check_build
+    echo "Building Tomcat Connector. Please wait"
+    make 2>&1 | tee $OEM_WORK_DIR/make_tc.log
+    check_build
+    make install 2>&1 | tee $OEM_WORK_DIR/make_install_php.log
+    check_build
+fi
+
+#dump vars
+echo "#!/bin/sh" > $OEM_WORK_DIR/env_vars.sh
+echo "export MG_INST_PREFIX=$MG_INST_PREFIX" >> $OEM_WORK_DIR/env_vars.sh
+echo "export BUILD_CPU=$BUILD_CPU" >> $OEM_WORK_DIR/env_vars.sh
+echo "export BUILD_CONFIG=$BUILD_CONFIG" >> $OEM_WORK_DIR/env_vars.sh
+echo "export PHP_VER=$PHP_VER" >> $OEM_WORK_DIR/env_vars.sh
+echo "export HTTPD_VER=$HTTPD_VER" >> $OEM_WORK_DIR/env_vars.sh
+echo "export TC_VER=$TC_VER" >> $OEM_WORK_DIR/env_vars.sh
+echo "export HTTPD_PORT=$HTTPD_PORT" >> $OEM_WORK_DIR/env_vars.sh
+echo "export TOMCAT_PORT=$TOMCAT_PORT" >> $OEM_WORK_DIR/env_vars.sh
+echo "export HAVE_SYSTEM_XERCES=$HAVE_SYSTEM_XERCES" >> $OEM_WORK_DIR/env_vars.sh
+chmod +x $OEM_WORK_DIR/env_vars.sh
+
+echo "$OEM_WORK_DIR/env_vars.sh written"
+echo "Make sure to run cmake_build.sh with --oem_working_dir set to: $OEM_WORK_DIR"
\ No newline at end of file


Property changes on: sandbox/jng/cmake_v2/cmake_bootstrap.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: sandbox/jng/cmake_v2/cmake_build.sh
===================================================================
--- sandbox/jng/cmake_v2/cmake_build.sh	2018-01-09 09:44:20 UTC (rev 9296)
+++ sandbox/jng/cmake_v2/cmake_build.sh	2018-01-09 10:01:47 UTC (rev 9297)
@@ -1,13 +1,12 @@
 #!/bin/sh
 
-MG_INST_PREFIX=/usr/local/mapguideopensource-3.3.0
 CMAKE_BUILD_DIR=~/mapguide_build_area
 OEM_WORK_DIR=~/mapguide_oem_build
-BUILD_CPU=32
-BUILD_CONFIG=Release
+#BUILD_CPU=32
+#BUILD_CONFIG=Release
 BUILD_DBXML=0
 BUILD_LINUXAPT=0
-HAVE_SYSTEM_XERCES=0
+#HAVE_SYSTEM_XERCES=0
 USE_NINJA=0
 while [ $# -gt 0 ]; do    # Until you run out of parameters...
     case "$1" in
@@ -19,29 +18,15 @@
             OEM_WORK_DIR="$2"
             shift
             ;;
-        --build)
-            BUILD_CPU=$2
-            shift
-            ;;
-        --config)
-            BUILD_CONFIG=$2
-            shift
-            ;;
         --ninja)
             USE_NINJA=1
             ;;
-        --have-system-xerces)
-            HAVE_SYSTEM_XERCES=1
-            ;;
         --help)
             echo "Usage: $0 (options)"
             echo "Options:"
             echo "  --cmake_build_dir [CMake build directory]"
             echo "  --oem_working_dir [installation directory]"
-            echo "  --build [32(default)|64]"
-            echo "  --config [Release(default)|Debug]"
             echo "  --ninja [Use ninja build system]"
-            echo "  --have-system-xerces [Use system-installed xerces]"
             echo "  --help [Display usage]"
             exit
             ;;
@@ -62,6 +47,14 @@
     fi
 }
 
+if [ ! -f $OEM_WORK_DIR/env_vars.sh ]; then
+    echo "ERROR: Could not find env_vars.sh in $OEM_WORK_DIR"
+    echo "       This file should exist if you ran cmake_bootstrap.sh with (--oem_working_dir $OEM_WORK_DIR)"
+    exit 1;
+fi
+
+source $OEM_WORK_DIR/env_vars.sh
+
 # Validate
 if test "$BUILD_CPU" != "32" -a "$BUILD_CPU" != "64"; then
     echo "--build must be 32 or 64"
@@ -72,6 +65,7 @@
     exit 1;
 fi
 
+echo "Install prefix is: $MG_INST_PREFIX"
 echo "Current source dir is: $SOURCE_DIR"
 echo "Building for: $BUILD_CPU-bit"
 echo "Building in: $BUILD_CONFIG"
@@ -82,158 +76,6 @@
 echo "Creating CMake build directory"
 mkdir -p $CMAKE_BUILD_DIR
 
-echo "Checking if OEM working dir exists"
-if [ ! -d $OEM_WORK_DIR ]; then
-    mkdir -p $OEM_WORK_DIR
-    echo "Created OEM working dir at: $OEM_WORK_DIR"
-fi
-
-echo "Checking if we need to build DBXML"
-# Basically perform the same checks as FindDbXml.cmake
-HAS_DBXML_HEADERS=0
-HAS_DBXML_LIB=0
-HAS_DBCXX_LIB=0
-HAS_XQILLA_LIB=0
-if [ -f "${OEM_WORK_DIR}/dbxml/install/include/dbxml/DbXml.hpp" ]; then
-    HAS_DBXML_HEADERS=1
-fi
-if [ -f "${OEM_WORK_DIR}/dbxml/install/lib/libdb_cxx.so" ]; then
-    HAS_DBCXX_LIB=1
-fi
-if [ -f "${OEM_WORK_DIR}/dbxml/install/lib/libdbxml.so" ]; then
-    HAS_DBXML_LIB=1
-fi
-if [ -f "${OEM_WORK_DIR}/dbxml/install/lib/libxqilla.so" ]; then
-    HAS_XQILLA_LIB=1
-fi
-echo "Has DBXML headers: $HAS_DBXML_HEADERS"
-echo "Has DB C++ Library: $HAS_DBCXX_LIB"
-echo "Has DBXML Library: $HAS_DBXML_LIB"
-echo "Has XQilla Library: $HAS_XQILLA_LIB"
-
-# (Re)build DBXML if any of the above is false
-if test $HAS_DBXML_HEADERS -eq 0 -o $HAS_DBCXX_LIB -eq 0 -o $HAS_DBXML_LIB -eq 0 -o $HAS_XQILLA_LIB -eq 0; then
-    echo "Re-building DBXML (${BUILD_CONFIG})"
-    cp -Rf Oem/dbxml ${OEM_WORK_DIR}/dbxml
-    cd ${OEM_WORK_DIR}/dbxml
-    if test $HAVE_SYSTEM_XERCES -eq 1; then
-        echo "Building DBXML with system-installed xerces. Please wait"
-        if test $BUILD_CONFIG == "Debug"; then
-            ./buildall.sh --enable-debug --with-xerces=/usr --have-system-xerces 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
-            check_build
-        else
-            ./buildall.sh --with-xerces=/usr --have-system-xerces 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
-            check_build
-        fi
-    else
-        echo "Building DBXML with internal copy of xerces. Please wait"
-        if test $BUILD_CONFIG == "Debug"; then
-            ./buildall.sh --enable-debug 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
-            check_build
-        else
-            ./buildall.sh 2>&1 | tee $OEM_WORK_DIR/dbxml_build.log
-            check_build
-        fi
-    fi
-fi
-
-PHP_VER=5.6.23
-HTTPD_VER=2.4.18
-TC_VER=1.2.41
-
-HTTPD_PORT=8008
-TOMCAT_PORT=8009
-
-MG_INSTALL_WEB_PREFIX=$MG_INST_PREFIX/webserverextensions
-
-LA_WORKDIR=${OEM_WORK_DIR}/LinuxApt
-HTTPD_FAKE_INSTALL=${OEM_WORK_DIR}/HttpdFakeInstall
-HTTPD_WORKDIR=${LA_WORKDIR}/httpd-${HTTPD_VER}
-PHP_WORKDIR=${LA_WORKDIR}/php-${PHP_VER}
-TC_WORKDIR=${LA_WORKDIR}/tomcat-connectors-${TC_VER}-src
-
-if [ ! -d ${LA_WORKDIR} ]; then
-    mkdir -p $LA_WORKDIR
-fi
-
-# BOGUS: We have to build httpd twice
-# Once to install to a fake location so that PHP and TC have a valid apxs tool when we configure them for building
-# Second to re-configure httpd to install to the real location
-REBUILD_HTTPD_FOR_REAL=0
-
-echo "Checking if we need to build httpd"
-HAS_HTTPD=0
-if [ -d ${HTTPD_WORKDIR} ]; then
-    HAS_HTTPD=1
-fi
-echo "Checking if we need to build php"
-HAS_PHP=0
-if [ -d ${PHP_WORKDIR} ]; then
-    HAS_PHP=1
-fi
-echo "Checking if we need to build tomcat connector"
-HAS_TOMCAT_CONNECTOR=0
-if [ -d ${TC_WORKDIR} ]; then
-    HAS_TOMCAT_CONNECTOR=1
-fi
-echo "Has HTTPD: ${HAS_HTTPD}"
-echo "Has PHP: ${HAS_PHP}"
-echo "Has Tomcat Connector: ${HAS_TOMCAT_CONNECTOR}"
-if test $HAS_HTTPD -eq 0; then
-    cd $SOURCE_DIR/Oem/LinuxApt
-    echo "Extracting HTTPD tarballs"
-    tar -jxf httpd-${HTTPD_VER}.tar.bz2 -C ${LA_WORKDIR}
-    tar -jxf httpd-${HTTPD_VER}-deps.tar.bz2 -C ${LA_WORKDIR}
-    cd ${HTTPD_WORKDIR}
-    echo "Configuring HTTPD (fake install)"
-    ./configure --prefix=${HTTPD_FAKE_INSTALL} --enable-mods-shared-all --with-included-apr --with-port=${HTTPD_PORT} 2>&1 | tee $OEM_WORK_DIR/configure_httpd_fake.log
-    check_build
-    echo "Building HTTPD. Please wait"
-    make 2>&1 | tee $OEM_WORK_DIR/make_httpd_fake.log
-    check_build
-    make install 2>&1 | tee $OEM_WORK_DIR/make_install_httpd_fake.log
-    check_build
-    REBUILD_HTTPD_FOR_REAL=1
-fi
-if test $HAS_PHP -eq 0; then
-    cd $SOURCE_DIR/Oem/LinuxApt
-    echo "Extracting PHP tarball"
-    tar -jxf php-${PHP_VER}.tar.bz2 -C ${LA_WORKDIR}
-    cd ${PHP_WORKDIR}
-    echo "Configuring PHP"
-    ./configure --prefix=${MG_INSTALL_WEB_PREFIX}/php --with-apxs2=${HTTPD_FAKE_INSTALL}/bin/apxs --with-openssl --with-curl --enable-xml --enable-wddx --enable-shared --with-zlib --enable-zip --enable-mbstring=all --with-xsl=/usr/lib --with-gd --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-freetype-dir=/usr/lib 2>&1 | tee $OEM_WORK_DIR/configure_php.log
-    check_build
-    echo "Building PHP. Please wait"
-    make 2>&1 | tee $OEM_WORK_DIR/make_php.log
-    check_build
-    REBUILD_HTTPD_FOR_REAL=1
-fi
-if test $HAS_TOMCAT_CONNECTOR -eq 0; then
-    cd $SOURCE_DIR/Oem/LinuxApt
-    echo "Extracting Tomcat Connector tarball"
-    tar -zxf tomcat-connectors-${TC_VER}-src.tar.gz -C ${LA_WORKDIR}
-    cd ${TC_WORKDIR}/native
-    echo "Configuring Tomcat Connector"
-    ./configure--with-apxs2=${HTTPD_FAKE_INSTALL}/bin/apxs 2>&1 | tee $OEM_WORK_DIR/configure_tc.log
-    check_build
-    echo "Building Tomcat Connector. Please wait"
-    make 2>&1 | tee $OEM_WORK_DIR/make_tc.log
-    check_build
-    REBUILD_HTTPD_FOR_REAL=1
-fi
-if test $REBUILD_HTTPD_FOR_REAL -eq 1; then
-    cd ${HTTPD_WORKDIR}
-    echo "Cleaning httpd"
-    make clean
-    check_build
-    echo "Configuring httpd (for real)"
-    ./configure --prefix=${MG_INSTALL_WEB_PREFIX}/apache2 --enable-mods-shared-all --with-included-apr --with-port=${HTTPD_PORT} 2>&1 | tee $OEM_WORK_DIR/configure_httpd_real.log
-    check_build
-    echo "Rebuilding httpd for real. Please wait"
-    make 2>&1 | tee $OEM_WORK_DIR/make_httpd_real.log
-    check_build
-fi
-
 # Now for the main event
 echo "Setting up CMake in: $CMAKE_BUILD_DIR"
 cd $CMAKE_BUILD_DIR



More information about the mapguide-commits mailing list