configure.in
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:12k
源码类别:

信息检索与抽取

开发平台:

Unix_Linux

  1. AC_INIT(etc/Makefile.appl.in)
  2. AC_CANONICAL_SYSTEM
  3. VERSION=`head -1 $srcdir/VERSION`
  4. AM_INIT_AUTOMAKE(swarm, $VERSION)
  5. md_SWARM_INSTALLER
  6. test "x$ACLOCAL" = xaclocal && ACLOCAL="aclocal -I m4"
  7. AM_CONFIG_HEADER(swarmconfig.h externvar.h)
  8. AC_PROG_CC
  9. wn_PROG_OBJC
  10. LT_AC_PROG_SED
  11. AC_SUBST(SED)
  12. test -n "$OBJCFLAGS" || OBJCFLAGS="$CFLAGS"
  13. case ${host} in
  14.         *-*-darwin*)
  15.                 OBJCFLAGS="$OBJCFLAGS -B $(top_srcdir)/tools"
  16.                 ;;
  17.         *)
  18.                 ;;
  19. esac
  20. OBJCFLAGS="$OBJCFLAGS -fgnu-runtime -fno-strict-aliasing -Wall -Wno-import -Wno-protocol -Wno-long-long"
  21. AC_SUBST(OBJCFLAGS)
  22. AC_LIBTOOL_WIN32_DLL
  23. AC_PROG_LIBTOOL
  24. SHLIBPATH_VAR=`./libtool --config | $SED -n 's/^shlibpath_var=(.*)/1/p'`
  25. AC_SUBST(SHLIBPATH_VAR)
  26. AC_PATH_XTRA
  27. if test -n "$x_includes"; then
  28.   XINCLUDES="-I$x_includes"
  29. fi
  30. AC_SUBST(XINCLUDES)
  31. md_CHECK_GUILIBS
  32. AC_ARG_WITH(defaultdir,
  33. [  --with-defaultdir=DIR            Use DIR instead of prefix as default path],
  34.   defaultdir=$withval)
  35. if test $prefix = NONE; then
  36.   prefix=/usr/local
  37. fi
  38. if test -z "$defaultdir" ; then
  39.   defaultdir='${prefix}'
  40. fi
  41. AC_ARG_ENABLE(onelib,
  42. [  --enable-onelib                        build as a single library],
  43.         , enable_onelib=no)
  44. if test x$enable_onelib = xyes; then
  45. ONELIB=yes
  46. else
  47. ONELIB=no
  48. fi
  49. AC_ARG_ENABLE(gui,
  50. [  --disable-gui                    Disable GUI, Swarm is batch only],
  51.   ,enable_gui=yes)
  52. AC_ARG_WITH(xpmdir,
  53. [  --with-xpmdir=DIR                Use DIR/include and DIR/lib for XPM],
  54.   xpmincludedir=$withval/include
  55.   xpmlibdir=$withval/lib)
  56. AC_ARG_WITH(xpmlibdir,
  57. [  --with-xpmlibdir=DIR             Use DIR for XPM library files],
  58.   xpmlibdir=$withval)
  59. AC_ARG_WITH(xpmincludedir,
  60. [  --with-xpmincludedir=DIR         Use DIR for XPM header files],
  61.   xpmincludedir=$withval)
  62. AC_ARG_WITH(xpmlibname,
  63. [  --with-xpmlibname=NAME           Use -lNAME for XPM],
  64.   xpmlibname=$withval)
  65. md_FIND_XPM
  66. AC_ARG_ENABLE(libobjc,
  67. [  --disable-libobjc                Disable local ObjC library],
  68.   ,enable_libobjc=yes)
  69. AC_ARG_ENABLE(gnustep,
  70. [  --enable-gnustep                 Enable Swarm for use with GNUstep],
  71.   ,enable_gnustep=no)
  72. if test "$enable_gnustep" = yes; then
  73. md_FIND_GNUSTEPLIB
  74.    echo GNUstep integration is enabled.  Skipping configuration of local libobjc
  75.    enable_libobjc=no
  76. fi
  77. AC_ARG_WITH(tcldir,
  78. [  --with-tcldir=DIR                Use DIR/include and DIR/lib for Tcl],
  79.   tclincludedir=$withval/include
  80.   tcllibdir=$withval/lib)
  81. AC_ARG_WITH(tclincludedir,
  82. [  --with-tclincludedir=DIR         Use DIR for Tcl header files],
  83.   tclincludedir=$withval)
  84. AC_ARG_WITH(tcllibname,
  85. [  --with-tcllibname=NAME           Use -lNAME for Tcl],
  86.   tcllibname=$withval)
  87. AC_ARG_WITH(tclscriptdir,
  88. [  --with-tclscriptdir=DIR          Use DIR for Tcl scripts],
  89.   tclscriptdir=$withval)
  90. if test "$enable_gui" = no; then
  91.    echo GUI has been disabled.  Skipping configure of tclobjc
  92. else
  93.    if test "$enable_gnustep" = yes; then
  94.       echo GNUstep integration is enabled.  Skipping configuration of tclobjc
  95.    else
  96. md_FIND_TCL
  97. md_FIND_TCL_HEADERS
  98. if test -z "$tclincludedir" ; then
  99.   AC_MSG_ERROR(Please specify Tcl header path using --with-tcldir or --with-tclincludedir)
  100. fi
  101. md_FIND_TCL_LIBRARIES
  102. if test -z "$tcllibdir" ; then
  103.   AC_MSG_ERROR(Please specify Tcl library path using --with-tcldir)
  104. fi
  105. md_FIND_TCL_SCRIPTS
  106. AC_SUBST(tclscriptdir)
  107. md_CHECK_TCLTK_LIBINC_VERSION_MATCH(tcl)
  108. TCLMODULE=tclobjc
  109. AC_SUBST(TCLMODULE)
  110.    fi
  111. fi
  112. AC_ARG_WITH(tkdir,
  113. [  --with-tkdir=TKDIR               Use DIR/include and DIR/lib for Tk],
  114.   tkincludedir=$withval/include
  115.   tklibdir=$withval/lib)
  116. AC_ARG_WITH(tkincludedir,
  117. [  --with-tkincludedir=DIR          Use DIR for Tk header files],
  118.   tkincludedir=$withval)
  119. AC_ARG_WITH(tkscriptdir,
  120. [  --with-tkscriptdir=DIR           Use DIR for Tk scripts],
  121.   tkscriptdir=$withval)
  122. AC_ARG_WITH(tklibname,
  123. [  --with-tklibname=NAME            Use -lNAME for Tk],
  124.   tklibname=$withval)
  125. if test "$enable_gui" = no; then
  126.    echo GUI has been disabled.  Skipping configure of tkobjc
  127. else
  128.    if test "$enable_gnustep" = yes; then
  129.       echo GNUstep integration is enabled.  Skipping configuration of tkobjc
  130.    else
  131. md_FIND_TK_HEADERS
  132. if test -z "$tkincludedir" ; then
  133.   AC_MSG_ERROR(Please specify Tk include path using --with-tkincludedir)
  134. fi
  135. md_FIND_TK_LIBRARIES
  136. if test -z "$tklibdir" ; then
  137.   AC_MSG_ERROR(Please specify Tk library path using --with-tkdir)
  138. fi
  139. md_FIND_TK_SCRIPTS
  140. AC_SUBST(tkscriptdir)
  141. md_CHECK_TCLTK_LIBINC_VERSION_MATCH(tk)
  142. TKMODULE=tkobjc
  143. AC_SUBST(TKMODULE)
  144.    fi
  145. fi
  146. AC_ARG_WITH(bltdir,
  147. [  --with-bltdir=DIR                Use DIR/include and DIR/lib for BLT],
  148.   bltdir=$withval)
  149. AC_ARG_WITH(bltlibname,
  150. [  --with-bltlibname=NAME           Use -lNAME for BLT],
  151.   bltlibname=$withval)
  152. if test "$enable_gui" = no; then
  153.    echo GUI has been disabled.  Skipping configure of tclobjc
  154. else
  155.    if test "$enable_gnustep" = yes; then
  156.       echo GNUstep integration is enabled.  Skipping configuration of BLT
  157.    else
  158. md_FIND_BLT
  159.    fi
  160. fi
  161. AC_ARG_WITH(ffidir,
  162. [  --with-ffidir=DIR                Use DIR/include and DIR/lib for libffi],
  163.   ffidir=$withval)
  164. AC_ARG_WITH(ffcalldir,
  165. [  --with-ffcalldir=DIR             Use DIR/include and DIR/lib
  166.                                      for ffcall (alternative to libffi)])
  167. md_FIND_FFI
  168. AC_ARG_WITH(zlibdir,
  169. [  --with-zlibdir=DIR               Use DIR/include and DIR/lib for zlib],
  170.   zlibdir=$withval
  171.   zlibincludedir=$withval/include)
  172. AC_ARG_WITH(zlibincludedir,
  173. [  --with-zlibincludedir=DIR        Use DIR for zlib include files],
  174.   zlibincludedir=$withval)
  175. md_FIND_ZLIB
  176. AC_ARG_WITH(pngdir,
  177. [  --with-pngdir=DIR                Use DIR/include and DIR/lib for PNG],
  178.   pngdir=$withval
  179.   pngincludedir=$withval/include)
  180. AC_ARG_WITH(pngincludedir,
  181. [  --with-pngincludedir=DIR         Use DIR for PNG include files],
  182.   pngincludedir=$withval)
  183. md_FIND_PNG
  184. AC_ARG_WITH(hdf5dir,
  185. [  --with-hdf5dir=DIR               Use DIR for HDF5],
  186.   hdf5dir=$withval
  187.   hdf5includedir=$withval/include)
  188. md_FIND_HDF5
  189. AC_ARG_WITH(jdkdir,
  190. [  --with-jdkdir=DIR                Use DIR for Java Development Kit],
  191.   jdkdir=$withval)
  192. AC_ARG_ENABLE(jar, 
  193. [  --disable-jar                    Don't create a swarm.jar file],
  194.   ,enable_jar=yes)
  195. if test "$enable_jar" = no; then
  196.   JAVA_CLASSES_INSTALLED_AS=files
  197. else
  198.   JAVA_CLASSES_INSTALLED_AS=jar
  199. fi
  200. AC_SUBST(JAVA_CLASSES_INSTALLED_AS)
  201. AC_ARG_ENABLE(subdirs,
  202. [  --enable-subdirs                 Add {include,lib}/swarm subdirs],
  203.   ,enable_subdirs=no)
  204. if test $prefix = /usr || test $enable_subdirs = yes; then
  205.    includesubdir=swarm
  206.    includedir=${includedir}/${includesubdir}
  207.   
  208.    if ! test -x $prefix/bin/cygwin1.dll; then
  209.      # Cygwin will want to use ../bin for DLLs, which will result
  210.      # in /usr/lib/bin/cygswarm.dll.  Anyway, the shared libraries 
  211.      # are consolidated into a single DLL, so there is no proliferation 
  212.      # of libraries
  213.      libdir=${libdir}/swarm
  214.    fi
  215. fi
  216. md_CHECK_LINKFLAGS
  217. AC_CHECK_LIB(dl,main,DLLIB=-ldl)
  218. AC_CHECK_LIB(dld,main,DLLIB=-ldld) # HPUX
  219. AC_SUBST(DLLIB)
  220. md_CHECK_INLINING
  221. md_CHECK_WARNFLAGS
  222. # md_CHECK_OBJC_LIBS
  223. md_CHECK_NEXTSTEP
  224. md_CHECK_POINTER_FMT
  225. md_CHECK_BUILTIN_APPLY
  226. md_CHECK_SIZES
  227. md_CHECK_long_long_printf
  228. #AC_OBJEXT
  229. #if test $ac_objext = o ; then 
  230.  # so that LIBOBJS additions from AC_REPLACE_FUNCS have a .lo suffix.
  231. #  ac_objext=lo
  232. #fi
  233. ac_save_CFLAGS=$CFLAGS
  234. CFLAGS="$CFLAGS -fno-builtin"
  235. AC_REPLACE_FUNCS(memcpy memset strcmp strlen)
  236. CFLAGS=$ac_save_CFLAGS
  237. AC_REPLACE_FUNCS(memchr realpath stpcpy strchr strncmp strndup strnlen strpbrk strsep strtoll)
  238. # then undo the change because AC_TRY_COMPILE will be checking for
  239. # the file.$ac_objext, but configure tests are only with gcc, not libtool
  240. if test $ac_objext = lo ; then
  241.   ac_objext=o
  242. fi
  243. md_CHECK_ARGP
  244. md_STRUCT_XPM_ALLOCPIXELS
  245. test -n "$CONSERVATIVE_OPTIMIZATION" || CONSERVATIVE_OPTIMIZATION=no
  246. AM_CONDITIONAL(CONSERVATIVE_OPTIMIZATION,test $CONSERVATIVE_OPTIMIZATION = yes)
  247. if test $ac_cv_func_stpcpy = yes || test $ac_cv_func_strndup = yes || test $ac_cv_func_strnlen = yes; then
  248.   CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
  249. fi
  250. AC_CHECK_HEADERS(sys/sigevent.h)
  251. swarm_prefix=$prefix
  252. if test $exec_prefix = NONE; then
  253.   swarm_exec_prefix='${swarm_prefix}'
  254. else
  255.   swarm_exec_prefix=$exec_prefix
  256. fi
  257. swarm_bindir="`echo $bindir | $SED 's/{/{swarm_/'`"
  258. swarm_libdir="`echo $libdir | $SED 's/{/{swarm_/'`"
  259. swarm_includedir="`echo $includedir | $SED 's/{/{swarm_/'`"
  260. swarm_datadir="`echo $datadir | $SED 's/{/{swarm_/'`"
  261. SWARMLDFLAGS="-L${swarm_libdir} -rpath ${swarm_libdir}"
  262. AC_SUBST(SWARMLDFLAGS)
  263. AC_SUBST(swarm_prefix)
  264. AC_SUBST(swarm_exec_prefix)
  265. AC_SUBST(swarm_bindir)
  266. AC_SUBST(swarm_libdir)
  267. AC_SUBST(swarm_includedir)
  268. AC_SUBST(swarm_datadir)
  269. AC_DEFINE_UNQUOTED(PREFIX,"$prefix",[toplevel directory for Swarm installation])
  270. AC_DEFINE_UNQUOTED(DATADIR,"$datadir",[directory for architecutre independent files])
  271. AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir",[directory for Swarm Makefile templates])
  272. AC_DEFINE_UNQUOTED(INCLUDEDIR,"$includedir",[directory for Swarm include files])
  273. if test -n "$includesubdir"; then
  274. AC_DEFINE_UNQUOTED(INCLUDESUBDIR,"$includesubdir", [subdirectory for includes, if any])
  275. fi
  276. md_CHECK_PATH_SYNTAX
  277. vj_FIND_JDK
  278. md_CHECK_JNI_H
  279. md_CHECK_DLL
  280. if test $USEDLL = yes; then
  281.   LIBSWARM_LA=libswarm.la
  282.   SWARM_DLL=swarm.dll
  283.   LIBJAVASWARM_LA=
  284.   JAVASWARM_DLL=${JAVASWARM_LIB_NAME}.dll
  285.   noinst_LIBS='lib$(MODULE).la'
  286.   inst_LDFLAGS=-static
  287. else
  288.   if test  x$ONELIB = xyes; then
  289.   LIBSWARM_LA=libswarm.la
  290.   SWARM_DLL=
  291.   LIBJAVASWARM_LA=lib${JAVASWARM_LIB_NAME}.la
  292.   JAVASWARM_DLL=
  293.   noinst_LIBS='lib$(MODULE).la' 
  294.   inst_LDFLAGS=
  295.   else
  296.   LIBSWARM_LA=libswarm.la
  297.   SWARM_DLL=
  298.   LIBJAVASWARM_LA=lib${JAVASWARM_LIB_NAME}.la
  299.   JAVASWARM_DLL=
  300.   inst_LIBS='lib$(MODULE).la' 
  301.       inst_LDFLAGS='-rpath $(DESTDIR)$(libdir) -version-info $(CURRENT):$(REVISION):$(AGE)'
  302.   fi
  303. fi
  304. AC_SUBST(SWARM_DLL)
  305. AC_SUBST(LIBSWARM_LA)
  306. AC_SUBST(LIBJAVASWARM_LA)
  307. AC_SUBST(JAVASWARM_DLL)
  308. AC_SUBST(noinst_LIBS)
  309. AC_SUBST(inst_LIBS)
  310. AC_SUBST(inst_LDFLAGS)
  311. AC_SUBST(ONELIB)
  312. AC_SUBST(MACOSJAVA)
  313. AC_PATH_PROG(EMACS, emacs, missing)
  314. test -n "$ffidir" || AVCALLDIR=avcall
  315. AC_SUBST(AVCALLDIR)
  316. if test "$enable_libobjc" = yes; then
  317.    LIBOBJCDIR='libobjc'
  318.    LIBOBJCINCLUDES='-I$(top_builddir)/libobjc -I$(top_srcdir)/libobjc'
  319.    LIBOBJCLDFLAGS='-L../libobjc'
  320.    LIBOBJCLIB='-lswarmobjc'
  321.    LIBOBJCDEP='$(top_builddir)/libobjc/libswarmobjc.la'
  322.    AC_DEFINE([USE_MFRAME], 1, [Define if mframe functions to be used.])
  323.    # test -d libobjc || mkdir libobjc
  324.    AC_CONFIG_SUBDIRS(libobjc)
  325. else
  326.    echo Skipping configuration of local ObjC library.
  327.    LIBOBJCDIR=
  328.    LIBOBJCINCLUDES=
  329.    LIBOBJCLDFLAGS=
  330.    LIBOBJCLIB='-lobjc'
  331.    LIBOBJCDEP=
  332. fi
  333. AC_SUBST(LIBOBJCDIR)
  334. AC_SUBST(LIBOBJCINCLUDES)
  335. AC_SUBST(LIBOBJCLDFLAGS)
  336. AC_SUBST(LIBOBJCLIB)
  337. AC_SUBST(LIBOBJCDEP)
  338. TCLTKGUIDIR='tclobjc tkobjc'
  339. SIMTOOLSGUI='simtoolsgui'
  340. SIMTOOLSGUIINCLUDE='-I$(top_srcdir)/src/simtoolsgui'
  341. GUIDIR='gui'
  342. GUIDIRINCLUDE='-I$(top_srcdir)/src/gui'
  343. AM_CONDITIONAL(DISABLE_GUI, false)
  344. if test "$enable_gui" = no; then
  345.    TCLTKGUIDIR=
  346.    SIMTOOLSGUI=
  347.    SIMTOOLSGUIINCLUDE=
  348.    GUIDIR=
  349.    GUIDIRINCLUDE=
  350.    AC_DEFINE([DISABLE_GUI], 1, [Define if GUI is disabled.])
  351.    AM_CONDITIONAL(DISABLE_GUI, true)
  352. fi
  353. if test "$enable_gnustep" = yes; then
  354.    AM_CONDITIONAL(ENABLE_GNUSTEP, true)
  355.    TCLTKGUIDIR=
  356.    SIMTOOLSGUI=
  357.    SIMTOOLSGUIINCLUDE=
  358.    GUIDIR=
  359.    GUIDIRINCLUDE=
  360. else
  361.    AM_CONDITIONAL(ENABLE_GNUSTEP, false)
  362. fi
  363. AC_SUBST(TCLTKGUIDIR)
  364. AC_SUBST(SIMTOOLSGUI)
  365. AC_SUBST(SIMTOOLSGUIINCLUDE)
  366. AC_SUBST(GUIDIR)
  367. AC_SUBST(GUIDIRINCLUDE)
  368. if test -n "$AVCALLDIR"; then
  369.   test -d avcall || mkdir avcall
  370.   AC_CONFIG_SUBDIRS(avcall)
  371. else
  372.   test -d avcall || mkdir avcall
  373.   # avcall.h finds its way into dependency information
  374.   touch avcall/avcall.h
  375. fi
  376. AC_OUTPUT([Makefile m4/Makefile src/Makefile src/activity/Makefile
  377. src/analysis/Makefile src/collections/Makefile src/defobj/Makefile
  378. src/misc/Makefile src/objectbase/Makefile
  379. src/random/Makefile src/simtools/Makefile 
  380. src/space/Makefile etc/modules etc/config.swarm etc/Makefile.appl
  381. etc/Makefile.lib etc/Makefile.common etc/Makefile.tests etc/Makefile
  382. etc/swarmrc etc/swarmtrc
  383. tests/Makefile tests/activity/Makefile tests/collections/Makefile
  384. tests/defobj/Makefile tests/objectbase/Makefile
  385. tests/simtools/Makefile tests/space/Makefile tools/Makefile
  386. tools/print-hdf5 java/Makefile java/javaswarm java/javacswarm
  387. java/c/Makefile java/swarm/Makefile java/swarm/Makefile.rules
  388. COM/Makefile COM/c/Makefile
  389. src/gui/Makefile src/simtoolsgui/Makefile src/tclobjc/Makefile src/tkobjc/Makefile src/tkobjc/tk/Makefile src/swarmgstep/Makefile
  390. ])
  391. # abs_srcdir=`cd $srcdir; pwd`