#------------------configure.in---------------------------------------- dnl Configure.in for MapGuide Open Source #---------------------------------------------------------------------- # Variables # Following are the makefile directories #---------------------------------------------------------------------- AC_INIT(mapguide,3.0.0,http://mapguide.osgeo.org) AC_CONFIG_SRCDIR(configure.in) AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE([1.9 tar-pax]) # Enable silent rules if supported. Allows for less verbose output while still displaying any compiler/linker warnings/errors m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_PREFIX_DEFAULT(/usr/local/mapguideopensource) AC_LANG_C AC_PROG_CC AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_LIBTOOL # Check for std headers AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h math.h netdb.h netinet/in.h sys/types.h sys/socket.h,,AC_MSG_ERROR([required header file missing])) AC_CHECK_FUNCS(gethostbyname socket htons connect shutdown,,AC_MSG_ERROR([required standard library function missing])) dnl ******************************************************* dnl CoordinateSystem Configuration dnl ******************************************************* map_using_proj4="no" map_unittesting_dir="UnitTesting" AC_MSG_NOTICE([Using Mentor CoordinateSystem]) AC_SUBST(map_coordsys_dir,"CoordinateSystem") AC_SUBST(map_coordsys_dir_path,"Common/CoordinateSystem") AC_SUBST(map_coordsys_include_path,"Common/CoordinateSystem") AC_SUBST(map_unittesting_dir) map_opt_oem_subdirs="CsMap" map_opt_oem_distsubdirs="" dnl ******************************************************* dnl Oem root configuration dnl ******************************************************* AC_ARG_WITH([oem], MAP_HELP_STRING([--with-oem], [specify root path of oem components [[default=no]]]), [with_oem=$withval], [with_oem=no]) if test $with_oem = "no"; then AC_MSG_WARN([--with-oem not specified. Assuming each required component is passed in the configure script. If anything goes wrong, it's probably because of this]) else AC_MSG_NOTICE([Using oem component root path of $with_oem. All component paths will be implicitly be based from this path unless overridden individually]) fi dnl ******************************************************* dnl ACE 6.2.6 Configuration dnl ******************************************************* AC_ARG_WITH([ace], MAP_HELP_STRING([--with-ace], [specify ACE source dir prefix as args [[default=no]]]), [with_ace=$withval], [with_ace=no]) if test $with_ace == "no"; then mg_oem_ace_src=$with_oem/ACE else mg_oem_ace_src=$with_ace fi AC_MSG_NOTICE([Using ACE source dir: $mg_oem_ace_src]) if test -d $mg_oem_ace_src; then AC_MSG_NOTICE([ACE source directory is: $mg_oem_ace_src]) else AC_MSG_ERROR([ACE source directory ($mg_oem_ace_src) does not exist]) fi AC_SUBST(mg_oem_ace_src) dnl ******************************************************* dnl DWF Toolkit 7.7 Configuration dnl ******************************************************* AC_ARG_WITH([dwftk], MAP_HELP_STRING([--with-dwftk], [specify DWF Toolkit source dir prefix as args [[default=no]]]), [with_dwftk=$withval], [with_dwftk=no]) if test $with_dwftk == "no"; then mg_oem_dwftk_src=$with_oem/DWFTK else mg_oem_dwftk_src=$with_dwftk fi AC_MSG_NOTICE([Using DWF Toolkit source dir: $mg_oem_dwftk_src]) if test -d $mg_oem_dwftk_src; then AC_MSG_NOTICE([DWF Toolkit source directory is: $mg_oem_dwftk_src]) else AC_MSG_ERROR([DWF Toolkit source directory ($mg_oem_dwftk_src) does not exist]) fi AC_SUBST(mg_oem_dwftk_src) dnl ******************************************************* dnl GEOS 3.4.2 configuration dnl ******************************************************* AC_ARG_WITH([geos], MAP_HELP_STRING([--with-geos], [specify GEOS source dir prefix as args [[default=no]]]), [with_geos=$withval], [with_geos=no]) if test $with_geos == "no"; then mg_oem_geos_src=$with_oem/geos else mg_oem_geos_src=$with_geos fi AC_MSG_NOTICE([Using GEOS source dir: $mg_oem_geos_src]) if test -d $mg_oem_geos_src; then AC_MSG_NOTICE([GEOS source directory is: $mg_oem_geos_src]) else AC_MSG_ERROR([GEOS source directory ($mg_oem_geos_src) does not exist]) fi AC_SUBST(mg_oem_geos_src) dnl ******************************************************* dnl SWIGEx configuration dnl ******************************************************* AC_ARG_WITH([swig], MAP_HELP_STRING([--with-swig], [specify SWIG source dir prefix as args [[default=no]]]), [with_swig=$withval], [with_swig=no]) if test $with_swig == "no"; then mg_oem_swig_src=$with_oem/SWIGEx else mg_oem_swig_src=$with_swig fi AC_MSG_NOTICE([Using SWIG source dir: $mg_oem_swig_src]) if test -d $mg_oem_swig_src; then AC_MSG_NOTICE([SWIG source directory is: $mg_oem_swig_src]) else AC_MSG_ERROR([SWIG source directory ($mg_oem_swig_src) does not exist]) fi AC_SUBST(mg_oem_swig_src) dnl ******************************************************* dnl DBXML configuration dnl ******************************************************* AC_ARG_WITH([dbxml], MAP_HELP_STRING([--with-dbxml], [specify DBXML source dir prefix as args [[default=no]]]), [with_dbxml=$withval], [with_dbxml=no]) if test $with_dbxml == "no"; then mg_oem_dbxml_src=$with_oem/dbxml else mg_oem_dbxml_src=$with_dbxml fi AC_MSG_NOTICE([Using DBXML source dir: $mg_oem_dbxml_src]) if test -d $mg_oem_dbxml_src; then AC_MSG_NOTICE([DBXML source directory is: $mg_oem_dbxml_src]) else AC_MSG_ERROR([DBXML source directory ($mg_oem_dbxml_src) does not exist]) fi AC_SUBST(mg_oem_dbxml_src) dnl ******************************************************* dnl CppUnit configuration dnl ******************************************************* AC_ARG_WITH([cppunit], MAP_HELP_STRING([--with-cppunit], [specify cppunit source dir prefix as args [[default=no]]]), [with_cppunit=$withval], [with_cppunit=no]) if test $with_cppunit == "no"; then mg_oem_cppunit_src=$with_oem/CppUnit-1.9.14 else mg_oem_cppunit_src=$with_cppunit fi AC_MSG_NOTICE([Using cppunit source dir: $mg_oem_cppunit_src]) if test -d $mg_oem_cppunit_src; then AC_MSG_NOTICE([cppunit source directory is: $mg_oem_cppunit_src]) else AC_MSG_ERROR([cppunit source directory ($mg_oem_cppunit_src) does not exist]) fi AC_SUBST(mg_oem_cppunit_src) dnl ******************************************************* dnl IMake configuration dnl ******************************************************* AC_ARG_WITH([imake], MAP_HELP_STRING([--with-imake], [specify imake source dir prefix as args [[default=no]]]), [with_imake=$withval], [with_imake=no]) if test $with_imake == "no"; then mg_oem_imake_src=$with_oem/WebTools/IMake else mg_oem_imake_src=$with_imake fi AC_MSG_NOTICE([Using imake source dir: $mg_oem_imake_src]) if test -d $mg_oem_imake_src; then AC_MSG_NOTICE([imake source directory is: $mg_oem_imake_src]) else AC_MSG_ERROR([imake source directory ($mg_oem_imake_src) does not exist]) fi AC_SUBST(mg_oem_imake_src) dnl ******************************************************* dnl ZLib configuration dnl ******************************************************* AC_ARG_WITH([zlib], MAP_HELP_STRING([--with-zlib], [specify zlib source dir prefix as args [[default=no]]]), [with_zlib=$withval], [with_zlib=no]) if test $with_zlib == "no"; then mg_oem_zlib_src=$with_oem/gd/zlib else mg_oem_zlib_src=$with_zlib fi AC_MSG_NOTICE([Using zlib source dir: $mg_oem_zlib_src]) if test -d $mg_oem_zlib_src; then AC_MSG_NOTICE([zlib source directory is: $mg_oem_zlib_src]) else AC_MSG_ERROR([zlib source directory ($mg_oem_zlib_src) does not exist]) fi AC_SUBST(mg_oem_zlib_src) dnl ******************************************************* dnl libpng configuration dnl ******************************************************* AC_ARG_WITH([libpng], MAP_HELP_STRING([--with-libpng], [specify libpng source dir prefix as args [[default=no]]]), [with_libpng=$withval], [with_libpng=no]) if test $with_libpng == "no"; then mg_oem_libpng_src=$with_oem/gd/lpng else mg_oem_libpng_src=$with_libpng fi AC_MSG_NOTICE([Using libpng source dir: $mg_oem_libpng_src]) if test -d $mg_oem_libpng_src; then AC_MSG_NOTICE([libpng source directory is: $mg_oem_libpng_src]) else AC_MSG_ERROR([libpng source directory ($mg_oem_libpng_src) does not exist]) fi AC_SUBST(mg_oem_libpng_src) dnl ******************************************************* dnl libjpeg configuration dnl ******************************************************* AC_ARG_WITH([libjpeg], MAP_HELP_STRING([--with-libjpeg], [specify libjpeg source dir prefix as args [[default=no]]]), [with_libjpeg=$withval], [with_libjpeg=no]) if test $with_libjpeg == "no"; then mg_oem_libjpeg_src=$with_oem/gd/jpeg else mg_oem_libjpeg_src=$with_libjpeg fi AC_MSG_NOTICE([Using libjpeg source dir: $mg_oem_libjpeg_src]) if test -d $mg_oem_libjpeg_src; then AC_MSG_NOTICE([libjpeg source directory is: $mg_oem_libjpeg_src]) else AC_MSG_ERROR([libjpeg source directory ($mg_oem_libjpeg_src) does not exist]) fi AC_SUBST(mg_oem_libjpeg_src) dnl ******************************************************* dnl freetype configuration dnl ******************************************************* AC_ARG_WITH([freetype], MAP_HELP_STRING([--with-freetype], [specify freetype source dir prefix as args [[default=no]]]), [with_freetype=$withval], [with_freetype=no]) if test $with_freetype == "no"; then mg_oem_freetype_src=$with_oem/gd/freetype else mg_oem_freetype_src=$with_freetype fi AC_MSG_NOTICE([Using freetype source dir: $mg_oem_freetype_src]) if test -d $mg_oem_freetype_src; then AC_MSG_NOTICE([freetype source directory is: $mg_oem_freetype_src]) else AC_MSG_ERROR([freetype source directory ($mg_oem_freetype_src) does not exist]) fi AC_SUBST(mg_oem_freetype_src) dnl ******************************************************* dnl gd configuration dnl ******************************************************* AC_ARG_WITH([gd], MAP_HELP_STRING([--with-gd], [specify gd source dir prefix as args [[default=no]]]), [with_gd=$withval], [with_gd=no]) if test $with_gd == "no"; then mg_oem_gd_src=$with_oem/gd/gd else mg_oem_gd_src=$with_gd fi AC_MSG_NOTICE([Using gd source dir: $mg_oem_gd_src]) if test -d $mg_oem_gd_src; then AC_MSG_NOTICE([gd source directory is: $mg_oem_gd_src]) else AC_MSG_ERROR([gd source directory ($mg_oem_gd_src) does not exist]) fi AC_SUBST(mg_oem_gd_src) dnl ******************************************************* dnl JSONCPP configuration dnl ******************************************************* AC_ARG_WITH([jsoncpp], MAP_HELP_STRING([--with-jsoncpp], [specify jsoncpp source dir prefix as args [[default=no]]]), [with_jsoncpp=$withval], [with_jsoncpp=no]) if test $with_jsoncpp == "no"; then mg_oem_jsoncpp_src=$with_oem/jsoncpp else mg_oem_jsoncpp_src=$with_jsoncpp fi AC_MSG_NOTICE([Using jsoncpp source dir: $mg_oem_jsoncpp_src]) if test -d $mg_oem_jsoncpp_src; then AC_MSG_NOTICE([jsoncpp source directory is: $mg_oem_jsoncpp_src]) else AC_MSG_ERROR([jsoncpp source directory ($mg_oem_jsoncpp_src) does not exist]) fi AC_SUBST(mg_oem_jsoncpp_src) dnl ******************************************************* dnl CS-Map configuration dnl ******************************************************* AC_ARG_WITH([csmap], MAP_HELP_STRING([--with-csmap], [specify csmap source dir prefix as args [[default=no]]]), [with_csmap=$withval], [with_csmap=no]) if test $with_csmap == "no"; then mg_oem_csmap_src=$with_oem/CsMap else mg_oem_csmap_src=$with_csmap fi AC_MSG_NOTICE([Using csmap source dir: $mg_oem_csmap_src]) if test -d $mg_oem_csmap_src; then AC_MSG_NOTICE([csmap source directory is: $mg_oem_csmap_src]) else AC_MSG_ERROR([csmap source directory ($mg_oem_csmap_src) does not exist]) fi AC_SUBST(mg_oem_csmap_src) dnl ******************************************************* dnl PHP 5.5.17 Configuration dnl ******************************************************* AC_ARG_WITH([php], MAP_HELP_STRING([--with-php], [specify php headers dir prefix as args [[default=no]]]), [with_php=$withval], [with_php=no]) if test $with_php = "no"; then AC_MSG_NOTICE([Using php 5.5.17 from included Oem Directory]) php_src=$with_oem/LinuxApt/php-5.5.17 else AC_MSG_NOTICE([Using custom PHP source directory]) php_src=$with_php fi if test -d $php_src; then AC_MSG_NOTICE([PHP source directory is: $php_src]) else AC_MSG_ERROR([PHP source directory ($php_src) does not exist]) fi AC_SUBST(php_src) dnl ******************************************************* dnl httpd 2.4.10 Configuration dnl ******************************************************* AC_ARG_WITH([httpd], MAP_HELP_STRING([--with-httpd], [specify httpd source dir prefix as args [[default=no]]]), [with_httpd=$withval], [with_httpd=no]) if test $with_httpd = "no"; then AC_MSG_NOTICE([Using httpd 2.4.10 from included Oem Directory]) httpd_src=$with_oem/LinuxApt/httpd-2.4.10 else AC_MSG_NOTICE([Using custom httpd source directory]) httpd_src=$with_httpd fi if test -d $http_src; then AC_MSG_NOTICE([httpd source directory is: $httpd_src]) else AC_MSG_ERROR([httpd source directory ($httpd_src) does not exist]) fi AC_SUBST(httpd_src) dnl ******************************************************* dnl FDO 4.0.0 Configuration dnl Include / lib paths dnl ******************************************************* # custom Fdo path specification AC_ARG_WITH([fdo-include], MAP_HELP_STRING([--with-fdo-include], [specifies custom dir for fdo include files [[default=DEFAULT]]]), [custom_inc=$withval], [custom_inc=DEFAULT]) if test $custom_inc = "DEFAULT"; then map_fdo_include="/usr/local/fdo-4.0.0/include" if test -d $map_fdo_include; then AC_MSG_NOTICE([Building with default location of FDO include files at /usr/local/fdo-4.0.0/include]) else AC_MSG_ERROR([the default FDO include path $map_fdo_include is not a valid directory. Please use the custom option]) fi else if test -d $custom_inc; then map_fdo_include="$custom_inc" AC_MSG_NOTICE([Building with custom location of FDO include dir at $map_fdo_include]) else AC_MSG_ERROR([the specified FDO include path $custom_inc is not a valid directory]) fi fi AC_ARG_WITH([fdo-lib], MAP_HELP_STRING([--with-fdo-lib], [specifies custom path for fdo libraries [[default=DEFAULT]]]), [custom_lib=$withval], [custom_lib=DEFAULT]) if test $custom_lib = "DEFAULT"; then map_fdo_lib="/usr/local/fdo-4.0.0/lib" if test -d $map_fdo_lib; then AC_MSG_NOTICE([Building with default location of FDO libraries at /usr/local/fdo-4.0.0/lib]) else AC_MSG_ERROR([the default FDO lib path $map_fdo_lib is not a valid directory. Please use the custom option]) fi else if test -d $custom_lib; then map_fdo_lib="$custom_lib" AC_MSG_NOTICE([Building with custom location of FDO libraries at $custom_lib]) else AC_MSG_ERROR([the specified FDO library path $custom_lib is not a valid directory]) fi fi map_fdo_nls="/usr/local/fdo-4.0.0/nls/%N" AC_SUBST(map_fdo_include) AC_SUBST(map_fdo_lib) AC_SUBST(map_fdo_nls) dnl ******************************************************* dnl GCC Compiler Configuration dnl ******************************************************* # Compiler version checking AC_MSG_NOTICE([Checking GCC Version]) gcc --version > gccver.txt sed -e '/^gcc version 3.2/ p' gccver.txt > gcc32.txt # Check for Debug or Release build settings AC_ARG_ENABLE([optimized], MAP_HELP_STRING([--enable-optimized], [enable optimized build [[default=no]]]), [enable_optimized=$enableval], [enable_optimized=no]) AC_ARG_ENABLE([64bit], MAP_HELP_STRING([--enable-64bit], [enable 64-bit build [[default=no]]]), [enable_64bit=$enableval], [enable_64bit=no]) if test $enable_optimized = no; then AC_MSG_NOTICE([Using debug configuration]) if test $enable_64bit = no; then AC_MSG_NOTICE([Using 32-bit CXXFLAGS]) CXXFLAGS="-g -D_DEBUG -m32" AC_SUBST(CXXFLAGS, ["-g -D_DEBUG -m32"]) else #TODO: Review. i686 is not a valid march/mtune value for 64-bit compilation #TODO: Sticking -fPIC globally is probably a bit of a thermonuclear solution, but we # *absolutely* must be sure this flag is used when compiling static libraries AC_MSG_NOTICE([Using 64-bit CXXFLAGS]) CXXFLAGS="-g -D_DEBUG -m64 -fPIC" AC_SUBST(CXXFLAGS, ["-g -D_DEBUG -m64 -fPIC"]) fi else AC_MSG_NOTICE([Using optimized configuration]) if test $enable_64bit = no; then AC_MSG_NOTICE([Using 32-bit CXXFLAGS]) CXXFLAGS="-O2 -g -pipe -m32 -march=i686 -mtune=i686 -fno-use-cxa-atexit -fexceptions" AC_SUBST(CXXFLAGS, ["-O2 -g -pipe -m32 -march=i686 -mtune=i686 -fno-use-cxa-atexit -fexceptions -Wno-write-strings"]) else #TODO: Review. i686 is not a valid march/mtune value for 64-bit compilation #TODO: Sticking -fPIC globally is probably a bit of a thermonuclear solution, but we # *absolutely* must be sure this flag is used when compiling static libraries AC_MSG_NOTICE([Using 64-bit CXXFLAGS]) CXXFLAGS="-O2 -g -pipe -m64 -fPIC -fno-use-cxa-atexit -fexceptions" AC_SUBST(CXXFLAGS, ["-O2 -g -pipe -m64 -fPIC -fno-use-cxa-atexit -fexceptions -Wno-write-strings"]) fi fi dnl ******************************************************* dnl Server / WebTier Toggle dnl ******************************************************* # Setup Subdirs AC_MSG_NOTICE([Building Common Libraries]) map_toplevel_subdirs="Oem Common" AC_ARG_ENABLE([server], MAP_HELP_STRING([--enable-server], [enable server build [[default=yes]]]), [enable_server=$enableval], [enable_server=yes]) if test $enable_server = yes; then AC_MSG_NOTICE([Building Server]) map_toplevel_subdirs="$map_toplevel_subdirs Server" else AC_MSG_NOTICE([Ignoring Server]) fi AC_ARG_ENABLE([webtier], MAP_HELP_STRING([--enable-webtier], [enable webtier build [[default=yes]]]), [enable_webtier=$enableval], [enable_webtier=yes]) if test $enable_webtier = yes; then AC_MSG_NOTICE([Building Web Tier]) map_toplevel_subdirs="$map_toplevel_subdirs Web" else AC_MSG_NOTICE([Ignoring Web Tier]) fi AC_SUBST(map_toplevel_subdirs) dnl ******************************************************* dnl Cleanup and Output Makefiles dnl ******************************************************* rm gccver.txt rm gcc32.txt map_srcdir=`(cd $srcdir && pwd)` AC_SUBST(map_srcdir) # All Makefile.am in the entire structure that need to be generated. # TODO: move them all to the macro file. AC_CONFIG_FILES(Makefile) # MAP_CONFIG_FILES_OEM AC_CONFIG_FILES([Oem/Makefile]) # MAP_CONFIG_FILES_COMMON AC_CONFIG_FILES([Common/Makefile \ Common/MdfModel/Makefile \ Common/MdfParser/Makefile \ Common/Security/Makefile \ Common/Foundation/Makefile \ Common/Geometry/Makefile \ Common/PlatformBase/Makefile \ Common/MapGuideCommon/Makefile \ Common/Stylization/Makefile \ Common/Renderers/Makefile]) # MAP_CONFIG_FILES_SERVER AC_CONFIG_FILES([Server/Makefile \ Server/src/Makefile \ Server/src/Gws/Makefile \ Server/src/Gws/GwsResource/Makefile \ Server/src/Gws/GwsCommon/Makefile \ Server/src/Gws/GwsQueryEngine/Makefile \ Server/src/Common/Makefile \ Server/src/Common/Base/Makefile \ Server/src/Common/Cache/Makefile \ Server/src/Common/Manager/Makefile \ Server/src/Common/Thread/Makefile \ Server/src/Services/Makefile \ Server/src/Services/Feature/Makefile \ Server/src/Services/Kml/Makefile \ Server/src/Services/Mapping/Makefile \ Server/src/Services/Resource/Makefile \ Server/src/Services/Site/Makefile \ Server/src/Services/Drawing/Makefile \ Server/src/Services/Profiling/Makefile \ Server/src/Services/Rendering/Makefile \ Server/src/Services/ServerAdmin/Makefile \ Server/src/Services/Tile/Makefile \ Server/src/Core/Makefile]) AC_CONFIG_FILES([Server/src/UnitTesting/Makefile]) # MAP_CONFIG_FILES_WEBTIER AC_CONFIG_FILES([Web/Makefile \ Web/src/Makefile \ Web/src/WebApp/Makefile \ Web/src/WebSupport/Makefile \ Web/src/JavaApi/Makefile \ Web/src/JavaApiEx/Makefile \ Web/src/PhpApi/Makefile \ Web/src/HttpHandler/Makefile \ Web/src/CgiAgent/Makefile \ Web/src/ApacheAgent/Makefile]) AC_OUTPUT