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