PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/wad-0-2-1/SWIG/Tools/WAD/configure.in

#
Autoconf | 363 lines | 283 code | 44 blank | 36 comment | 46 complexity | 8f0007ed349e2c1dbf924b09b63e5098 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1dnl Process this file with autoconf to produce a configure script.
  2
  3dnl NOTES:
  4dnl * As of 1.34, we no longer use and test for "nope" to indicate
  5dnl   an empty variable.  Instead, we use `VAR=' (set the variable
  6dnl   to nothing) and `test -z "$VAR"' or `test -n "$VAR"' as the
  7dnl   case may be.  --ttn, 2000/08/04 12:11:26
  8
  9AC_INIT(Include/wad.h)
 10AC_PREREQ(2.0)
 11
 12# Set name for machine-dependent library files
 13AC_SUBST(MACHDEP)
 14AC_MSG_CHECKING(MACHDEP)
 15if test -z "$MACHDEP"
 16then
 17	if test -f /usr/lib/NextStep/software_version; then
 18		set X `hostinfo | grep 'NeXT Mach.*:' | \
 19			sed -e 's/://' -e 's/\./_/'` && \
 20		ac_sys_system=next && ac_sys_release=$4
 21		MACHDEP="$ac_sys_system$ac_sys_release$ac_sys_cpu"
 22	else
 23		ac_sys_system=`uname -s`
 24		if test "$ac_sys_system" = "AIX" ; then
 25			ac_sys_release=`uname -v`
 26		else
 27			ac_sys_release=`uname -r`
 28		fi
 29		ac_md_system=`echo $ac_sys_system |
 30				   tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
 31		ac_md_release=`echo $ac_sys_release |
 32				   tr -d '[/ ]' | sed 's/\..*//'`
 33		MACHDEP="$ac_md_system$ac_md_release"
 34	fi
 35	case MACHDEP in
 36	'')	MACHDEP=unknown;;
 37	esac
 38fi
 39AC_MSG_RESULT($MACHDEP)
 40
 41AC_PROG_CC
 42AC_PROG_CXX
 43AC_PROG_RANLIB
 44
 45dnl Checks for programs.
 46
 47AC_SUBST(AR)
 48AC_CHECK_PROGS(AR, ar aal, ar)
 49
 50dnl Checks for header files.
 51AC_HEADER_STDC
 52dnl Checks for library functions.
 53
 54# Set info about shared libraries.
 55AC_SUBST(SO)
 56AC_SUBST(LDSHARED)
 57AC_SUBST(CCSHARED)
 58
 59# SO is the extension of shared libraries `(including the dot!)
 60# -- usually .so, .sl on HP-UX
 61AC_MSG_CHECKING(SO)
 62if test -z "$SO"
 63then
 64	case $ac_sys_system in
 65	hp*|HP*)   SO=.sl;;
 66	*)	   SO=.so;;
 67	esac
 68fi
 69AC_MSG_RESULT($SO)
 70
 71# WAD Options
 72AC_SUBST(WADOPT)
 73AC_MSG_CHECKING(WADOPT)
 74if test -z "$WADOPT"
 75then
 76	case $ac_sys_system/$ac_sys_release in
 77	SunOS/5*) WADOPT="-DWAD_SOLARIS";;
 78	Linux*) WADOPT="-DWAD_LINUX";;
 79	*)	WADOPT="-DWAD_UNKWOWN";;
 80	esac
 81fi
 82AC_MSG_RESULT($WADOPT)
 83
 84
 85# LDSHARED is the ld *command* used to create shared library
 86# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
 87# (Shared libraries in this instance are shared modules to be loaded into
 88# Python, as opposed to building Python itself as a shared library.)
 89AC_MSG_CHECKING(LDSHARED)
 90if test -z "$LDSHARED"
 91then
 92	case $ac_sys_system/$ac_sys_release in
 93	AIX*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";;
 94	IRIX/5*) LDSHARED="ld -shared";;
 95	IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
 96	SunOS/4*) LDSHARED="ld";;
 97	SunOS/5*) LDSHARED="ld -G";;
 98	hp*|HP*) LDSHARED="ld -b";;
 99	OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
100	DYNIX/ptx*) LDSHARED="ld -G";;
101	next/*)
102		if test "$ns_dyld"
103		then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
104		else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
105		fi
106                if test "$with_next_framework" ; then
107		    LDSHARED="$LDSHARED \$(LDLIBRARY)"
108		fi ;;
109	Linux*) LDSHARED="gcc -shared";;
110	dgux*) LDSHARED="ld -G";;
111	FreeBSD*/3*) LDSHARED="gcc -shared";;
112	FreeBSD*|OpenBSD*) LDSHARED="ld -Bshareable";;
113	NetBSD*)
114		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
115		then
116			LDSHARED="cc -shared"
117		else
118			LDSHARED="ld -Bshareable"
119		fi;;
120	SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
121	*)	LDSHARED="ld";;
122	esac
123fi
124AC_MSG_RESULT($LDSHARED)
125
126
127# CXXSHARED is the C++ *command* used to create shared library
128AC_SUBST(CXXLINK)
129
130AC_MSG_CHECKING(CXXLINK)
131if test -z "$CXXLINK"
132then
133	case $ac_sys_system/$ac_sys_release in
134	SunOS/5*) if test "$GCC" = yes;
135             then CXXLINK="g++ -shared";
136             else CXXLINK="CC -G";
137             fi;;
138	Linux*) CXXLINK="g++ -shared";;
139	*)	CXXLINK="g++";;
140	esac
141fi
142AC_MSG_RESULT($CXXLINK)
143
144# CCSHARED are the C *flags* used to create objects to go into a shared
145# library (module) -- this is only needed for a few systems
146AC_MSG_CHECKING(CCSHARED)
147if test -z "$CCSHARED"
148then
149	case $ac_sys_system/$ac_sys_release in
150	hp*|HP*) if test "$GCC" = yes;
151		 then CCSHARED="-fpic";
152		 else CCSHARED="+z";
153		 fi;;
154	Linux*) CCSHARED="-fpic";;
155	FreeBSD*|OpenBSD*) CCSHARED="-fpic";;
156	NetBSD*) CCSHARED="-fPIC";;
157	SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";;
158	IRIX*/6*)  case $CC in
159		   *gcc*) CCSHARED="-shared";;
160		   *) CCSHARED="";;
161		   esac;;
162	esac
163fi
164AC_MSG_RESULT($CCSHARED)
165
166AC_SUBST(CXXSHARED)
167# CCSHARED are the C *flags* used to create objects to go into a shared
168# library (module) -- this is only needed for a few systems
169AC_MSG_CHECKING(CXXSHARED)
170if test -z "$CXXSHARED"
171then
172	case $ac_sys_system/$ac_sys_release in
173	Linux*) CXXSHARED="-fpic";;
174	SunOS/5*) if test "$GCC" = yes;
175             then CXXSHARED="-fpic";
176             else CXXSHARED="-Kpic";
177             fi;;
178	esac
179fi
180AC_MSG_RESULT($CXXSHARED)
181
182# RPATH is the path used to look for shared library files.
183AC_MSG_CHECKING(RPATH)
184if test -z "$RPATH"
185then
186	case $ac_sys_system/$ac_sys_release in
187	SunOS/5*) RPATH="\"-R\"";;
188	Linux*) RPATH="-Xlinker -rpath ";;
189	*)	RPATH="";;
190	esac
191fi
192AC_MSG_RESULT($RPATH)
193AC_SUBST(RPATH)
194
195#--------------------------------------------------------------------
196#	Try to locate the Tcl package
197#--------------------------------------------------------------------
198
199TCLINCLUDE=
200TCLLIB=
201TCLPACKAGE=
202MAKETCL=
203
204AC_ARG_WITH(tcl,[  --with-tcl=path         Set location of Tcl package],[
205	TCLPACKAGE="$withval"], [TCLPACKAGE=])
206AC_ARG_WITH(tclincl,[  --with-tclincl=path     Set location of Tcl include directory],[
207	TCLINCLUDE="-I$withval"], [TCLINCLUDE=])
208AC_ARG_WITH(tcllib,[  --with-tcllib=path      Set location of Tcl library directory],[
209	TCLLIB="-L$withval"], [TCLLIB=])
210
211if test -z "$TCLINCLUDE"; then
212   if test -n "$TCLPACKAGE"; then
213	TCLINCLUDE="-I$TCLPACKAGE/include"
214   fi
215fi
216
217if test -z "$TCLLIB"; then
218   if test -n "$TCLPACKAGE"; then
219	TCLLIB="-L$TCLPACKAGE/lib"
220   fi
221fi
222
223AC_MSG_CHECKING(for Tcl header files)
224if test -z "$TCLINCLUDE"; then
225AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="")
226if test -z "$TCLINCLUDE"; then
227	dirs="$prefix/include /usr/local/include /usr/include /opt/local/include /home/sci/local/include"
228	for i in $dirs ; do
229		if test -r $i/tcl.h; then
230			AC_MSG_RESULT($i)
231			TCLINCLUDE="-I$i"
232			MAKETCL="tcl"
233			break
234		fi
235	done
236fi
237if test -z "$TCLINCLUDE"; then
238	TCLINCLUDE=""
239	MAKETCL=""
240    	AC_MSG_RESULT(not found)
241fi
242else
243        AC_MSG_RESULT($TCLINCLUDE)
244fi
245
246AC_SUBST(TCLINCLUDE)
247AC_SUBST(MAKETCL)
248
249#----------------------------------------------------------------
250# Look for Python
251#----------------------------------------------------------------
252
253PYINCLUDE=
254MAKEPYTHON=
255PYLIB=
256PYPACKAGE=
257
258AC_ARG_WITH(py,[  --with-py=path          Set location of Python],[
259	PYPACKAGE="$withval"], [PYPACKAGE=])
260AC_ARG_WITH(pyincl,[  --with-pyincl=path      Set location of Python include directory],[
261	PYINCLUDE="$withval"], [PYINCLUDE=])
262AC_ARG_WITH(pylib,[  --with-pylib=path       Set location of Python library directory],[
263	PYLIB="$withval"], [PYLIB=])
264
265if test -z "$PYINCLUDE"; then
266   if test -n "$PYPACKAGE"; then
267	PYINCLUDE="$PYPACKAGE/include"
268   fi
269fi
270
271if test -z "$PYLIB"; then
272   if test -n "$PYPACKAGE"; then
273	PYLIB="$PYPACKAGE/lib"
274   fi
275fi
276
277
278AC_MSG_CHECKING(for Python header files)
279
280dirs="$PYINCLUDE $PYINCLUDE/python2.0 $PYINCLUDE/python1.6 $PYINCLUDE/python1.5 $prefix/include/python2.0 $prefix/include/python1.6 $prefix/include/python1.5 /usr/local/include/python2.0 /usr/local/include/python1.6 /usr/local/include/python1.5 /usr/include/python1.5" 
281for i in $dirs ; do
282	if test -r $i/Python.h; then
283		AC_MSG_RESULT($i)
284		PYINCLUDE="-I$i"
285		MAKEPYTHON="python"
286		break
287	fi
288done
289if test -z "$PYINCLUDE"; then
290	PYINCLUDE=""
291	MAKEPYTHON=""
292    	AC_MSG_RESULT(not found)
293fi
294
295AC_SUBST(PYINCLUDE)
296AC_SUBST(PYLINK)
297AC_SUBST(MAKEPYTHON)
298
299#----------------------------------------------------------------
300# Look for Perl5
301#----------------------------------------------------------------
302
303PERLBIN=
304MAKEPERL=
305
306AC_ARG_WITH(perl5,[  --with-perl5=path       Set location of Perl5 executable],[ PERLBIN="$withval"], [PERLBIN=])
307
308# First figure out what the name of Perl5 is
309
310if test -z "$PERLBIN"; then
311AC_CHECK_PROGS(PERL, perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
312else
313PERL="$PERLBIN"
314fi
315AC_MSG_CHECKING(for Perl5 header files)
316if test -n "$PERL"; then
317	PERL5DIR=`($PERL -e 'use Config; print $Config{archlib};') 2>/dev/null`
318	if test "$PERL5DIR" != ""; then
319		dirs="$PERL5DIR $PERL5DIR/CORE"
320		PERL5EXT=none
321		for i in $dirs; do
322			if test -r $i/perl.h; then
323				AC_MSG_RESULT($i)
324				PERL5EXT="-I$i"
325				MAKEPERL="perl"
326				break;
327			fi
328		done
329		if test "$PERL5EXT" = none; then
330			PERL5EXT=""
331			MAKEPERL=""
332			AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT)
333		fi
334	else
335		AC_MSG_RESULT(unable to determine perl5 configuration)
336		PERL5EXT=""
337		MAKEPERL=""
338	fi
339    else
340       	AC_MSG_RESULT(could not figure out how to run perl5)
341	PERL5EXT=""
342	MAKEPERL=""
343    fi
344
345AC_SUBST(PERL5EXT)
346AC_SUBST(MAKEPERL)
347
348dnl We use the following in `AC_OUTPUT' and "make distclean".
349configure_substituted_files=`echo	\
350    Wad/Makefile			\
351    Python/Makefile    \
352    Tcl/Makefile \
353    Test/Makefile  \
354    Prebuilt/linux/Makefile \
355    Prebuilt/solaris/Makefile \
356    Makefile				\
357`
358AC_SUBST(configure_substituted_files)
359
360AC_OUTPUT([$configure_substituted_files])
361
362dnl configure.in ends here
363