📄 configure.ac
字号:
# Configuration script using Automake + Autoconf for FreeFem++# ------------------------------------------------------------# Antoine Le Hyaric - LJLL Paris 6 - lehyaric@ann.jussieu.fr - 13/5/04# $Id: configure.ac,v 1.283 2009/03/14 16:27:30 hecht Exp $# Version numbering: x.xx-pp where "pp" is the package version (when# the same FreeFem++ version is packaged several times). For# coherency, this should have the same value as the top-most package# number in debian/changelog.# add check of FLIBS and X11_LIBS v2.24-2AC_INIT(FreeFem++,3.1-1,hecht@ann.jussieu.fr,freefem++)AC_CONFIG_SRCDIR(src/FreeFem++-CoCoa)# Automake 1.4 is too oldAM_INIT_AUTOMAKE(1.6.3 dist-zip)AM_CONFIG_HEADER(config.h)AC_PROG_MAKE_SETAC_PROG_RANLIB# To allow anonymous CVS version to contain a "./configure" and# MakefilesAM_MAINTAINER_MODE# Necessary compilersAC_PROG_CXXif test -z "$CXX"; then AC_MSG_ERROR(" Sorry no c++ compiler !")fi# dur dur car sous MacOsX le fortran n'est pas standard. ff_AR="ar"ff_ARFLAGS="rv"ff_RANLIB="ranlib" AC_ARG_ENABLE(fortran,[ --disable-fortran No Fortran compiler available ( ARPACK need it)]) ff_g2c_lib=""; if test "$enable_fortran" != nothen AC_PROG_F77(g77 f77 gfortran g77 f90 xlf xlf90 fort77)# if test -n "$F77" # then ff_flibs="" # modif FH AC_F77_LIBRARY_LDFLAGS # correct pb of double def under macos case $F77 in *fort77) if test -z "$FLIBS" ; then# FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print $(NF-2),$(NF-1)}'`# FH to remove " " FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print "echo",$(NF-2),$(NF-1)}'|sh` AC_MSG_WARN([ fort77 FLIBS : $FLIBS ]) fi ;; *g77) for i in $FLIBS; do case $i in # save last directory of the list -L*) d=`expr $i : '-L\(.*\)'`; echo " try $d " if test -e $d/libg2c.so -o -e $d/libg2c.a ; then ff_flibs="$i" fi;; esac done FLIBS="$ff_flibs -lg2c" AC_MSG_WARN([ get dir of -lg2c FLIBS : $FLIBS ]) ;;# add FH sep 2006 *gfortran) for i in $FLIBS; do case $i in -L*) d=`expr $i : '-L\(.*\)'`; if test -e $d/libgfortran.so -o -e $d/libgfortran.a ; then ff_flibs="$i" fi;; esac done FLIBS="$ff_flibs -lgfortran" AC_MSG_WARN([ get dir of -lgfortran FLIBS : $FLIBS ]) ;; esac AC_ARG_WITH(flib,[ --with-flib= the fortran library ])# correct FH sep 2006 -o -> -a if test "$with_flib" != no -a -n "$with_flib" then ff_g2c_lib="$with_flib" FLIBS="$with_flib" fi# add FH oct 2007 for download f2c if test -z "$F77" ; then ff_f77=`pwd`/download/bin/fort77 ff_flibs=`pwd`/download/lib/libf2c.a if test -x $ff_f77 -a -f $ff_flibs ; then AC_MSG_WARN([ no fortran, but find download f2c/fort]); F77=$ff_f77 FLIBS=$ff_flibs else AC_MSG_NOTICE( [ fatal error : no fortran ] ); AC_MSG_NOTICE( [add ---without-fortran ] ); AC_MSG_NOTICE( [or try to compile f2c in directory download/f2c ] ); AC_MSG_NOTICE( [ just do: make install ] ); AC_MSG_ERROR([ Fatal error No Fortran compiler . ],1); fi fi# check if the FLIBS is correct ff_libs="$LIBS" LIBS="$ff_libs $FLIBS" AC_TRY_LINK_FUNC(exit,ff_err=,ff_err=ok); if test "$ff_err" = "ok" ; then AC_MSG_ERROR([ Fatal FLIBS: $FLIBS is incorrect. ],1); fi LIBS="$ff_libs"fiAC_ARG_ENABLE(c,[ --disable-c No C compiler available (C BLAS need it)])if test "$enable_c" != nothen AC_PROG_CCelse # We need to define this otherwise ./configure crashes with # the message "configure: error: conditional "am__fastdepCC" # was never defined". am__fastdepCC_TRUE= am__fastdepCC_FALSE='#'fiAM_PROG_LEXAC_PROG_YACCAC_LANG(C++)# Some useful librariesAC_CHECK_LIB(pthread,pthread_create,ff_pthread="-lpthread",ff_pthread="")# Necessary absolute pathname for local directory when some libraries# are used from several different locations (for instance locally in# configure.ac and in a subdir).curdir=`pwd`# Configure options# -----------------echo $ac_configure_args > configure.param# by default the suffix of the .so lib file is .so# it is .dll under windows# it is .dylib under macos Xff_suffix_dylib="so"; # Checking wether we can produce a MacIntosh-specific version# -----------------------------------------------------------AC_MSG_CHECKING(wether we are on a MacIntosh)ff_mac=noff_aglprog=if test `uname` = Darwin;then ff_suffix_dylib="dylib" ff_mac=yes# ff_aglprog=FreeFem++-agl${EXEEXT}AC_DEFINE_UNQUOTED(FF_PREFIX_DIR_APPLE,"/Applications/FreeFem++.app/Contents/",FreeFem prefix dir) fiAC_MSG_RESULT($ff_mac)AC_MSG_CHECKING(wether we are on SunOS)ff_sunos=noif test `uname -s` = SunOS;then ff_sunos=yesfiAC_MSG_RESULT($ff_sunos)# Checking wether we can produce a Microsoft Windows-specific version# -------------------------------------------------------------------# Sometimes (under cygwin for instance) the default version of FLTK# does not fit our purposeAC_ARG_ENABLE(default-fltk, [ --disable-default-fltk Does not use default FLTK])AC_ARG_ENABLE(cygwindll, [ --enable-cygwindll Forces the use of the Cygwin DLL (not recommended)])# Default FLTK version under Cygwin does not use threads. So we cannot# use it.if test "$enable_cygwindll" = yesthen enable_default_fltk=nofiAC_MSG_CHECKING(wether we are on Microsoft Windows)ff_uname=`uname`# flag to build window 32 version ff_mingw = yes ff_mingw=nocase $ff_uname inCYGWIN*) ff_suffix_dylib="dll"; ff_win32=yes; # We need Mingw to avoid Cygwin's extra DLLs if test "$enable_cygwindll" != yes then ff_glut_ok=yes ff_mingw=yes enable_cygwindll=no; ff_pthread="-mthread" CXXFLAGS="$CXXFLAGS -mno-cygwin -I/usr/include/mingw" FFLAGS="$FFLAGS -mno-cygwin" CFLAGS="$CFLAGS -mno-cygwin -I/usr/include/mingw" LIBS="$LIBS -mno-cygwin -mthreads -lws2_32 -lcomdlg32" LIBSNOCONSOLE="-mwindows" FLIBS="-mno-cygwin -lg2c" ff_glut="-lglut32 -mthreads -lglu32 -lopengl32" # Resources for FreeFem++-cs in Microsoft Windows format AC_SUBST(WINDRESOBJ,windres.o) AC_SUBST(LIBSNOCONSOLE,$LIBSNOCONSOLE) AC_SUBST(WIN32DLLTARGET,win32-dll-target) AC_DEFINE(PURE_WIN32,1,A pure windows applications no cygwin dll) ff_dynload=yes fi ;;*)ff_win32=no;;esacAC_MSG_RESULT($ff_win32)if test "$ff_win32" = nothen enable_cygwindll=nofi# FreeFem++-specific version information# --------------------------------------# Version numbering, converted to a floating point valueff_numver="`echo $VERSION|sed 's/-\(.*\)/+\1.0*0.000001/'`"AC_DEFINE_UNQUOTED(VersionFreeFempp,$ff_numver,FreeFem++ version as a float)# Since src/fflib/strversionnumber.cpp is recreated at each build, this# date is only useful for config-version.htest "$prefix" = NONE && prefix="$ac_default_prefix"ff_prefix_dir="${prefix}/lib/ff++/$VERSION" AC_MSG_CHECKING(prefix dir freefem++ )AC_MSG_RESULT($ff_prefix_dir) FF_DATE=`date`AC_DEFINE_UNQUOTED(VersionFreeFemDate,"$FF_DATE",FreeFem++ build date)AC_DEFINE_UNQUOTED(FF_PREFIX_DIR,"${ff_prefix_dir}",FreeFem prefix dir)AC_SUBST(ff_prefix_dir,$ff_prefix_dir)# Separate configuration header file for version information, included# in config-macos9.hcat << EOF > config-version.h/* FreeFem++ version information for MacOS 9 configuration *//* File generated by configure.ac *//* Define to the full name and version of this package. */#define PACKAGE_STRING "$PACKAGE_STRING"/* Define to the one symbol short name of this package. */#define PACKAGE_TARNAME "$PACKAGE_TARNAME"/* Define to the version of this package. */#define PACKAGE_VERSION "$PACKAGE_VERSION"/* Version number of package */#define VERSION "$VERSION"/* FreeFem++ build date */#define VersionFreeFemDate "$FF_DATE"/* FreeFem++ version as a float */#define VersionFreeFempp ($ff_numver)EOF# Checking wether to produce a debug version# ------------------------------------------# Generic or hardware-dependant optimizationm4_include(acmacros.m4)m4_include(acoptim.m4)# ------------------------------# compilation flags of FreeFem++ # ------------------------------# -DDRAWING bamg active some drawing facility in bamg (inquire mesh)# -DBAMG_LONG_LONG active the use of long long in bamg# -DDEBUG active the checking in bamg # -DNCHECKPTR remove check pointer facility # -DCHECK_KN active subscripting of some array # -DWITHCHECK of the dynamic type ckecking of the langague (very slow)# -DEIGENVALUE to compile the eigen value part# ------------------------------------------------# FreeFrem++-specific optimizations -fpascal-strings if test "$enable_debug" = yes;then CXXFLAGS="$CXXFLAGS -DDRAWING -DBAMG_LONG_LONG -DCHECK_KN" if test "$ff_mac" = yes; then CXXFLAGS="$CXXFLAGS -fno-inline -fexceptions" fielse CXXFLAGS="$CXXFLAGS -DDRAWING -DBAMG_LONG_LONG -DNCHECKPTR" if test "$ff_mac" = yes; then CXXFLAGS="$CXXFLAGS " fifi#whether or not to add a suffix to the package name#--------------------------------------------------AC_ARG_WITH(suffix,[ --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix to package name)])AC_MSG_CHECKING(suffix to add to package name) ff_suffix=if test "$with_suffix" = yes -o "$with_suffix" = no -o "$with_suffix" = ""then AC_MSG_RESULT(none)else ff_suffix="-$with_suffix" AC_MSG_RESULT($ff_suffix)fiAC_SUBST(ADD_PACKAGE_NAME,$ff_suffix)# Checking wether we can produce a X11 version# --------------------------------------------AC_MSG_CHECKING(wether we can compile for X11)ff_x11=no# At the moment, we cannot compile for X11 on Mingw because /usr/X11R6# is part of Cygwin, not Mingw.if test "$ff_mingw" = no && test "$with_x" != "no";then if test -d /usr/X11R6 then ff_x11=yes fifiAC_MSG_RESULT($ff_x11)if test "$ff_x11" = yesthen ff_save_libs="$LIBS" AC_PATH_X AC_PATH_XTRA if test "$no_x" = "yes" ;then ff_x11_libs=""; ff_x11=no; else CPPFLAGS="$CPPFLAGS $X_CFLAGS"# echo "X11 -- $X_LIBS ext -- $X_EXTRA_LIBS -- $X_PRE_LIBS " # When libXxf86vm is present, it is necessary to add it to define # "XF86VidModeQueryVersion" (called by OpenGL) on newer X11 systems LIBS="$LIBS $X_LIBS" AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, ff_Xxf86vm="-lXxf86vm", ff_Xxf86vm="") AC_CHECK_LIB(Xpm, XpmReadFileToImage, ff_Xpm="-lXpm", ff_Xpm86vm="") LIBS="$ff_save_libs" ff_x11_libs="$X_LIBS $ff_Xxf86vm -lXext -lX11 $ff_Xpm -lm" AC_MSG_CHECKING(for X11_LIBS) AC_MSG_RESULT(["$ff_x11_libs"]) # ff_x11_libs="-L/usr/X11R6/lib $ff_Xxf86vm -lXext -lXpm -lX11 -lm" AC_SUBST(X11_LIBS,$ff_x11_libs) ff_x11prog=FreeFem++-x11${EXEEXT}# check if the X11_LIBS is correct ff_libs="$LIBS" LIBS="$ff_libs $X11_LIBS" AC_TRY_LINK_FUNC(XOpenDisplay,ff_err=,ff_err=ok);# ????? if test "$ff_err" = "ok" ; then AC_MSG_ERROR([ Fatal X11_LIBS: $X11_LIBS is incorrect (missing package libX11-dev,libxext-dev or libxt-dev) . ],1); fi LIBS="$ff_libs" fifi# Checking that OpenGL is accessible# ----------------------------------ff_gl_ok=noff_glx_ok=noff_agl_ok=noff_libs="$LIBS"# echo " .... LIBS = $LIBS .... " # GL libraries seem to depend on some dlopen capabilitiesif test "$enable_static" != yes -a "$ff_glut_ok" != yesthen # If we cannot find gl.h, no OpenGL version can be produced AC_CHECK_HEADERS(OpenGL/gl.h, ff_gl_ok=yes ff_agl_ok=yes, ff_gl_ok=no ff_agl_ok=no) if test "$ff_gl_ok" = no then AC_CHECK_HEADERS(GL/gl.h, ff_gl_ok=yes ff_agl_ok=yes, ff_gl_ok=no ff_agl_ok=no) fi AC_CHECK_HEADERS(GLUT/glut.h, ff_glut_ok=yes, ff_glut_ok=no) if test "$ff_glut_ok" = no then AC_CHECK_HEADERS(GL/glut.h, ff_glut_ok=yes, ff_glut_ok=no) fi if test "$ff_gl_ok" = yes then AC_CHECK_HEADERS(GL/glx.h, ff_glx_ok=yes, ff_glx_ok=no) fi if test "$ff_glx_ok" = yes -a "$ff_x11" = yes then AC_CHECK_LIB(GL, glBegin, ff_glx_ok=yes, ff_glx_ok=no) fi if test "$ff_glx_ok" = yes then AC_CHECK_LIB(GLU, gluSphere, ff_glx_ok=yes, ff_glx_ok=no, -lGL) fi# GLUT ..... if test "$ff_glut_ok" = yes then for glut in \ "-framework GLUT -framework OpenGL -framework Cocoa" \ "-lglut -lGLU -lGL" do ff_glut="$glut" ff_libs1="$LIBS" LIBS="$LIBS $ff_glut" AC_TRY_LINK_FUNC(glutInit, ff_glut_ok=yes LIBS="$ff_libs1" break, ff_glut_ok=next); LIBS="$ff_libs1" done fi fiif test "$ff_glut_ok" = yesthen AC_SUBST(LIBSGLUT,$ff_glut) if test -n "$ff_pthread" ; then ff_ffglutprog="ffglut${EXEEXT}" AC_DEFINE_UNQUOTED(PROG_FFGLUT,"$ff_ffglutprog", the ffglut application for the new graphics ) AC_SUBST(LIBSPTHREAD,$ff_pthread) fi ff_meditprog="ffmedit${EXEEXT}"fi# echo " .... LIBS = $LIBS .... " # If we cannot find GL, we cannot compile FreeFem++-aglif test "$ff_agl_ok" = nothen ff_aglprog=fi# If we cannot find GLX, we cannot compile FreeFem++ with itif test "$ff_glx_ok" = yesthen ff_glxprog=FreeFem++-glx${EXEEXT}fiAC_ARG_WITH(suffix,[ --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix package name)])if test "$with_suffix" = yes
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -