]> git.sven.stormbind.net Git - sven/tclcurl.git/blob - configure.in
Emtpy override for dh_auto_test, the reference all.tcl doesn't exist; Most of the...
[sven/tclcurl.git] / configure.in
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.in,v 1.48 2008/11/05 00:13:00 hobbs 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 # Set your package name and version numbers here.
16 #
17 # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
18 # set as provided.  These will also be added as -D defs in your Makefile
19 # so you can encode the package version directly into the source files.
20 #-----------------------------------------------------------------------
21
22 AC_INIT([TclCurl], [7.19.6])
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([3.7])
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 # Handle the --prefix=... option by defaulting to what Tcl gave.
50 # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
51 #-----------------------------------------------------------------------
52
53 TEA_PREFIX
54
55 #-----------------------------------------------------------------------
56 # Standard compiler checks.
57 # This sets up CC by using the CC env var, or looks for gcc otherwise.
58 # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
59 # the basic setup necessary to compile executables.
60 #-----------------------------------------------------------------------
61
62 TEA_SETUP_COMPILER
63
64 #-----------------------------------------------------------------------
65 # __CHANGE__
66 # Specify the C source files to compile in TEA_ADD_SOURCES,
67 # public headers that need to be installed in TEA_ADD_HEADERS,
68 # stub library C source files to compile in TEA_ADD_STUB_SOURCES,
69 # and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
70 # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
71 # and PKG_TCL_SOURCES.
72 #-----------------------------------------------------------------------
73
74 TEA_ADD_SOURCES([tclcurl.c multi.c])
75 TCLCURL_SCRIPTS=tclcurl.tcl
76 AC_SUBST(TCLCURL_SCRIPTS)
77
78 #--------------------------------------------------------------------
79 # Find libcurl, if it's not present, it makes no sense to compile
80 # this.
81 #--------------------------------------------------------------------
82
83 AC_ARG_WITH(curlprefix,
84  [  --with-curlprefix       base directory for the cURL install '/usr', '/usr/local',...],
85  [
86     curlprefix=$withval
87     curlpath=$curlprefix/bin
88     AC_CHECK_PROG(curl,curl,yes,no,$curlpath)
89     if test "x$curl" = xno ; then
90        AC_MSG_ERROR([can not find cURL in $curlpath])
91     fi
92  ],[
93     AC_CHECK_PROG(curl,curl-config,yes,no)
94     if test "x$curl" = xno ; then
95         AC_MSG_ERROR([can not find cURL or libcurl... go to http://curl.haxx.se/ to download and then install it first])
96     else
97         curlprefix=`curl-config --prefix`
98         curlpath=$curlprefix/bin
99     fi
100 ])
101
102 AC_ARG_WITH(curlinclude,
103  [  --with-curlinclude      directory containing the public libcurl header files],[
104     TEA_ADD_INCLUDES([-I$withval])
105     curlinclude=$withval
106  ],
107  [
108     TEA_ADD_INCLUDES([-I$curlprefix/include])
109      curlinclude=$curlprefix/include
110  ])
111
112 AC_CHECK_HEADER(curl/curl.h,headercurl=yes, headercurl=no)
113 if test "x$headercurl" = xno ; then
114     AC_MSG_CHECKING([checking for headers at $curlinclude])
115     if test [ ! -r $curlinclude/curl/curl.h ] ; then
116         AC_MSG_ERROR([cURL headers not found, you may need to install a curl-devel package])
117     fi
118     AC_MSG_RESULT([found])
119 fi
120
121 AC_ARG_WITH(libcurl,
122  [  --with-libcurl          directory containing libcurl],[
123     TEA_ADD_LIBS([-L$withval])
124  ],
125  [ 
126     TEA_ADD_LIBS([-L$curlprefix/lib])
127  ])
128
129 AC_MSG_CHECKING([if libcurl version is recent enough])
130 CURL_VERSION=`$curlpath/curl-config --checkfor 7.19.6`
131 if test "${CURL_VERSION}" != "" ; then
132     echo ${CURL_VERSION}
133     AC_MSG_ERROR([libcurl version too old, please upgrade])
134 fi
135 AC_MSG_RESULT(yes)
136
137 TEA_ADD_LIBS([`$curlpath/curl-config --libs`])
138
139 #--------------------------------------------------------------------
140 # __CHANGE__
141 # A few miscellaneous platform-specific items:
142 #
143 # Define a special symbol for Windows (BUILD_sample in this case) so
144 # that we create the export library with the dll.
145 #
146 # Windows creates a few extra files that need to be cleaned up.
147 # You can add more files to clean if your extension creates any extra
148 # files.
149 #
150 # TEA_ADD_* any platform specific compiler/build info here.
151 #--------------------------------------------------------------------
152
153 # Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
154 # and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
155 #CLEANFILES="pkgIndex.tcl"
156 if test "${TEA_PLATFORM}" = "windows" ; then
157     AC_DEFINE(BUILD_sample, 1, [Build windows export dll])
158     CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
159     #TEA_ADD_SOURCES([win/winFile.c])
160     #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
161 else
162     # Ensure no empty else clauses
163     :
164     #TEA_ADD_SOURCES([unix/unixFile.c])
165     #TEA_ADD_LIBS([-lsuperfly])
166 fi
167 AC_SUBST(CLEANFILES)
168
169 #--------------------------------------------------------------------
170 # __CHANGE__
171 # Choose which headers you need.  Extension authors should try very
172 # hard to only rely on the Tcl public header files.  Internal headers
173 # contain private data structures and are subject to change without
174 # notice.
175 # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
176 #--------------------------------------------------------------------
177
178 TEA_PUBLIC_TCL_HEADERS
179 #TEA_PRIVATE_TCL_HEADERS
180
181 #TEA_PUBLIC_TK_HEADERS
182 #TEA_PRIVATE_TK_HEADERS
183 #TEA_PATH_X
184
185 #--------------------------------------------------------------------
186 # Check whether --enable-threads or --disable-threads was given.
187 # This auto-enables if Tcl was compiled threaded.
188 #--------------------------------------------------------------------
189
190 TEA_ENABLE_THREADS
191
192 #--------------------------------------------------------------------
193 # The statement below defines a collection of symbols related to
194 # building as a shared library instead of a static library.
195 #--------------------------------------------------------------------
196
197 TEA_ENABLE_SHARED
198
199 #--------------------------------------------------------------------
200 # This macro figures out what flags to use with the compiler/linker
201 # when building shared/static debug/optimized objects.  This information
202 # can be taken from the tclConfig.sh file, but this figures it all out.
203 #--------------------------------------------------------------------
204
205 TEA_CONFIG_CFLAGS
206
207 #--------------------------------------------------------------------
208 # Set the default compiler switches based on the --enable-symbols option.
209 #--------------------------------------------------------------------
210
211 TEA_ENABLE_SYMBOLS
212
213 #--------------------------------------------------------------------
214 # Everyone should be linking against the Tcl stub library.  If you
215 # can't for some reason, remove this definition.  If you aren't using
216 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
217 # link against the non-stubbed Tcl library.  Add Tk too if necessary.
218 #--------------------------------------------------------------------
219
220 AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
221 #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
222
223 #--------------------------------------------------------------------
224 # This macro generates a line to use when building a library.  It
225 # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
226 # and TEA_LOAD_TCLCONFIG macros above.
227 #--------------------------------------------------------------------
228
229 TEA_MAKE_LIB
230
231 #--------------------------------------------------------------------
232 # Determine the name of the tclsh and/or wish executables in the
233 # Tcl and Tk build directories or the location they were installed
234 # into. These paths are used to support running test cases only,
235 # the Makefile should not be making use of these paths to generate
236 # a pkgIndex.tcl file or anything else at extension build time.
237 #--------------------------------------------------------------------
238
239 TEA_PROG_TCLSH
240 #TEA_PROG_WISH
241
242 #--------------------------------------------------------------------
243 # Finally, substitute all of the various values into the Makefile.
244 # You may alternatively have a special pkgIndex.tcl.in or other files
245 # which require substituting th AC variables in.  Include these here.
246 #--------------------------------------------------------------------
247
248 AC_OUTPUT([Makefile pkgIndex.tcl])