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

Simplify things alot by using fltk-config
parent 90806611
No related branches found
No related tags found
No related merge requests found
...@@ -5,17 +5,15 @@ facilities. ...@@ -5,17 +5,15 @@ facilities.
To install Gmsh, type To install Gmsh, type
./configure --with-fltk-prefix=/path/to/fltk-1.1.x ./configure
make make
make install make install
This requires the Fast Light Tool Kit (FLTK, http://www.fltk.org) This requires the GSL (http://sources.redhat.com/gsl/) and FLTK 1.1.x
version 1.1 or above, the GNU Scientific Library (GSL, (http://www.fltk.org), configured with OpenGL support, to be installed
http://sources.redhat.com/gsl/) and OpenGL (for a free implementation, on your system. If not in default locations, you can either use the
see http://www.mesa3d.org) to be installed on your system. If not in --with-fltk-prefix and --with-gsl-prefix configure options, or you can
default locations, you can either use the --with-fltk-prefix, set the environment variables FLTK_DIR and GSL_DIR.
--with-gsl-prefix and --with-gl-prefix configure options, or you can
set the environment variables FLTK_DIR, GSL_DIR and GL_DIR.
To install a non-graphical version of Gmsh (that does not require To install a non-graphical version of Gmsh (that does not require
FLTK nor OpenGL), type FLTK nor OpenGL), type
......
This diff is collapsed.
dnl "$Id: configure.in,v 1.4 2003-02-11 17:55:23 geuzaine Exp $" dnl "$Id: configure.in,v 1.5 2003-02-11 22:01:43 geuzaine Exp $"
dnl dnl
dnl Machine independent configuration script for Gmsh. dnl Machine independent configuration script for Gmsh.
dnl dnl
...@@ -35,10 +35,6 @@ AC_ARG_WITH(fltk-prefix, ...@@ -35,10 +35,6 @@ AC_ARG_WITH(fltk-prefix,
AC_HELP_STRING([--with-fltk-prefix=PFX], AC_HELP_STRING([--with-fltk-prefix=PFX],
[prefix where FLTK is installed]), [prefix where FLTK is installed]),
[FLTK_PREFIX=$withval],[FLTK_PREFIX="$FLTK_DIR"]) [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 dnl Parse --enable command line options
AC_ARG_ENABLE(gui, AC_ARG_ENABLE(gui,
...@@ -78,7 +74,7 @@ AC_EXEEXT ...@@ -78,7 +74,7 @@ AC_EXEEXT
dnl How to build static libraries dnl How to build static libraries
if test "x${AR}" = "x:"; then if test "x${AR}" = "x:"; then
AC_MSG_ERROR(Configure could not find the library archiver, aborting.) AC_MSG_ERROR(Could not find the library archiver, aborting.)
fi fi
AR="${AR} ruvs" AR="${AR} ruvs"
...@@ -89,30 +85,24 @@ dnl Choose blackbox or GUI version ...@@ -89,30 +85,24 @@ dnl Choose blackbox or GUI version
if test "x$enable_gui" != "xno"; then if test "x$enable_gui" != "xno"; then
GMSH_DIRS="${GMSH_DIRS} Graphics Fltk jpeg" GMSH_DIRS="${GMSH_DIRS} Graphics Fltk jpeg"
GMSH_LIBS="-Llib -lGmshFltk -lGmshParser -lGmshGraphics -lGmshMesh -lGmshGeo -lGmshNumeric -lGmshCommon -lGmshDataStr -lGmshJpeg -lGmshPlugin -lGmshParallel" GMSH_LIBS="-Llib -lGmshFltk -lGmshParser -lGmshGraphics -lGmshMesh -lGmshGeo -lGmshNumeric -lGmshCommon -lGmshDataStr -lGmshJpeg -lGmshPlugin -lGmshParallel"
# dnl We should check for FLTK like this:
# AC_PATH_PROG(FLTKCONFIG,fltk-config)
#
# if test "x$FLTKCONFIG" = x; then
# AC_MSG_ERROR([Sorry, flphoto requires FLTK 1.1.x.])
# else
# CFLAGS="`$FLTKCONFIG --cflags` $CFLAGS"
# CXXFLAGS="`$FLTKCONFIG --cflags` $CXXFLAGS"
# LIBS="`$FLTKCONFIG --use-images --ldflags` $LIBS"
# fi
VERSION_FLAGS="-D_FLTK" VERSION_FLAGS="-D_FLTK"
if test "x${FLTK_PREFIX}" != "x"; then AC_PATH_PROG(FLTKCONFIG,fltk-config)
FLTK_LIB_PREFIX="-L${FLTK_PREFIX}/lib" if test "x${FLTKCONFIG}" = "x" -a "x${FLTK_PREFIX}" != "x" ; then
GUI_INCLUDE="-I${FLTK_PREFIX}" AC_PATH_PROG(FLTKCONFIG,fltk-config,"",${FLTK_PREFIX})
fi fi
if test "x${GL_PREFIX}" != "x"; then if test "x${FLTKCONFIG}" = "x" ; then
GUI_INCLUDE="${GUI_INCLUDE} -I${GL_PREFIX}/include" AC_PATH_PROG(FLTKCONFIG,fltk-config,"",${HOME}/SOURCES/fltk-1.1)
fi fi
if test "x$FLTKCONFIG" = "x"; then
AC_MSG_ERROR(Could not find fltk-config. Try --with-prefix-fltk?)
fi
GUI_LIBS="`$FLTKCONFIG --use-gl --ldstaticflags`"
GUI_INCLUDE="`$FLTKCONFIG --use-gl --cxxflags`"
else else
GMSH_DIRS="${GMSH_DIRS} Box" GMSH_DIRS="${GMSH_DIRS} Box"
GMSH_LIBS="-Llib -lGmshBox -lGmshParser -lGmshMesh -lGmshGeo -lGmshNumeric -lGmshPlugin -lGmshCommon -lGmshDataStr -lGmshParallel" GMSH_LIBS="-Llib -lGmshBox -lGmshParser -lGmshMesh -lGmshGeo -lGmshNumeric -lGmshPlugin -lGmshCommon -lGmshDataStr -lGmshParallel"
VERSION_FLAGS="-D_BLACKBOX" VERSION_FLAGS="-D_BLACKBOX"
GUI_LIBS=""
GUI_INCLUDE="" GUI_INCLUDE=""
fi fi
...@@ -136,101 +126,60 @@ dnl default flags and linker ...@@ -136,101 +126,60 @@ dnl default flags and linker
OPT_FLAGS="${CXXFLAGS}" OPT_FLAGS="${CXXFLAGS}"
LINKER="${CXX}" LINKER="${CXX}"
POSTBUILD="" POSTBUILD=""
if test "x$enable_gui" != "xno"; then
GMSH_LIBS="${GMSH_LIBS} ${GUI_LIBS}"
else
GMSH_LIBS="${GMSH_LIBS} -lm";
fi
dnl Modify defaults according to OS dnl Modify defaults according to OS
case "$UNAME" in case "$UNAME" in
CYGWIN* | MINGW*) CYGWIN* | MINGW*)
OPT_FLAGS="-O2"
OS_FLAGS="-mwindows -DWIN32 -D_LITTLE_ENDIAN" OS_FLAGS="-mwindows -DWIN32 -D_LITTLE_ENDIAN"
LINKER="g++ -Wl,--subsystem,windows -mwindows" LINKER="g++ -Wl,--subsystem,windows -mwindows"
if test "x$enable_gui" != "xno"; then 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" GMSH_LIBS="${GMSH_LIBS} Fltk/Win32Icon.res"
else
GMSH_LIBS="${GMSH_LIBS} -lm"
fi fi
;; ;;
Darwin*) Darwin*)
OPT_FLAGS="-O2"
OS_FLAGS="-D_NODLL" 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" POSTBUILD="/Developer/Tools/Rez -t APPL -o bin/gmsh Fltk/MacRes.r"
;; ;;
*) Linux*)
if test "x$enable_gui" != "xno"; then OS_FLAGS="-D_LITTLE_ENDIAN"
AC_PATH_XTRA GMSH_LIBS="${GMSH_LIBS} -ldl"
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 OSF1*)
Linux*) OS_FLAGS="-D_LITTLE_ENDIAN"
OPT_FLAGS="-O3 -Wall -Wno-uninitialized" ;;
OS_FLAGS="-D_LITTLE_ENDIAN"
GMSH_LIBS="${GMSH_LIBS} -ldl" AIX*)
;; OS_FLAGS="-D_BSD -D_NODLL"
OSF1*) ;;
OPT_FLAGS="-O2"
OS_FLAGS="-D_LITTLE_ENDIAN" IRIX*)
;; OS_FLAGS="-mips3 -n32"
AIX*) CXX="CC"
OPT_FLAGS="-O2" CC="cc"
OS_FLAGS="-D_BSD -D_NODLL" OPT_FLAGS="-O2 -OPT:Olimit=0 -LANG:std"
;; AR="CC -mips3 -n32 -ar -o"
IRIX*) LINKER="CC -O2 -mips3 -n32"
CXX="CC" ;;
CC="cc"
OPT_FLAGS="-O2 -OPT:Olimit=0 -LANG:std" SunOS*)
AR="CC -mips3 -n32 -ar -o" OS_FLAGS="-D_NODLL"
OS_FLAGS="-mips3 -n32" CXX="g++"
LINKER="CC -O2 -mips3 -n32" CC="gcc"
;; GMSH_LIBS="${GMSH_LIBS} -lsocket -lnsl -ldl"
SunOS*) ;;
CXX="g++"
CC="gcc" *)
OPT_FLAGS="-O2" OS_FLAGS="-D_NODLL"
OS_FLAGS="-D_NODLL" ;;
GMSH_LIBS="${GMSH_LIBS} -lsocket -lnsl -ldl"
;;
*)
OS_FLAGS="-D_NODLL"
;;
esac
;;
esac esac
...@@ -258,9 +207,6 @@ fi ...@@ -258,9 +207,6 @@ fi
AC_SUBST(GSL_LIBS) AC_SUBST(GSL_LIBS)
AC_SUBST(GSL_INCLUDE) AC_SUBST(GSL_INCLUDE)
dnl Check for math library
AC_CHECK_LIB(m, sin)
dnl Check for header files dnl Check for header files
AC_CHECK_HEADERS(sys/time.h sys/resource.h) AC_CHECK_HEADERS(sys/time.h sys/resource.h)
...@@ -298,5 +244,3 @@ if test "x${GSL}" = "xno"; then ...@@ -298,5 +244,3 @@ if test "x${GSL}" = "xno"; then
echo " http://sources.redhat.com/gsl/" echo " http://sources.redhat.com/gsl/"
echo "*******************************************************************" echo "*******************************************************************"
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment