celestia/configure.in

161 lines
4.4 KiB
Plaintext

dnl
dnl Celestia autoconf file
dnl
AC_INIT(src/glutmain.cpp)
AM_INIT_AUTOMAKE(Celestia, 1.0.10)
AM_CONFIG_HEADER(config.h)
dnl Check system type
AC_CANONICAL_HOST
dnl Check for compilers. Set CFLAGS and CXXFLAGS to null if unset, so
dnl that these macros won't set the to default values that we don't want.
if test "x${CFLAGS-notset}" = "xnotset" ; then
export CFLAGS
CFLAGS=""
fi
AC_PROG_CC
if test "x${CXXFLAGS-notset}" = "xnotset" ; then
export CXXFLAGS
CXXFLAGS=""
fi
AC_PROG_CXX
dnl Checks for programs.
AC_PROG_CPP
AC_PROG_CXXCPP
AC_PROG_INSTALL
dnl
dnl Compilation options
dnl
CELESTIA_CPPFLAGS=""
CELESTIA_CFLAGS="-O2 -Wall -fomit-frame-pointer -ffast-math -fexpensive-optimizations"
CELESTIA_CXXFLAGS="-O2 -Wall -fomit-frame-pointer -ffast-math -fexpensive-optimizations"
dnl CELESTIA_CFLAGS="-O2 -g -Wall"
dnl CELESTIA_CXXFLAGS="-O2 -g -Wall"
dnl case "$host" in
dnl i*86-*-*) CELESTIA_CFLAGS="$CELESTIA_CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2";
dnl CELESTIA_CXXFLAGS="$CELESTIA_CXXFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2";;
dnl alpha*-*-linux-*) CELESTIA_CFLAGS="$CELESTIA_CFLAGS -mieee";;
dnl esac
AC_ARG_ENABLE(debug, [ --enable-debug Produce an executable with debugging symbols],
[CELESTIA_CFLAGS="-g -Wall"; CELESTIA_CXXFLAGS="-g -Wall"],
[CELESTIA_CPPFLAGS="$CELESTIA_CPPFLAGS -DCELESTIA_NO_ASSERT=1"])
AC_ARG_ENABLE(pedantic, [ --enable-pedantic Enable -pedantic (and -ansi for C) when compiling], CELESTIA_CFLAGS="$CELESTIA_CFLAGS -ansi -pedantic"; CELESTIA_CXXFLAGS="$CELESTIA_CXXFLAGS -pedantic")
AC_ARG_ENABLE(profile,[ --enable-profile Produce a profiled executable], [CELESTIA_CFLAGS="$CELESTIA_CFLAGS -pg"; CELESTIA_CXXFLAGS="$CELESTIA_CXXFLAGS -pg"])
dnl
dnl GL and GLUT libs
dnl
AC_ARG_WITH(
gl-libs,
[ --with-gl-libs=DIR Specify OpenGL library location],
CELESTIALIBS="$CELESTIALIBS -L$withval")
AC_ARG_WITH(
gl-inc,
[ --with-gl-inc=DIR Specify OpenGL header file location],
CELESTIAFLAGS="$CELESTIAFLAGS -I$withval")
AC_ARG_WITH(
glut-libs,
[ --with-glut-libs=DIR Specify GLUT library location],
CELESTIALIBS="$CELESTIALIBS -L$withval")
AC_ARG_WITH(
glut-inc,
[ --with-glut-inc=DIR Specify GLUT header file location],
CELESTIAFLAGS="$CELESTIAFLAGS -I$withval")
dnl Use Gtk if requested
GTK_LIBS=""
GTKGL_LIBS=""
AC_ARG_ENABLE(gtk, [ --enable-gtk Use Gtk for an enhanced GUI],
enable_gtk="yes", enable_gtk="no")
if test "$enable_gtk" == "yes" ; then
dnl Check for GTK libraries
AM_PATH_GTK(,,AC_MSG_ERROR([Cannot find proper gtk version]))
GTKGL_LIBS=-lgtkgl
fi
AM_CONDITIONAL(ENABLE_GTK, test "$enable_gtk" == "yes")
CFLAGS="$CFLAGS $CELESTIAFLAGS $CELESTIA_CFLAGS $GTK_CFLAGS"
CXXFLAGS="$CXXFLAGS $CELESTIAFLAGS $CELESTIA_CXXFLAGS $GTK_CFLAGS"
LIBS="$LIBS $CELESTIA_LIBS $GTK_LIBS $GTKGL_LIBS"
dnl Check for X11.
AC_PATH_XTRA
LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lXmu -lXi -lXext -lX11 -lm $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
dnl Check for OpenGL. Taken partly from the plib sources.
AC_CHECK_LIB(GL,glNewList)
if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
dnl Check for MesaGL.
AC_CHECK_LIB(MesaGL, glNewList,,
AC_MSG_ERROR(GL library was not found))
fi
AC_CHECK_LIB(GLU,gluLookAt)
if test "x$ac_cv_lib_GLU_gluLookAt" = "xno"; then
dnl Check for MesaGLU.
AC_CHECK_LIB(MesaGLU, gluLookAt,,
AC_MSG_ERROR(GLU library was not found))
fi
dnl Check for GLUT.
AC_CHECK_LIB(glut, glutKeyboardUpFunc,,
AC_MSG_ERROR(GLUT library version >= 3.7 not found))
dnl Check for JPEG library.
AC_CHECK_LIB(jpeg, jpeg_start_decompress,,
AC_MSG_ERROR(jpeg library not found))
dnl Check for PNG library.
AC_CHECK_LIB(png, png_create_info_struct,,
AC_MSG_ERROR(png library not found))
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(GL/gl.h GL/glut.h)
# AC_DEFINE(TEXTURE_DIR,"textures")
# AC_DEFINE(FONT_DIR,"fonts")
# AC_DEFINE(MODEL_DIR,"models")
# AC_DEFINE(DATA_DIR,"data")
AC_OUTPUT( Makefile \
src/Makefile \
)
AC_MSG_RESULT()
AC_MSG_RESULT()
AC_MSG_RESULT(********************************************************************)
AC_MSG_RESULT(*** Celestia configuration complete.)
AC_MSG_RESULT(********************************************************************)
AC_MSG_RESULT()
AC_MSG_RESULT()