Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 1 | dnl Copyright (C) 2001-2005 Open Source Telecom Corporation. |
| 2 | dnl Copyright (C) 2006-2010 David Sugar, Tycho Softworks. |
| 3 | dnl |
| 4 | dnl This program is free software; you can redistribute it and/or modify |
| 5 | dnl it under the terms of the GNU General Public License as published by |
| 6 | dnl the Free Software Foundation; either version 2 of the License, or |
| 7 | dnl (at your option) any later version. |
| 8 | dnl |
| 9 | dnl This program is distributed in the hope that it will be useful, |
| 10 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | dnl GNU General Public License for more details. |
| 13 | dnl |
| 14 | dnl You should have received a copy of the GNU General Public License |
| 15 | dnl along with this program; if not, write to the Free Software |
| 16 | dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | dnl |
| 18 | dnl As a special exception to the GNU General Public License, if you |
| 19 | dnl distribute this file as part of a program that contains a configuration |
| 20 | dnl script generated by Autoconf, you may include it under the same |
| 21 | dnl distribution terms that you use for the rest of that program. |
| 22 | |
| 23 | dnl modification of AC_SEARCH_LIBS for problem with c++ name mangling |
| 24 | |
| 25 | dnl OST_SEARCH_LIBS(FUNCTION, INCLUDES, MAIN, SEARCH-LIBS [, ACTION-IF-FOUND |
| 26 | dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) |
| 27 | dnl Search for a library defining FUNC, if it's not already available. |
| 28 | |
| 29 | AC_DEFUN([OST_SEARCH_LIBS],[ |
| 30 | AC_PREREQ([2.13]) |
| 31 | AC_CACHE_CHECK([for library containing $1], [ost_cv_search_$1],[ |
| 32 | ac_func_search_save_LIBS="$LIBS" |
| 33 | ost_cv_search_$1="no" |
| 34 | AC_TRY_LINK([$2], [$3], [ost_cv_search_$1="none required"]) |
| 35 | test "$ost_cv_search_$1" = "no" && for i in $4; do |
| 36 | LIBS="-l$i $7 $ac_func_search_save_LIBS" |
| 37 | AC_TRY_LINK([$2], [$3],[ |
| 38 | ost_cv_search_$1="-l$i" |
| 39 | break |
| 40 | ]) |
| 41 | done |
| 42 | LIBS="$ac_func_search_save_LIBS" |
| 43 | ]) |
| 44 | if test "$ost_cv_search_$1" != "no"; then |
| 45 | test "$ost_cv_search_$1" = "none required" || LIBS="$ost_cv_search_$1 $LIBS" |
| 46 | $5 |
| 47 | else : |
| 48 | $6 |
| 49 | fi |
| 50 | ]) |
| 51 | |
| 52 | |
| 53 | AC_DEFUN([OST_SGI_STLPORT],[ |
| 54 | AC_REQUIRE([OST_CXX_PROGRAMMING]) |
| 55 | |
| 56 | dnl |
| 57 | dnl Check for sgi/stlport portable c++ library |
| 58 | dnl |
| 59 | |
| 60 | AC_LANG_SAVE |
| 61 | ac_save_CXXFLAGS="$CXXFLAGS" |
| 62 | CXXFLAGS="" |
| 63 | AC_LANG_CPLUSPLUS |
| 64 | |
| 65 | AC_ARG_WITH(stlport, [ --with-stlport[=dir] using SGI portable C++ stream library |
| 66 | ie: /usr/local, not all include directory],[ |
| 67 | if test "$withval" = "" ; then |
| 68 | COMMON_FLAGS="-I$(includedir)/stlport $COMMON_FLAGS" |
| 69 | else |
| 70 | COMMON_FLAGS="-I$withval/include/stlport $COMMON_FLAGS" |
| 71 | LIBS="-L$withval/lib $LIBS" |
| 72 | fi |
| 73 | dnl AC_SEARCH_LIBS do not run (consider name mangling) |
| 74 | OST_SEARCH_LIBS(__stl_throw_invalid_argument, [ |
| 75 | namespace _STL { void __stl_throw_invalid_argument(const char*); } |
| 76 | ], [_STL::__stl_throw_invalid_argument("x")], [stlport_gcc stlport_cygwin stlport_mingw32 stlport_sunpro stlport_watcom]) |
| 77 | ]) |
| 78 | |
| 79 | AC_LANG_RESTORE |
| 80 | CXXFLAGS="$ac_save_CXXFLAGS" |
| 81 | ]) |
| 82 | |
| 83 | |