1#! /bin/bash -norc
2dnl	This file is an input file used by the GNU "autoconf" program to
3dnl	generate the file "configure", which is run during Snack installation
4dnl	to configure the system for the local environment.
5AC_INIT(../generic/snack.h)
6
7SNACK_VERSION=`sh $srcdir/sver.sh $srcdir/../generic/snack.h`
8SNACK_NODOT_VERSION=`echo $SNACK_VERSION | tr -d .`
9
10AC_CHECK_HEADER(stdint.h)
11
12#--------------------------------------------------------------------
13#       See if there was a command-line option for where Tcl is;  if
14#       not, assume that its top-level directory is a sibling of ours.
15#--------------------------------------------------------------------
16
17SC_PATH_TCLCONFIG
18
19#--------------------------------------------------------------------
20#       See if there was a command-line option for where Tk is;  if
21#       not, assume that its top-level directory is a sibling of ours.
22#--------------------------------------------------------------------
23
24SC_PATH_TKCONFIG
25
26#--------------------------------------------------------------------
27
28if test "x${prefix}" = "xNONE"; then
29    prefix=/usr/local
30fi
31if test "x${exec_prefix}" = "xNONE"; then
32    exec_prefix=$prefix
33fi
34
35SNACK_INSTALL_PATH=${libdir}
36SNACK_HINSTALL_PATH=${includedir}
37SNACK_LIB_SPEC="-L${libdir} -lsnack"
38
39#--------------------------------------------------------------------
40#       Read in configuration information generated by Tcl and
41#	arrange for it to be substituted into our Makefile.
42#--------------------------------------------------------------------
43
44file=$TCL_BIN_DIR/tclConfig.sh
45. $file
46
47if test "$TCL_SHARED_BUILD" = 0; then
48    AC_MSG_ERROR(Tcl and Tk must be configured with the --enable-shared flag)
49fi
50
51#--------------------------------------------------------------------
52#       Read in configuration information generated by Tk and arrange
53#	for it to be substituted into our Makefile.
54#--------------------------------------------------------------------
55
56file=$TK_BIN_DIR/tkConfig.sh
57. $file
58
59
60SNACK_STUB_LIB_FILE="libsnackstub${SNACK_NODOT_VERSION}.a"
61SNACK_STUB_LIB_FLAG="-lsnackstub${SNACK_NODOT_VERSION}"
62
63if test "$TCL_DBGX" = ""; then
64    CFLAGS="$CFLAGS $TCL_CFLAGS_OPTIMIZE"
65else
66    CFLAGS="$CFLAGS $TCL_CFLAGS_DEBUG"
67fi
68
69# If TCL_MEM_DEBUG is defined, add it to the CFLAGS
70if (echo "$TCL_DEFS" | grep TCL_MEM_DEBUG > /dev/null) ; then
71    CFLAGS="$CFLAGS -DTCL_MEM_DEBUG"
72fi
73
74# If HAVE_STDINT_H was detected, pass it to the CFLAGS
75if test "$ac_cv_header_stdint_h" = "yes" ; then
76    CFLAGS="$CFLAGS -DHAVE_STDINT_H"
77fi
78
79
80# Include files from Tcl src/build location
81TCL_INCLUDE_SPEC="-I$TCL_SRC_DIR/generic"
82TK_INCLUDE_SPEC="-I$TK_SRC_DIR/generic -I$TK_SRC_DIR/xlib"
83TCL_LIB_SPEC=$TCL_BUILD_STUB_LIB_SPEC
84TK_LIB_SPEC=$TK_BUILD_STUB_LIB_SPEC
85
86AC_SUBST(srcdir)
87AC_SUBST(CFLAGS)
88
89AC_SUBST(SNACK_VERSION)
90AC_SUBST(SNACK_NODOT_VERSION)
91
92AC_SUBST(TCL_INCLUDE_SPEC)
93AC_SUBST(TK_INCLUDE_SPEC)
94AC_SUBST(TCL_LIB_SPEC)
95AC_SUBST(TK_LIB_SPEC)
96
97AC_SUBST(SNACK_INSTALL_PATH)
98AC_SUBST(SNACK_HINSTALL_PATH)
99AC_SUBST(SNACK_LIB_SPEC)
100
101AC_SUBST(SNACK_STUB_LIB_FILE)
102AC_SUBST(SNACK_STUB_LIB_FLAG)
103
104AC_OUTPUT(Makefile snackConfig.sh)
105
106