OSDN Git Service

Merge branch 'master' of git://github.com/monaka/binutils
[pf3gnuchains/pf3gnuchains3x.git] / itcl / itcl / configure.ac
1 #!/bin/bash -norc
2 #--------------------------------------------------------------------
3 # Sample configure.in for Tcl Extensions.  The only places you should
4 # need to modify this file are marked by the string __CHANGE__
5 #--------------------------------------------------------------------
6
7 #-----------------------------------------------------------------------
8 # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
9 # set as provided.  These will also be added as -D defs in your Makefile
10 # so you can encode the package version directly into the source files.
11 #-----------------------------------------------------------------------
12
13 AC_INIT([itcl], [3.3])
14
15 #--------------------------------------------------------------------
16 # Call TEA_INIT as the first TEA_ macro to set up initial vars.
17 # This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
18 # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
19 #--------------------------------------------------------------------
20
21 TEA_INIT([3.2])
22
23 AC_PROG_LN_S
24 CONFIG_CLEAN_FILES=
25 if test ! -d $srcdir/tclconfig ; then
26     if test -d $srcdir/../tclconfig ; then
27         $LN_S $srcdir/../tclconfig tclconfig
28         CONFIG_CLEAN_FILES=tclconfig
29     fi
30 fi
31 AC_SUBST(CONFIG_CLEAN_FILES)
32
33 AC_CONFIG_AUX_DIR(tclconfig)
34
35 #--------------------------------------------------------------------
36 # Load the tclConfig.sh file
37 #--------------------------------------------------------------------
38
39 TEA_PATH_TCLCONFIG
40 TEA_LOAD_TCLCONFIG
41
42 #-----------------------------------------------------------------------
43 # Handle the --prefix=... option by defaulting to what Tcl gave.
44 # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
45 #-----------------------------------------------------------------------
46
47 TEA_PREFIX
48
49 #-----------------------------------------------------------------------
50 # Standard compiler checks.
51 # This sets up CC by using the CC env var, or looks for gcc otherwise.
52 # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
53 # the basic setup necessary to compile executables.
54 #-----------------------------------------------------------------------
55
56 TEA_SETUP_COMPILER
57
58 #-----------------------------------------------------------------------
59 # __CHANGE__
60 # Specify the C source files to compile in TEA_ADD_SOURCES,
61 # public headers that need to be installed in TEA_ADD_HEADERS,
62 # stub library C source files to compile in TEA_ADD_STUB_SOURCES,
63 # and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
64 # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
65 # and PKG_TCL_SOURCES.
66 #-----------------------------------------------------------------------
67
68 TEA_ADD_SOURCES([itclStubInit.c
69                 itcl_bicmds.c
70                 itcl_class.c
71                 itcl_cmds.c
72                 itcl_ensemble.c
73                 itcl_linkage.c
74                 itcl_methods.c
75                 itcl_migrate.c
76                 itcl_objects.c
77                 itcl_parse.c
78                 itcl_util.c])
79 TEA_ADD_HEADERS([generic/itcl.h
80                 generic/itclDecls.h
81                 generic/itclInt.h
82                 generic/itclIntDecls.h])
83 TEA_ADD_INCLUDES([-I\"`${CYGPATH} ${srcdir}/generic`\"])
84 TEA_ADD_LIBS([])
85 TEA_ADD_CFLAGS([])
86 TEA_ADD_STUB_SOURCES([itclStubLib.c])
87 TEA_ADD_TCL_SOURCES([library/itcl.tcl])
88
89 #--------------------------------------------------------------------
90 # __CHANGE__
91 # A few miscellaneous platform-specific items:
92 #
93 # Define a special symbol for Windows (BUILD_itcl in this case) so
94 # that we create the export library with the dll.  See sha1.h on how
95 # to use this.
96 #
97 # Windows creates a few extra files that need to be cleaned up.
98 # You can add more files to clean if your extension creates any extra
99 # files.
100 #
101 # Define any extra compiler flags in the PACKAGE_CFLAGS variable.
102 # These will be appended to the current set of compiler flags for
103 # your system.
104 #--------------------------------------------------------------------
105
106 if test "${TEA_PLATFORM}" = "windows" ; then
107     AC_DEFINE(BUILD_itcl)
108     CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
109     TEA_ADD_SOURCES([dllEntryPoint.c])
110 else
111     CLEANFILES=
112     #TEA_ADD_SOURCES([])
113 fi
114
115 AC_SUBST(CLEANFILES)
116
117 #--------------------------------------------------------------------
118 # __CHANGE__
119 # Choose which headers you need.  Extension authors should try very
120 # hard to only rely on the Tcl public header files.  Internal headers
121 # contain private data structures and are subject to change without
122 # notice.
123 # This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
124 # so that we can extract TCL_SRC_DIR from the config file (in the case
125 # of private headers
126 #--------------------------------------------------------------------
127
128 #TEA_PUBLIC_TCL_HEADERS
129 TEA_PRIVATE_TCL_HEADERS
130
131 #--------------------------------------------------------------------
132 # We need to enable the threading macros found in tcl.h and tclInt.h.
133 # The use of the threading features is determined by the core the
134 # extension is loaded into, but we need to compile with these macros
135 # turned on.
136 #--------------------------------------------------------------------
137
138 AC_DEFINE(TCL_THREADS)
139
140 #--------------------------------------------------------------------
141 # Check whether --enable-threads or --disable-threads was given.
142 # This auto-enables if Tcl was compiled threaded.
143 #--------------------------------------------------------------------
144
145 #TEA_ENABLE_THREADS
146
147 #--------------------------------------------------------------------
148 # The statement below defines a collection of symbols related to
149 # building as a shared library instead of a static library.
150 #--------------------------------------------------------------------
151
152 TEA_ENABLE_SHARED
153
154 #--------------------------------------------------------------------
155 # This macro figures out what flags to use with the compiler/linker
156 # when building shared/static debug/optimized objects.  This information
157 # can be taken from the tclConfig.sh file, but this figures it all out.
158 #--------------------------------------------------------------------
159
160 TEA_CONFIG_CFLAGS
161
162 #--------------------------------------------------------------------
163 # Set the default compiler switches based on the --enable-symbols 
164 # option.
165 #--------------------------------------------------------------------
166
167 TEA_ENABLE_SYMBOLS
168
169 #--------------------------------------------------------------------
170 # Everyone should be linking against the Tcl stub library.  If you
171 # can't for some reason, remove this definition.  If you aren't using
172 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
173 # link against the non-stubbed Tcl library.
174 #--------------------------------------------------------------------
175
176 if test "${SHARED_BUILD}" = "1" ; then
177     AC_DEFINE(USE_TCL_STUBS)
178 fi
179
180 #--------------------------------------------------------------------
181 # This macro generates a line to use when building a library.  It
182 # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
183 # and TEA_LOAD_TCLCONFIG macros above.
184 #--------------------------------------------------------------------
185
186 TEA_MAKE_LIB
187
188 #--------------------------------------------------------------------
189 # __CHANGE__
190 # Change the name from exampeA_LIB_FILE to match your package name.
191 # Use the stub_LIB_FILE substitution if your package creates a stub
192 # library.
193 #--------------------------------------------------------------------
194
195 itcl_STUB_LIB_FILE=${PKG_STUB_LIB_FILE}
196 itcl_LIB_FILE=${PKG_LIB_FILE}
197 AC_SUBST(itcl_STUB_LIB_FILE)
198 AC_SUBST(itcl_LIB_FILE)
199
200 #--------------------------------------------------------------------
201 # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
202 # file during the install process.  Don't run the TCLSH_PROG through
203 # ${CYGPATH} because it's being used directly by make.
204 # Require that we use a tclsh shell version 8.2 or later since earlier
205 # versions have bugs in the pkg_mkIndex routine.
206 #--------------------------------------------------------------------
207
208 TEA_PROG_TCLSH
209
210 #--------------------------------------------------------------------
211 # These are for itclConfig.sh
212 #--------------------------------------------------------------------
213
214 # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib)
215 eval pkglibdir="${libdir}/${PACKAGE_NAME}${PACKAGE_VERSION}"
216 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
217     eval itcl_LIB_FLAG="-litcl${PACKAGE_VERSION}${DBGX}"
218     eval itcl_STUB_LIB_FLAG="-litclstub${PACKAGE_VERSION}${DBGX}"
219 else
220     eval itcl_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
221     eval itcl_STUB_LIB_FLAG="-litclstub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
222 fi
223 itcl_BUILD_LIB_SPEC="-L`pwd` ${itcl_LIB_FLAG}"
224 itcl_LIB_SPEC="-L${pkglibdir} ${itcl_LIB_FLAG}"
225
226 itcl_BUILD_STUB_LIB_SPEC="-L`pwd` ${itcl_STUB_LIB_FLAG}"
227 itcl_STUB_LIB_SPEC="-L${pkglibdir} ${itcl_STUB_LIB_FLAG}"
228 itcl_BUILD_STUB_LIB_PATH="`pwd`/${itcl_STUB_LIB_FILE}"
229 itcl_STUB_LIB_PATH="${pkglibdir}/${itcl_STUB_LIB_FILE}"
230
231 AC_SUBST(itcl_BUILD_LIB_SPEC)
232 AC_SUBST(itcl_LIB_SPEC)
233 AC_SUBST(itcl_BUILD_STUB_LIB_SPEC)
234 AC_SUBST(itcl_STUB_LIB_SPEC)
235 AC_SUBST(itcl_BUILD_STUB_LIB_PATH)
236 AC_SUBST(itcl_STUB_LIB_PATH)
237
238 # itcl_SRC_DIR must be a fully qualified path
239 eval itcl_SRC_DIR="$srcdir"
240 itcl_SRC_DIR=`cd "${itcl_SRC_DIR}"; pwd`
241 AC_SUBST(itcl_SRC_DIR)
242
243 #--------------------------------------------------------------------
244 # Finally, substitute all of the various values into the Makefile.
245 #--------------------------------------------------------------------
246
247 AC_OUTPUT([Makefile pkgIndex.tcl itclConfig.sh])