File: configure.in

package info (click to toggle)
ftools-fv 5.5.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,072 kB
  • sloc: tcl: 50,774; ansic: 17,858; exp: 2,004; makefile: 172; cpp: 169; sh: 109; csh: 10
file content (304 lines) | stat: -rw-r--r-- 7,857 bytes parent folder | download | duplicates (4)
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
296
297
298
299
300
301
302
303
304
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(Makefile.in)
AC_REVISION($Revision$)
AC_PREREQ(2.13)

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

AC_ARG_WITH(
  tcl,
  [ --with-tcl Path to tcl source ],
  TCLPATH=$withval
)

AC_ARG_WITH(
  tk,
  [ --with-tk Path to tk source ],
  TKPATH=$withval
)

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

# 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=lnx
      ;;
    IRIX*)
      AC_MSG_WARN(IRIX support is marginal)
      EXT=sgi
      ;;
    HP-UX*)
      AC_MSG_WARN(HP-UX support is marginal)
      EXT=hpu
      lhea_machine=`$UNAME -m 2> /dev/null | tr '/' ' ' | awk '{ print $2 }'`
      ;;
    Linux*|kFreeBSD*|GNU*)
      EXT=lnx
      ;;
    OSF1*)
      EXT=osf
      ;;
    SunOS_4*)
      AC_MSG_WARN(SunOS 4.x is not supported!)
      AC_MSG_WARN(PROCEED AT YOUR OWN RISK!)
      EXT=sun
      lhea_machine=sparc
      ;;
    SunOS_5*)
      EXT=sol
      lhea_machine=`$UNAME -p`
      ;;
    Darwin_*)
      EXT=darwin
      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 "$cross_compiling" = yes; then
  AC_MSG_WARN(Cannot run a simple C executable on your system:)
  AC_MSG_WARN(There may be something wrong with your compiler,)
  AC_MSG_WARN(or perhaps you're trying to cross-compile?)
  AC_MSG_WARN(Cross-compiling is not supported within HEAsoft.)
  AC_MSG_WARN(Please make sure your compiler is working.)
  AC_MSG_WARN(Contact the FTOOLS help desk for further assistance.)
  AC_MSG_ERROR(Cross-compiling is not allowed.)
fi
if test "x$GCC" = x; then
  GCC=no
fi

AC_PROG_RANLIB
if test $EXT = darwin; then
  RANLIB="$RANLIB -cs"
fi
# RANLIB on IRIX is flaky
if test $EXT = sgi; then
  RANLIB=:
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 ])
)

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)
    ;;
  osf)
    changequote(,)
    if test $GCC = yes; then
      # Remove optimization on DEC systems
      CFLAGS=`echo $CFLAGS | sed 's:-O[0-9]* *::g'`
    else
      # Standard DEC cc behavior is *STILL* K&R -- force ANSI compliance
      CFLAGS="$CFLAGS -std1 -Dunix"
    fi
    changequote([,])
    ;;
  sgi)
    AC_DEFINE(HAVE_POSIX_SIGNALS)
    ;;
  sol)
    AC_DEFINE(HAVE_POSIX_SIGNALS)
    ;;
  *)
    ;;
esac
# Remove optimization on all systems for all older gcc
if test $GCC = yes; then
  if test `$CC -v 2> /dev/null | grep -c 'version 2\.[45678]'` -ne 0; then
    CFLAGS=`echo $CFLAGS | sed 's:-O[0-9]* *::g'`
  fi
fi
#-------------------------------------------------------------------------------

# Shared library section
#-------------------------------------------------------------------------------
LD_FLAGS=
SHLIB_SUFFIX=".so"
SHLIB_LD_LIBS=""
if test $EXT = darwin; then
  SHLIB_SUFFIX=".dylib"
fi
lhea_shlib_cflags=
lhea_shlib_cxxflags=
lhea_shlib_fflags=
dnl if test $lhea_shared = yes; then
  case $EXT in
    darwin)
      SHLIB_LD="cc -dynamiclib"
      SHLIB_SUFFIX=".dylib"
      lhea_shlib_cflags='-fPIC -fno-common'
      lhea_shlib_fflags='-fPIC -fno-common'
      ;;
    hpu)
      SHLIB_LD="ld -b"
      SHLIB_LD_LIBS='${LIBS}'
      SHLIB_SUFFIX=".sl"
      ;;
    lnx)
      SHLIB_LD=":"
      ;;
    osf)
      SHLIB_LD="ld -shared -expect_unresolved '*'"
      ;;
    sol)
      SHLIB_LD="/usr/ccs/bin/ld -G"
      SHLIB_LD_LIBS='${LIBS}'
      lhea_shlib_cflags="-KPIC"
      lhea_shlib_cxxflags="-KPIC"
      lhea_shlib_fflags="-KPIC"
      ;;
    sgi)
      SHLIB_LD="ld -shared -rdata_shared"
      ;;
    *)
      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
dnl else
dnl   SHLIB_LD=:
dnl 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)
#-------------------------------------------------------------------------------

AC_SUBST(TCLPATH)
AC_SUBST(TKPATH)

AC_OUTPUT(Makefile)