File: configure.in

package info (click to toggle)
tcl-fitstcl 2.4-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,272 kB
  • sloc: ansic: 19,659; sh: 2,939; makefile: 256; tcl: 158
file content (295 lines) | stat: -rw-r--r-- 7,690 bytes parent folder | download
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
dnl Process this file with autoconf to produce a configure script.

dnl disable caching to avoid sticky mistakes
dnl ----------------------------------------------------------------------------
dnl define([AC_CACHE_LOAD], )
dnl define([AC_CACHE_SAVE], )
dnl ----------------------------------------------------------------------------

AC_INIT
AC_CONFIG_SRCDIR([Makefile.in])
AC_REVISION($Revision: 1.19 $)
AC_PREREQ(2.59)

if test $cache_file = ./config.cache; then
  cache_file=`pwd`/config.cache
fi

# Tcl:
#-------------------------------------------
AC_ARG_WITH(
  tcl,
  [ --with-tcl Path to tcl library ],
  TCL_PATH=$withval
)
AC_ARG_WITH(
  tcl-includes,
  [ --with-tcl-includes Path to tcl include files ],
  TCL_INCLUDES=$withval
)
AC_SUBST(TCL_PATH)
# Make sure we have tcl.h before proceeding:
#-------------------------------------------
AC_MSG_CHECKING([for tcl header file])
TCL_INC_PATH=
for dir in $TCL_INCLUDES $prefix/include /usr/include ; do
    if test -r $dir/tcl.h; then
        TCL_INC_PATH=$dir
        AC_MSG_RESULT($dir)
        break
    fi
done
if test -z "$TCL_INC_PATH"; then
    AC_MSG_RESULT([no])
    AC_MSG_ERROR(Cannot find Tcl header. Use --with-tcl-includes to specify the location of tcl.h on your system.)
fi
AC_SUBST(TCL_INC_PATH)

#-------------------------------------------
AC_ARG_ENABLE(
  shared,
  [ --disable-shared Produce static binaries ],
  lhea_shared=$enableval,
  lhea_shared=yes,
  lhea_shared=no
)
AC_ARG_ENABLE(
  static,
  [ --enable-static Produce static binaries ],
  [ if test $enableval = yes; then lhea_shared=no; fi ]
)

if test $lhea_shared = yes; then
  C_LIB_OPTION=shared
else
  C_LIB_OPTION=static
fi
AC_SUBST(C_LIB_OPTION)

#-------------------------------------------------------------------------------

# Determine system type
#-------------------------------------------------------------------------------
BIN_EXT=
if test "x$EXT" = x; then EXT=lnx; fi
if test "x$BINDIR" = x; then
  AC_CHECK_PROG(UNAME, uname, uname, nouname)
  if test $UNAME = nouname; then
    AC_MSG_ERROR(HEAsoft: Unable to guess system type. Please set it using --with-bindir option)
  fi
  changequote(,)
  BINDIR=`$UNAME -s 2> /dev/null | sed 's:.*/::'`_`$UNAME -r 2> /dev/null | sed 's:[^0-9]*\([0-9][0-9]*\.[0-9]*\).*:\1:'`
  changequote([,])
  lhea_machine=`$UNAME -m 2> /dev/null`
  BIN_EXT=
  case $BINDIR in
    CYGWIN*)
      BINDIR=CYGWIN32_`$UNAME -a 2> /dev/null | awk '{ print $4 }'`
      lhea_machine=
      BIN_EXT=".exe"
      EXT=win
      ;;
    Linux*|kFreeBSD*|GNU*)
      EXT=lnx
      ;;
    Darwin*)
      EXT=darwin
      lhea_machine=`$UNAME -p`
      ;;
    SunOS_5*)
      EXT=sol
      lhea_machine=`$UNAME -p`
      ;;
    *)
      AC_MSG_ERROR(Unable to recognize your system. Please make sure this platform is supported.)
      ;;
  esac
  if test x$lhea_machine != x; then
    BINDIR=$BINDIR"_"$lhea_machine
  fi
fi
AC_SUBST(BINDIR)
AC_SUBST(BIN_EXT)
AC_SUBST(EXT)
#-------------------------------------------------------------------------------

# Checks for programs.
#-------------------------------------------------------------------------------
# Try first to find a proprietary C compiler, then gcc
if test "x$CC" = x; then
  AC_CHECK_PROGS(CC, cc)
fi
# Set up flags to use the selected compiler
#
AC_PROG_CC
if test "x$GCC" = x; then
  GCC=no
fi

AC_PROG_RANLIB
if test $EXT = darwin; then
  RANLIB="$RANLIB -cs"
fi

#-------------------------------------------------------------------------------

# Checks for libraries.
#-------------------------------------------------------------------------------

# X
XLIBS=
XLIBPTH=
XINCLUDES=

# socket and nsl libraries -- only if needed
AC_CHECK_FUNC(gethostbyname, [], [AC_CHECK_LIB(nsl, gethostbyname)])
AC_CHECK_FUNCS(connect accept, [], [AC_CHECK_LIB(socket, main, , , [ $XLIBS ])])

# Prepend the standard location X11 bin directory (if it exists) to PATH
# to assist AC_PATH_X in finding headers & libraries:
if test -d /usr/X11R6/bin; then
  if test "x$PATH" != x; then
    PATH=$PATH:/usr/X11R6/bin
  else
    PATH=/usr/X11R6/bin
  fi
  export PATH
fi
AC_PATH_X

if test "x$no_x" != xyes; then
  USE_X=yes
  no_x=no
  if test `echo $x_includes | grep -c /` -ne 0; then
    XINCLUDES="-I$x_includes"
  fi
  if test `echo $x_libraries | grep -c /` -ne 0; then
    XLIBPTH="-L$x_libraries "
  fi
  XLIBS="$XLIBPTH-lX11"
dnl xpa sometimes needs Xt
dnl this doesn't work at the moment:
dnl AC_CHECK_LIB(Xt, main, XLIBS="$XLIBS -lXt")
  if test -f $x_libraries/libXt.a; then
    XLIBS="$XLIBS -lXt"
  fi
  # dnet_stub
  AC_CHECK_LIB(dnet_stub, getnodebyname, XLIBS="$XLIBS -ldnet_stub")
else
  USE_X=no
fi
AC_SUBST(USE_X)
AC_SUBST(XINCLUDES)
AC_SUBST(XLIBPTH)
AC_SUBST(XLIBS)

# dl
AC_CHECK_LIB(dl, dlopen)
if test `echo $LIBS | grep -c '\-ldl'` -eq 0; then
  AC_CHECK_LIB(dld, dlopen)
fi

#-------------------------------------------------------------------------------
# Checks for header files.
#-------------------------------------------------------------------------------
AC_HEADER_STDC
AC_CHECK_HEADERS(
  dirent.h fcntl.h limits.h malloc.h string.h sys/time.h unistd.h
)
AC_HEADER_TIME
AC_FUNC_ALLOCA
#-------------------------------------------------------------------------------

# Checks for typedefs, structures, and compiler characteristics.
#-------------------------------------------------------------------------------
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
#-------------------------------------------------------------------------------

# Tweak compiler flags as needed
#-------------------------------------------------------------------------------
case $EXT in
  darwin)
    CFLAGS="$CFLAGS -Dunix"
    ;;
  lnx)
    ;;
  sol)
    AC_DEFINE(HAVE_POSIX_SIGNALS)
    ;;
  *)
    ;;
esac
#-------------------------------------------------------------------------------

# Shared library section
#-------------------------------------------------------------------------------
LD_FLAGS="$LDFLAGS"
SHLIB_SUFFIX=".so"
SHLIB_LD_LIBS=""
lhea_shlib_cflags=
lhea_shlib_fflags=
if test $lhea_shared = yes; then
  case $EXT in
    darwin)
      SHLIB_LD="$CC -dynamiclib -flat_namespace -undefined suppress"
      SHLIB_SUFFIX=".dylib"
      lhea_shlib_cflags='-fPIC -fno-common'
      lhea_shlib_fflags='-fPIC -fno-common'
      ;;
    lnx)
      SHLIB_LD=":"
      ;;
    sol)
      SHLIB_LD="/usr/ccs/bin/ld -G"
      SHLIB_LD_LIBS='${LIBS}'
      lhea_shlib_cflags="-KPIC"
      lhea_shlib_fflags="-KPIC"
      ;;
    win)
      SHLIB_LD="$CC -shared"
      SHLIB_SUFFIX=".dll"
      ;;
    *)
      AC_MSG_WARN(Unable to determine how to make a shared library)
      ;;
  esac
  # Darwin uses gcc, but uses -dynamiclib flag
  if test $GCC = yes -a $EXT != darwin; then
    SHLIB_LD="$CC -shared"
    lhea_shlib_cflags='-fPIC'
  fi
  if test "x$lhea_shlib_cflags" != x; then
    CFLAGS="$CFLAGS $lhea_shlib_cflags"
  fi
else
  SHLIB_LD=:
fi

AC_SUBST(LD_FLAGS)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_SUFFIX)
#-------------------------------------------------------------------------------

# Checks for library functions.
#-------------------------------------------------------------------------------
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(getcwd socket strcspn strspn strstr strtod strtol)
#-------------------------------------------------------------------------------

# Construct TCL_LIB:
#-------------------------------------------------------------------------------
for tclversion in 8 8.5 8.4; do
   if test -e "$TCL_PATH/libtcl${tclversion}${SHLIB_SUFFIX}"; then
     TCL_LIB="tcl${tclversion}"
   fi
done
AC_SUBST(TCL_LIB)

AC_CONFIG_FILES([Makefile])
AC_OUTPUT