如何在Windows 10上准备Cygwin环境以编译Ada GNATColl库

Igo*_*bic 3 windows postgresql cygwin ada

在Windows 10上成功安装Ada 2012(使用AdaCore-Download-2016-07-14_0729包)后,我没有找到如何向Ada添加数据库驱动程序支持.我找到了GNATColl库和下载包,但我没有找到任何描述如何准备cygwin环境来编译它.我是否需要再次在cygwin中安装带有ada支持,postgres和python的gcc工具链,或者只是在Windows中准备PATH到/ cygdrive/*位置?

Igo*_*bic 5

在Windows 10 64位上安装ADA 2012

在安装基础Ada软件包之后,我们得到了我们需要在Ada中使用IDE环境(GPS)和带有调试器(GDB)的GNAT mingw环境开发的所有内容.在Windows操作系统上,仅支持32位安装.Windows可以是64位版本.

http://libre.adacore.com/download/configurations

1.先决条件:

1.1.安装适用于Windows的Python 2.7 - 32位

https://www.python.org/downloads/windows/ 选择32位Windows版本:Windows x86 MSI安装程序在Windows上将C:\ Python27添加到PATH.

1.2.安装PostgreSQL 32位

AdaCore中的GNAT Gcc编译器和外部库必须采用相同的格式.可以使用32位格式的Postgres库:http ://www.enterprisedb.com/products-services-training/pgbindownload文件:postgresql-9.5.3-1-windows-binaries.zip将postgres解压缩到build将获取库的文件夹中:文件夹:H:\ Ada\PostgreSQL953
为了编译客户端应用程序,我们不需要安装整个服务器,只需要适当格式的库.

1.3.安装Cygwin

从以下网址下载:https://cygwin.com/install.html 获取setup-x86.exe文件,这是cygwin的32位版本.

1.3.1.安装make

如果您忘记在第一次安装运行时安装任何内容,只需再次运行安装程序并添加缺少的软件包.再次启动setup-x86.exe并在»Devel«中搜索»make«package,标记为安装并继续»Next«.包将安装在现有安装中.

2.安装Ada

2.1.安装GNAT Gpl - 基础Ada包

File:  gnat-gpl-2016-x86-windows-bin.exe
Install with »Run as administrator« .
Destination folder. H:\Ada\GNAT\2016
Run Code Online (Sandbox Code Playgroud)

2.2.安装Win32Ada

D:\Install\Ada\AdaCore-Download-2016-07-14_0729\x86-windows\adagpl-2016\win32ada
File: win32ada-gpl-2016-x86-windows-bin.exe
Install with »Run as administrator« .
Destination folder:   H:\Ada\GNAT\2016
Run Code Online (Sandbox Code Playgroud)

2.3.安装GtkAda

D:\Install\Ada\AdaCore-Download-2016-07-14_0729\x86-windows\adagpl-2016\gtkada
File: gtkada-gpl-2016-x86-windows-bin.exe
Install with »Run as administrator« .
Destination folder: H:\Ada\GtkAda   
Run Code Online (Sandbox Code Playgroud)

2.4.安装AWS - ada Web服务器

D:\Install\Ada\AdaCore-Download-2016-07-14_0729\x86-windows\adagpl-2016\aws\sources
File:  aws-gpl-2016-src.tar.gz unzip file to working folder.

Now execute next commands in cygwin environment :

$ make setup build
$ make --prefix=/Ada/GNAT/2016 install 

AWS should be installed on GNAT compiler root folder by default. 
http://docs.adacore.com/aws-docs/aws/building_aws.html
Run Code Online (Sandbox Code Playgroud)

2.5.使用postgres接口安装GNATColl库

D:\Install\Ada\AdaCore-Download-2016-07-14_0729\x86-windows\adagpl-2016\gnatcoll\sources\

File gnatcoll-gpl-2016-src.tar.gz unzip file to working folder.

**Now execute next commands in cygwin environment :**

$ ./configure --prefix=/Ada/GNAT/2016 –with-postgresql=H:/ADA/PostgreSQL953/lib 
Run Code Online (Sandbox Code Playgroud)

对postgresql lib文件夹的路径要非常小心.

--------- Summary for GNAT Components --------------
Shared libraries:       yes (default: static)
Gtk+:                   yes (requires pkg-config and gtkada.gpr)
PostgreSQL:             yes -LH:/ADA/PostgreSQL953/lib (see --with-postgresql)
Sqlite:                 embedded  (see --with-sqlite)
Projects:               yes
Other components where on "no". 
Run Code Online (Sandbox Code Playgroud)

手动编辑文件:gnatcoll_shared.gpr

我不确定这是否真的有必要,但我做了清理工作.
清除虚线,其中RETURN字符除以"行尾",例如:

Python_Version :=  "27
";
Run Code Online (Sandbox Code Playgroud)

改成 :

Python_Version :=  "27";
Run Code Online (Sandbox Code Playgroud)

在cygwin中执行make命令

$ make 

$ make install
Run Code Online (Sandbox Code Playgroud)

如果出现错误,请使用»make clean«命令重置构建环境,然后使用"configure"重新启动.