www.pudn.com > nurbs++3_0_10.zip > configure.in


dnl Process this file with autoconf to produce a configure script.
AC_INIT(matrix/matrix.cc)

AC_CANONICAL_SYSTEM

AM_INIT_AUTOMAKE(nurbs++,3.0.10)

dnl
dnl  the prefix stuff
dnl

has_prefix=no

if test "$prefix" != NONE; then
  has_prefix=yes 
else
 prefix="/usr/local"
fi

PLIB_INSIDE_MINDSEYE

AM_PROG_LIBTOOL

AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL

AM_CONFIG_HEADER(include/plib_config.hh)


dnl the user can use --enable-shared to enable this
dnl AM_DISABLE_SHARED

AC_PROG_MAKE_SET



dnl 
dnl Adding exception handling support
dnl 
AC_ARG_ENABLE(exception,[  --enable-exception          use exception handling instead of the Error class [default=yes]],
if test "$enable_exception" != no; then
AC_DEFINE(USE_EXCEPTION)
fi,AC_DEFINE(USE_EXCEPTION))

dnl 
dnl Adding exception handling support
dnl 
AC_ARG_ENABLE(verbose_exception,[  --enable-verbose-exception          will print an error message when an exception is thrown [default=no]],
if test "$enable_verbose_exception" != no; then
AC_DEFINE(USE_EXCEPTION)
AC_DEFINE(VERBOSE_EXCEPTION)
fi)

dnl
dnl Adding debug information support
dnl

AC_ARG_ENABLE(debug,[  --enable-debug          adds range checking and other debugging information  
                          to the library [default=yes]],
if test "$enable_debug" != no; then
AC_DEFINE(DEBUG_PLIB)
fi,AC_DEFINE(DEBUG_PLIB))

dnl 
dnl Create a library or not ? 
dnl

include_source=no

AC_ARG_ENABLE(library,[ --enable-library       it generates explicitely instantiate the templates.
                          This creates a library. If disabled, it will
                          include the source files with the header files
                          and the compiler will instantiate the templates
                          as it needs them [default=yes]],
if test "$enable_library" != no; then
include_source=no
else
include_source=yes
fi,include_source=no)

dnl
dnl Setting the flags for different compilers to the proper settings
dnl

dnl clean_list="" 

if test "$CXX" = CC; then
case "$target_os" in 
solaris*) 
    CXXFLAGS=$CXXFLAGS" -pta"
    complex_lib="-lcomplex"
    clean_list="-r Templates.DB"
;;
irix*) 
    CXXFLAGS=$CXXFLAGS" -pta -n32 -64"
    complex_lib="-lcomplex"
    clean_list="-r Templates.DB ii_files"
;;
esac
else
if test "$GXX" = yes; then
 if test "$include_source" = yes; then
 AC_DEFINE(INCLUDE_TEMPLATE_SOURCE)
 CXXFLAGS=$CXXFLAGS" -frepo"
 else
 AC_DEFINE(NO_IMPLICIT_TEMPLATES)
 CXXFLAGS=$CXXFLAGS" -fno-implicit-templates"
 fi
 case "$target_os" in
 solaris*)
    AC_DEFINE(USING_GNU_SOLARIS)
 ;;
 linux*)
    AC_DEFINE(USING_LINUX)
 ;;
 alpha*)
    AC_DEFINE(USING_GNU_DECALPHA)
 ;; 
 esac   
fi
fi

dnl 
dnl Optional library support
dnl

option_libs=
option_include=


dnl
dnl Adding Image Magick support
dnl

has_magick=no
magick_include=" "
magick_lib=" "

AC_ARG_WITH(magick,[  --with-magick[=/magickdir]     
                          supports a limited set of the Image Magick library 
                          functionnality with the IM_ImageT class [default=no]],
if test "$with_magick" = no; then
	has_magick=no
else
	has_magick=yes
	if test "$with_magick" != yes; then
	magick_include="-I"$with_magick"/include"
	magick_lib="-L"$with_magick"/lib"
	fi
fi)

AC_ARG_WITH(magick-include,[  --with-magick-include=include_flag          
                          Specifies the include flag for the Magick Library
                          [default=-I/magickdir/include]],
if test "$with_magick_include" = no; then
	has_magick=no
else
	has_magick=yes
	magick_include=$with_magick_include
fi)

AC_ARG_WITH(magick-lib,[  --with-magick-lib=library_flag           
                          specifies the magick library flag 
                          [default=-L/magickdir/lib]],
if test "$with_magick_lib" = no; then
	has_magick=no
else
	has_magick=yes
	magick_lib=$with_magick_lib
fi)

dnl magick_libs="-lXt -lX11 -lXext -lmfhdf -ldf -lXpm -ltiff -ldpstk -ldps -ljbig -lMagick -lpng -ljpeg -lz -lmpeg -lttf "
magick_libs="-lmfhdf -ldf -lXpm -ltiff -ldpstk -ldps -ljbig -lMagick -lpng -ljpeg -lz -lmpeg -lttf "

AC_ARG_WITH(magick-libs,[  --with-magick-libs=library_flag           
                          specifies which Image Magick library should be 
                          included [default=-lXt -lX11 -lXext -lmfhdf -ldf -lXpm
                           -ltiff -lz -ldpstk -ldps -ljbig
                           -lMagick -lpng -ljpeg -lmpeg ]],
if test "$with_magick_libs" != no; then
	has_magick=yes
	magick_libs=$with_magick_libs
fi)

if test "$has_magick" = yes; then
AC_DEFINE(WITH_IMAGE_MAGICK)
option_libs=" $(MAGICK_LIB) $(MAGICK_LIBS)"
option_include="$(MAGICK_INCLUDE)"
else
magick_libs=" "
fi

dnl
dnl setting the order to be column order
dnl

user_defined_column_order=no

AC_ARG_ENABLE(column-order,[  --enable-column-order         defines if the matrices are in row or column ordering [default=no]],
if test "$enable_column-order" != no; then 
AC_DEFINE(COLUMN_ORDER)
user_defined_column_order=yes
fi)

dnl
dnl Adding OpenGL support
dnl

AC_PATH_GL

if test "$use_opengl" = yes; then
AC_DEFINE(WITH_OPENGL)
AC_DEFINE(COLUMN_ORDER)
option_libs=$option_libs' $(OPENGL_LIBS)'
option_include=$option_include' $(GL_CFLAGS)'
fi

AC_ARG_WITH(sunopengl,[  --with-sunopengl                Sun's version of OpenGL has some particularities...],
if test "$with_sunopengl" != no; then
CXXFLAGS=$CXXFLAGS" -DSUNOPENGL"
fi)

dnl 
dnl adjusting the option information
dnl

if test "$option_libs" != ''; then
echo 'option is defined'
option_libs='$(XLIBS)'$option_libs
option_include=$option_include' $(XINCLUDE)'
fi


dnl
dnl checking for the ways of your C++ compiler...
dnl

dnl first it must have namespaces...

CXX_MUST_HAVE_NAMESPACE
CXX_HAVE_TEMPLATE_OF_TEMPLATE
CXX_HAVE_ISO_FRIEND_DECL

AC_LANG_SAVE
AC_LANG_CPLUSPLUS

complex_header="complex.h"
use_iso_complex=no
AC_MSG_CHECKING(if the compiler can see complex instead of complex.h)
AC_TRY_COMPILE([#include ],[return 1; ],
	[use_iso_complex=yes ; ])

if test "$use_iso_complex" = yes; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
dnl echo "\nI am sorry. This library requires an ISO C++ compiler. The reason is"
dnl echo "the difference between the new standards and old implementations"
dnl echo "are big enough to become a maintenance problem. Even more so, when"
dnl echo "you take into account that an ISO C++ compiler should be available"
dnl echo "very soon now (tm) by your vendor. Or you can use a GNU alternative"
dnl echo "such as EGCS or GCC."
dnl exit 1
echo 
echo "The ISO C++ standard requires the presence of ."
echo "Your system doesn't seem to have it, you might not be able to"
echo "use NURBS++. Cross your fingers."
fi


AC_LANG_RESTORE


dnl The matrix libs and includes

packagedir=`pwd`

matrix_include='-I$(top_srcdir)/matrix -I$(top_srcdir)/image -I$(top_srcdir)/numerical'
matrix_lib_flag='-L$(packagedir)/matrix -L$(packagedir)/image -L$(packagedir)/numerical'
matrix_lib='$(packagedir)/numerical/libmatrixN.la $(packagedir)/image/libmatrixI.la $(packagedir)/matrix/libmatrix.la '

dnl the NURBS libs and includes

dnl
dnl creating a double floating point library
dnl

AC_ARG_ENABLE(float,[  --enable-float         creates a single floating point library [default=yes]],
if test "$enable_float" != no; then 
build_float=yes
else
build_float=no
fi,build_float=yes)

AC_ARG_ENABLE(double,[  --enable-double         creates a double floating point library [default=yes]],
if test "$enable_double" != no; then 
build_double=yes
else
build_double=no
fi,build_double=yes)


dnl setting the libraries to build

if test "$inside_mindseye" = yes; then
 build_float=yes
 build_double=no
fi

AC_MSG_CHECKING(if building a float NURBS library)
if test "$build_float" = yes; then
build_lib="libnurbsf.la"
AM_CONDITIONAL(BUILD_FLOAT_DOUBLE,test $build_double = yes)
AM_CONDITIONAL(BUILD_FLOAT,test "$build_double" = no)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING(if building a double NURBS library)
if test "$build_double" = yes; then
build_lib=$build_lib" libnurbsd.la"
AM_CONDITIONAL(BUILD_DOUBLE,test "$build_float" = no)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi


nurbs_include='-I$(top_srcdir)/nurbs'
nurbs_libf='$(packagedir)/nurbs/libnurbsf.la'
nurbs_libd='$(packagedir)/nurbs/libnurbsd.la'
nurbs_lib="$nurbs_libf $nurbs_libd"

dnl
dnl Making the changes in the proper files
dnl

AC_DEFINE(PACKAGE)
AC_DEFINE(VERSION)
AC_SUBST(VERSION)

AC_SUBST(packagedir)
AC_SUBST(nurbs_libf) 
AC_SUBST(nurbs_libd) 
AC_SUBST(libld)
AC_SUBST(libld_options)
AC_SUBST(libcxx_flags)
AC_SUBST(magick_include)
AC_SUBST(magick_lib)
AC_SUBST(magick_libs)
AC_SUBST(complex_lib)
AC_SUBST(matrix_lib)
AC_SUBST(matrix_lib_flag)
AC_SUBST(ar)
AC_SUBST(clean_list)
AC_SUBST(complex_header)
AC_SUBST(matrix_include)
AC_SUBST(nurbs_libs)
AC_SUBST(nurbs_include)
AC_SUBST(nurbs_lib)
AC_SUBST(nurbs_demo_lib)
AC_SUBST(libs_inc)
AC_SUBST(option_libs)
AC_SUBST(option_include)

PL_PROG_PERL
dnl PL_PROG_SHELL

AC_OUTPUT(Makefile Doxyfile include/Makefile matrix/Makefile numerical/Makefile image/Makefile nurbs/Makefile examples/Makefile examples/matrix/Makefile examples/image/Makefile examples/numerical/Makefile examples/nurbs/Makefile  )

echo
echo 'The package has now been configured. Type '
echo '	make '
echo '	make install'
echo 
echo 'To generate and install the NURBS++ package.'
echo
echo 'The library will be installed in ' $libdir
echo 'The header files will be installed in '$includedir'/nurbs++'
echo 
echo