link-inclibs.sh 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #!/bin/sh
  2. #
  3. # link-inclibs.sh
  4. #
  5. # The iODBC driver manager.
  6. #
  7. # Copyright (C) 1996-2021 OpenLink Software <[email protected]>
  8. # All Rights Reserved.
  9. #
  10. # This software is released under the terms of either of the following
  11. # licenses:
  12. #
  13. # - GNU Library General Public License (see LICENSE.LGPL)
  14. # - The BSD License (see LICENSE.BSD).
  15. #
  16. # Note that the only valid version of the LGPL license as far as this
  17. # project is concerned is the original GNU Library General Public License
  18. # Version 2, dated June 1991.
  19. #
  20. # While not mandated by the BSD license, any patches you make to the
  21. # iODBC source code may be contributed back into the iODBC project
  22. # at your discretion. Contributions will benefit the Open Source and
  23. # Data Access community as a whole. Submissions may be made at:
  24. #
  25. # http://www.iodbc.org
  26. #
  27. #
  28. # GNU Library Generic Public License Version 2
  29. # ============================================
  30. # This library is free software; you can redistribute it and/or
  31. # modify it under the terms of the GNU Library General Public
  32. # License as published by the Free Software Foundation; only
  33. # Version 2 of the License dated June 1991.
  34. #
  35. # This library is distributed in the hope that it will be useful,
  36. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  38. # Library General Public License for more details.
  39. #
  40. # You should have received a copy of the GNU Library General Public
  41. # License along with this library; if not, write to the Free
  42. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  43. #
  44. #
  45. # The BSD License
  46. # ===============
  47. # Redistribution and use in source and binary forms, with or without
  48. # modification, are permitted provided that the following conditions
  49. # are met:
  50. #
  51. # 1. Redistributions of source code must retain the above copyright
  52. # notice, this list of conditions and the following disclaimer.
  53. # 2. Redistributions in binary form must reproduce the above copyright
  54. # notice, this list of conditions and the following disclaimer in
  55. # the documentation and/or other materials provided with the
  56. # distribution.
  57. # 3. Neither the name of OpenLink Software Inc. nor the names of its
  58. # contributors may be used to endorse or promote products derived
  59. # from this software without specific prior written permission.
  60. #
  61. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  62. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  63. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  64. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
  65. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  66. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  67. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  68. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  69. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  70. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  71. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  72. #
  73. #
  74. # Installation PATHS
  75. #
  76. PREFIX="$DESTDIR/usr/local/iODBC"
  77. ODBC_FW="/Library/Frameworks/iODBC.framework"
  78. INST_FW="/Library/Frameworks/iODBCinst.framework"
  79. #
  80. # Remove old installation
  81. #
  82. if [ -d "$PREFIX" ] ; then
  83. rm -rf "$PREFIX"
  84. fi
  85. #
  86. # Create new directory structure
  87. #
  88. mkdir -p "$PREFIX/bin"
  89. mkdir -p "$PREFIX/lib"
  90. mkdir -p "$PREFIX/include"
  91. #
  92. # Copy header files
  93. #
  94. cp -f "../include/iodbcext.h" "$PREFIX/include/iodbcext.h"
  95. cp -f "../include/iodbcunix.h" "$PREFIX/include/iodbcunix.h"
  96. cp -f "../include/isql.h" "$PREFIX/include/isql.h"
  97. cp -f "../include/isqlext.h" "$PREFIX/include/isqlext.h"
  98. cp -f "../include/isqltypes.h" "$PREFIX/include/isqltypes.h"
  99. cp -f "../include/sql.h" "$PREFIX/include/sql.h"
  100. cp -f "../include/sqlext.h" "$PREFIX/include/sqlext.h"
  101. cp -f "../include/sqltypes.h" "$PREFIX/include/sqltypes.h"
  102. cp -f "../include/sqlucode.h" "$PREFIX/include/sqlucode.h"
  103. cp -f "../include/iodbcinst.h" "$PREFIX/include/iodbcinst.h"
  104. cp -f "../include/odbcinst.h" "$PREFIX/include/odbcinst.h"
  105. #
  106. # Create symlinks for libraries
  107. #
  108. ln -s "$ODBC_FW/iODBC" "$PREFIX/lib/libiodbc.dylib"
  109. ln -s "$INST_FW/iODBCinst" "$PREFIX/lib/libiodbcinst.dylib"
  110. #
  111. # Add special macOS version of iodbc-config
  112. #
  113. cp iodbc-config.macos "$PREFIX/bin/iodbc-config"
  114. chmod 755 "$PREFIX/bin/iodbc-config"
  115. #
  116. # Fix basic permissions
  117. #
  118. chmod -R og+rX "$PREFIX"
  119. #
  120. # Done
  121. #
  122. exit 0