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