dnl Process this file with autoconf to produce a configure script. AC_INIT(src/mire.c) AM_INIT_AUTOMAKE(fgsd,0.3.1a) AM_CONFIG_HEADER(src/config.h:src/config.in) dnl Checks for programs. AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_RANLIB AC_PROG_INSTALL dnl Checks for libraries. dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST # Determine version of automake ... important becuase of # incompatibilities between versions AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\-p[[0-9]]$//' | sed -e 's/\.//' | sed -e 's/\..*//'` AM_CONDITIONAL(ANCIENT_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 14) AM_CONDITIONAL(OLD_AUTOMAKE, test $AUTO_MAKE_VERSION -lt 15) AC_CHECK_FUNCS(mkstemp) # specify the simgear location AC_ARG_WITH(simgear, [ --with-simgear=prefix Specify the prefix path to simgear]) if test "x$with_simgear" != "x" ; then echo "SimGear prefix path is $with_simgear" SIMGEAR_DIR="$with_simgear" else SIMGEAR_DIR= fi # extra library and include directories EXTRA_DIRS="${SIMGEAR_DIR} /usr/X11R6 /usr/mingw/usr" if test -d /opt/X11R6 ; then EXTRA_DIRS="${EXTRA_DIRS} /opt/X11R6" fi wi_EXTRA_DIRS(no, ${EXTRA_DIRS}) dnl Checks for header files. AC_ARG_WITH(fltk, [ --with-fltk=prefix Path to fltk V2]) if test "x$with_fltk" != "x" ; then CPPFLAGS="$CPPFLAGS -I$with_fltk/include" LDFLAGS="$LDFLAGS -L$with_fltk/lib" fi AC_LANG_CPLUSPLUS dnl Check for FLTK AC_CHECK_HEADER(FL/Fl.H) if test "x$ac_cv_header_FL_Fl_H" != "xyes"; then echo echo "FLTK not found" echo "configure aborted." exit fi dnl Check for FLU AC_CHECK_HEADER(FLU/Flu_File_Chooser.h) if test "x$ac_cv_header_FLU_Flu_File_Chooser_h" != "xyes"; then echo echo "FLU not found" echo "configure aborted." exit fi GIF_LIB="" dnl Check for libgif AC_CHECK_HEADER(gif_lib.h) if test "x$ac_cv_header_gif_lib_h" = "xyes"; then AC_DEFINE([HAVE_GIF_LIB_H], 1, [Define if gif_lib.h is present]) AC_CHECK_LIB(gif, DGifOpen) if test "x$ac_cv_lib_gif_DGifOpen" = "xyes" ; then AC_DEFINE([HAVE_DGIFOPEN], 1, [Define if DGifOpen is present in -lgif]) fi GIF_LIB="-lgif" fi AC_SUBST(GIF_LIB) dnl Check for libCURL AC_CHECK_HEADER(curl/curl.h) if test "x$ac_cv_header_curl_curl_h" != "xyes"; then echo echo "libCURL not found" echo "configure aborted." exit fi AC_ARG_WITH(CGAL_PLATFORM, [ --with-cgal-platform=prefix Path to CGAL]) if test "x$with_cgal_platform" != "x" ; then CGAL_PLATFORM="$with_cgal_platform" fi AC_SUBST(CGAL_PLATFORM) AC_ARG_WITH(CGAL, [ --with-cgal=prefix Path to CGAL]) if test "x$with_cgal" != "x" ; then CPPFLAGS="$CPPFLAGS -I$with_cgal/include -I$with_cgal/include/CGAL/config/$CGAL_PLATFORM" LDFLAGS="$LDFLAGS -L$with_cgal/lib/$CGAL_PLATFORM" fi AC_LANG_CPLUSPLUS AC_MSG_CHECKING([if g++ have std::fixed]) AC_TRY_RUN([ #include int main() { std::ofstream str("/dev/null"); str << std::fixed << 0.5; return 0; } ], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_STD_FIXED], 1, [Define if std::fixed is understood]) ], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) AC_LANG_C dnl Check for the presence of SimGear AC_CHECK_HEADER(simgear/version.h) if test "x$ac_cv_header_simgear_version_h" != "xyes"; then echo echo "SimGear not found" echo "configure aborted." exit fi dnl Check for the presence of libjpeg AC_CHECK_HEADER(jpeglib.h) if test "x$ac_cv_header_jpeglib_h" != "xyes"; then echo echo "libjpeg not found" echo "configure aborted." exit fi dnl Check for the presence of libpng AC_CHECK_HEADER(png.h) if test "x$ac_cv_header_png_h" != "xyes"; then echo echo "libpng not found" fi dnl check for OpenGL related libraries AC_CANONICAL_HOST case "${host}" in *-*-cygwin* | *-*-mingw32*) dnl CygWin under Windoze. echo Win32 specific hacks... AC_DEFINE([WIN32], 1, [Define for Win32 platforms]) AC_DEFINE([_WIN32], 1, [Define for Win32 platforms]) AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms]) LIBS="$LIBS -lglut32 -lglu32 -lopengl32" LIBS="$LIBS -luser32 -lgdi32" LIBS="$LIBS -lole32 -luuid -lcomctl32 -lsupc++" LIBS="$LIBS -lwinmm -lwsock32 -lcomdlg32" dnl add -lwsock32 for mingwin case "${host}" in *-*-mingw32*) echo "********** BUILDING FOR MINGW32 *************" base_LIBS="$base_LIBS -lws2_32" ;; esac echo "Will link apps with $LIBS" ;; *-apple-darwin*) dnl Mac OS X LIBS="$LIBS -framework GLUT -framework OpenGL -framework Carbon -lobjc" ;; *) dnl X-Windows based machines LDFLAGS="$LDFLAGS -lm" dnl Skip X11 library tests if requested. if test "x$no_x" != "xyes"; then AC_CHECK_LIB(X11, XCreateWindow) AC_CHECK_LIB(Xext, XShmCreateImage) AC_CHECK_LIB(Xi, XGetExtensionVersion) AC_CHECK_LIB(ICE, IceOpenConnection) AC_CHECK_LIB(SM, SmcOpenConnection) AC_CHECK_LIB(Xt, XtMalloc) AC_CHECK_LIB(Xmu, XmuLookupStandardColormap) fi AC_CHECK_LIB(GLcore, glNewList) if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then dnl if no GLcore, check for GL AC_CHECK_LIB(GL, glNewList) if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then dnl if no GL, check for MesaGL AC_CHECK_LIB(MesaGL, glNewList) fi else dnl if GLcore found, then also check for GL AC_CHECK_LIB(GL, glXCreateContext) fi dnl if using mesa, check for xmesa.h if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then AC_CHECK_HEADER(GL/fxmesa.h) if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then AC_DEFINE([XMESA], 1, [Define for fxmesa]) AC_DEFINE([FX], 1, [Define for fxmesa]) fi fi AC_CHECK_LIB(GLU, gluLookAt) if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then dnl if no GLU, check for MesaGLU AC_CHECK_LIB(MesaGLU, gluLookAt) fi AC_CHECK_LIB(glut, glutGetModifiers) if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno" ; then dnl if no "real" glut, check for freeglut AC_CHECK_LIB(freeglut, glutGetModifiers) fi ;; esac opengl_LIBS="$LIBS" AC_SUBST(opengl_LIBS) dnl Checks for library functions. AC_OUTPUT( \ Makefile \ Fl_Plib/Makefile \ src/Makefile \ msvc/Makefile \ )