home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / ObjectTcl-1.1 / configure.in < prev    next >
Encoding:
Text File  |  1995-06-30  |  4.1 KB  |  111 lines

  1. dnl----------------------------------------------------------------------------
  2. dnl configure.in -
  3. dnl----------------------------------------------------------------------------
  4. dnl  This file is an input file used by the GNU "autoconf" program to
  5. dnl  generate the file "configure", which is run to configure Object Tcl.
  6. dnl
  7. dnl  Although the generated configure script is under the GNU Public,
  8. dnl  License, Object Tcl has its own license terms.  See LICENSE.TXT for
  9. dnl  details.
  10. dnl----------------------------------------------------------------------------
  11. dnl $Id: configure.in,v 1.4 1995/05/11 14:42:22 deans Exp $
  12. dnl----------------------------------------------------------------------------
  13. AC_INIT(Otcl.H)
  14.  
  15. ifdef([AC_REVISION],AC_REVISION($Revision: 1.4 $),)dnl
  16.  
  17. AC_PROG_CXX
  18. AC_LANG_CPLUSPLUS
  19.  
  20. AC_PROG_RANLIB
  21. AC_PROG_INSTALL
  22.  
  23. #====================================================================
  24. # Begin code from Tk configure script.
  25.  
  26. #--------------------------------------------------------------------
  27. #    Locate the X11 header files and the X11 library archive.  Try
  28. #    the ac_path_x macro first, but if it doesn't find the X stuff
  29. #    (e.g. because there's no xmkmf program) then check through
  30. #    a list of possible directories.  Under some conditions the
  31. #    autoconf macro will return an include directory that contains
  32. #    no include files, so double-check its result just to be safe.
  33. #--------------------------------------------------------------------
  34.  
  35. AC_PATH_X
  36. if test "$no_x" = yes; then
  37.     XLIBSW=nope
  38.     if test "$XLIBSW" = nope; then
  39.     dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
  40.     for i in $dirs ; do
  41.         if test -r $i/libX11.a; then
  42.         XLIBSW="-L$i -lX11"
  43.         fi
  44.     done
  45.     fi
  46. else
  47.     if test "$x_libraries" = ""; then
  48.     XLIBSW=-lX11
  49.     else
  50.     XLIBSW="-L$x_libraries -lX11"
  51.     fi
  52. fi
  53. if test "$XLIBSW" = nope ; then
  54.     AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
  55. fi
  56. if test "$XLIBSW" = nope ; then
  57.     echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
  58.     XLIBSW=-lX11
  59. fi
  60. AC_SUBST(XLIBSW)
  61.  
  62. #--------------------------------------------------------------------
  63. #    Check for the existence of various libraries.  The order here
  64. #    is important, so that then end up in the right order in the
  65. #    command line generated by make.  The -lsocket and -lnsl libraries
  66. #    require a couple of special tricks:
  67. #    1. Use "connect" and "accept" to check for -lsocket, and
  68. #       "gethostbyname" to check for -lnsl.
  69. #    2. Use each function name only once:  can't redo a check because
  70. #       autoconf caches the results of the last check and won't redo it.
  71. #    3. Use -lnsl and -lsocket only if they supply procedures that
  72. #       aren't already present in the normal libraries.  This is because
  73. #       IRIX 5.2 has libraries, but they aren't needed and they're
  74. #       bogus:  they goof up name resolution if used.
  75. #    4. On some SVR4 systems, can't use -lsocket without -lnsl too.
  76. #       To get around this problem, check for both libraries together
  77. #       if -lsocket doesn't work by itself.
  78. #--------------------------------------------------------------------
  79.  
  80. AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"])
  81.  
  82. tk_checkBoth=0
  83. AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
  84. if test "$tk_checkSocket" = 1; then
  85.     AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tk_checkBoth=1)
  86. fi
  87. if test "$tk_checkBoth" = 1; then
  88.     tk_oldLibs=$LIBS
  89.     LIBS="$LIBS -lsocket -lnsl"
  90.     AC_CHECK_FUNC(accept, tk_checkNsl=0, [LIBS=$tk_oldLibs])
  91. fi
  92. AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
  93.  
  94. #--------------------------------------------------------------------
  95. #    On a few very rare systems, all of the libm.a stuff is
  96. #    already in libc.a.  Set compiler flags accordingly.
  97. #    Also, Linux requires the "ieee" library for math to
  98. #    work right.
  99. #--------------------------------------------------------------------
  100.  
  101. MATHLIBS=""
  102. AC_FUNC_CHECK(sin, , MATH_LIBS="-lm")
  103. AC_CHECK_LIB(ieee, main, [MATHLIBS="$MATHLIBS -lieee"])
  104. AC_SUBST(MATH_LIBS)
  105.  
  106. # End code from Tk configure script.
  107. #====================================================================
  108.  
  109. AC_PATH_X
  110. AC_OUTPUT(Makefile)
  111.