acinclude.m4 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #
  2. # acinclude.m4
  3. #
  4. # The iODBC driver manager.
  5. #
  6. # Copyright (C) 1995 Ke Jin <[email protected]>
  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. AC_DEFUN([IODBC_CHECK_PTHREAD_LIB],
  74. [AC_MSG_CHECKING([for $2 in -l$1 $5])
  75. ac_save_LIBS="$LIBS"
  76. LIBS="-l$1 $5 $LIBS"
  77. AC_LINK_IFELSE([AC_LANG_PROGRAM(dnl
  78. [[
  79. #ifdef __cplusplus
  80. extern "C"
  81. #endif
  82. #if defined (HAVE_PTHREAD_H)
  83. #include <pthread.h>
  84. #endif
  85. ]],
  86. [[$2(0)]])],
  87. eval "ac_cv_lib_$ac_lib_var=yes",
  88. eval "ac_cv_lib_$ac_lib_var=no")
  89. LIBS="$ac_save_LIBS"
  90. dnl
  91. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  92. AC_MSG_RESULT(yes)
  93. ifelse([$3], ,
  94. [changequote(, )dnl
  95. ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  96. -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  97. changequote([, ])dnl
  98. AC_DEFINE_UNQUOTED($ac_tr_lib)
  99. LIBS="-l$1 $LIBS"
  100. ], [$3])
  101. else
  102. AC_MSG_RESULT(no)
  103. ifelse([$4], , , [$4
  104. ])dnl
  105. fi
  106. ])