?? configure.in
字號:
dnl -----------------------------------------------------------------------dnl Stage Autoconf scriptdnl $Id: configure.in,v 1.28.2.9.2.1 2003/12/05 03:10:25 gerkey Exp $dnl -----------------------------------------------------------------------dnl Process this file with autoconf to produce a configure script.AC_INIT(src/main.cc)dnl determine system type. this is used in a couple of places to infer the dnl types of arguments to some networking library functions. if/when we dnl upgrade to newer Autotools, this can probably go away.AC_CANONICAL_SYSTEMcase $host in*-*-solaris*) AC_DEFINE(PLAYER_SOLARIS,1,[building for Solaris]);;*-*-linux*) AC_DEFINE(PLAYER_LINUX,1,[building for Linux]);;esacdnl Need AC_PROG_MAKE_SET for recursive buildingAC_PROG_MAKE_SETdnl Generate a configuration header called <config.h> and put all the Cdnl preprocessor defines in thereAM_CONFIG_HEADER(config.h)dnl Define this so that we can refer to it twice belowdnl PS_VERSION is the major.minor version that is common for Player anddnl Stage. All revisions with this major.minor version must be forwards dnl and backwards compatible. This number is used for the install directories.define(PS_VERSION,1.3)dnl STAGE_VERSION is major.minor.revision - unique to this release and dnl independent of Player's revision numberdefine(STAGE_VERSION,PS_VERSION.3)dnl Initialize automake with name and version of package to be built. dnl PACKAGE and VERSION will be so defined in <config.h>.AM_INIT_AUTOMAKE(stage-src,STAGE_VERSION)dnl Checks for programs.AC_PROG_CCAC_PROG_CXXAC_PROG_INSTALLAC_PROG_RANLIBdnl Checks for header files.AC_CHECK_HEADERS(stdint.h strings.h values.h)dnl Check for types that are not defined on some systemsdnl Test for socklen_t and define it to int if it's not there.dnl Note that we can't simply dnl use AC_CHECK_TYPE because socklen_t dnl isn't in the standard headers (autoconf-2.5 has better methods for this)AC_MSG_CHECKING(if socklen_t is defined)AC_TRY_COMPILE( [#include <sys/types.h> #include <sys/socket.h>], [socklen_t len = 42; return len;], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) AC_DEFINE(socklen_t, int, must define this on BSD-based platforms)])dnl Checks for library functions.AC_REPLACE_FUNCS(poll dirname)AC_CHECK_LIB(z, gzopen)AC_CHECK_LIB(nsl, gethostbyname)AC_CHECK_LIB(socket, connect)dnl **********************************************************************dnl Begin GUI configurationdnl **********************************************************************dnl This macro does all the checking for RTK, taking into account --prefixdnl and --with-rtk. Please don't change this macro, unless you also change dnl the version in player/m4.d/drivertests.m4.AC_DEFUN([RTK_CHECK],[dnl where's RTK?AC_ARG_WITH(rtk, [ --with-rtk=dir Location of RTK],RTK_DIR=$with_rtk,RTK_DIR=$prefix)dnl RTK2 uses libjpeg to export images.AC_CHECK_HEADER(jpeglib.h, AC_DEFINE(HAVE_JPEGLIB_H,1,[include jpeg support]) LIBJPEG="-ljpeg",,)AC_SUBST(LIBJPEG)AC_CHECK_PROG([have_gtk], [gtk-config], [yes], [no])if test "x$have_gtk" = "xyes"; then if test "x$RTK_DIR" = "xNONE"; then AC_CHECK_LIB(rtk,rtk_init, AC_CHECK_LIB(rtk,LIBRTK_VERSION_2_2, with_rtk=yes, AC_MSG_WARN([Your librtk installation is too old (< 2.2).]) AC_MSG_WARN([Either download a newer version of librtk]) AC_MSG_WARN([or pass --without-rtk to configure.]) AC_MSG_ERROR([RTK is too old]), [$LIBJPEG `gtk-config --libs gtk gthread`]), with_rtk=no, [$LIBJPEG `gtk-config --libs gtk gthread`]) RTK_CPPFLAGS="`gtk-config --cflags`" RTK_LDADD="-lrtk $LIBJPEG `gtk-config --libs gtk gthread`" elif test ! "x$RTK_DIR" = "xno"; then AC_CHECK_LIB(rtk,rtk_init, AC_CHECK_LIB(rtk,LIBRTK_VERSION_2_2, with_rtk=yes RTK_CPPFLAGS="-I$RTK_DIR/include `gtk-config --cflags`" RTK_LDADD="-L$RTK_DIR/lib -lrtk $LIBJPEG `gtk-config --libs gtk gthread`", AC_MSG_WARN([Your librtk installation is too old (< 2.2).]) AC_MSG_WARN([Either download a newer version of librtk]) AC_MSG_WARN([or pass --without-rtk to configure.]) AC_MSG_ERROR([RTK is too old]), [-L$RTK_DIR/lib $LIBJPEG `gtk-config --libs gtk gthread`]), with_rtk=no, [-L$RTK_DIR/lib $LIBJPEG `gtk-config --libs gtk gthread`]) fielse with_rtk=nofiif test "x$with_rtk" = "xno"; then AC_MSG_WARN([***************************************************]) AC_MSG_WARN([Couldn't find RTK so I won't build RTK-based GUIs]) AC_MSG_WARN([Maybe you should download and install RTK?]) AC_MSG_WARN([If you have RTK installed, try --with-rtk=path]) AC_MSG_WARN([***************************************************])fiAM_CONDITIONAL(WITH_RTK, test x$with_rtk = xyes)AC_SUBST(RTK_CPPFLAGS)AC_SUBST(RTK_LDADD)])dnl invoke above macroRTK_CHECKdnl Based on which GUI we're using (assuming there are ever more than one),dnl set some variables that will used during the build.if test "x$with_rtk" = "xyes"; then with_gui=yes AC_DEFINE(INCLUDE_RTK2,1,[include the RTK GUI]) GUI_LIB=librtkstage.a GUI_LIBPATH=rtkstage/$GUI_LIB GUI_LDADD=$RTK_LDADD GUI_CPPFLAGS=$RTK_CPPFLAGSelse with_gui=nofiAC_SUBST(GUI_LIB)AC_SUBST(GUI_LIBPATH)AC_SUBST(GUI_LDADD)AC_SUBST(GUI_CPPFLAGS)dnl **********************************************************************dnl End GUI configurationdnl **********************************************************************dnl **********************************************************************dnl Begin Player configurationdnl **********************************************************************AC_DEFUN([PLAYER_CHECK],[dnl where's player?AC_ARG_WITH(player, [ --with-player=dir Location of Player (installation or source)],PLAYER_DIR=$with_player,PLAYER_DIR=$prefix)if test "x$PLAYER_DIR" = "xNONE"; then AC_CHECK_HEADER(player.h, with_player=yes PLAYER_CPPFLAGS="" PLAYER_LDADD="-lplayerpacket -lplayerqueue -lplayerclient", with_player=no)else AC_MSG_CHECKING(for $PLAYER_DIR/include/player.h) if test -f $PLAYER_DIR/include/player.h; then AC_MSG_RESULT(yes) PLAYER_CPPFLAGS="-I$PLAYER_DIR/include" PLAYER_LDADD="-L$PLAYER_DIR/lib -lplayerqueue -lplayerpacket -lplayerclient" elif test -f $PLAYER_DIR/server/player.h; then AC_MSG_RESULT(yes) PLAYER_CPPFLAGS="-I$PLAYER_DIR/server -I$PLAYER_DIR/server/drivers/stage -I$PLAYER_DIR/client_libs/libplayerpacket -I$PLAYER_DIR/client_libs/c -I$PLAYER_DIR/client_libs/c++" PLAYER_LDADD="-L$PLAYER_DIR/server -lplayerqueue -L$PLAYER_DIR/client_libs/libplayerpacket -lplayerpacket -L$PLAYER_DIR/client_libs/c++ -lplayerclient" else with_player=no fifiif test "x$with_player" = "xno"; then AC_MSG_RESULT([Could not find player.h. Player is required to build Stage.]) AC_MSG_RESULT([You can specify a path to Player like this:]) AC_MSG_RESULT([ ./configure --with-player=<Player prefix dir>]) AC_MSG_ERROR([Configuration aborted. Fix the Player path.])fiAC_SUBST(PLAYER_CPPFLAGS)AC_SUBST(PLAYER_LDADD)])PLAYER_CHECKdnl **********************************************************************dnl End Player configurationdnl **********************************************************************dnl where's the X11-style color database?AC_CHECK_FILE([/usr/X11R6/lib/X11/rgb.txt], CDB="\"/usr/X11R6/lib/X11/rgb.txt\"", AC_CHECK_FILE([/usr/openwin/lib/X11/rgb.txt], CDB="\"/usr/openwin/lib/X11/rgb.txt\"", CDB="\"/usr/X11R6/lib/X11/rgb.txt\""))AC_ARG_WITH(color, [ --with-color=file Location of X11-style color file],CDB="\"$with_color\"",)AC_DEFINE_UNQUOTED(COLOR_DATABASE,$CDB,[the X11-style color database])dnl should tests (e.g., RTK) be built?AC_ARG_WITH(tests, [ --with-tests Build tests],,with_tests=yes)AM_CONDITIONAL(WITH_TESTS, test x$with_tests = xyes)AC_OUTPUT(Makefile src/Makefile src/models/Makefile src/rtkstage/Makefile worlds/Makefile tools/Makefile)dnl should use AC_MSG_NOTICE(), but that's apparently not defined indnl autoconf 2.13.AC_MSG_RESULT([])AC_MSG_RESULT([*************************************************************])AC_MSG_RESULT([])AC_MSG_RESULT([Stage will be built on a $build system to run])AC_MSG_RESULT([on a $host system, with the following tools:])AC_MSG_RESULT([ C compiler: $CC $CFLAGS])AC_MSG_RESULT([ C++ compiler: $CXX $CXXFLAGS])AC_MSG_RESULT([])AC_MSG_RESULT([Stage will build against Player using:])AC_MSG_RESULT([ CPPFLAGS: $PLAYER_CPPFLAGS])AC_MSG_RESULT([ LDFLAGS: $PLAYER_LDADD])AC_MSG_RESULT([])if test "x$with_gui" = "xno"; then AC_MSG_RESULT([Stage will NOT build any GUI.]) AC_MSG_RESULT([]) else AC_MSG_RESULT([Stage will build a GUI using:]) AC_MSG_RESULT([ CPPFLAGS: $GUI_CPPFLAGS]) AC_MSG_RESULT([ LDFLAGS: $GUI_LDADD]) AC_MSG_RESULT([])fiAC_MSG_RESULT([Stage will be installed in:])AC_MSG_RESULT([ $prefix/])AC_MSG_RESULT([])AC_MSG_RESULT([To see the configuration options, do:])AC_MSG_RESULT([ ./configure --help])AC_MSG_RESULT([])AC_MSG_RESULT([When you're satisfied with the configuration, type 'make install'. ])AC_MSG_RESULT([])
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -