dnl dnl This file is used by GNU autoconf to produce a shell script dnl called "configure". The "configure" shell script is run to dnl 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_CC AC_PROG_CXX INC="" LDFLAGS="" LIBS="" solaris=0 sunos=0 AC_CANONICAL_SYSTEM case "$target" in sparc-sun-solaris*) solaris=1 ;; sparc-sun-sunos4*) sunos=1 ;; esac COMPAT_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" fi fi if test "$found_snprintf" = "yes" ; then AC_DEFINE(HAVE_SNPRINTF) fi #---------------------------------------- # Find X11 header files and libraries #---------------------------------------- AC_PATH_X if test "$no_x" = "yes" ; then AC_MSG_ERROR([Can't find X11 header files.]) fi if test "$x_includes" != "" ; then INC="$INC -I$x_includes" fi if test "$x_libraries" != "" ; then if test "$solaris" = 1 ; then LDFLAGS="$LDFLAGS -R$x_libraries" fi LDFLAGS="$LDFLAGS -L$x_libraries" fi X11_LIB="-lX11" # XXX any other X libs? #---------------------------------------- # Find Tcl/Tk (need versions >= 7.5/4.1) #---------------------------------------- # Find Tcl found_tcl_h="no" libtcl="no" AC_MSG_CHECKING(for tcl.h) places="/usr/local/include/tcl8.3" 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.]) fi AC_MSG_CHECKING(for libtcl) places="$dir/lib \ /usr/local/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/libtcl83.a ; then AC_MSG_RESULT($place/libtcl83.a) LDFLAGS="$LDFLAGS -L$place" libtcl="-ltcl83" 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.]) fi found_init_tcl="no" AC_MSG_CHECKING(for Tcl runtime libraries) places="/usr/local/lib/tcl8.3" for place in $places; do if test -r $place/init.tcl ; then AC_MSG_RESULT($place) TCL_LIB=$place found_init_tcl="yes" break fi done if 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 Tk found_tk_h="no" libtk="no" AC_MSG_CHECKING(for tk.h) places="/usr/local/include/tk8.3" 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.]) fi AC_MSG_CHECKING(for libtk) places="$dir/lib \ /usr/local/lib \ $prefix/lib \ $x_libraries" for place in $places; do if test -r $place/libtk83.a ; then AC_MSG_RESULT($place/libtk83.a) LDFLAGS="$LDFLAGS -L$place" libtk="-ltk83" 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.]) fi found_tk_tcl="no" AC_MSG_CHECKING(for Tk runtime libraries) places="/usr/local/lib/tk8.3" for place in $places; do if test -r $place/tk.tcl ; then AC_MSG_RESULT($place) TK_LIB=$place found_tk_tcl="yes" break fi done if test "$found_tk_tcl" = "no" ; then AC_MSG_RESULT(nope) AC_MSG_ERROR([Can't find tk.tcl. Try the --with-tk option.]) fi LIBS="$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 others esac AC_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)