Skip to content
Snippets Groups Projects
Commit 16c2d3d7 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Add first draft of new configure script
parent 79757cf2
No related branches found
No related tags found
No related merge requests found
configure 0 → 100755
This diff is collapsed.
dnl "$Id: configure.in,v 1.1 2003-02-11 08:00:45 geuzaine Exp $"
dnl
dnl Machine independent configuration script for Gmsh.
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
dnl USA.
dnl
dnl Please report all bugs and problems to "gmsh@geuz.org".
dnl Check that this is the gmsh source tree
AC_INIT(Parser/Gmsh.y)
dnl Parse --with command-line options
AC_ARG_WITH(gsl-prefix,
AC_HELP_STRING([--with-gsl-prefix=PFX],
[prefix where GSL is installed]),
[GSL_PREFIX=$withval],[GSL_PREFIX="$GSL_DIR"])
AC_ARG_WITH(fltk-prefix,
AC_HELP_STRING([--with-fltk-prefix=PFX],
[prefix where FLTK is installed]),
[FLTK_PREFIX=$withval],[FLTK_PREFIX="$FLTK_DIR"])
AC_ARG_WITH(gl-prefix,
AC_HELP_STRING([--with-gl-prefix=PFX],
[prefix where OpenGL is installed]),
[GL_PREFIX=$withval],[GL_PREFIX="$GL_DIR"])
dnl Parse --enable command line options
AC_ARG_ENABLE(gui,
AC_HELP_STRING([--enable-gui],
[build the graphical user interface (default=yes)]))
dnl Get the operating system and version number
UNAME=`uname`
UVERSION=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
if test "x${UNAME}" = "xIRIX64"; then
UNAME="IRIX"
fi
AC_SUBST(UNAME)
dnl Check for default compilers
AC_PROG_CC
AC_PROG_CXX
dnl Check for various programs
AC_PROG_CPP
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar)
dnl How to build static libraries
if test "x${AR}" = "x:"; then
AC_MSG_ERROR(Configure could not find the library archiver, aborting.)
fi
AR="${AR} ruvs"
dnl Default subdirectories and libraries
GMSH_DIRS="Common DataStr Geo Mesh Numeric Parallel Parser Plugin"
dnl Choose blackbox or GUI version
if test "x$enable_gui" != "xno"; then
GMSH_DIRS="${GMSH_DIRS} Graphics Fltk jpeg"
GMSH_LIBS="-Llib -lGmshFltk -lGmshParser -lGmshGraphics -lGmshMesh -lGmshGeo -lGmshNumeric -lGmshCommon -lGmshDataStr -lGmshJpeg -lGmshPlugin -lGmshParallel"
VERSION_FLAGS="-D_FLTK"
if test "x${FLTK_PREFIX}" != "x"; then
FLTK_LIB_PREFIX="-L${FLTK_PREFIX}/lib"
GUI_INCLUDE="-I${FLTK_PREFIX}"
fi
if test "x${GL_PREFIX}" != "x"; then
GUI_INCLUDE="${GUI_INCLUDE} -I${GL_PREFIX}/include"
fi
else
GMSH_DIRS="${GMSH_DIRS} Box"
GMSH_LIBS="-Llib -lGmshBox -lGmshParser -lGmshMesh -lGmshGeo -lGmshNumeric -lGmshPlugin -lGmshCommon -lGmshDataStr -lGmshParallel"
VERSION_FLAGS="-D_BLACKBOX"
GUI_INCLUDE=""
fi
dnl Check if Triangle is installed
AC_CHECK_FILES(./Triangle/triangle.c ./Triangle/triangle.h, HAVE_TRIANGLE="yes", HAVE_TRIANGLE="no")
if test "x${HAVE_TRIANGLE}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} Triangle"
GMSH_LIBS="${GMSH_LIBS} -lGmshTriangle"
VERSION_FLAGS="${VERSION_FLAGS} -DHAVE_TRIANGLE"
fi
AC_SUBST(VERSION_FLAGS)
AC_SUBST(GUI_INCLUDE)
dnl default flags and linker
OPT_FLAGS="${CXXFLAGS}"
LINKER="${CXX}"
POSTBUILD=""
dnl Modify defaults according to OS
case "$UNAME" in
CYGWIN* | MINGW*)
OPT_FLAGS="-O2"
OS_FLAGS="-mwindows -DWIN32 -D_LITTLE_ENDIAN"
LINKER="g++ -Wl,--subsystem,windows -mwindows"
if test "x$enable_gui" != "xno"; then
GMSH_LIBS="${GMSH_LIBS} Fltk/Win32Icon.res ${FLTK_LIB_PREFIX} -lfltk_gl -lglu32 -lopengl32 -lfltk -lole32 -luuid -lcomctl32 -lwsock32 -lm"
else
GMSH_LIBS="${GMSH_LIBS} -lm"
fi
;;
Darwin*)
OPT_FLAGS="-O2"
OS_FLAGS="-D_NODLL"
if test "x$enable_gui" != "xno"; then
GMSH_LIBS="${GMSH_LIBS} ${FLTK_LIB_PREFIX} -lfltk_gl -lfltk -framework AGL -framework OpenGL -framework Carbon -framework ApplicationServices"
else
GMSH_LIBS="${GMSH_LIBS}"
fi
POSTBUILD="/Developer/Tools/Rez -t APPL -o bin/gmsh Fltk/MacRes.r"
;;
*)
if test "x$enable_gui" != "xno"; then
AC_PATH_XTRA
if test "x$no_x" = "xyes"; then
AC_MSG_ERROR(Configure could not find required X11 libraries, aborting. Try --disable-gui?)
fi
GL_LIB=""
AC_CHECK_HEADER(GL/gl.h,
AC_CHECK_LIB(GL, glXMakeCurrent, GL_LIB="-lGL",
AC_CHECK_LIB(MesaGL, glXMakeCurrent, GL_LIB="-lMesaGL", , -lm),
-lm)
)
GLU_LIB=""
AC_CHECK_HEADER(GL/glu.h,
if test "x$ac_cv_lib_GL_glXMakeCurrent" = "xyes"; then
GLU_LIB="-lGLU"
fi
if test "x$ac_cv_lib_MesaGL_glXMakeCurrent" = "xyes"; then
GLU_LIB="-lMesaGLU"
fi
)
if test "x${GL_LIB}" = "x" -o "x${GLU_LIB}" = "x"; then
AC_MSG_ERROR(Configure could not find required OpenGL libraries, aborting. Try --disable-gui?)
fi
if test "x${GL_PREFIX}" != "x"; then
GL_LIB="-L${GL_PREFIX}/lib ${GL_LIB}"
fi
GMSH_LIBS="${GMSH_LIBS} ${FLTK_LIB_PREFIX} -lfltk_gl ${GL_LIB} ${GLU_LIB} -lfltk ${X_LIBS} -lXext -lX11 ${X_EXTRA_LIBS} -lm"
if test "x$x_includes" != x; then
ac_cpp="$ac_cpp -I$x_includes"
fi
else
GMSH_LIBS="${GMSH_LIBS} -lm";
fi
case "${UNAME}" in
Linux*)
OPT_FLAGS="-O3 -Wall -Wno-uninitialized"
OS_FLAGS="-D_LITTLE_ENDIAN"
GMSH_LIBS="${GMSH_LIBS} -ldl"
;;
OSF1*)
OPT_FLAGS="-O2"
OS_FLAGS="-D_LITTLE_ENDIAN"
;;
AIX*)
OPT_FLAGS="-O2"
OS_FLAGS="-D_BSD -D_NODLL"
;;
IRIX*)
CXX="CC"
CC="cc"
OPT_FLAGS="-O2 -OPT:Olimit=0 -LANG:std"
AR="CC -mips3 -n32 -ar -o"
OS_FLAGS="-mips3 -n32"
LINKER="CC -O2 -mips3 -n32"
;;
SunOS*)
CXX="g++"
CC="gcc"
OPT_FLAGS="-O2"
OS_FLAGS="-D_NODLL"
GMSH_LIBS="${GMSH_LIBS} -lsocket -lnsl -ldl"
;;
*)
OS_FLAGS="-D_NODLL"
;;
esac
;;
esac
AC_SUBST(OPT_FLAGS)
AC_SUBST(OS_FLAGS)
AC_SUBST(LINKER)
AC_SUBST(GMSH_DIRS)
AC_SUBST(GMSH_LIBS)
AC_SUBST(POSTBUILD)
AC_SUBST(AR)
dnl Check for GSL
if test "x${GSL_PREFIX}" = "x"; then
LDFLAGS="-lgslcblas"
else
LDFLAGS="-L${GSL_PREFIX}/lib -lgslcblas"
fi
AC_CHECK_LIB(gsl,gsl_vector_alloc,GSL="yes",GSL="no")
if test "x${GSL_PREFIX}" = "x"; then
GSL_LIBS="-lgsl -lgslcblas"
else
GSL_LIBS="-L${GSL_PREFIX}/lib -lgsl -lgslcblas"
GSL_INCLUDE="-I${GSL_PREFIX}/include"
fi
AC_SUBST(GSL_LIBS)
AC_SUBST(GSL_INCLUDE)
dnl Check for math library
AC_CHECK_LIB(m, sin)
dnl Check for header files
AC_CHECK_HEADERS(sys/time.h sys/resource.h)
dnl Write output
AC_OUTPUT(variables)
dnl Print some information
echo "*******************************************************************"
echo "Gmsh is configured for"
echo "- Operating system: $UNAME"
echo "- Version flags: $VERSION_FLAGS"
echo "*******************************************************************"
if test "x${HAVE_TRIANGLE}" = "xno"; then
echo "*******************************************************************"
echo "If you want to use Jonathan Shewchuk's Triangle as an alternative"
echo "isotropic 2D mesh generator, please download Triangle from the"
echo "author's web site at http://www.cs.cmu.edu/~quake/triangle.html,"
echo "unpack the archive and copy the two files 'triangle.c' and"
echo "'triangle.h' in the ./Triangle subdirectory. Then run ./configure"
echo "again."
echo ""
echo "Please note that by doing so, you agree to Triangle's licencing"
echo "requirements stated in ./Triangle/README. (Most notably, you can"
echo "only redistribute Gmsh if no compensation is received.)"
echo "*******************************************************************"
fi
if test "x${GSL}" = "xno"; then
echo "*******************************************************************"
echo "Configure could not find the GNU Scientific Library (GSL):"
echo "- if it is installed in a non-standard location, please run"
echo " ./configure again with the --with-gsl-prefix option"
echo "- if it is not installed on your system, you can download it from"
echo " http://sources.redhat.com/gsl/"
echo "*******************************************************************"
fi
# OS
UNAME=@UNAME@
# The names of the C and C++ compilers and linker
CC=@CC@
CXX=@CXX@
LINKER=@LINKER@
# Compiler flags
OPT_FLAGS=@OPT_FLAGS@
OS_FLAGS=@OS_FLAGS@ ${GSL_INCLUDE}
VERSION_FLAGS=@VERSION_FLAGS@
GUI_INCLUDE=@GUI_INCLUDE@
# Gmsh subdirectories and libraries
GMSH_DIRS=@GMSH_DIRS@
GMSH_LIBS=@GMSH_LIBS@
# GSL include and library path
GSL_INCLUDE=@GSL_INCLUDE@
GSL_LIBS=@GSL_LIBS@
# How you create a static library on this machine
AR=@AR@
RANLIB=@RANLIB@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment