README_MACOSX 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # How to build iODBC for macOS (formerly known as *OS X* and *Mac OS X*)
  2. Copyright (C) 1996-2021 OpenLink Software <[email protected]>
  3. ## Method 1: Using Project builder
  4. This build method only works for Xcode 8.0 or newer.
  5. This version of Xcode was first supported on macOS El Capitan (10.11),
  6. however the resulting binaries are backward-compatible with OS X
  7. Mavericks (10.9) and newer.
  8. OpenLink uses build environments on macOS Mojave (10.14) and macOS Big
  9. Sur (11.x) to produce suitable notarized installers with graphical
  10. components.
  11. To build iODBC components yourself, you will first need to install the
  12. latest Mac OS X Developer Packages, which can be found at ---
  13. http://developer.apple.com/tools
  14. Then, execute the following commands in a terminal session, to build all
  15. the frameworks and demo applications:
  16. $ cd mac
  17. $ make
  18. After building the iODBC libraries and applications, you have to install
  19. them on your system with the command:
  20. $ sudo make install
  21. This installs the `iODBCinst` and `iODBC` frameworks into ---
  22. /Library/Frameworks/iODBC.framework
  23. /Library/Frameworks/iODBCinst.framework
  24. --- and the test applications `iodbctest` and `iodbctestw` into ---
  25. /Library/Application Support/iODBC/bin
  26. --- and the iODBC Administrator and iODBC Demo applications in ---
  27. /Applications/iODBC
  28. ### `iODBC Administrator.app`
  29. Now that you have installed the iODBC frameworks on your system, you are
  30. able to use ODBC applications or build your own applications using the
  31. iODBC API.
  32. Once you have installed an ODBC Driver, you can configure and test a new
  33. ODBC DSN, using either the 32-bit Cocoa UI, which can configure and test
  34. any ODBC driver that is built in Universal mode ---
  35. /Applications/iODBC/iODBC Administrator.app
  36. --- or the 64-bit version, which can configure drivers that only support
  37. a 64-bit Cocoa UI ---
  38. /Applications/iODBC/iODBC Administrator64.app
  39. ### Test DSN connection
  40. Once you have configured a DSN, you will be able to make a connection
  41. using the `iodbctest` tool which is located at ---
  42. /Library/Application Support/iODBC/bin/iodbctest
  43. ## Method 2: Using `configure` and `make`
  44. The iODBC package can also be built like any other Open Source package
  45. not using any frameworks.
  46. This build method still works with older versions of Xcode.
  47. On OS X Yosemite (10.10) and newer, Apple removed a number of programs
  48. from their **`Xcode.app`** commandline installation, including
  49. `autoconf`, `automake`, `libtool`, and some other tools needed to build
  50. iODBC from a newly checked out GIT tree. We suggest using the [HomeBrew
  51. package manager](http://brew.sh/) to install these tools, according to
  52. their documentation.
  53. To build the libraries, open up a terminal session in **`Terminal.app`**
  54. or similar, and execute the following commands:
  55. $ sh autogen.sh
  56. $ ./configure
  57. $ make
  58. To install the header files and libraries in `/usr/local`, execute the
  59. following command as an administrator, and provide that user's password
  60. when prompted:
  61. $ sudo make install
  62. Note that, by default, this will build components that only run on the
  63. CPU type you are building on, so `ppc` on very old systems, `x86` on
  64. early CoreDuo machines, `x86_64` on recent Intel models, and `arm64` on
  65. current Apple Silicon models.
  66. You can also build iODBC components that support multiple CPU
  67. architectures --- either Universal components that support `ppc`, `x86`,
  68. and/or `x86_64`; or Universal2 components that support `x86_64`
  69. (including as emulated by Rosetta2) and `arm64`.
  70. ### Mac OS X Leopard (10.5) and Mac OS X Snow Leopard (10.6)
  71. The following commands will build a release of iODBC that supports Mac
  72. OS X Leopard (10.5) as well as Mac OS X Snow Leopard (10.6), on `ppc`
  73. (including as emulated by Rosetta), `x86`, and `x86_64`:
  74. $ CFLAGS="-O -arch ppc -arch i386 -arch x86_64"
  75. $ CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk"
  76. $ CFLAGS="$CFLAGS -mmacosx-version-min=10.5"
  77. $ export CFLAGS
  78. $ sh autogen.sh
  79. $ ./configure \
  80. --disable-dependency-tracking \
  81. --prefix=/usr/local/iODBC.universal
  82. $ make
  83. $ sudo make install
  84. ### Mac OS X Lion (10.7) and OS X Mountain Lion (10.8)
  85. The following commands will build a release of iODBC that works on Mac
  86. OS X Lion (10.7) and OS X Mountain Lion (10.8):
  87. $ CFLAGS="-O -arch i386 -arch x86_64"
  88. $ CFLAGS="$CFLAGS -mmacosx-version-min=10.7"
  89. $ export CFLAGS
  90. $ sh autogen.sh
  91. $ ./configure \
  92. --disable-dependency-tracking \
  93. --prefix=/usr/local/iODBC.universal
  94. $ make
  95. $ sudo make install
  96. ### OS X Mavericks (10.9) through macOS Big Sur (11.x) on `x86` or `x86_64` (including Rosetta2 emulation)
  97. The following commands will build a release of iODBC that works on OS X
  98. Mavericks (10.9) through macOS Big Sur (11.x), supporting other
  99. components built for `x86` (through macOS Mojave (10.14), where Apple
  100. dropped support for 32-bit components) or `x86_64` (including Rosetta2
  101. emulation):
  102. $ CFLAGS="-O -arch i386 -arch x86_64"
  103. $ CFLAGS="$CFLAGS -mmacosx-version-min=10.9"
  104. $ export CFLAGS
  105. $ sh autogen.sh
  106. $ ./configure \
  107. --disable-dependency-tracking \
  108. --prefix=/usr/local/iODBC.universal
  109. $ make
  110. $ sudo make install
  111. ### macOS Big Sur (11.x) including Apple Silicon support
  112. The following commands will build a release of iODBC that works on macOS
  113. Big Sur (11.x), running on Intel (`x86_64`) or Apple Silicon (M1 a/k/a
  114. `arm64`):
  115. $ CFLAGS="-O -arch arm64 -arch x86_64"
  116. $ CFLAGS="$CFLAGS -mmacosx-version-min=10.9"
  117. $ export CFLAGS
  118. $ sh autogen.sh
  119. $ ./configure \
  120. --disable-dependency-tracking \
  121. --prefix=/usr/local/iODBC.universal
  122. $ make
  123. $ sudo make install
  124. ### Test DSN connection
  125. Once you have installed an ODBC driver and configured a DSN, you will be
  126. able to make a connection using the `iodbctest` tool which is located at
  127. ---
  128. /usr/local/iODBC.universal/bin/iodbctest