summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/configure.ac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-16 00:19:13 +0000
committerKarl Berry <karl@freefriends.org>2009-05-16 00:19:13 +0000
commitbab45528d65eaafe68a705dbb2a57075c7b7cbd8 (patch)
tree10b4ae2b5195c8dede153ab89359ec00f55f325f /Build/source/utils/asymptote/configure.ac
parent8643d90372e9c31e0f461c15c596b60a545bd7d3 (diff)
asymptote 1.72 sources (not integrated into build yet)
git-svn-id: svn://tug.org/texlive/trunk@13110 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/configure.ac')
-rw-r--r--Build/source/utils/asymptote/configure.ac297
1 files changed, 297 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/configure.ac b/Build/source/utils/asymptote/configure.ac
new file mode 100644
index 00000000000..b2974bd984f
--- /dev/null
+++ b/Build/source/utils/asymptote/configure.ac
@@ -0,0 +1,297 @@
+# -*- Autoconf -*-
+# Run autoheader and autoconf to produce a header and configure script from
+# this file.
+
+AC_PREREQ(2)
+AC_INIT([Asymptote],[1.72],[http://sourceforge.net/projects/asymptote])
+VERSION=$PACKAGE_VERSION
+AC_SUBST(VERSION)
+
+test "$CFLAGS" || CFLAGS="-g -O3"
+
+AC_C_BIGENDIAN(AC_DEFINE(WORDS_BIG_ENDIAN, 1,
+ [Define if words are stored with the most significant byte first.]),AC_DEFINE(WORDS_LITTLE_ENDIAN, 1 ,
+ [Define if words are stored with the least significant byte first.]))
+
+test "$prefix" = NONE && prefix=/usr/local
+Datadir=$datadir
+test "$Datadir" = '${datarootdir}' && Datadir=$datarootdir
+test "$Datadir" = '${prefix}/share' && Datadir=$prefix/share
+AC_SUBST(Datadir)
+
+AC_ARG_WITH(latex,
+ [ --with-latex=PATH specify path to LaTeX installation ],
+ [if test "x$withval" != "x" ; then
+ latexdir=$withval
+ fi
+ ],[
+AC_CHECK_PROG(kpsewhich,kpsewhich,true)
+if test "x$kpsewhich" = "xtrue"; then
+ latexdir=`kpsewhich -expand-var='$TEXMFLOCAL'/tex/latex`
+else
+ latexdir=$prefix/share/texmf/tex/latex
+ AC_CHECK_FILE($latexdir/base/latex.ltx,,
+ [latexdir=/usr/share/texmf/tex/latex
+ AC_CHECK_FILE($latexdir/base/latex.ltx,,)])
+fi
+])
+
+AC_CHECK_PROGS(TEXI2DVI,[texi2dvi texi2dvi4a2ps])
+AC_SUBST(TEXI2DVI)
+
+latexdir=$latexdir/asymptote
+
+AC_MSG_NOTICE([Using $latexdir for LaTeX style file])
+
+AC_SUBST(latexdir)
+
+docdir=$Datadir/doc/asymptote
+
+AC_ARG_WITH(docdir,
+ [ --with-docdir=PATH alternate documentation installation directory],
+ [if test "x$withval" != "x" ; then
+ docdir=$withval
+ fi
+ ])
+AC_SUBST(docdir)
+
+sysdir=$Datadir/asymptote
+
+AC_ARG_ENABLE(tetex-build,
+[ --enable-tetex-build automatically determine settings.sysdir from kpsewhich],
+[ if test "x$enableval" = "xyes" ; then
+ sysdir=""
+ fi
+])
+
+AC_DEFINE_UNQUOTED(ASYMPTOTE_SYSDIR,"$sysdir",
+ [System directory for global .asy files])
+AC_DEFINE_UNQUOTED(ASYMPTOTE_DOCDIR,"$docdir",
+ [Directory for documentation])
+
+AC_CONFIG_SRCDIR([absyn.cc])
+
+AC_LANG([C++])
+
+# Checks for programs.
+AC_PROG_LEX
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_CC
+AC_PROG_MAKE_SET
+AC_PROG_YACC
+
+if test "$GXX" = yes ; then
+ ac_gcc_version=`echo __GNUC__ | $CC -E - | grep -v ^\#`
+ if test "$ac_gcc_version" -lt 4; then
+ CFLAGS=$CFLAGS" -finline-limit=400"
+ fi
+fi
+
+AC_CHECK_HEADER(fftw3.h,
+ AC_CHECK_LIB([fftw3], fftw_execute,,
+ AC_MSG_NOTICE([*** Could not find libfftw3: will compile without optional fast Fourier transforms. ***])),
+ AC_MSG_NOTICE([*** Header file fftw3.h not found: will compile without optional fast Fourier transforms. ***]))
+
+GCVERSION=gc-7.1
+
+AC_CHECK_FILE($GCVERSION.tar.gz,
+ac_cv_use_gc=$GCVERSION,
+[GC_SYSTEM="$GCVERSION.tar.gz not found: using system Boehm garbage collector"
+ac_cv_use_gc="system"])
+AC_ARG_ENABLE(gc,
+ [ --enable-gc[[=system]] enable system Boehm garbage collector]
+ [ [[=VERSION]] enable local VERSION of Boehm garbage collector]
+ [ [[=PREFIX]] use Boehm garbage collector installed in PREFIX],
+ [
+ if test "x$enableval" != "xyes"; then
+ ac_cv_use_gc=$enableval
+ GC_SYSTEM=""
+ fi
+ ])
+
+OPTIONS="-D_FILE_OFFSET_BITS=64 "
+GCLIB=
+GCPPLIB=
+GCNAME="Boehm Garbage Collector"
+GCOPTIONS=""
+if test "x$ac_cv_use_gc" != "xno" ; then
+ OPTIONS=$OPTIONS"-DUSEGC "
+ case $ac_cv_use_gc in
+ system|*[[\\/]]*)
+ if test "x$ac_cv_use_gc" = "xsystem" ; then
+ INCL="-I$prefix/include/gc -I/usr/include/gc"
+ LIBS=$LIBS"-L$prefix/lib "
+ else
+ INCL="-I$ac_cv_use_gc/include/gc"
+ LIBS=$LIBS"-L$ac_cv_use_gc/lib "
+ fi
+ CPPFLAGS_SAVE=$CPPFLAGS
+ CPPFLAGS=$CPPFLAGS" $INCL"
+ AC_CHECK_HEADER(gc.h,
+ AC_CHECK_LIB([gc],[GC_malloc],[
+ LIBS=$LIBS"-lgc "
+ AC_MSG_NOTICE([enabling system $GCNAME])],[
+ GCDIR=$GCVERSION
+ GCLIB="\$(GC)/.libs/libgc.a"
+ AC_MSG_NOTICE($GCNAME library not found)]),
+ GCDIR=$GCVERSION
+ INCL="-I\$(GC)/include"
+ AC_MSG_NOTICE($GCNAME header file not found))
+ CPPFLAGS=$CPPFLAGS_SAVE
+ ;;
+ *)
+ GCDIR=$ac_cv_use_gc
+ GCOPTIONS="--disable-shared "
+ AC_MSG_NOTICE([enabling local $GCNAME $GCDIR])
+ GCLIB="\$(GC)/.libs/libgc.a"
+ INCL="-I\$(GC)/include"
+ ;;
+ esac
+else
+ AC_MSG_NOTICE([disabling the $GCNAME])
+fi
+
+AC_ARG_ENABLE(gc-debug,
+[ --enable-gc-debug enable (slow) garbage collector debugging],
+[ if test "x$ac_cv_use_gc" != "xno" ; then
+ if test "x$enableval" = "xyes" ; then
+ OPTIONS=$OPTIONS"-DGC_DEBUG "
+ AC_MSG_NOTICE([*** Enabling GC debugging: remember to make clean ***])
+ AC_MSG_NOTICE([*** Set the environment variable GC_FIND_LEAK at runtime ***])
+ fi
+ fi
+])
+
+AC_ARG_ENABLE(gc-full-debug,
+[ --enable-gc-full-debug enable (very slow) garbage collector backtrace],
+[ if test "x$ac_cv_use_gc" != "xno" ; then
+ if test "x$enableval" = "xyes" ; then
+ OPTIONS=$OPTIONS"-DGC_DEBUG -DGC_BACKTRACE "
+ GCOPTIONS=$GCOPTIONS"--enable-gc-debug "
+ AC_MSG_NOTICE([*** Enabling GC backtrace debugging; remember to make gc-clean ***])
+ fi
+ fi
+])
+
+AC_CHECK_FUNC(getopt_long_only, AC_DEFINE(HAVE_GNU_GETOPT_H, 1,
+ [Define if getopt.h is the GNU version]),
+ getopt="getopt getopt1",)
+AC_CHECK_HEADER(tr1/unordered_map,,
+ [AC_CHECK_HEADER(ext/hash_map,,OPTIONS=$OPTIONS"-DNOHASH ")])
+
+AC_SUBST(getopt)
+AC_SUBST(GCDIR)
+AC_SUBST(GCOPTIONS)
+AC_SUBST(GCLIB)
+AC_SUBST(GCPPLIB)
+AC_SUBST(INCL)
+AC_SUBST(OPTIONS)
+
+# Checks for libraries.
+AC_CHECK_LIB([ncurses], [setupterm], [AC_DEFINE(HAVE_LIBCURSES)
+ LIBS=$LIBS"-lncurses "],
+ AC_CHECK_LIB([curses], [setupterm]))
+AC_CHECK_LIB([m], [sqrt])
+AC_CHECK_LIB([z], [deflate])
+AC_CHECK_LIB([pthread], [pthread_create])
+AC_CHECK_LIB([sigsegv], [stackoverflow_install_handler])
+
+AC_CHECK_LIB([readline], [rl_completion_matches],,
+AC_MSG_NOTICE(*** Could not find GNU readline 4.2 or later: will compile without readline support ***))
+
+# Checks for header files.
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([fenv.h stddef.h libintl.h])
+AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h], [break])
+AC_CHECK_HEADERS(fpu_control.h)
+
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include "xstream.h"]),
+ [AC_SEARCH_LIBS([xdrstdio_create],[nsl rpc])
+ AC_DEFINE(HAVE_RPC_RPC_H, 1,
+ [Define if you have a working <rpc/rpc.h> header file])],
+ AC_MSG_WARN([*** Broken rpc headers; XDR support disabled ***]))
+
+AC_CHECK_HEADER(gsl/gsl_sf.h,
+ AC_CHECK_LIB([gsl], gsl_sf_Si, [AC_DEFINE(HAVE_LIBGSL, 1,
+ [Define to 1 if you have the 'gsl' library (-lgsl). ]) LIBS=$LIBS"-lgsl -lgslcblas "],
+ AC_MSG_NOTICE([*** Could not find libgsl: will compile without optional special functions. ***]),[-lgslcblas]),
+ AC_MSG_NOTICE([*** Header file gsl_sf.h not found: will compile without optional special functions. ***]))
+
+case "$OSTYPE" in
+ cygwin) AC_CHECK_HEADER(GL/glut.h,
+ [AC_DEFINE(HAVE_LIBGLUT, 1,
+ [Define if you have the `freeglut' library (-lfreeglut).])
+ LIBS=$LIBS"-lfreeglut -lopengl32 "],
+ AC_MSG_NOTICE([*** Could not find freeglut: will compile without OpenGL support ***]))
+ AC_CHECK_LIB([GLU], [gluNewNurbsRenderer],[AC_DEFINE(HAVE_LIBGLU, 1,
+ [Define to 1 if you have the 'glu32' library (-lglu32). ]) LIBS=$LIBS"-lglu32 "],
+ AC_MSG_NOTICE([*** Could not find libglu32: will compile without OpenGL support ***]))
+ ;;
+ darwin*) AC_CHECK_HEADER(GLUT/glut.h,
+ [AC_DEFINE(HAVE_LIBGLUT, 1,
+ [Define if you have the `glut' library (-lglut).])
+ AC_DEFINE(HAVE_LIBGLU, 1,
+ [Define to 1 if you have the 'GLU' library. ])
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#ifndef GLU_TESS_CALLBACK_TRIPLEDOT
+typedef GLvoid (* _GLUfuncptr)(...);
+void f(void) {
+ gluNurbsCallback(gluNewNurbsRenderer(),GLU_NURBS_BEGIN,(_GLUfuncptr) glBegin);
+}
+#endif
+]),[AC_DEFINE(GLU_TESS_CALLBACK_TRIPLEDOT, 1, [Define if gluNurbsCallback expects a variadic function.])])
+ LIBS=$LIBS"-framework GLUT -framework OpenGL -framework Cocoa"],
+ AC_MSG_NOTICE([*** Could not find glut: will compile without OpenGL support ***]))
+ ;;
+ *) AC_CHECK_LIB([glut], [glutMainLoop],,
+ AC_MSG_NOTICE([*** Could not find libglut: will compile without OpenGL support ***]))
+ AC_CHECK_LIB([GLU], [gluNewNurbsRenderer],,
+ AC_MSG_NOTICE([*** Could not find libGLU: will compile without OpenGL support ***]))
+esac
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_CHECK_TYPES([ptrdiff_t])
+AC_CHECK_TYPES([long long])
+AC_CHECK_TYPES([long])
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIGNAL
+
+AC_DEFUN(AC_FUNC_STRPTIME, [
+ AC_CHECK_FUNCS(strptime)
+ AC_MSG_CHECKING(for strptime declaration in time.h)
+ AC_EGREP_HEADER(strptime, time.h, [
+ AC_DEFINE([HAVE_STRPTIME_DECL],,[Define if the function strptime is declared in <time.h>])
+ AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
+ ])
+])
+
+# Checks for library functions.
+AC_FUNC_FORK
+AC_CHECK_FUNCS([dup2 floor memset pow sqrt strchr tgamma])
+AC_FUNC_STRFTIME
+AC_FUNC_STRPTIME
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FSEEKO
+
+AC_CONFIG_HEADERS(config.h)
+
+AC_CONFIG_FILES([Makefile doc/Makefile doc/png/Makefile])
+AC_OUTPUT
+
+if test "x$GCDIR" != "x" ; then
+ AC_CHECK_FILE($GCDIR.tar.gz,,[
+ echo
+ echo Please put the Boehm garbage collector tar.gz file in the current directory.
+ echo FOR EXAMPLE, USE THE COMMAND:
+ echo
+ echo wget http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/$GCDIR.tar.gz
+ exit 1
+ ])
+fi