tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
377 stars 101 forks source link

Fix OSX setup instructions #198

Closed juliogonzalez closed 5 years ago

juliogonzalez commented 5 years ago

As requested at #197.

I don't have any OSX system to test.

@cstork, can you review this?

jenkins-juliogonzalez commented 5 years ago

Test FAILed.

damoclark commented 5 years ago

Not sure if this information helps or not.

I can confirm that it compiles on macOS 10.13, but instead, the macports version of freetsd instead of homebrew. I don't use homebrew so can't test that configuration.

Macports installs into /opt/local, rather than /usr/local so I changed the make command as follows:

make USE_PGXS=1 PG_CPPFLAGS="-I./include/ -I/opt/local/include/freetds -fvisibility=hidden"

My compiler:

$ clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

and version of freetds from macports:

$ port installed and freetds
The following ports are currently installed:
  freetds @1.00.111_0 (active)

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

Compile output:

$ make USE_PGXS=1 PG_CPPFLAGS="-I./include/ -I/opt/local/include/freetds -fvisibility=hidden"
/usr/bin/clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -pipe -Os   -I./include/ -I/opt/local/include/freetds -fvisibility=hidden -I. -I./ -I/opt/local/include/postgresql11/server -I/opt/local/include/postgresql11/internal  -I/opt/local/include -I/opt/local/include/libxml2  -I/opt/local/include  -c -o src/tds_fdw.o src/tds_fdw.c
/usr/bin/clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -pipe -Os   -I./include/ -I/opt/local/include/freetds -fvisibility=hidden -I. -I./ -I/opt/local/include/postgresql11/server -I/opt/local/include/postgresql11/internal  -I/opt/local/include -I/opt/local/include/libxml2  -I/opt/local/include  -c -o src/options.o src/options.c
/usr/bin/clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -pipe -Os   -I./include/ -I/opt/local/include/freetds -fvisibility=hidden -I. -I./ -I/opt/local/include/postgresql11/server -I/opt/local/include/postgresql11/internal  -I/opt/local/include -I/opt/local/include/libxml2  -I/opt/local/include  -c -o src/deparse.o src/deparse.c
/usr/bin/clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -pipe -Os   -bundle -multiply_defined suppress -o tds_fdw.so src/tds_fdw.o src/options.o src/deparse.o -L/opt/local/lib/postgresql11  -L/opt/local/lib -Wl,-headerpad_max_install_names -headerpad_max_install_names  -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib  -L/opt/local/lib -Wl,-dead_strip_dylibs   -lsybdb -bundle_loader /opt/local/lib/postgresql11/bin/postgres
cp sql/tds_fdw.sql sql/tds_fdw--2.0.0-alpha.3.sql
cp README.md README.tds_fdw.md
cstork commented 5 years ago

Works for me.

juliogonzalez commented 5 years ago

Close in favour of #199