📄 configure.in
字号:
dnldnl This file is used by GNU autoconf to produce a shell scriptdnl called "configure". The "configure" shell script is run todnl produce a Makefile customized for the local environment.dnl# $Id: configure.in,v 1.9 1997/01/15 22:31:11 aswan Exp $AC_INIT(main.cc)AC_PROG_CCAC_PROG_CXXINC=""LDFLAGS=""LIBS=""solaris=0sunos=0AC_CANONICAL_SYSTEMcase "$target" in sparc-sun-solaris*) solaris=1 ;; sparc-sun-sunos4*) sunos=1 ;;esacCOMPAT_OBJS=""#---------------------------------------# Look for a few header files#---------------------------------------AC_CHECK_HEADERS(stdarg.h sys/bitypes.h sys/select.h sys/types.h varargs.h)RTPMON_PROG_CXX_MCAST#----------------------------------------# See if we have snprintf()#----------------------------------------found_snprintf="no"AC_CHECK_FUNC(snprintf, found_snprintf="yes")if test "$found_snprintf" = "no" ; then # an undocumented solaris 2.5 feature... AC_CHECK_FUNC(_snprintf, found_snprintf="yes") if test "$found_snprintf" = "yes" ; then AC_DEFINE(snprintf,_snprintf) else COMPAT_OBJS="${COMPAT_OBJS} snprintf.o" fifiif test "$found_snprintf" = "yes" ; then AC_DEFINE(HAVE_SNPRINTF)fi#----------------------------------------# Find X11 header files and libraries#----------------------------------------AC_PATH_Xif test "$no_x" = "yes" ; then AC_MSG_ERROR([Can't find X11 header files.])fiif test "$x_includes" != "" ; then INC="$INC -I$x_includes"fiif test "$x_libraries" != "" ; then if test "$solaris" = 1 ; then LDFLAGS="$LDFLAGS -R$x_libraries" fi LDFLAGS="$LDFLAGS -L$x_libraries"fiX11_LIB="-lX11"# XXX any other X libs?#----------------------------------------# Find Tcl/Tk (need versions >= 7.5/4.1)#----------------------------------------# Find Tclfound_tcl_h="no"libtcl="no"AC_ARG_WITH(tcl, --with-tcl=path Specify a path for Tcl, dir=$withval, dir="none")if test "$dir" = "none" ; then AC_CHECK_HEADER(tcl.h, found_tcl_h="yes", found_tcl_h="no") AC_CHECK_LIB(tcl7.6, Tcl_Init, libtcl="-ltcl7.6", libtcl="no") if test "$libtcl" = "no" ; then AC_CHECK_LIB(tcl7.5, Tcl_Init, libtcl="-ltcl7.5", libtcl="no") fi if test "$libtcl" = "no" ; then AC_CHECK_LIB(tcl, Tcl_Init, libtcl="-ltcl", libtcl="no") fifiif test "$found_tcl_h" = "no" ; then AC_MSG_CHECKING(for tcl.h) places="$dir/include \ ../tcl7.6/generic \ /usr/src/tcl7.6/generic \ /usr/local/src/tcl7.6/generic \ /usr/src/local/tcl7.6/generic \ ../tcl7.5/generic \ /usr/src/tcl7.5/generic \ /usr/local/src/tcl7.5/generic \ /usr/src/local/tcl7.5/generic \ /usr/include \ /usr/local/include \ /usr/contrib/include \ $prefix/include \ $x_includes" for place in $places ; do if test -r $place/tcl.h ; then AC_MSG_RESULT($place) INC="$INC -I$place" found_tcl_h="yes" break fi done if test "$libtcl" = "-ltcl" ; then AC_MSG_WARN([Tcl library may be too old (need verion 7.5 or later)]) fi if test "$found_tcl_h" = "no" ; then AC_MSG_RESULT(nope) AC_MSG_ERROR([Can't find tcl.h. Try the --with-tcl option.]) fifiif test "$libtcl" = "no" ; then AC_MSG_CHECKING(for libtcl) places="$dir/lib \ ../tcl7.6/unix \ /usr/src/tcl7.6/unix \ /usr/local/src/tcl7.6/unix \ /usr/src/local/tcl7.6/unix \ ../tcl7.5/unix \ /usr/src/tcl7.5/unix \ /usr/local/src/tcl7.5/unix \ /usr/src/local/tcl7.5/unix \ /usr/lib \ /usr/local/lib \ /usr/contrib/lib \ $prefix/lib \ $x_libraries" for place in $places; do if test "$solaris" = 1 ; then if test -r $place/libtcl7.6.so ; then AC_MSG_RESULT($place/libtcl7.6.so) LDFLAGS="$LDFLAGS -R$place -L$place" libtcl="-ltcl7.6" elif test -r $place/libtcl7.5.so ; then AC_MSG_RESULT($place/libtcl7.5.so) LDFLAGS="$LDFLAGS -R$place -L$place" libtcl="-ltcl7.5" elif test -r $place/lib/libtcl.so ; then AC_MSG_RESULT($place/libtcl.so) LDFLAGS="$LDFLAGS -R$place -L$place" libtcl="-ltcl" fi fi if test "$sunos" = 1 ; then if test -r $place/libtcl76.a ; then AC_MSG_RESULT($place/libtcl76.a) LDFLAGS="$LDFLAGS -L$place" libtcl="-ltcl76" elif test -r $place/libtcl75.a ; then AC_MSG_RESULT($place/libtcl75.a) LDFLAGS="$LDFLAGS -L$place" libtcl="-ltcl75" fi fi if test "$libtcl" = "no" ; then if test -r $place/libtcl7.6.a ; then AC_MSG_RESULT($place/libtcl7.6.a) LDFLAGS="$LDFLAGS -L$place" libtcl="-ltcl7.6" elif test -r $place/libtcl7.5.a ; then AC_MSG_RESULT($place/libtcl7.5.a) LDFLAGS="$LDFLAGS -L$place" libtcl="-ltcl7.5" elif test -r $place/libtcl.a ; then AC_MSG_RESULT($place/libtcl.a) LDFLAGS="$LDFLAGS -L$place" libtcl="-ltcl" fi fi if test "$libtcl" != "no" ; then break fi done if test "$libtcl" = "no" ; then AC_MSG_RESULT(nope) AC_MSG_ERROR([Can't find libtcl. Try the --with-tcl option.]) fififound_init_tcl="no"AC_MSG_CHECKING(for Tcl runtime libraries)places="$dir/lib/tcl7.6 \ $dir/share/lib/tcl7.6 \ ../tcl7.6/library \ /usr/src/tcl7.6/library \ /usr/local/src/tcl7.6/library \ /usr/src/local/tcl7.6/library \ /usr/lib/tcl7.6 \ /usr/share/lib/tcl7.6 \ /usr/local/lib/tcl7.6 \ /usr/local/share/lib/tcl7.6 \ /usr/contrib/lib/tcl7.6 \ /usr/contrib/share/lib/tcl7.6 \ $prefix/lib/tcl7.6 \ $prefix/share/lib/tcl7.6 \ $x_libraries/tcl7.6 \ $dir/lib/tcl7.5 \ $dir/share/lib/tcl7.5 \ ../tcl7.5/library \ /usr/src/tcl7.5/library \ /usr/local/src/tcl7.5/library \ /usr/src/local/tcl7.5/library \ /usr/lib/tcl7.5 \ /usr/share/lib/tcl7.5 \ /usr/local/lib/tcl7.5 \ /usr/local/share/lib/tcl7.5 \ /usr/contrib/lib/tcl7.5 \ /usr/contrib/share/lib/tcl7.5 \ $prefix/lib/tcl7.5 \ $prefix/share/lib/tcl7.5 \ $x_libraries/tcl7.5"for place in $places; do if test -r $place/init.tcl ; then AC_MSG_RESULT($place) TCL_LIB=$place found_init_tcl="yes" break fidoneif test "$found_init_tcl" = "no" ; then AC_MSG_RESULT(nope) AC_MSG_ERROR([Can't find init.tcl. Try the --with-tcl option.])fi# Find Tkfound_tk_h="no"libtk="no"AC_ARG_WITH(tk, --with-tk=path Specify a path for Tk, dir=$withval, dir="none")if test "$dir" = "none" ; then AC_CHECK_HEADER(tk.h, found_tk_h="yes", found_tk_h="no") if test "$sunos" = 1 ; then AC_CHECK_LIB(tk42, Tk_Init, libtk="-ltk42", libtk="no") if test "$libtk" = "no" ; then AC_CHECK_LIB(tk41, Tk_Init, libtk="-ltk41", libtk="no") fi else AC_CHECK_LIB(tk4.2, Tk_init, libtk="-ltk4.2", libtk="no") if test "$libtk" = "no" ; then AC_CHECK_LIB(tk4.1, Tk_Init, libtk="-ltk4.1", libtk="no") fi fi if test "$libtk" = "no" ; then AC_CHECK_LIB(tk, Tk_Init, libtk="-ltk", libtk="no") fifiif test "$found_tk_h" = "no" ; then AC_MSG_CHECKING(for tk.h) places="$dir/include \ ../tk4.1/generic \ /usr/src/tk4.1/generic \ /usr/local/src/tk4.1/generic \ /usr/src/local/tk4.1/generic \ /usr/include \ /usr/local/include \ /usr/contrib/include \ $prefix/include \ $x_includes" for place in $places; do if test -r $place/tk.h ; then AC_MSG_RESULT($place) INC="$INC -I$place" found_tk_h="yes" break fi done if test "$found_tk_h" = "no" ; then AC_MSG_RESULT(nope) AC_MSG_ERROR([Can't find tk.h. Try the --with-tk option.]) fifiif test "$libtk" = "no" ; then AC_MSG_CHECKING(for libtk) places="$dir/lib \ ../tk4.1/unix \ /usr/src/tk4.1/unix \ /usr/local/src/tk4.1/unix \ /usr/src/local/tk4.1/unix \ /usr/lib \ /usr/local/lib \ /usr/contrib/lib \ $prefix/lib \ $x_libraries" for place in $places; do if test "$solaris" = 1 ; then if test -r $place/libtk4.1.so ; then AC_MSG_RESULT($place/libtk4.1.so) LDFLAGS="$LDFLAGS -R$place -L$place" libtk="-ltk4.1" elif test -r $place/libtk.so ; then AC_MSG_RESULT($place/libtk.so) LDFLAGS="$LDFLAGS -R$place -L$place" libtk="-ltk" fi fi if test "$sunos" = 1 -a -r $place/libtk41.a ; then AC_MSG_RESULT($place/libtk41.a) LDFLAGS="$LDFLAGS -L$place" libtk="-ltk41" fi if test "$libtk" = "no" ; then if test -r $place/libtk4.2.a ; then AC_MSG_RESULT($place/libtk4.2.a) LDFLAGS="$LDFLAGS -L$place" libtk="-ltk4.2" elif test -r $place/libtk4.1.a ; then AC_MSG_RESULT($place/libtk4.1.a) LDFLAGS="$LDFLAGS -L$place" libtk="-ltk4.1" elif test -r $place/libtk.a ; then AC_MSG_RESULT($place/libtk.a) LDFLAGS="$LDFLAGS -L$place" libtk="-ltk" fi fi if test "$libtk" != "no" ; then break fi done if test "$libtk" = "-ltk" ; then AC_MSG_WARN([Tk library may be too old (need version 4.1 or later)]) fi if test "$libtk" = "no" ; then AC_MSG_RESULT(nope) AC_MSG_ERROR([Can't find libtk. Try the --with-tk option.]) fififound_tk_tcl="no"AC_MSG_CHECKING(for Tk runtime libraries)places="$dir/lib/tk4.2 \ $dir/share/lib/tk4.2 \ ../tk4.2/library \ /usr/src/tk4.2/library \ /usr/local/src/tk4.2/library \ /usr/src/local/tk4.2/library \ /usr/lib/tk4.2 \ /usr/share/lib/tk4.2 \ /usr/local/lib/tk4.2 \ /usr/local/share/lib/tk4.2 \ /usr/contrib/lib/tk4.2 \ /usr/contrib/share/lib/tk4.2 \ $prefix/lib/tk4.2 \ $prefix/share/lib/tk4.2 \ $x_libraries/tk4.2 \ $dir/lib/tk4.1 \ $dir/share/lib/tk4.1 \ ../tk4.1/library \ /usr/src/tk4.1/library \ /usr/local/src/tk4.1/library \ /usr/src/local/tk4.1/library \ /usr/lib/tk4.1 \ /usr/share/lib/tk4.1 \ /usr/local/lib/tk4.1 \ /usr/local/share/lib/tk4.1 \ /usr/contrib/lib/tk4.1 \ /usr/contrib/share/lib/tk4.1 \ $prefix/lib/tk4.1 \ $prefix/share/lib/tk4.1 \ $x_libraries/tk4.1"for place in $places; do if test -r $place/tk.tcl ; then AC_MSG_RESULT($place) TK_LIB=$place found_tk_tcl="yes" break fidoneif test "$found_tk_tcl" = "no" ; then AC_MSG_RESULT(nope) AC_MSG_ERROR([Can't find tk.tcl. Try the --with-tk option.])fiLIBS="$LIBS $libtk $libtcl $X11_LIB -lm"#----------------------------------------# Any extra libs#----------------------------------------case "$target" in *-*-hpux9*) LIBS="$LIBS -ldld" ;; sparc-sun-solaris*) LIBS="$LIBS -lnsl -lsocket -ldl" ;; *-sgi-irix*) V_SHELL="SHELL = /bin/sh" ;; *-ibm-aix4*) if "`basename $CXX`" = "xlC" ; then LIBS="$LIBS -lld" AC_DEFINE(_AIX41) fi ;; # need to add othersesacAC_SUBST(COMPAT_OBJS)AC_SUBST(INC)AC_SUBST(LDFLAGS)AC_SUBST(LIBS)AC_SUBST(TCL_LIB)AC_SUBST(TK_LIB)AC_SUBST(V_SHELL)AC_OUTPUT(Makefile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -