PageRenderTime 36ms CodeModel.GetById 11ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/Root-branch-php-utl/SWIG/Tools/WAD/configure.in

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