2017-03-16 4 views
1

はい、Ubuntu 10.04.4 LTSです。残念ながら、私たちはそれを必要とする依存関係があります。freetdsがUbuntu 10.04でビルドする際に構文エラーで失敗する

私はFreeTDSに依存しているpythonモジュールpymssqlを使用しようとしています。

aptパッケージFreeTDSの-devのを介してインストールバージョンが4.2

ある
$ tsql -C 
Compile-time settings (established with the "configure" script) 
          Version: freetds v0.82 
      freetds.conf directory: /etc/freetds 
    MS db-lib source compatibility: no 
     Sybase binary compatibility: yes 
         Thread safety: yes 
         iconv library: yes 
         TDS version: 4.2 
           iODBC: no 
          unixodbc: yes 

私たちは、マイクロソフトのストアドプロシージャを使用するには、少なくとも7.2が必要です。だから私は彼らのgitリポジトリをクローン化し

_mssql.MSSQLDriverException: Stored Procedures aren't supported with a TDS version less than 7. 

をソースからビルドしようとしています。

INSTALL.GITファイルには、autogen.shが実行されており、構文エラーで失敗しています。ここで

は出力です:

16798 if test "$with_gnutls" = "yes"; then 
16799 
16800 $as_echo "#define HAVE_GNUTLS 1" >>confdefs.h 
16801 
16802   gnutls_backend=unknown 
16803   PKG_CHECK_MODULES(GNUTLS, gnutls, 
16804     CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS" 
16805     NETWORK_LIBS="$NETWORK_LIBS $GNUTLS_LIBS" 
16806     if "$PKG_CONFIG" --libs --static gnutls | grep nettle > /dev/null 2>&1 ; then 
16807       gnutls_backend=nettle 
16808       AC_DEFINE(GNUTLS_USE_NETTLE, 1, [Define to 1 if GNU tls use nettle as backend.]) 
16809       PKG_CHECK_MODULES(NETTLE, nettle, 
16810         [AC_DEFINE(HAVE_NETTLE, 1, [Define to 1 if nettle is present.]) 
16811         NETWORK_LIBS="$NETWORK_LIBS $NETTLE_LIBS"]) 
16812       ACX_PUSH_LIBS("$NETWORK_LIBS") 
16813       TDS_HAVE_GMP 
16814       AC_SEARCH_LIBS(nettle_rsa_public_key_init, [nettle hogweed]) 
16815       NETWORK_LIBS="$LIBS" 
16816       ACX_POP_LIBS 
16817     fi, 
16818     CPPFLAGS="$CPPFLAGS `libgnutls-config --cflags`" 
16819     NETWORK_LIBS="$NETWORK_LIBS `libgnutls-config --libs`" 
16820  ) 
16821   LIBS_761="$LIBS" 
16822 LIBS="$NETWORK_LIBS" 

$ ./autogen.sh 
running /usr/bin/autoreconf in /home/amlguser03/freetds: 
configure.ac:121: warning: macro `AM_ICONV' not found in library 
configure.ac:121: warning: macro `AM_ICONV' not found in library 
configure.ac:92: error: possibly undefined macro: AC_DEFINE 
     If this token and others are legitimate, please use m4_pattern_allow. 
     See the Autoconf documentation. 
configure.ac:121: error: possibly undefined macro: AM_ICONV 
configure.ac:194: error: possibly undefined macro: AC_SEARCH_LIBS 
autoreconf: /usr/bin/autoconf failed with exit status: 1 
configure.ac:121: warning: macro `AM_ICONV' not found in library 
libtoolize: putting auxiliary files in `.'. 
libtoolize: copying file `./config.guess' 
libtoolize: copying file `./config.sub' 
configure.ac:121: warning: macro `AM_ICONV' not found in library 
Running 
./configure 
... 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... /bin/mkdir -p 
checking for gawk... gawk 
checking whether make sets $(MAKE)... yes 
checking for gawk... (cached) gawk 
checking for grep that handles long lines and -e... /bin/grep 
checking whether ln -s works... yes 
checking for a sed that does not truncate output... /bin/sed 
./configure: line 3486: PKG_PROG_PKG_CONFIG: command not found 
checking build system type... x86_64-unknown-linux-gnu 
checking host system type... x86_64-unknown-linux-gnu 
checking for style of include used by make... GNU 
checking for gcc... gcc 
checking whether the C compiler works... yes 
checking for C compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... no 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking dependency style of gcc... gcc3 
checking how to run the C preprocessor... gcc -E 
checking for egrep... /bin/grep -E 
checking for ANSI C header files... yes 
checking for sys/types.h... yes 
checking for sys/stat.h... yes 
checking for stdlib.h... yes 
checking for string.h... yes 
checking for memory.h... yes 
checking for strings.h... yes 
checking for inttypes.h... yes 
checking for stdint.h... yes 
checking for unistd.h... yes 
checking minix/config.h usability... no 
checking minix/config.h presence... no 
checking for minix/config.h... no 
checking whether it is safe to define __EXTENSIONS__... yes 
checking for special C compiler options needed for large files... no 
checking for _FILE_OFFSET_BITS value needed for large files... no 
checking for gcc... (cached) gcc 
checking whether we are using the GNU C compiler... (cached) yes 
checking whether gcc accepts -g... (cached) yes 
checking for gcc option to accept ISO C89... (cached) none needed 
checking dependency style of gcc... (cached) gcc3 
checking how to run the C preprocessor... gcc -E 
checking whether gcc and cc understand -c and -o together... yes 
checking for inline... inline 
checking for a sed that does not truncate output... (cached) /bin/sed 
checking for fgrep... /bin/grep -F 
checking for ld used by gcc... /usr/bin/ld 
checking if the linker (/usr/bin/ld) is GNU ld... yes 
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B 
checking the name lister (/usr/bin/nm -B) interface... BSD nm 
checking the maximum length of command line arguments... 1572864 
checking whether the shell understands some XSI constructs... yes 
checking whether the shell understands "+="... yes 
checking for /usr/bin/ld option to reload object files... -r 
checking for objdump... objdump 
checking how to recognize dependent libraries... pass_all 
checking for ar... ar 
checking for strip... strip 
checking for ranlib... ranlib 
checking command to parse /usr/bin/nm -B output from gcc object... ok 
checking for dlfcn.h... yes 
checking for objdir... .libs 
checking if gcc supports -fno-rtti -fno-exceptions... no 
checking for gcc option to produce PIC... -fPIC -DPIC 
checking if gcc PIC flag -fPIC -DPIC works... yes 
checking if gcc static flag -static works... yes 
checking if gcc supports -c -o file.o... yes 
checking if gcc supports -c -o file.o... (cached) yes 
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes 
checking whether -lc should be explicitly linked in... no 
checking dynamic linker characteristics... GNU/Linux ld.so 
checking how to hardcode library paths into programs... immediate 
checking whether stripping libraries is possible... yes 
checking if libtool supports shared libraries... yes 
checking whether to build shared libraries... yes 
checking whether to build static libraries... yes 
checking for library containing dlopen... -ldl 
checking for dlerror... yes 
checking for shl_load... no 
checking for shl_load in -ldld... no 
checking for dld_link in -ldld... no 
checking for windres... no 
./configure: line 13103: AM_ICONV: command not found 
checking for doxygen... no 
checking for odbc_config... no 
checking for library containing socket... none required 
checking for library containing gethostbyname... none required 
checking for library containing tgetent... no 
checking for readline in -lreadline... no 
checking for rl_on_new_line... no 
checking for rl_reset_line_state... no 
checking for the pthreads library -lpthreads... no 
checking whether pthreads work without any flags... no 
checking whether pthreads work with -Kthread... no 
checking whether pthreads work with -kthread... no 
checking for the pthreads library -llthread... no 
checking whether pthreads work with -pthread... yes 
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE 
checking if more special flags are required for pthreads... no 
checking for library containing pthread_condattr_setclock... -lrt 
checking for pthread_condattr_setclock... yes 
checking for pthread_cond_timedwait_relative_np... no 
checking for ANSI C header files... (cached) yes 
checking whether time.h and sys/time.h may both be included... yes 
checking whether struct tm is in sys/time.h or time.h... time.h 
checking for struct tm.tm_zone... yes 
checking for struct tm.__tm_zone... no 
checking errno.h usability... yes 
checking errno.h presence... yes 
checking for errno.h... yes 
checking libgen.h usability... yes 
checking libgen.h presence... yes 
checking for libgen.h... yes 
checking limits.h usability... yes 
checking limits.h presence... yes 
checking for limits.h... yes 
checking locale.h usability... yes 
checking locale.h presence... yes 
checking for locale.h... yes 
checking poll.h usability... yes 
checking poll.h presence... yes 
checking for poll.h... yes 
checking signal.h usability... yes 
checking signal.h presence... yes 
checking for signal.h... yes 
checking stddef.h usability... yes 
checking stddef.h presence... yes 
checking for stddef.h... yes 
checking sys/param.h usability... yes 
checking sys/param.h presence... yes 
checking for sys/param.h... yes 
checking sys/select.h usability... yes 
checking sys/select.h presence... yes 
checking for sys/select.h... yes 
checking for sys/stat.h... (cached) yes 
checking sys/time.h usability... yes 
checking sys/time.h presence... yes 
checking for sys/time.h... yes 
checking for sys/types.h... (cached) yes 
checking sys/resource.h usability... yes 
checking sys/resource.h presence... yes 
checking for sys/resource.h... yes 
checking sys/eventfd.h usability... yes 
checking sys/eventfd.h presence... yes 
checking for sys/eventfd.h... yes 
checking sys/wait.h usability... yes 
checking sys/wait.h presence... yes 
checking for sys/wait.h... yes 
checking for unistd.h... (cached) yes 
checking netdb.h usability... yes 
checking netdb.h presence... yes 
checking for netdb.h... yes 
checking wchar.h usability... yes 
checking wchar.h presence... yes 
checking for wchar.h... yes 
checking for inttypes.h... (cached) yes 
checking winsock2.h usability... no 
checking winsock2.h presence... no 
checking for winsock2.h... no 
checking localcharset.h usability... no 
checking localcharset.h presence... no 
checking for localcharset.h... no 
checking valgrind/memcheck.h usability... no 
checking valgrind/memcheck.h presence... no 
checking for valgrind/memcheck.h... no 
checking malloc.h usability... yes 
checking malloc.h presence... yes 
checking for malloc.h... yes 
checking dirent.h usability... yes 
checking dirent.h presence... yes 
checking for dirent.h... yes 
checking stdbool.h usability... yes 
checking stdbool.h presence... yes 
checking for stdbool.h... yes 
checking gnutls/abstract.h usability... no 
checking gnutls/abstract.h presence... no 
checking for gnutls/abstract.h... no 
checking getopt.h usability... yes 
checking getopt.h presence... yes 
checking for getopt.h... yes 
checking for windows.h... no 
checking for sql.h... no 
checking arpa/inet.h usability... yes 
checking arpa/inet.h presence... yes 
checking for arpa/inet.h... yes 
checking langinfo.h usability... yes 
checking langinfo.h presence... yes 
checking for langinfo.h... yes 
checking for netdb.h... (cached) yes 
checking netinet/in.h usability... yes 
checking netinet/in.h presence... yes 
checking for netinet/in.h... yes 
checking netinet/tcp.h usability... yes 
checking netinet/tcp.h presence... yes 
checking for netinet/tcp.h... yes 
checking roken.h usability... no 
checking roken.h presence... no 
checking for roken.h... no 
checking com_err.h usability... no 
checking com_err.h presence... no 
checking for com_err.h... no 
checking paths.h usability... yes 
checking paths.h presence... yes 
checking for paths.h... yes 
checking sys/ioctl.h usability... yes 
checking sys/ioctl.h presence... yes 
checking for sys/ioctl.h... yes 
checking sys/socket.h usability... yes 
checking sys/socket.h presence... yes 
checking for sys/socket.h... yes 
checking whether INADDR_NONE is defined... yes 
checking size of char... 1 
checking size of short... 2 
checking size of long... 8 
checking size of int... 4 
checking size of float... 4 
checking size of double... 8 
checking size of long double... 16 
checking size of long long... 8 
checking size of __int64... 0 
checking size of void *... 8 
checking size of wchar_t... 4 
checking is FIONBIO defined... yes 
checking for socklen_t... yes 
checking whether getopt has optreset support... no 
checking whether byte ordering is bigendian... no 
checking for an ANSI C-conforming const... yes 
checking whether we can use -Wl,-Bsymbolic... no 
checking whether we can use -static-libgcc... sed: can't read conftest.c: No such file or directory 
no 
checking whether we can use -Wl,-static-libgcc... sed: can't read conftest.c: No such file or directory 
no 
checking whether memset(0) sets pointers to NULL... yes 
checking for vsnprintf... yes 
checking for _vsnprintf... no 
checking for _vscprintf... no 
checking for gettimeofday... yes 
checking for nl_langinfo... yes 
checking for locale_charset... no 
checking for setenv... yes 
checking for putenv... yes 
checking for getuid... yes 
checking for getpwuid... yes 
checking for getpwuid_r... yes 
checking for fstat... yes 
checking for alarm... yes 
checking for fork... yes 
checking for gethrtime... no 
checking for localtime_r... yes 
checking for setitimer... yes 
checking for eventfd... yes 
checking for _fseeki64... no 
checking for _ftelli64... no 
checking for setrlimit... yes 
checking for pthread_cond_timedwait... yes 
checking for _lock_file... no 
checking for _unlock_file... no 
checking for usleep... yes 
checking for nanosleep... yes 
checking for readdir_r... yes 
checking for inet_ntoa_r... no 
checking for getipnodebyaddr... no 
checking for getipnodebyname... no 
checking for getaddrinfo... yes 
checking for inet_ntop... yes 
checking for gethostname... yes 
checking for poll... yes 
checking for socketpair... yes 
checking for asprintf... yes 
checking for vasprintf... yes 
checking for strtok_r... yes 
checking for readpassphrase... no 
checking for strlcpy... no 
checking for strlcat... no 
checking for basename... yes 
checking for getopt... yes 
checking for strsep... yes 
checking for daemon... yes 
checking for _LARGEFILE_SOURCE value needed for large files... no 
checking for library containing clock_gettime... none required 
checking if clock_gettime support CLOCK_MONOTONIC... yes 
checking for working alloca.h... yes 
checking for alloca... yes 
checking whether malloc_options variable is present... no 
checking compile-time options 
looking for installed odbc driver manager 
checking for SQLConnect in -liodbc... no 
checking for SQLConnect in -lodbc... no 
checking for SQLSETPOSIROW... no 
checking for SQLROWSETSIZE... no 
checking for SQLROWOFFSET... no 
checking size of SQLWCHAR... 0 
./configure: line 16803: syntax error near unexpected token `GNUTLS,' 
./configure: line 16803: `  PKG_CHECK_MODULES(GNUTLS, gnutls,' 

そして、ここではのconfigure、私はPKG_CHECK_MODULES()の呼び出しをコメントアウトする場合、この特定の構文エラーが消えるから近くの行があります

誰でもエラーの原因を教えてもらえますか?助けてくれてありがとう!

UPDATE 1:PKG_CHECK_MODULES()へのすべての呼び出しとautogen.shスクリプトが完了したことをコメントアウトしました。私はそれを呼んでいた各コードブロックの前にテストされている変数をエコーし​​て、今はOKだと思います。しかし、私はまだエラーの原因を知りたいです。スクリプトは単にその関数定義を欠いていますか?

UPDATE 2:メイクとは、しかし、私たちのPythonスクリプトは、まだ同じエラーで失敗している、仕事に登場してインストールします

_mssql.MSSQLDriverException: Stored Procedures aren't supported with a TDS version less than 7. 

TDSのバージョンは今、「自動」として示しているので、それはだ場合、私は疑問に思う:

$ tsql -C 
Compile-time settings (established with the "configure" script) 
          Version: freetds v1.1.dev.20170315 
      freetds.conf directory: /usr/local/etc 
    MS db-lib source compatibility: no 
     Sybase binary compatibility: no 
         Thread safety: yes 
         iconv library: no 
         TDS version: auto 
           iODBC: no 
          unixodbc: no 
       SSPI "trusted" logins: no 
          Kerberos: no 
          OpenSSL: no 
          GnuTLS: no 
           MARS: no 

答えて

0

pymssql接続文字列にTDSバージョンを指定しようとしましたか?

con = pymssql.connect(
    server="your.server.org", 
    port=1433, 
    user="pymssql_user", 
    password="yourpw", 
    database="yourdb", 
    autocommit=True, 
    tds_version='7.2', 
) 

あなたはfreetds.confでDSNを設定していない場合、私は通常pyodbcを使用しても、これは通常、私のために動作します。

+0

私たちはO.Sのアップグレードを終了しました。 10.04(明快)から12.04(正確)までの範囲である。それは恐ろしいpythonを破った、幸いにも私は名前に "python"とすべてのパッケージを再インストールする魔法の手配を与えたSOのポストを見つけた、そしてそれは私たちを走らせた。コマンドは次のとおりです: 'dpkg --get-selections | egrep -v 'deinstall' | egrep python | awk '{print $ 1}' '; do apt-get -y --force-yes install --reinstall $ pkgを実行します。完了 – Alan

関連する問題