[503] | 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.46 2006/01/23 19:18:55 hobbs Exp $ |
---|
| 7 | |
---|
| 8 | #----------------------------------------------------------------------- |
---|
[158] | 9 | # Sample configure.in for Tcl Extensions. The only places you should |
---|
| 10 | # need to modify this file are marked by the string __CHANGE__ |
---|
[503] | 11 | #----------------------------------------------------------------------- |
---|
[158] | 12 | |
---|
[503] | 13 | #----------------------------------------------------------------------- |
---|
[158] | 14 | # __CHANGE__ |
---|
[503] | 15 | # Set your package name and version numbers here. |
---|
[158] | 16 | # |
---|
[503] | 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 | #----------------------------------------------------------------------- |
---|
[158] | 21 | |
---|
[503] | 22 | AC_INIT([RapptureGUI], [1.0]) |
---|
[158] | 23 | |
---|
| 24 | PACKAGE=RapptureGUI |
---|
| 25 | |
---|
| 26 | MAJOR_VERSION=1 |
---|
| 27 | MINOR_VERSION=0 |
---|
| 28 | VERSION=${MAJOR_VERSION}.${MINOR_VERSION} |
---|
| 29 | |
---|
| 30 | #-------------------------------------------------------------------- |
---|
[503] | 31 | # Call TEA_INIT as the first TEA_ macro to set up initial vars. |
---|
| 32 | # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" |
---|
| 33 | # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. |
---|
| 34 | #-------------------------------------------------------------------- |
---|
| 35 | |
---|
| 36 | TEA_INIT([3.5]) |
---|
| 37 | |
---|
| 38 | AC_CONFIG_AUX_DIR(tclconfig) |
---|
| 39 | |
---|
| 40 | #-------------------------------------------------------------------- |
---|
[158] | 41 | # Extra build options |
---|
| 42 | #-------------------------------------------------------------------- |
---|
| 43 | AC_ARG_WITH(blt, [ --with-blt=DIR Find bltInt.h in DIR], |
---|
| 44 | blt_source_dir=$withval) |
---|
| 45 | |
---|
| 46 | #-------------------------------------------------------------------- |
---|
[503] | 47 | # Load the tclConfig.sh file |
---|
[158] | 48 | #-------------------------------------------------------------------- |
---|
| 49 | |
---|
[503] | 50 | TEA_PATH_TCLCONFIG |
---|
| 51 | TEA_LOAD_TCLCONFIG |
---|
[158] | 52 | |
---|
| 53 | #-------------------------------------------------------------------- |
---|
[503] | 54 | # Load the tkConfig.sh file if necessary (Tk extension) |
---|
[158] | 55 | #-------------------------------------------------------------------- |
---|
| 56 | |
---|
[503] | 57 | #TEA_PATH_TKCONFIG |
---|
| 58 | #TEA_LOAD_TKCONFIG |
---|
[158] | 59 | |
---|
[503] | 60 | #----------------------------------------------------------------------- |
---|
| 61 | # Handle the --prefix=... option by defaulting to what Tcl gave. |
---|
| 62 | # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. |
---|
| 63 | #----------------------------------------------------------------------- |
---|
| 64 | |
---|
| 65 | TEA_PREFIX |
---|
| 66 | |
---|
| 67 | #----------------------------------------------------------------------- |
---|
| 68 | # Standard compiler checks. |
---|
| 69 | # This sets up CC by using the CC env var, or looks for gcc otherwise. |
---|
| 70 | # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create |
---|
| 71 | # the basic setup necessary to compile executables. |
---|
| 72 | #----------------------------------------------------------------------- |
---|
| 73 | |
---|
| 74 | TEA_SETUP_COMPILER |
---|
| 75 | |
---|
| 76 | #----------------------------------------------------------------------- |
---|
| 77 | # __CHANGE__ |
---|
| 78 | # Specify the C source files to compile in TEA_ADD_SOURCES, |
---|
| 79 | # public headers that need to be installed in TEA_ADD_HEADERS, |
---|
| 80 | # stub library C source files to compile in TEA_ADD_STUB_SOURCES, |
---|
| 81 | # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. |
---|
| 82 | # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS |
---|
| 83 | # and PKG_TCL_SOURCES. |
---|
| 84 | #----------------------------------------------------------------------- |
---|
| 85 | |
---|
[702] | 86 | TEA_ADD_SOURCES([RpInit.c RpRlimit.c RpRusage.c RpSignal.c RpDaemon.c]) |
---|
[503] | 87 | TEA_ADD_HEADERS([]) |
---|
| 88 | TEA_ADD_INCLUDES([]) |
---|
| 89 | TEA_ADD_CFLAGS([]) |
---|
| 90 | TEA_ADD_STUB_SOURCES([]) |
---|
| 91 | |
---|
[158] | 92 | #-------------------------------------------------------------------- |
---|
[503] | 93 | # __CHANGE__ |
---|
| 94 | # A few miscellaneous platform-specific items: |
---|
| 95 | # |
---|
| 96 | # Define a special symbol for Windows (BUILD_Rappture in this case) so |
---|
| 97 | # that we create the export library with the dll. |
---|
| 98 | # |
---|
| 99 | # Windows creates a few extra files that need to be cleaned up. |
---|
| 100 | # You can add more files to clean if your extension creates any extra |
---|
| 101 | # files. |
---|
| 102 | # |
---|
| 103 | # TEA_ADD_* any platform specific compiler/build info here. |
---|
[158] | 104 | #-------------------------------------------------------------------- |
---|
| 105 | |
---|
[503] | 106 | if test "${TEA_PLATFORM}" = "windows" ; then |
---|
| 107 | AC_DEFINE(BUILD_Rappture, 1, [Build windows export dll]) |
---|
| 108 | CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch *.manifest" |
---|
| 109 | TEA_ADD_SOURCES([RpWinResource.c]) |
---|
| 110 | TEA_ADD_LIBS([-LIBPATH:${TCL_EXEC_PREFIX}/lib]) |
---|
[678] | 111 | TEA_ADD_LIBS([BLTlite24.LIB]) |
---|
[503] | 112 | TEA_ADD_LIBS([psapi.lib]) |
---|
| 113 | TEA_ADD_CFLAGS([-D_CRT_SECURE_NO_DEPRECATE -wd4996]) |
---|
| 114 | else |
---|
| 115 | CLEANFILES="" |
---|
| 116 | TEA_ADD_LIBS([-L${TCL_EXEC_PREFIX}/lib]) |
---|
[678] | 117 | TEA_ADD_LIBS([-lBLTlite24]) |
---|
[503] | 118 | fi |
---|
| 119 | AC_SUBST(CLEANFILES) |
---|
[158] | 120 | |
---|
| 121 | #-------------------------------------------------------------------- |
---|
[503] | 122 | # __CHANGE__ |
---|
| 123 | # Choose which headers you need. Extension authors should try very |
---|
| 124 | # hard to only rely on the Tcl public header files. Internal headers |
---|
| 125 | # contain private data structures and are subject to change without |
---|
| 126 | # notice. |
---|
| 127 | # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG |
---|
[158] | 128 | #-------------------------------------------------------------------- |
---|
| 129 | |
---|
[503] | 130 | TEA_PUBLIC_TCL_HEADERS |
---|
| 131 | #TEA_PRIVATE_TCL_HEADERS |
---|
[158] | 132 | |
---|
[507] | 133 | TEA_PUBLIC_TK_HEADERS |
---|
[503] | 134 | #TEA_PRIVATE_TK_HEADERS |
---|
| 135 | #TEA_PATH_X |
---|
| 136 | |
---|
[158] | 137 | #-------------------------------------------------------------------- |
---|
[503] | 138 | # Check whether --enable-threads or --disable-threads was given. |
---|
| 139 | # This auto-enables if Tcl was compiled threaded. |
---|
[158] | 140 | #-------------------------------------------------------------------- |
---|
| 141 | |
---|
[503] | 142 | TEA_ENABLE_THREADS |
---|
[158] | 143 | |
---|
| 144 | #-------------------------------------------------------------------- |
---|
[503] | 145 | # The statement below defines a collection of symbols related to |
---|
| 146 | # building as a shared library instead of a static library. |
---|
[158] | 147 | #-------------------------------------------------------------------- |
---|
| 148 | |
---|
[503] | 149 | TEA_ENABLE_SHARED |
---|
[158] | 150 | |
---|
| 151 | #-------------------------------------------------------------------- |
---|
[503] | 152 | # This macro figures out what flags to use with the compiler/linker |
---|
| 153 | # when building shared/static debug/optimized objects. This information |
---|
| 154 | # can be taken from the tclConfig.sh file, but this figures it all out. |
---|
[158] | 155 | #-------------------------------------------------------------------- |
---|
| 156 | |
---|
[503] | 157 | TEA_CONFIG_CFLAGS |
---|
[158] | 158 | |
---|
[503] | 159 | #-------------------------------------------------------------------- |
---|
| 160 | # Set the default compiler switches based on the --enable-symbols option. |
---|
| 161 | #-------------------------------------------------------------------- |
---|
[158] | 162 | |
---|
[503] | 163 | TEA_ENABLE_SYMBOLS |
---|
| 164 | |
---|
[158] | 165 | #-------------------------------------------------------------------- |
---|
[503] | 166 | # Everyone should be linking against the Tcl stub library. If you |
---|
| 167 | # can't for some reason, remove this definition. If you aren't using |
---|
| 168 | # stubs, you also need to modify the SHLIB_LD_LIBS setting below to |
---|
| 169 | # link against the non-stubbed Tcl library. Add Tk too if necessary. |
---|
[158] | 170 | #-------------------------------------------------------------------- |
---|
| 171 | |
---|
[503] | 172 | AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) |
---|
| 173 | #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) |
---|
[158] | 174 | |
---|
| 175 | #-------------------------------------------------------------------- |
---|
[503] | 176 | # This macro generates a line to use when building a library. It |
---|
| 177 | # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, |
---|
| 178 | # and TEA_LOAD_TCLCONFIG macros above. |
---|
[158] | 179 | #-------------------------------------------------------------------- |
---|
| 180 | |
---|
[503] | 181 | TEA_MAKE_LIB |
---|
[158] | 182 | |
---|
| 183 | #-------------------------------------------------------------------- |
---|
[503] | 184 | # Determine the name of the tclsh and/or wish executables in the |
---|
| 185 | # Tcl and Tk build directories or the location they were installed |
---|
| 186 | # into. These paths are used to support running test cases only, |
---|
| 187 | # the Makefile should not be making use of these paths to generate |
---|
| 188 | # a pkgIndex.tcl file or anything else at extension build time. |
---|
| 189 | #-------------------------------------------------------------------- |
---|
| 190 | |
---|
| 191 | TEA_PROG_TCLSH |
---|
| 192 | #TEA_PROG_WISH |
---|
| 193 | |
---|
| 194 | |
---|
| 195 | #-------------------------------------------------------------------- |
---|
[158] | 196 | # Look for bltInt.h on the normal include path. If not found, look |
---|
| 197 | # for it in the --with-blt directory. |
---|
| 198 | #-------------------------------------------------------------------- |
---|
| 199 | AC_MSG_CHECKING([for bltInt.h]) |
---|
| 200 | BLT_SRC_DIR="" |
---|
| 201 | if test "x$blt_source_dir" != "x" ; then |
---|
| 202 | # |
---|
[503] | 203 | # Verify that a tclConfig.sh file exists in the directory specified |
---|
| 204 | # by --with-blt. |
---|
[158] | 205 | # |
---|
| 206 | if test -r "$blt_source_dir/bltInt.h" ; then |
---|
| 207 | BLT_SRC_DIR="$blt_source_dir" |
---|
| 208 | elif test -r "$blt_source_dir/src/bltInt.h" ; then |
---|
| 209 | BLT_SRC_DIR="$blt_source_dir/src" |
---|
| 210 | fi |
---|
[503] | 211 | else |
---|
[158] | 212 | # |
---|
| 213 | # Otherwise, search for the bltInt.h include file... |
---|
| 214 | # 1. Search previously named locations. |
---|
[503] | 215 | # |
---|
[158] | 216 | for dir in \ |
---|
| 217 | $prefix \ |
---|
| 218 | $exec_prefix |
---|
| 219 | do |
---|
| 220 | if test -r "$dir/bltInt.h" ; then |
---|
| 221 | BLT_SRC_DIR="$dir" |
---|
| 222 | break |
---|
| 223 | elif test -r "$dir/include/bltInt.h" ; then |
---|
[503] | 224 | BLT_SRC_DIR="$dir/include" |
---|
[158] | 225 | break |
---|
| 226 | fi |
---|
| 227 | done |
---|
| 228 | # |
---|
| 229 | # 2. Search source directories. |
---|
[503] | 230 | # |
---|
[158] | 231 | if test "x$BLT_SRC_DIR" = "x" ; then |
---|
| 232 | for dir in \ |
---|
| 233 | `ls -dr ../blt[[2-3]].[[0-9]]* 2>/dev/null` \ |
---|
| 234 | ../blt \ |
---|
| 235 | `ls -dr ../../blt[[2-3]].[[0-9]]* 2>/dev/null` \ |
---|
| 236 | ../../blt \ |
---|
| 237 | `ls -dr ../../../blt[[2-3]].[[0-9]]* 2>/dev/null` \ |
---|
[503] | 238 | ../../../blt \ |
---|
| 239 | `ls -dr c:/opt/blt[[2-3]].[[0-9]]* 2>/dev/null` \ |
---|
| 240 | c\:/opt/blt |
---|
[158] | 241 | do |
---|
[503] | 242 | if test -r "$dir/src/bltInt.h" ; then |
---|
| 243 | BLT_SRC_DIR="$dir/src" |
---|
| 244 | break |
---|
[158] | 245 | fi |
---|
| 246 | done |
---|
| 247 | fi |
---|
| 248 | fi |
---|
| 249 | AC_MSG_RESULT([${BLT_SRC_DIR}]) |
---|
| 250 | |
---|
| 251 | if test "x$BLT_SRC_DIR" = "x" ; then |
---|
| 252 | echo "can't find BLT include file \"bltInt.h\"" |
---|
| 253 | echo "use --with-blt=DIR to specify the location of the BLT sources" |
---|
| 254 | exit 1 |
---|
| 255 | fi |
---|
| 256 | |
---|
| 257 | AC_SUBST(BLT_SRC_DIR) |
---|
| 258 | |
---|
[503] | 259 | PATCHLEVEL=`${TCLSH_PROG} tclconfig/patchlevel.tcl` |
---|
[158] | 260 | EXACT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}-${PATCHLEVEL} |
---|
| 261 | NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} |
---|
| 262 | |
---|
| 263 | AC_SUBST(PACKAGE) |
---|
| 264 | AC_SUBST(VERSION) |
---|
| 265 | AC_SUBST(PATCHLEVEL) |
---|
| 266 | AC_SUBST(EXACT_VERSION) |
---|
| 267 | AC_SUBST(NODOT_VERSION) |
---|
| 268 | |
---|
| 269 | |
---|
| 270 | #-------------------------------------------------------------------- |
---|
| 271 | # Finally, substitute all of the various values into the Makefile. |
---|
[503] | 272 | # You may alternatively have a special pkgIndex.tcl.in or other files |
---|
| 273 | # which require substituting th AC variables in. Include these here. |
---|
[158] | 274 | #-------------------------------------------------------------------- |
---|
| 275 | |
---|
| 276 | AC_OUTPUT([Makefile pkgIndex.tcl init.tcl]) |
---|