home *** CD-ROM | disk | FTP | other *** search
/ Practical Programming in Tcl & Tk (4th Edition) / TCLBOOK4.BIN / mac / extensions / tktreectrl / tktreectrl-1.0-7.tar.gz / tktreectrl-1.0-7.tar / tktreectrl-1.0-7 / configure.ac < prev    next >
Text File  |  2002-12-17  |  8KB  |  211 lines

  1. #!/bin/bash -norc
  2. dnl    This file is an input file used by the GNU "autoconf" program to
  3. dnl    generate the file "configure", which is run during Tcl installation
  4. dnl    to configure the system for the local environment.
  5. #
  6. # RCS: @(#) $Id: configure.ac,v 1.1.1.1 2002/12/17 05:04:18 treectrl Exp $
  7.  
  8. #-----------------------------------------------------------------------
  9. # Sample configure.in for Tcl Extensions.  The only places you should
  10. # need to modify this file are marked by the string __CHANGE__
  11. #-----------------------------------------------------------------------
  12.  
  13. #-----------------------------------------------------------------------
  14. # __CHANGE__
  15. # This very first macro is used to verify that the configure script can 
  16. # find the sources.  The argument to AC_INIT should be a unique filename
  17. # for this package, and can be a relative path, such as:
  18. #
  19. # AC_INIT(generic/tcl.h)
  20. #-----------------------------------------------------------------------
  21.  
  22. AC_INIT(generic/tkTreeCtrl.h)
  23.  
  24. AC_CONFIG_AUX_DIR(tclconfig)
  25. CONFIGDIR=${srcdir}/tclconfig
  26. AC_SUBST(CONFIGDIR)
  27.  
  28. #----------------------------------------------------------------------
  29. # __CHANGE__
  30. # Set your package name and version numbers here.  The NODOT_VERSION is
  31. # required for constructing the library name on systems that don't like
  32. # dots in library names (Windows).  The VERSION variable is used on the
  33. # other systems.
  34. #----------------------------------------------------------------------
  35.  
  36. PACKAGE=treectrl
  37.  
  38. MAJOR_VERSION=1
  39. MINOR_VERSION=0
  40. PATCHLEVEL=
  41.  
  42. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}${PATCHLEVEL}
  43. NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
  44.  
  45. AC_SUBST(PACKAGE)
  46. AC_SUBST(VERSION)
  47. # This package name must be replaced statically for AC_SUBST to work
  48. AC_SUBST(treectrl_LIB_FILE)
  49. # Substitute stub_LIB_FILE if your package creates a stub library too.
  50. #AC_SUBST(samplestub_LIB_FILE)
  51.  
  52. #--------------------------------------------------------------------
  53. # We put this here so that you can compile with -DVERSION="1.2" to
  54. # encode the package version directly into the source files.
  55. #--------------------------------------------------------------------
  56.  
  57. eval AC_DEFINE_UNQUOTED(VERSION, "${VERSION}")
  58.  
  59. #--------------------------------------------------------------------
  60. # Call TEA_INIT as the first TEA_ macro to set up initial vars.
  61. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows".
  62. #--------------------------------------------------------------------
  63.  
  64. TEA_INIT
  65.  
  66. #--------------------------------------------------------------------
  67. # Load the tclConfig.sh file
  68. #--------------------------------------------------------------------
  69.  
  70. TEA_PATH_TCLCONFIG
  71. TEA_LOAD_TCLCONFIG
  72.  
  73. #--------------------------------------------------------------------
  74. # Load the tkConfig.sh file if necessary (Tk extension)
  75. #--------------------------------------------------------------------
  76.  
  77. TEA_PATH_TKCONFIG
  78. TEA_LOAD_TKCONFIG
  79.  
  80. #-----------------------------------------------------------------------
  81. # Handle the --prefix=... option by defaulting to what Tcl gave.
  82. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
  83. #-----------------------------------------------------------------------
  84.  
  85. TEA_PREFIX
  86.  
  87. #-----------------------------------------------------------------------
  88. # Standard compiler checks.
  89. # This sets up CC by using the CC env var, or looks for gcc otherwise.
  90. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
  91. # the basic setup necessary to compile executables.
  92. #-----------------------------------------------------------------------
  93.  
  94. TEA_SETUP_COMPILER
  95.  
  96. #--------------------------------------------------------------------
  97. # __CHANGE__
  98. # Choose which headers you need.  Extension authors should try very
  99. # hard to only rely on the Tcl public header files.  Internal headers
  100. # contain private data structures and are subject to change without
  101. # notice.
  102. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
  103. #--------------------------------------------------------------------
  104.  
  105. #TEA_PUBLIC_TCL_HEADERS
  106. TEA_PRIVATE_TCL_HEADERS
  107.  
  108. #TEA_PUBLIC_TK_HEADERS
  109. TEA_PRIVATE_TK_HEADERS
  110.  
  111. #--------------------------------------------------------------------
  112. # __CHANGE__
  113. # A few miscellaneous platform-specific items:
  114. #
  115. # Define a special symbol for Windows (BUILD_sample in this case) so
  116. # that we create the export library with the dll.  See sha1.h on how
  117. # to use this.
  118. #
  119. # Windows creates a few extra files that need to be cleaned up.
  120. # You can add more files to clean if your extension creates any extra
  121. # files.
  122. #
  123. # Define any extra compiler flags in the PACKAGE_CFLAGS variable.
  124. # These will be appended to the current set of compiler flags for
  125. # your system.
  126. #--------------------------------------------------------------------
  127.  
  128. if test "${TEA_PLATFORM}" = "windows" ; then
  129.     AC_DEFINE(BUILD_treectrl)
  130.     CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
  131.     EXTRA_SOURCES='$(WIN_SOURCES)'
  132. else
  133.     CLEANFILES="pkgIndex.tcl"
  134.     EXTRA_SOURCES='$(UNIX_SOURCES)'
  135. fi
  136. AC_SUBST(CLEANFILES)
  137. AC_SUBST(EXTRA_SOURCES)
  138.  
  139. #--------------------------------------------------------------------
  140. # Check whether --enable-threads or --disable-threads was given.
  141. #--------------------------------------------------------------------
  142.  
  143. TEA_ENABLE_THREADS
  144.  
  145. #--------------------------------------------------------------------
  146. # The statement below defines a collection of symbols related to
  147. # building as a shared library instead of a static library.
  148. #--------------------------------------------------------------------
  149.  
  150. TEA_ENABLE_SHARED
  151.  
  152. #--------------------------------------------------------------------
  153. # This macro figures out what flags to use with the compiler/linker
  154. # when building shared/static debug/optimized objects.  This information
  155. # can be taken from the tclConfig.sh file, but this figures it all out.
  156. #--------------------------------------------------------------------
  157.  
  158. TEA_CONFIG_CFLAGS
  159.  
  160. #--------------------------------------------------------------------
  161. # Set the default compiler switches based on the --enable-symbols option.
  162. #--------------------------------------------------------------------
  163.  
  164. TEA_ENABLE_SYMBOLS
  165.  
  166. #--------------------------------------------------------------------
  167. # Everyone should be linking against the Tcl stub library.  If you
  168. # can't for some reason, remove this definition.  If you aren't using
  169. # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
  170. # link against the non-stubbed Tcl library.  Add Tk too if necessary.
  171. #--------------------------------------------------------------------
  172.  
  173. AC_DEFINE(USE_TCL_STUBS)
  174. AC_DEFINE(USE_TK_STUBS)
  175.  
  176. #--------------------------------------------------------------------
  177. # This macro generates a line to use when building a library.  It
  178. # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
  179. # and TEA_LOAD_TCLCONFIG macros above.
  180. #--------------------------------------------------------------------
  181.  
  182. TEA_MAKE_LIB
  183.  
  184. #--------------------------------------------------------------------
  185. # __CHANGE__
  186. # Add platform libs to LIBS or SHLIB_LD_LIBS as necessary.
  187. #--------------------------------------------------------------------
  188.  
  189. #LIBS="${LIBS} -lsuperfly"
  190. LIBS="${LIBS} ${TK_LIBS}"
  191.  
  192. #--------------------------------------------------------------------
  193. # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
  194. # file during the install process.  Don't run the TCLSH_PROG through
  195. # ${CYGPATH} because it's being used directly by make.
  196. # Require that we use a tclsh shell version 8.2 or later since earlier
  197. # versions have bugs in the pkg_mkIndex routine.
  198. # Add WISH as well if this is a Tk extension.
  199. #--------------------------------------------------------------------
  200.  
  201. TEA_PROG_TCLSH
  202. TEA_PROG_WISH
  203.  
  204. #--------------------------------------------------------------------
  205. # Finally, substitute all of the various values into the Makefile.
  206. # You may alternatively have a special pkgIndex.tcl.in or other files
  207. # which require substituting th AC variables in.  Include these here.
  208. #--------------------------------------------------------------------
  209.  
  210. AC_OUTPUT([Makefile pkgIndex.tcl])
  211.