File: configure.in

package info (click to toggle)
gap 4r4p12-2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 29,584 kB
  • ctags: 7,113
  • sloc: ansic: 98,786; sh: 3,299; perl: 2,263; makefile: 498; asm: 63; awk: 6
file content (242 lines) | stat: -rw-r--r-- 5,413 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
dnl #########################################################################
dnl ##
dnl ## check for a unique program in the source directory
dnl ##

AC_INIT(gap.c)
AC_CONFIG_AUX_DIR(../cnf)

if test "x$CFLAGS" = "x" ;  then
  CFLAGS=${COPTS}
fi

dnl #########################################################################
dnl ##
dnl ## create a config file from "config.hin"
dnl ##

AC_CONFIG_HEADER(config.h:../cnf/config.hin)


dnl #########################################################################
dnl ##
dnl ## check for compiler features
dnl ##

AC_PROG_CC
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
#
# Assume that cross-compiling is for 32 bit systems 
# (alpha/NT will have to wait)
#
AC_CHECK_SIZEOF(void *, 4) # no space between 'void *' and ','
GP_C_UNDERSCORE_SYMBOLS


dnl #########################################################################
dnl ##
dnl ## find a canonical name for the system
dnl ##

AC_CANONICAL_TARGET
AC_DEFINE_UNQUOTED( SYS_ARCH, "$target-$CC" )

dnl This has to be left until after we know the system type
GP_C_LONG_ALIGN
GP_CFLAGS
GP_LDFLAGS
GP_PROG_CC_DYNFLAGS


dnl #########################################################################
dnl ##
dnl ## check for the existence of various header files
dnl ##

AC_HEADER_STDC
AC_CHECK_HEADERS( termios.h termio.h sgtty.h signal.h stdio.h unistd.h libc.h sys/stat.h )
AC_CHECK_HEADERS( errno.h fcntl.h sys/types.h assert.h sys/sysmacros.h stdlib.h string.h math.h)

dnl #########################################################################
dnl ##
dnl ## check how to get a pseudo-tty pair
dnl ##

AC_CHECK_FUNCS( getpseudotty _getpty getpt ptsname_r )

dnl #########################################################################
dnl ##
dnl ## check whether we have setpgid to protect a background child from SIGINT
dnl ##

AC_CHECK_FUNCS( setpgid )

dnl #########################################################################
dnl ##
dnl ## check for dynamic loading of modules
dnl ##

AC_CHECK_FUNCS( rld_load )

AC_SEARCH_LIBS(dlopen, dl, AC_DEFINE(HAVE_DLOPEN,1))

if test "$ac_cv_search_dlopen" != "no";  then
  GP_PROG_CC_EXPORT_DYNAMIC
  if test "$gp_cv_prog_cc_export_dynamic" = yes;  then
    LDFLAGS="$LDFLAGS -export-dynamic"
  fi
fi

case "$LIBS" in 

	*-ldl* ) C_DYNLIBS="-ldl";;
                *)  C_DYNLIBS="";;
esac;

AC_SUBST(LDFLAGS)
AC_SUBST(C_DYNLIBS)

dnl #########################################################################
dnl ##
dnl ## check for timing functions
dnl ##

AC_CHECK_HEADERS( sys/times.h sys/param.h )
AC_CHECK_FUNCS( times getrusage )


dnl #########################################################################
dnl ##
dnl ## check for functions dealing with virtual memory
dnl ##

AC_CHECK_FUNCS( vm_allocate sbrk )


dnl #########################################################################
dnl ##
dnl ## check for fork, wait, execute functions
dnl ##

AC_HEADER_SYS_WAIT
AC_TYPE_PID_T
AC_FUNC_VFORK
AC_CHECK_FUNCS( fork popen waitpid wait4 )

AC_MSG_CHECKING([for old non-posix union wait])

dnl AC_EGREP_HEADER( union wait, sys/wait.h,
dnl   [AC_DEFINE( HAVE_UNION_WAIT )
dnl   AC_MSG_RESULT(yes)],
dnl  [AC_MSG_RESULT(no)] )

GP_C_UNION_WAIT


dnl #########################################################################
dnl ##
dnl ## check for signal handling
dnl ##

AC_CHECK_FUNCS( signal )
AC_TYPE_SIGNAL
if test "$ac_cv_type_signal" = "void"; then
  AC_DEFINE( HAVE_SIGNAL_VOID )
fi


dnl #########################################################################
dnl ##
dnl ## check for input/output functions
dnl ##

AC_CHECK_FUNCS( ttyname strerror select )


dnl #########################################################################
dnl ##
dnl ## check for file access functions
dnl ##

AC_CHECK_FUNCS( access stat fstat lstat unlink mkdir mkdtemp mkstemp rmdir link rename symlink readlink chmod fchmod chown fchown lchown dup dup2 mknod mkfifo )
AC_HEADER_STAT

dnl #########################################################################
dnl ##
dnl ## check for socket access functions
dnl ##
AC_CHECK_FUNCS( socket listen accept connect bind getsockname recv recvfrom recvmsg send sendto sendmsg getsockopt setsockopt getprotobyname gethostbyname )

dnl #########################################################################
dnl ##
dnl ## check for directory access functions
dnl ##

AC_HEADER_DIRENT
AC_CHECK_FUNCS( opendir closedir dirfd readdir rewinddir seekdir telldir )

dnl #########################################################################
dnl ##
dnl ## set features on systems we know for better performance
dnl ##

case "$host" in

  i386-*-* | i486-*-* | i586-*-* | i686-*-*)
    AC_DEFINE( C_STACK_ALIGN, 2 )
    ;;


  *)
    AC_DEFINE_UNQUOTED( C_STACK_ALIGN, $gp_cv_c_long_align )
    ;;

esac

case "$host" in 

   sparc-* )
    AC_DEFINE( SPARC, 1)
   ;;

   ia64-* ) 
    AC_DEFINE(ITANIUM,1)
    ITANIUMOBJ=itanium.o
    ;;
esac

AC_SUBST(ITANIUMOBJ)

AC_CYGWIN
if test "$CYGWIN" = "yes"; then
  AC_DEFINE(SYS_IS_CYGWIN32, 1)
else
  AC_DEFINE(SYS_IS_CYGWIN32, 0)
fi


case "$host" in 
	*-darwin* )
	AC_DEFINE(SYS_IS_DARWIN, 1)
        ;;
	* )
	AC_DEFINE(SYS_IS_DARWIN, 0)
	;;
esac




dnl #########################################################################
dnl ##
dnl ## generate a makefile
dnl ##

AC_SUBST(gapbin)
gapbin=`pwd`

AC_OUTPUT(gac:../cnf/gac.in Makefile:../cnf/Makegap.in)
chmod a+x gac