File: configure.in

package info (click to toggle)
neuron 7.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 48,268 kB
  • sloc: cpp: 192,952; ansic: 145,860; python: 42,092; sh: 10,507; makefile: 6,816; yacc: 3,259; java: 995; lex: 457; csh: 108; pascal: 37; sed: 5
file content (211 lines) | stat: -rwxr-xr-x 4,560 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
dnl Process this file with autoconf to produce a configure script.

AC_INIT(src/bin/iclass/classbuffer.cpp) dnl some random source file.
AC_CONFIG_HEADER(config.h src/include/ivstream.h)

AH_TOP([
#ifndef H_config_included
#define H_config_included 1
])
AH_BOTTOM([
#if defined(__cplusplus)
#include <ivstream.h>
#endif

#if defined(CYGWIN) || defined(MINGW)
#define WIN32 1
#endif

#if defined(carbon)
#include <Carbon/Carbon.h>
#endif

#endif /* H_config_included */
])


dnl following does not seem to work in the sense of
dnl causing problems with exec_prefix
AC_PREFIX_DEFAULT(/usr/local/iv)
dnl so do it explicitly
if test "$prefix" = NONE ; then
	prefix=/usr/local/iv
fi

dnl This does the useful stuff from AM_INIT_AUTOMAKE, which we don't include
dnl because I couldn't get automake to work properly.
mlh_cxxflag="$CXXFLAGS"
PACKAGE=iv
VERSION=3.2b.hines18
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

AC_CYGWIN

if test "$CYGWIN" = "yes" ; then
	MINGW="no"
fi

case $host_os in
	mingw*)
		MINGW="yes"
		CYGWIN="no"
		;;
esac

echo "CYGWIN=$CYGWIN"
echo "MINGW=$MINGW"

if test "$enable_carbon" == 'yes' ; then
	CARBON_FALSE='#'
	CARBON_TRUE=
else
	CARBON_FALSE=
	CARBON_TRUE='#'
fi
AC_SUBST(CARBON_FALSE)
AC_SUBST(CARBON_TRUE)

dnl Don't bother building static libraries if we can avoid it.
MINGW_LIBS=""
if test "$CYGWIN" = "yes" ; then
	AC_DISABLE_STATIC
	AC_ENABLE_SHARED
	LIBS="-lgdi32 -lcomdlg32"
elif test "$MINGW" = "yes" ; then
	AC_DISABLE_STATIC
	AC_ENABLE_SHARED
	MINGW_LIBS="-lgdi32 -lcomdlg32"
else
	AC_DISABLE_STATIC
	AC_ENABLE_SHARED
fi

AC_SUBST(MINGW_LIBS)

AC_ARG_ENABLE([UniversalMacBinary],
	AC_HELP_STRING([--enable-UniversalMacBinary], [combined binary for ppc and i386, fake arch is called umac]),[
	CFLAGS="$CFLAGS -arch ppc -arch i386"
	CXXFLAGS="$CXXFLAGS -arch ppc -arch i386"
	host_cpu=umac
])

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL

dnl Checks for libraries.
AC_CHECK_LIBM
LIBS="$LIBS $LIBM"

sinclude(./chkstream.m4)

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h malloc.h sys/file.h sys/ioctl.h sys/time.h unistd.h osfcn.h sys/select.h sys/stat.h sys/mman.h stropts.h sys/conf.h)

if test "$CYGWIN" = "yes" ; then        
	echo " CYGWIN defined so make MSWwin version"           
	build_cygwin=yes        
elif test "$MINGW" = "yes" ; then
	echo " MINGW defined so make MSWwin version"           
	build_mingw=yes        
elif test "$enable_carbon" != "yes" ; then        
	AC_PATH_XTRA
	if test "$no_x" = "yes" ; then
		AC_MSG_ERROR([cannot find X11])
	fi
fi        

dnl fake automake if
if test x$build_cygwin = xyes ; then
	CYGWIN_FALSE='#'
	CYGWIN_TRUE=
	AC_DEFINE(CYGWIN,,[define if using cygwin])
else
	CYGWIN_FALSE=
	CYGWIN_TRUE='#'
fi
AC_SUBST(CYGWIN_FALSE)
AC_SUBST(CYGWIN_TRUE)

if test x$build_mingw = xyes ; then
	MINGW_FALSE='#'
	MINGW_TRUE=
	AC_DEFINE(MINGW,,[define if using mingw])
else
	MINGW_FALSE=
	MINGW_TRUE='#'
fi
AC_SUBST(MINGW_FALSE)
AC_SUBST(MINGW_TRUE)

NRN_FABS

dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UID_T

dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getcwd gethostname gettimeofday regcomp select socket strcspn strerror strtod strtol uname)

dnl See whether we need the prototype for gettimeofday.
AC_MSG_CHECKING([for prototype for gettimeofday])
AC_TRY_COMPILE([#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif
],[struct timeval curtime; gettimeofday(&curtime, 0);],
[AC_MSG_RESULT(found)],
[
AC_MSG_RESULT(not found)
AC_DEFINE(NEED_GETTIMEOFDAY_PROTOTYPE,,do we need the prototype for gettimeofday)
])

BASH_SIGNAL_CHECK

dnl special problem work arounds

dnl c++ compiler internal errors
if test -z "$mlh_cxxflag" ; then
	if test "$GXX"='yes' ; then
		zzz="`$CXX -v 2>&1 | sed -n '2s/ /_/gp'`"
		case "$zzz" in
		*version_2.8.1 ) dnl -O fails on deck2_6.cpp and xfont.cpp
echo "Compiling deck2_6.cpp and xfont.cpp will fail with an internal error"
echo "because of a g++-2.8.1 optimization bug. Setting CXXFLAGS=-g"
			CXXFLAGS=-g
		;;
		esac
	fi
fi

case "$exec_prefix" in
	NONE*)	exec_prefix="${prefix}/${host_cpu}"
	;;
esac

AC_OUTPUT([Makefile src/Makefile src/bin/Makefile src/bin/idemo/Makefile
	src/bin/idraw/Makefile src/bin/iclass/Makefile src/include/Makefile
	src/lib/Makefile
])