dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl ********************** Macro definitions:
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
[using namespace Outer::Inner; return i;],
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])
AC_DEFUN([AC_CXX_HAVE_STL],
[AC_CACHE_CHECK(whether the compiler supports Standard Template Library,
ac_cv_cxx_have_stl,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <list>
#include <deque>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[list<int> x; x.push_back(5);
list<int>::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;],
ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_stl" = yes; then
AC_DEFINE(HAVE_STL,,[define if the compiler supports Standard Template Library])
fi
])
dnl ********************** Processing starts here...
AC_INIT(Gto, 3.5.3)
dnl AC_PREREQ(2.57)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE()
AC_LANG(C++)
AC_PROG_INSTALL
AC_PROG_CXX
# Check for fink installed stuff
if test `uname` = Darwin ; then
CPPFLAGS="$CPPFLAGS -I/sw/include"
LDFLAGS="$LDFLAGS -L/sw/lib"
fi
SHARED_VERSION_INFO="3:5:1"
AC_DISABLE_SHARED()
AC_PROG_LIBTOOL()
dnl ********************** ./configure options ***********************
AC_ARG_WITH([maya-dir],
[AC_HELP_STRING([--with-maya-dir=DIR],
[Maya install location])],
[gto_maya_location=$withval])
AC_SUBST(gto_maya_location,$gto_maya_location)
AC_ARG_ENABLE([maya-plugin],
[AC_HELP_STRING([--enable-maya-plugin],
[Build GtoIO plugin for Maya (default=no)])],
[gto_build_maya=$enableval],
[gto_build_maya=no])
AM_CONDITIONAL(GTO_BUILD_MAYA, test "$gto_build_maya" = yes)
AC_ARG_WITH([rman-dir],
[AC_HELP_STRING([--with-rman-dir=DIR],
[Renderman® install location])],
[gto_rman_location=$withval])
AC_SUBST(gto_rman_location,$gto_rman_location)
AC_ARG_ENABLE([rman-plugin],
[AC_HELP_STRING([--enable-rman-plugin],
[Build RiGto plugin for RenderMan® (default=no)])],
[gto_build_rman=$enableval],
[gto_build_rman=no])
AM_CONDITIONAL(GTO_BUILD_RMAN, test "$gto_build_rman" = yes)
dnl ********************** Basic System Checks ***********************
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
AC_CHECK_HEADERS([float.h malloc.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_REPLACE_FNMATCH
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_CHECK_FUNCS([regcomp strtol])
AC_CHECK_LIB(z, gzopen, [AC_DEFINE(GTO_SUPPORT_ZIP) LIBS="$LIBS -lz"])
AC_CHECK_LIB(tiff, TIFFOpen, [gto_build_gtoimage=yes],[gto_build_gtoimage=no])
AM_CONDITIONAL(GTO_BUILD_GTOIMAGE, test "$gto_build_gtoimage" = yes)
AC_CXX_HAVE_STL
if test "$ac_cv_cxx_have_stl" = yes; then :; else
AC_MSG_ERROR(STL Support is required)
fi
AC_SUBST([CYCLE_OBJ])
if test `uname` = Linux; then
# Keeps maya includes from complaining about deprecated #pragmas
AC_DEFINE( LINUX )
fi
AC_MSG_CHECKING(for ios_base)
AC_TRY_COMPILE(
[
#include <iostream>
],
[
if(std::ios_base::cur);
],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_FULL_IOSTREAMS)],
[AC_MSG_RESULT(no)])
dnl ********************** Maya Checks ***********************
if test "$gto_build_maya" = yes; then
if test -e $gto_maya_location/include/maya/MGlobal.h ; then
AC_SUBST(DEVKIT_LOCATION,$gto_maya_location)
else
if test -e $gto_maya_location/../../devkit/include/maya/MGlobal.h ; then
AC_SUBST(DEVKIT_LOCATION,$gto_maya_location/../../devkit)
else
AC_MSG_ERROR("No valid installation of Maya was found.")
fi
fi
AC_MSG_RESULT([Using Maya Location: $gto_maya_location])
AC_SUBST(MAYA_LOCATION,$gto_maya_location)
else
AC_SUBST(DEVKIT_LOCATION,../config)
fi
dnl ********************** Renderman Checks ***********************
if test "$gto_build_rman" = yes; then
if test -e $gto_rman_location/include/ri.h; then
AC_MSG_RESULT([Using Renderman® Location: $gto_rman_location])
else
AC_MSG_ERROR("No valid installation of Renderman® was found.")
fi
fi
dnl ********************** Texi checks
AC_CHECK_PROG(HTMLGEN,texi2html,
[texi2html -split=chapter -subdir=html],
[$MAKEINFO --html --output=html])
dnl ********************** Output:
AC_CONFIG_FILES([Makefile
doc/Makefile
bin/Makefile
bin/gtoinfo/Makefile
bin/gtofilter/Makefile
bin/gtomerge/Makefile
bin/gto2obj/Makefile
bin/gtoimage/Makefile
bin/RiGtoRibOut/Makefile
lib/WFObj/Makefile
lib/Gto/Makefile
lib/Gto/test/Makefile
lib/GtoContainer/Makefile
lib/GtoContainer/test/Makefile
lib/RiGto/Makefile
lib/RiGtoStub/Makefile
lib/Makefile
plugins/Makefile
plugins/maya/Makefile
plugins/maya/GtoDeformer/Makefile
plugins/maya/gtoIO/Makefile
plugins/rman/Makefile
])
AC_OUTPUT
echo
echo "Configuration: "
if test "$gto_build_maya" = yes; then
echo " Maya Plugins: yes"
echo " Using Maya build config: $DEVKIT_LOCATION/plug-ins/buildconfig"
else
echo " Maya Plugins: no"
fi
if test "$gto_build_rman" = yes; then
echo " Renderman Plugins: yes"
else
echo " Renderman Plugins: no"
fi
echo