configure.in
上传用户:dgyhgb
上传日期:2007-01-07
资源大小:676k
文件大小:14k
源码类别:

SQL Server

开发平台:

Unix_Linux

  1. dnl Process this file with autoconf to produce a configure script.
  2. ##
  3. ## $Id: configure.in,v 1.8 1997/04/28 12:54:34 kml Exp $
  4. ##
  5. ## This file is a part of GNU SQL Server
  6. ##
  7. ## Copyright (c) 1996, Free Software Foundation, Inc
  8. ## Developed at Institute of System Programming of Russian Academy of Science
  9. ## This file is written by Michael Kimelman
  10. ##
  11. ## This program is free software; you can redistribute it and/or modify it under
  12. ## the terms of the GNU General Public License as published by the Free
  13. ## Software Foundation; either version 2 of the License, or (at your option)
  14. ## any later version.
  15. ##
  16. ## This program is distributed in the hope that it will be useful, but WITHOUT
  17. ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  18. ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  19. ## more details.
  20. ##
  21. ## You should have received a copy of the GNU General Public License along with
  22. ## this program; if not, write to the Free Software Foundation, Inc.,
  23. ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24. ##
  25. ## Contacts: gss@ispras.ru
  26. ##
  27. AC_INIT(test/testd1.ec)
  28. AC_CONFIG_HEADER(src/include/config.h:config.h.in)
  29. dnl self checking level
  30. dnl AC_ARG_ENABLE(TRLCHECK,
  31. dnl [  --enable-TRLCHECK      enable extensive compiler runtime checking], 
  32. dnl               AC_DEFINE(TRL_CHECK))
  33. dnl checking for debugger environment
  34. AC_ARG_ENABLE(DEBUG,
  35. [  --enable-DEBUG          enable transaction processes debugging], 
  36.               , 
  37.               ac_not_debug=1 )
  38. dnl execution profile checking
  39. AC_ARG_ENABLE(PROF,
  40. [  --enable-PROFILE        turn on execution profile mode    ], 
  41.               ac_profile=1   )
  42. version=`cat ${srcdir}/version`
  43. dbhome='$(prefix)/share/gnusql/$(version)/$(host)'
  44. builddir=`pwd`
  45. bindir='$(prefix)/bin'
  46. mandir='$(prefix)/man'
  47. infodir='$(prefix)/info'
  48. #### Make srcdir absolute, if it isn't already.  It's important to
  49. #### avoid running the path through pwd unnecessary, since pwd can
  50. #### give you automounter prefixes, which can go away.  
  51. case "${srcdir}" in
  52.   /* ) ;;
  53.   . )
  54.     ## We may be able to use the $PWD environment variable to make this
  55.     ## absolute.  But sometimes PWD is inaccurate.
  56.     ## Make sure CDPATH doesn't affect cd (in case PWD is relative).
  57.     CDPATH=
  58.     if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`"  ;
  59.     then
  60.       srcdir="$PWD"
  61.     else
  62.       srcdir="`(cd ${srcdir}; pwd)`"
  63.     fi
  64.   ;;
  65.   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
  66. esac
  67. #### Check if the source directory already has a configured system in it.
  68. if test `pwd` != `(cd ${srcdir} && pwd)` 
  69.    && test -f "${srcdir}/src/include/config.h" ; then
  70.   AC_MSG_WARN([The directory tree `${srcdir}' is being used
  71.    as a build directory right now; it has been configured in its own
  72.    right.  To configure in another directory as well, you MUST
  73.    use GNU make.  If you do not have GNU make, then you must
  74.    now do `make distclean' in ${srcdir},
  75.    and then run $0 again.])
  76. changequote(, )dnl
  77.   extrasub='/^VPATH[  ]*=/c
  78. changequote([, ])dnl
  79. vpath %.x   $(srcdir)
  80. vpath %.k   $(srcdir)
  81. vpath %.kt  $(srcdir)
  82. vpath %.ec  $(srcdir)
  83. vpath %.sql $(srcdir)
  84. vpath %.y   $(srcdir)
  85. vpath %.l   $(srcdir)
  86. vpath %.c   $(srcdir)
  87. vpath %.h   $(srcdir)
  88. vpath %.def $(srcdir)
  89. vpath %.texi $(srcdir)
  90. vpath %.1   $(srcdir)
  91. vpath %.in  $(srcdir)
  92. vpath %.m4  $(srcdir)
  93. vpath %.dep $(srcdir)
  94. '
  95. fi
  96. if test ! -f config.guess -a -f RCS/config.guess,v ; then
  97.     co config.guess
  98. fi
  99. if test ! -f config.sub -a -f RCS/config.sub,v ; then
  100.     co config.sub
  101. fi
  102. AC_CANONICAL_HOST
  103. canonical=$host
  104. configuration=$host_alias
  105. AC_DEFINE_UNQUOTED(VERSION,"$version")
  106. AC_DEFINE_UNQUOTED(HOST,"$host")
  107. dnl Checks for programs.
  108. AC_SYS_INTERPRETER
  109. if test "$ac_cv_sys_interpreter" = "yes" ; then
  110.   INT_SHELL="#! /bin/sh"
  111. else
  112.   INT_SHELL=""
  113. fi
  114. AC_PROG_CC
  115. AC_PROG_CPP
  116. ### ------------------------------------------------------------------
  117. ### ----------------- flags setting ----------------------------------
  118. ### ------------------------------------------------------------------
  119. ### Checks for ansi compatibility
  120. ### ---------------------------------
  121. dnl
  122. dnl Check if we can handle prototypes.
  123. dnl
  124. AM_C_PROTOTYPES
  125. if test "x$ANSI2KNR" = "x" ; then 
  126.   A2K_proc=:
  127.   A2K_entry=""
  128. else
  129.   A2K_proc=""
  130.   A2K_entry="ansi2knr"
  131.   ### emit warning about automatic converting all C files and 
  132.   ### assotiated stuff. 
  133.   echo "-------------------------------------------------------"
  134.   echo "<<<<<<<  Warning: Non ANSI compiler detected !! >>>>>>>"
  135.   echo "-------------------------------------------------------"
  136.   echo "All files will be automatically converted to KNR style."
  137.   echo "Be careful editing them and sending patches about it. "
  138.   echo "-------------------------------------------------------"
  139.   if test "${srcdir}" != "${builddir}" ; then
  140.     echo "You use --srcdir configuration. In this case source    "
  141.     echo "files are converted once and stored in the build tree  "
  142.     echo "Any modification in distribution tree will not take    "
  143.     echo "effect until your remove 'src/ansi2knrs' timestamp     "
  144.     echo "in your build tree. This lead to reading source tree   "
  145.     echo "again and repeating conversion                         "
  146.     echo "-------------------------------------------------------"
  147.   fi 
  148.   echo "ansi2knr feature has not been properly tested yet !!!  "
  149.   echo "-------------------------------------------------------"
  150.   sleep 5
  151.   ### override AM_C_PROTOTYPE difinition:we have another make's dependencies
  152.   U=""
  153. fi
  154. changequote(, )dnl
  155. if test -z "$ac_not_debug"  ; then ### if debug info required
  156.   ## turn off optimization
  157.   CFLAGS=`echo $CFLAGS | sed 's/[-]O[0-9]*//g'`
  158. else  ## if debug info not required -- turn off -g
  159.   CFLAGS=`echo $CFLAGS | sed 's/[-]g[0-9]//g'`
  160. fi
  161. if test "$GCC" = "yes" ; then
  162.   CFLAGS=`echo $CFLAGS | sed 's/[-]g[0-9]*/-g3/g;s/[-]O[0-9]*/-O4/g' `
  163.   CFLAGS="-Wall $CFLAGS"
  164. else
  165.   if test -d /usr/local/lib ; then
  166.     LDFLAGS="-L/usr/local/lib $LDFLAGS"
  167.   fi
  168. fi
  169. changequote([, ])dnl
  170. if test ! -z "$ac_profile" ; then ### if profiling is reqired
  171.   if test "$GCC" = "yes" ; then
  172.     CFLAGS="-pg $CFLAGS"
  173.   else
  174.     CFLAGS="-p $CFLAGS"
  175.   fi
  176. fi
  177. LDFLAGS="$CFLAGS $LDFLAGS"
  178. #### include directories path settings
  179. if test "${srcdir}" = "${builddir}" -o "x$ANSI2KNR" != "x" ; then
  180.   CPPFLAGS="$CPPFLAGS -I${builddir}/src/trl -I${builddir}/src/engine"
  181.   CPPFLAGS="$CPPFLAGS -I. -I${builddir}/src/include -I${builddir}/src/include/engine"
  182. else ###  --srcdir case and ansi compiler
  183.   CPPFLAGS="$CPPFLAGS -I. -I${srcdir}/src/include -I${srcdir}/src/include/engine"
  184.   CPPFLAGS="$CPPFLAGS -I${srcdir}/src/trl -I${srcdir}/src/engine"
  185.   CPPFLAGS="$CPPFLAGS -I$(srcdir) -I${builddir}/src/include -I${builddir}/src/include/engine"
  186. fi
  187. ### ------------------------------------------------------------------
  188. ### ------------------------------------------------------------------
  189. AC_PROG_INSTALL
  190. AC_PROG_YACC
  191. dnl ## actually we strongly need bison because we use @n construction
  192. if test "$YACC" = "bison -y" ; then
  193.   YACC=bison
  194.   YFLAGS="-d -v -t"
  195. else
  196.   YACC='$(LIB)/preserve'
  197.   YFLAGS="restore --bison"
  198. fi
  199. AC_PROG_LEX
  200. ## and here we seems to need flex (generic lex is something unpredictable)
  201. ## we also used %x constructions which happens to be unsopported by some lex.
  202. if test "$LEX" = "flex" ; then ### that's fine
  203.   LFLAGS="-d8i"
  204. #elif test "$LEX" = "lex" ; then
  205. #  LFLAGS="-t"
  206. else 
  207.   LEX='$(LIB)/preserve'
  208.   LFLAGS='restore --flex'
  209. fi
  210. AC_PROG_LN_S
  211. AC_PROG_RANLIB
  212. ### we can found ranlib here but it's not enough : hpus used to have 
  213. ### useless script with the same name. it's ok if you use standard 'ar'
  214. ### but if you install GNU's binutils some trouble can arise.
  215. dnl AC_PROG_AR
  216. dnl choose the best make
  217. ac_save_path="$PATH"
  218. PATH=/usr/local/bin:/usr/contrib/bin:/usr/bin:$PATH
  219. AC_PATH_PROGS(MAKE, gmake make)
  220. PATH="$ac_save_path"
  221. AC_MSG_CHECKING(for make include item)
  222. AC_CACHE_VAL(gss_cv_MAKE_includes,[
  223.      cat >maketst1 <<EOF
  224. EOF
  225.      gss_cv_MAKE_includes="##include"
  226.      for inc_test in "include" ".include" "%include" ; do
  227.        cat >maketest <<EOF
  228. $inc_test maketst1
  229. all:
  230. EOF
  231.        if ${MAKE} -f maketest 2>>config.log >/dev/null ; then
  232.           ## we can include other makefiles
  233.           gss_cv_MAKE_includes="$inc_test"
  234.        fi
  235.      done 
  236.      rm -f maketest maketst1
  237.     ])
  238. AC_MSG_RESULT($gss_cv_MAKE_includes)
  239. SET_MAKE="MAKE=${MAKE-make}"
  240. AC_MSG_CHECKING(if make able to identify short and long file name)
  241. AC_CACHE_VAL(gss_cv_MAKE_short_long,[
  242.      gss_cv_MAKE_short_long="no"
  243.      cat >maketest <<EOF
  244. all: maketest
  245. @echo >/dev/null
  246. maketest : `pwd`/maketest
  247. EOF
  248.      if test `${MAKE} -f maketest 2>&1 | wc -l ` -gt 0 ; then
  249.        gss_cv_MAKE_short_long="yes"
  250.      fi
  251.      rm -f maketest $$.log
  252.     ])
  253. AC_MSG_RESULT($gss_cv_MAKE_short_long)
  254. if test "$gss_cv_MAKE_short_long" = "yes" ; then
  255.   MCYCLE="## commnet cycle dependencies ##"
  256. fi
  257. dnl ------------------------------------------------------------------
  258. dnl -------- debugger environment customization ----------------------
  259. dnl ------------------------------------------------------------------
  260. if test -z "$ac_not_debug"  ; then
  261.   AC_PATH_PROG(DDD,ddd)                   dnl nice gdb/dbx environment
  262.   if test -n "$DDD"  ; then
  263.     AC_DEFINE_UNQUOTED(HAVE_DDD,"$DDD")
  264.   fi
  265.   AC_PATH_PROGS(XTERM,xterm shelltool cmdtool)
  266.   if test -n "$XTERM"  ; then
  267.      AC_DEFINE_UNQUOTED(HAVE_XTERM,"$XTERM")
  268.   fi
  269.   AC_PATH_PROG(XXGDB,xxgdb)               dnl gdb/dbx environment 
  270.   if test -n "$XXGDB"  ; then
  271.       AC_DEFINE_UNQUOTED(HAVE_XXGDB,"$XXGDB")
  272.   fi
  273.   if test -z "$XTERM" -a -z "$XXGDB" -a -z "$DDD" ; then
  274.         ac_not_debug=1
  275.   fi
  276. fi
  277. if test -z "$ac_not_debug"  ; then
  278.   AC_PATH_PROG(GDB,gdb)  
  279.   if test -n "$GDB"  ; then
  280.     AC_DEFINE_UNQUOTED(HAVE_GDB,"$GDB")
  281.   fi
  282.   AC_PATH_PROG(DBX,dbx)  
  283.   if test -n "$DBX"  ; then
  284.     AC_DEFINE_UNQUOTED(HAVE_DBX,"$DBX") 
  285.   fi
  286.   if test -z "$GDB" -a -z "$DBX" ; then
  287.       ac_not_debug=1
  288.   fi
  289. fi
  290. if test -n "$ac_not_debug"  ; then
  291.         AC_DEFINE(NOT_DEBUG)
  292. fi
  293. AC_PATH_PROG(RPCGEN,rpcgen)     dnl check rpc stubs generator
  294. if test -n "$RPCGEN" ; then
  295.     AC_MSG_CHECKING(rpcgen output)
  296.     AC_CACHE_VAL(gss_cv_RPCGEN_output,[
  297.         cat >mytest.x <<EOF
  298. program CT_P {
  299.   version CT_V { 
  300.     int         CT_P(void)   = 1;
  301.   } = 2 ;
  302. } = 3;
  303. EOF
  304.         $RPCGEN mytest.x
  305.         AC_EGREP_HEADER(ct_p_2_svc,mytest.h, stubs=svc, stubs=simple)
  306.         AC_EGREP_HEADER(main[ ]*(void),mytest_svc.c, main=void, main=proto)
  307.         AC_EGREP_CPP(Ok,[
  308. #include "mytest.h"
  309. #ifdef _MYTEST_H_RPCGEN
  310. Ok   
  311. #endif
  312.         ],opts="." , opts="Ihdr" )
  313.         rm -f mytest.?
  314.         gss_cv_RPCGEN_output="stubs=$stubs opts="$opts" main=$main"
  315.     ])
  316.     AC_MSG_RESULT($gss_cv_RPCGEN_output)
  317.     for outparm in $gss_cv_RPCGEN_output; do
  318.       case $outparm in 
  319.         stubs=*)
  320.                 if test "$outparm" = "stubs=svc" ; then
  321.                         AC_DEFINE(RPCSTUB_SVC_STYLE)
  322.                 fi
  323.         ;;  
  324.         opts=*)
  325.                 rpcgen_opts=`echo $outparm | sed -e "s/opts=//"`
  326.         ;;  
  327.         main=*)
  328.                 if test "$outparm" = "main=proto" ; then
  329.                         AC_DEFINE(RPCMAIN_PROTO)
  330.                 fi
  331.         ;;
  332.         *)
  333.         ;;  
  334.       esac
  335.     done
  336.     RPCGEN="$srcdir/etc/rpcgen-sh $RPCGEN $rpcgen_opts"
  337. else
  338.     RPCGEN="$srcdir/etc/preserve restore --rpcgen"
  339. changequote(, )dnl
  340.     if grep '[0-9]*_svc' `find ${srcdir} -name '*.preserve'` >/dev/null; then
  341. changequote([, ])dnl
  342.       AC_DEFINE(RPCSTUB_SVC_STYLE)
  343.     fi
  344. changequote(, )dnl
  345.     if grep 'main[ ]*([ ]*(void)*[ ]*)' `find ${srcdir} -name '*_svc.c.preserve'` >/dev/null; then
  346. changequote([, ])dnl
  347.        echo "do nothing" >/dev/null
  348.     else  
  349.       AC_DEFINE(RPCMAIN_PROTO)
  350.     fi
  351. fi
  352. ### Checks for libraries
  353. ### ---------------------------------
  354. ### find IPC library
  355. AC_FIND_LIB(shmat, ipc)
  356. ### find RPC library
  357. AC_FIND_LIB(callrpc, nsl socket rpc)
  358. AC_FIND_LIB(ftok, compat)
  359. dnl Checks for header files.
  360. dnl ---------------------------------
  361. AC_HEADER_DIRENT
  362. AC_HEADER_STDC
  363. AC_HEADER_SYS_WAIT
  364. AC_CHECK_HEADERS(stdio.h stdlib.h stdarg.h fcntl.h sys/file.h sys/time.h unistd.h)
  365. AC_CHECK_HEADERS(sys/ipc.h sys/shm.h sys/msg.h sys/cdefs.h)
  366. dnl Checks for typedefs, structures, and compiler characteristics.
  367. dnl --------------------------------------------------------------
  368. AC_C_CONST
  369. AC_TYPE_OFF_T
  370. AC_TYPE_PID_T
  371. AC_TYPE_SIZE_T
  372. AC_TYPE_SIGNAL
  373. AC_HEADER_TIME
  374. AC_STRUCT_TM
  375. dnl Checks for C standart types
  376. dnl ---------------------------------
  377. AC_C_LONG_DOUBLE
  378. AC_CHECK_SIZEOF(void*)
  379. AC_CHECK_SIZEOF(char)
  380. AC_CHECK_SIZEOF(short)
  381. AC_CHECK_SIZEOF(int)
  382. AC_CHECK_SIZEOF(long)
  383. AC_CHECK_SIZEOF(long long)
  384. AC_CHECK_SIZEOF(long double)
  385. dnl Checks for library functions.
  386. dnl ---------------------------------
  387. AC_FUNC_STRFTIME
  388. AC_FUNC_VPRINTF
  389. AC_CHECK_FUNCS(strstr memcpy uname cftime getlogin cuserid)
  390. AC_CHECK_FUNCS(svc_unreg svc_unregister atexit on_exit)
  391. if test "$GCC" != "yes" ; then
  392.   AC_CHECK_FUNCS(alloca)
  393.   if test $ac_cv_func_alloca = "no" ; then # if we have not found alloca
  394.     ## provide our own version instead
  395.     ALLOCA=alloca.o
  396.   fi
  397. fi
  398. ### create makefiles list to configure
  399. ### and cook postconfigure RCS creation in subdirectories
  400. ### prepare makefiles templates
  401. configurables=`${srcdir}/etc/conf-templ create "${LN_S}" ${MAKE} $gss_cv_MAKE_includes`
  402. if test "x$configurables" = x ; then
  403.   exit 1
  404. fi
  405. dnl Checks for system services
  406. dnl ---------------------------------
  407. dnl Specify what sort of things we''ll be editing into Makefile and config.h.
  408. dnl Use configuration here uncanonicalized to avoid exceeding size limits.
  409. AC_SUBST(srcdir)
  410. AC_SUBST(prefix)
  411. AC_SUBST(bindir)
  412. AC_SUBST(mandir)
  413. AC_SUBST(infodir)
  414. AC_SUBST(dbhome)
  415. AC_SUBST(builddir)
  416. AC_SUBST(version)
  417. AC_SUBST(host)
  418. AC_SUBST(CFLAGS)
  419. AC_SUBST(CPPFLAGS)
  420. AC_SUBST(LDFLAGS)
  421. AC_SUBST(LIBS)
  422. AC_SUBST(RPCGEN)
  423. AC_SUBST(RANLIB)
  424. AC_SUBST(YACC)
  425. AC_SUBST(YFLAGS)
  426. AC_SUBST(LEX)
  427. AC_SUBST(LFLAGS)
  428. AC_SUBST(LEXLIB)
  429. AC_SUBST(SET_MAKE)
  430. AC_SUBST(host_os)
  431. AC_SUBST(A2K_proc)
  432. AC_SUBST(A2K_entry)
  433. AC_SUBST(U)
  434. AC_SUBST(ALLOCA)
  435. AC_SUBST(MCYCLE)
  436. AC_SUBST(INT_SHELL)
  437. AC_OUTPUT(  ${configurables} ,
  438.           chmod a+x etc/dq
  439.           echo timestamp > stamp-h
  440.           ${top_srcdir}/etc/conf-templ postconfigure
  441. )