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.
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 #-----------------------------------------------------------------------
11 #-----------------------------------------------------------------------
13 # Set your package name and version numbers here.
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 #-----------------------------------------------------------------------
22 AC_INIT([tdbcpostgres],[1.1.3])
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 #--------------------------------------------------------------------
32 AC_CONFIG_AUX_DIR(tclconfig)
34 #--------------------------------------------------------------------
35 # Load the tclConfig.sh file
36 #--------------------------------------------------------------------
41 #--------------------------------------------------------------------
42 # Load the tkConfig.sh file if necessary (Tk extension)
43 #--------------------------------------------------------------------
48 #--------------------------------------------------------------------
49 # Load the tclooConfig.sh file on Tcl versions where oo is an
51 #--------------------------------------------------------------------
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}.])
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}.])
64 TCL_VERSION_REQ=8.6; AC_SUBST(TCL_VERSION_REQ)
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}
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)
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 #-----------------------------------------------------------------------
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 #-----------------------------------------------------------------------
97 #-----------------------------------------------------------------------
98 # Setup inlining if available. Check sizeof long long, long.
99 #-----------------------------------------------------------------------
102 AC_CHECK_TYPE([long long],[
103 AC_DEFINE([HAVE_LONG_LONG],[1])
104 AC_CHECK_SIZEOF([long long])
106 AC_CHECK_SIZEOF([long])
108 #-----------------------------------------------------------------------
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 #-----------------------------------------------------------------------
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}])
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}`\"])
131 TEA_ADD_LIBS([${tdbc_STUB_LIB_SPEC}])
133 TEA_ADD_CFLAGS([${tdbc_CFLAGS}])
134 TEA_ADD_STUB_SOURCES()
135 TEA_ADD_TCL_SOURCES([library/tdbcpostgres.tcl])
137 #--------------------------------------------------------------------
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.
145 # A few miscellaneous platform-specific items:
146 # TEA_ADD_* any platform specific compiler/build info here.
147 #--------------------------------------------------------------------
149 #CLEANFILES="$CLEANFILES pkgIndex.tcl"
150 if test "${TEA_PLATFORM}" = "windows" ; then
151 # Ensure no empty if clauses
153 #TEA_ADD_SOURCES([win/winFile.c])
154 #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
156 # Ensure no empty else clauses
158 #TEA_ADD_SOURCES([unix/unixFile.c])
159 #TEA_ADD_LIBS([-lsuperfly])
162 #--------------------------------------------------------------------
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
168 # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
169 #--------------------------------------------------------------------
171 TEA_PUBLIC_TCL_HEADERS
172 #TEA_PRIVATE_TCL_HEADERS
174 #TEA_PUBLIC_TK_HEADERS
175 #TEA_PRIVATE_TK_HEADERS
178 #--------------------------------------------------------------------
179 # Check whether --enable-threads or --disable-threads was given.
180 # This auto-enables if Tcl was compiled threaded.
181 #--------------------------------------------------------------------
185 #--------------------------------------------------------------------
186 # The statement below defines a collection of symbols related to
187 # building as a shared library instead of a static library.
188 #--------------------------------------------------------------------
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 #--------------------------------------------------------------------
200 #--------------------------------------------------------------------
201 # Set the default compiler switches based on the --enable-symbols option.
202 #--------------------------------------------------------------------
206 #--------------------------------------------------------------------
207 # Integer pointer types used by the (U)INT2PTR / PTR2(U)INT macros.
208 #--------------------------------------------------------------------
213 #--------------------------------------------------------------------
214 # Locate the ws2_32 library; we need it for ntohs and friends
215 #--------------------------------------------------------------------
217 AC_CHECK_LIB(ws2_32,main,TEA_ADD_LIBS([-lws2_32]),[
218 AC_CHECK_LIB(winsock,main,TEA_ADD_LIBS([-lwinsock]))
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 #--------------------------------------------------------------------
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 #--------------------------------------------------------------------
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 #--------------------------------------------------------------------
246 AC_CONFIG_FILES([Makefile pkgIndex.tcl])