OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tcl8.6.12 / pkgs / tdbcpostgres1.1.3 / configure.ac
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 #-----------------------------------------------------------------------
7 # Sample configure.ac for Tcl Extensions.  The only places you should
8 # need to modify this file are marked by the string __CHANGE__
9 #-----------------------------------------------------------------------
10
11 #-----------------------------------------------------------------------
12 # __CHANGE__
13 # Set your package name and version numbers here.
14 #
15 # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
16 # set as provided.  These will also be added as -D defs in your Makefile
17 # so you can encode the package version directly into the source files.
18 # This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
19 # so that we create the export library with the dll.
20 #-----------------------------------------------------------------------
21
22 AC_INIT([tdbcpostgres],[1.1.3])
23
24 #--------------------------------------------------------------------
25 # Call TEA_INIT as the first TEA_ macro to set up initial vars.
26 # This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
27 # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
28 #--------------------------------------------------------------------
29
30 TEA_INIT()
31
32 AC_CONFIG_AUX_DIR(tclconfig)
33
34 #--------------------------------------------------------------------
35 # Load the tclConfig.sh file
36 #--------------------------------------------------------------------
37
38 TEA_PATH_TCLCONFIG
39 TEA_LOAD_TCLCONFIG
40
41 #--------------------------------------------------------------------
42 # Load the tkConfig.sh file if necessary (Tk extension)
43 #--------------------------------------------------------------------
44
45 #TEA_PATH_TKCONFIG
46 #TEA_LOAD_TKCONFIG
47
48 #--------------------------------------------------------------------
49 # Load the tclooConfig.sh file on Tcl versions where oo is an
50 # extension.
51 #--------------------------------------------------------------------
52
53 if test "${TCL_MAJOR_VERSION}" -lt 8 ; then
54     AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6 or newer.
55 Found configuration for Tcl ${TCL_VERSION}.])
56 fi
57 if test "${TCL_MAJOR_VERSION}" -eq 8 ; then
58    if test "${TCL_MINOR_VERSION}" -lt 6 ; then
59       AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6 or newer.
60 Found configuration for Tcl ${TCL_VERSION}.])
61    fi
62    TCLOO_CFLAGS=''
63 fi
64 TCL_VERSION_REQ=8.6; AC_SUBST(TCL_VERSION_REQ)
65
66 TEA_PATH_CONFIG(tdbc)
67 TEA_LOAD_CONFIG(tdbc)
68 # The next bit probably ought to be in TEA_LOAD_CONFIG
69 AC_MSG_WARN([Looking for "${tdbc_BIN_DIR}/Makefile"])
70 if test -f "${tdbc_BIN_DIR}/Makefile" ; then
71     AC_MSG_WARN([Found Makefile - using build include spec and lib specs for tdbc])
72     tdbc_INCLUDE_SPEC=${tdbc_BUILD_INCLUDE_SPEC}
73     tdbc_LIBRARY_PATH=${tdbc_BUILD_LIBRARY_PATH}
74 fi
75 AC_SUBST(tdbc_LIBRARY_PATH)
76 AC_SUBST(TDBC_VERSION)
77 AC_SUBST(tdbc_SRC_DIR)
78 AC_SUBST(tdbc_BIN_DIR)
79 AC_SUBST(TDBC_LIB_FILE)
80
81 #-----------------------------------------------------------------------
82 # Handle the --prefix=... option by defaulting to what Tcl gave.
83 # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
84 #-----------------------------------------------------------------------
85
86 TEA_PREFIX
87
88 #-----------------------------------------------------------------------
89 # Standard compiler checks.
90 # This sets up CC by using the CC env var, or looks for gcc otherwise.
91 # This also calls AC_PROG_CC and a few others to create the basic setup
92 # necessary to compile executables.
93 #-----------------------------------------------------------------------
94
95 TEA_SETUP_COMPILER
96
97 #-----------------------------------------------------------------------
98 # Setup inlining if available. Check sizeof long long, long.
99 #-----------------------------------------------------------------------
100
101 AC_C_INLINE
102 AC_CHECK_TYPE([long long],[
103     AC_DEFINE([HAVE_LONG_LONG],[1])
104     AC_CHECK_SIZEOF([long long])
105 ],[],[])
106 AC_CHECK_SIZEOF([long])
107
108 #-----------------------------------------------------------------------
109 # __CHANGE__
110 # Specify the C source files to compile in TEA_ADD_SOURCES,
111 # public headers that need to be installed in TEA_ADD_HEADERS,
112 # stub library C source files to compile in TEA_ADD_STUB_SOURCES,
113 # and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
114 # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
115 # and PKG_TCL_SOURCES.
116 #-----------------------------------------------------------------------
117
118 TEA_ADD_SOURCES(generic/tdbcpostgres.c generic/pqStubInit.c)
119 TEA_ADD_HEADERS(generic/fakepq.h generic/pqStubs.h)
120 if test "${TCL_MAJOR_VERSION}" -eq 8 ; then
121   if test "${TCL_MINOR_VERSION}" -eq 5 ; then
122     TEA_ADD_INCLUDES([${TCLOO_INCLUDE_SPEC}])
123     TEA_ADD_LIBS([${TCLOO_STUB_LIB_SPEC}])
124   fi
125 fi
126 TEA_ADD_CFLAGS([${TCLOO_CFLAGS}])
127 TEA_ADD_INCLUDES([${tdbc_INCLUDE_SPEC}])
128 if test "x${TEA_PLATFORM}" = "xwindows" -a "x${GCC}" != "xyes" ; then
129     TEA_ADD_LIBS([\"`${CYGPATH} ${tdbc_STUB_LIB_PATH}`\"])
130 else
131     TEA_ADD_LIBS([${tdbc_STUB_LIB_SPEC}])
132 fi
133 TEA_ADD_CFLAGS([${tdbc_CFLAGS}])
134 TEA_ADD_STUB_SOURCES()
135 TEA_ADD_TCL_SOURCES([library/tdbcpostgres.tcl])
136
137 #--------------------------------------------------------------------
138 # __CHANGE__
139 #
140 # You can add more files to clean if your extension creates any extra
141 # files by extending CLEANFILES.
142 # Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
143 # and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
144 #
145 # A few miscellaneous platform-specific items:
146 # TEA_ADD_* any platform specific compiler/build info here.
147 #--------------------------------------------------------------------
148
149 #CLEANFILES="$CLEANFILES pkgIndex.tcl"
150 if test "${TEA_PLATFORM}" = "windows" ; then
151     # Ensure no empty if clauses
152     :
153     #TEA_ADD_SOURCES([win/winFile.c])
154     #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
155 else
156     # Ensure no empty else clauses
157     :
158     #TEA_ADD_SOURCES([unix/unixFile.c])
159     #TEA_ADD_LIBS([-lsuperfly])
160 fi
161
162 #--------------------------------------------------------------------
163 # __CHANGE__
164 # Choose which headers you need.  Extension authors should try very
165 # hard to only rely on the Tcl public header files.  Internal headers
166 # contain private data structures and are subject to change without
167 # notice.
168 # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
169 #--------------------------------------------------------------------
170
171 TEA_PUBLIC_TCL_HEADERS
172 #TEA_PRIVATE_TCL_HEADERS
173
174 #TEA_PUBLIC_TK_HEADERS
175 #TEA_PRIVATE_TK_HEADERS
176 #TEA_PATH_X
177
178 #--------------------------------------------------------------------
179 # Check whether --enable-threads or --disable-threads was given.
180 # This auto-enables if Tcl was compiled threaded.
181 #--------------------------------------------------------------------
182
183 TEA_ENABLE_THREADS
184
185 #--------------------------------------------------------------------
186 # The statement below defines a collection of symbols related to
187 # building as a shared library instead of a static library.
188 #--------------------------------------------------------------------
189
190 TEA_ENABLE_SHARED
191
192 #--------------------------------------------------------------------
193 # This macro figures out what flags to use with the compiler/linker
194 # when building shared/static debug/optimized objects.  This information
195 # can be taken from the tclConfig.sh file, but this figures it all out.
196 #--------------------------------------------------------------------
197
198 TEA_CONFIG_CFLAGS
199
200 #--------------------------------------------------------------------
201 # Set the default compiler switches based on the --enable-symbols option.
202 #--------------------------------------------------------------------
203
204 TEA_ENABLE_SYMBOLS
205
206 #--------------------------------------------------------------------
207 # Integer pointer types used by the (U)INT2PTR / PTR2(U)INT macros.
208 #--------------------------------------------------------------------
209
210 AC_TYPE_INTPTR_T
211 AC_TYPE_UINTPTR_T
212
213 #--------------------------------------------------------------------
214 # Locate the ws2_32 library; we need it for ntohs and friends
215 #--------------------------------------------------------------------
216
217 AC_CHECK_LIB(ws2_32,main,TEA_ADD_LIBS([-lws2_32]),[
218     AC_CHECK_LIB(winsock,main,TEA_ADD_LIBS([-lwinsock]))
219 ])
220
221 #--------------------------------------------------------------------
222 # This macro generates a line to use when building a library.  It
223 # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
224 # and TEA_LOAD_TCLCONFIG macros above.
225 #--------------------------------------------------------------------
226
227 TEA_MAKE_LIB
228
229 #--------------------------------------------------------------------
230 # Determine the name of the tclsh and/or wish executables in the
231 # Tcl and Tk build directories or the location they were installed
232 # into. These paths are used to support running test cases only,
233 # the Makefile should not be making use of these paths to generate
234 # a pkgIndex.tcl file or anything else at extension build time.
235 #--------------------------------------------------------------------
236
237 TEA_PROG_TCLSH
238 #TEA_PROG_WISH
239
240 #--------------------------------------------------------------------
241 # Finally, substitute all of the various values into the Makefile.
242 # You may alternatively have a special pkgIndex.tcl.in or other files
243 # which require substituting the AC variables in. Include these here.
244 #--------------------------------------------------------------------
245
246 AC_CONFIG_FILES([Makefile pkgIndex.tcl])
247 AC_OUTPUT