forked from monnerat/insight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
119 lines (102 loc) · 3.07 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
dnl Process this file with autoconf to produce configure.
AC_INIT(src/subcommand.h)
AM_INIT_AUTOMAKE(libgui, 0.0)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AC_PROG_CC
AC_EXEEXT
AC_OBJEXT
AC_ARG_ENABLE(install-libgui, \
[ --enable-install-libgui Install libgui.a and library header files])
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
AM_CONDITIONAL(INSTALL_LIBGUI, test x$enable_install_libgui = xyes)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar, :)
AC_FUNC_ALLOCA
AC_HAVE_HEADERS(stddef.h stdlib.h getopt.h unistd.h fcntl.h sys/file.h sys/wait.h string.h strings.h)
AC_CHECK_FUNCS(raise)
AC_ARG_ENABLE(ide, [ --enable-ide Enable IDE support],
[case "${enableval}" in
yes) ide=yes ;;
no) ide=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for enable-ide option) ;;
esac],
[ide=no])
AM_CONDITIONAL(IDE_ENABLED, test x$ide = xyes)
if test x$ide = xyes; then
AC_DEFINE(IDE_ENABLED)
fi
# If we have random, assume we have srandom. If we have drand48,
# assume we have srand48. If we have rand, assume we have srand.
AC_CHECK_FUNCS(random drand48 rand, break)
dnl Tcl ensures that strncasecmp is provided everywhere. But in some
dnl situations we might need to declare it. We check for that case
dnl here.
AC_EGREP_CPP(strncasecmp, [#include <string.h>],
AC_DEFINE(HAVE_STRNCASECMP_DECL))
AC_CACHE_CHECK([for cygwin32], ide_cv_os_cygwin32,
[AC_EGREP_CPP(lose, [
#ifdef __CYGWIN32__
lose
#endif],[ide_cv_os_cygwin32=yes],[ide_cv_os_cygwin32=no])])
ac_win_build="no"
if test x$ide_cv_os_cygwin32 = xyes; then
ac_win_build="yes"
fi
case "${host}" in
*-*-cygwin*)
touch ac$$.c
if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then
case "$LIBGUI_CFLAGS" in
*-mwin32*) ;;
*) LIBGUI_CFLAGS="-mwin32 $LIBGUI_CFLAGS" ;;
esac
fi
rm -f ac$$.o ac$$.c
;;
esac
case "${host}" in
*-*-cygwin*)
LIBGUI_CFLAGS="-DWIN32 $LIBGUI_CFLAGS" ;;
esac
AC_SUBST(LIBGUI_CFLAGS)
tmp="`cd $srcdir/library; pwd`"
if test x"$ac_cv_prog_CC" = xcl ; then
tmp2="`cygpath --windows $tmp`"
LIBGUI_LIBRARY_DIR="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
else
LIBGUI_LIBRARY_DIR=$tmp
fi
AC_SUBST(LIBGUI_LIBRARY_DIR)
# Check for Tcl and Tk.
SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
SC_PATH_TKCONFIG
SC_LOAD_TKCONFIG
here=`pwd`
cd ${srcdir}/..
topdir=`pwd`
cd ${here}
CY_AC_TCL_PRIVATE_HEADERS
CY_AC_TK_PRIVATE_HEADERS
TCL_INCLUDES="${TCL_INCLUDE_SPEC} ${TCL_PRIVATE_INCLUDE}"
TCL_LIBRARY=${TCL_LIB_SPEC}
TK_INCLUDES="${TK_INCLUDE_SPEC} ${TK_PRIVATE_INCLUDE}"
TK_LIBRARY=${TK_LIB_SPEC}
AC_SUBST(TCL_DEFS)
AC_SUBST(TCL_INCLUDES)
AC_SUBST(TCL_PLATFORM)
AC_SUBST(TK_DEFS)
AC_SUBST(TK_INCLUDES)
AC_SUBST(TK_PLATFORM)
AC_SUBST(TK_XINCLUDES)
AC_SUBST(TCL_LIBS)
AC_SUBST(TK_LIBRARY)
AC_SUBST(TCL_LIBRARY)
AC_SUBST(TK_LIBS)
AC_DEFINE_UNQUOTED([TCL_PLATFORM_`echo "${TCL_PLATFORM}" | tr 'a-z-' 'A-Z_'`])
AC_DEFINE_UNQUOTED([TK_PLATFORM_`echo "${TK_PLATFORM}" | tr 'a-z-' 'A-Z_'`])
AM_CONDITIONAL(TCL_SHARED, test x$TCL_SHARED_BUILD = x1)
AC_SUBST(RPATH_ENVVAR)
AC_OUTPUT([Makefile library/Makefile src/Makefile])