3 # This entire file is Cygnus local, it contains a set of cross
4 # platform autoconf macros to be used by Tcl extensions.
6 # FIXME: There seems to be a problem with variable
7 # names that still need an expansion (like $foo_FILE)
8 # since another eval might be needed in these macros.
10 #--------------------------------------------------------------------
13 # Return a file path that the build system tool will understand.
14 # This path might be different than the path used in the
27 # TCL_TOOL_PATH(TCL_CC_PATH, /usr/local/compiler)
29 #--------------------------------------------------------------------
31 AC_DEFUN(TCL_TOOL_PATH, [
34 if test "$val" = "" ; then
35 AC_MSG_ERROR([Empty value for variable $1])
39 *windows32* | *mingw32*)
40 if test "${CYGPATH}" = ""; then
41 AC_MSG_ERROR([CYGPATH variable is not defined.])
42 elif test "${CYGPATH}" = "echo"; then
43 # No cygpath when cross compiling
46 # store literal argument text in a variable
48 # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
49 val="`${CYGPATH} $val`"
50 # Convert path like C:\Tmp\foo to C:/Tmp/foo
51 $1="`echo $val | sed -e s#\\\\\\\\#/#g`"
55 # Default to a no-op under Unix or Cygwin gcc
61 # FIXME: It would simplify things if no SUFFIX had to be passed
62 # into these LONGNAME macros. Using the TCL_SHARED_LIB_SUFFIX
63 # and TCL_UNSHARED_LIB_SUFFIX from tclConfig.sh might do the trick!
65 #--------------------------------------------------------------------
66 # TCL_TOOL_STATIC_LIB_LONGNAME
68 # Return static library name in the "long format" understood by
69 # the build tools. This might involve prepending a suffix
70 # and appending version information to the library name.
84 # TCL_TOOL_STATIC_LIB_LONGNAME(TCL_LIB, tcl, $TCL_UNSHARED_LIB_SUFFIX)
94 #--------------------------------------------------------------------
96 AC_DEFUN(TCL_TOOL_STATIC_LIB_LONGNAME, [
101 *windows32* | *mingw32*)
102 if test "$GCC" != yes; then
103 eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
105 eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
109 eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
113 eval "long_libname=${long_libname}"
115 # Trick to replace DBGX with TCL_DBGX
117 eval "long_libname=${long_libname}"
122 #--------------------------------------------------------------------
123 # TCL_TOOL_SHARED_LIB_LONGNAME
125 # Return the shared library name in the "long format" understood by
126 # the build tools. This might involve prepending a suffix
127 # and appending version information to the shared library name.
141 # TCL_TOOL_SHARED_LIB_LONGNAME(TCL_SHLIB, tcl, $TCL_SHARED_LIB_SUFFIX)
144 # The above example could result in the following.
146 # TCL_SHLIB=libtcl83.so
150 # TCL_SHLIB=tcl83.dll
152 #--------------------------------------------------------------------
154 AC_DEFUN(TCL_TOOL_SHARED_LIB_LONGNAME, [
159 *windows32* | *mingw32* | *cygwin*)
160 eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
163 eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
167 eval "long_libname=${long_libname}"
169 # Trick to replace DBGX with TCL_DBGX
171 eval "long_libname=${long_libname}"
176 #--------------------------------------------------------------------
177 # TCL_TOOL_LIB_SHORTNAME
179 # Return the library name in the "short format" understood by
180 # the build tools. This might involve prepending a suffix
181 # and appending version information to the library name.
182 # The VC++ compiler does not support short library names
183 # so we just use the static import lib name in that case.
192 # TCL_LIB_VERSIONS_OK
199 # TCL_TOOL_LIB_SHORTNAME(TCL_LIB, tcl, 8.3)
202 # The above example could result in the following.
210 #--------------------------------------------------------------------
212 AC_DEFUN(TCL_TOOL_LIB_SHORTNAME, [
216 if test "$TCL_LIB_SUFFIX" = "" ; then
217 AC_MSG_ERROR([The TCL_LIB_SUFFIX variable is not defined])
220 # If the . character is not allowed in lib name, remove it from version
221 if test "${TCL_LIB_VERSIONS_OK}" != "ok"; then
222 version=`echo $version | tr -d .`
226 *windows32* | *mingw32*)
227 if test "$GCC" != yes; then
228 eval "short_libname=\"${TCL_VENDOR_PREFIX}${libname}${version}${TCL_LIB_SUFFIX}\""
230 short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}${TCL_DBGX}"
234 short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}\${TCL_DBGX}"
241 #--------------------------------------------------------------------
244 # Return the "lib spec format" understood by the build tools.
257 # TCL_TOOL_LIB_SPEC(SPEC, /usr/lib, -ltcl)
260 # The above example could result in the following.
262 # SPEC="-L/usr/lib -ltcl83"
264 #--------------------------------------------------------------------
266 AC_DEFUN(TCL_TOOL_LIB_SPEC, [
268 *windows32* | *mingw32*)
269 if test "$GCC" != yes; then
270 TCL_TOOL_PATH($1, "$2/$3")
272 TCL_TOOL_PATH(dirname, $2)
282 #--------------------------------------------------------------------
285 # Return the "lib path format" understood by the build tools.
286 # Typically, this is the fully qualified path name of the library.
299 # TCL_TOOL_LIB_PATH(TMP_PATH, /usr/lib, libtcl83.a)
302 # The above example could result in the following.
304 # TMP_PATH="/usr/lib/libtcl83.a"
306 #--------------------------------------------------------------------
308 AC_DEFUN(TCL_TOOL_LIB_PATH, [
309 TCL_TOOL_PATH($1, "$2/$3")