| | 873 | dnl Builds a list of the absolute path to each shared library that is linked |
|---|
| | 874 | dnl against when creating a shared library. |
|---|
| | 875 | dnl |
|---|
| | 876 | dnl Usage: |
|---|
| | 877 | dnl VJ_BUILD_LIB_FILE_LIST(dynamic-lib-list, file-name-var) |
|---|
| | 878 | dnl --------------------------------------------------------------------------- |
|---|
| | 879 | AC_DEFUN([VJ_BUILD_LIB_FILE_LIST], |
|---|
| | 880 | [ |
|---|
| | 881 | dirs='' |
|---|
| | 882 | libs='' |
|---|
| | 883 | |
|---|
| | 884 | dnl Extract the directories and library names from $1. We will use this to |
|---|
| | 885 | dnl build up the full path to each library against which linking will be |
|---|
| | 886 | dnl performed. |
|---|
| | 887 | for d in $1 ; do |
|---|
| | 888 | case $d in |
|---|
| | 889 | -L*) |
|---|
| | 890 | dir=`echo $d | sed -e 's#-L\(.*\)#\1#'` |
|---|
| | 891 | if test -d "$dir" ; then |
|---|
| | 892 | dirs="$dirs $dir" |
|---|
| | 893 | fi |
|---|
| | 894 | ;; |
|---|
| | 895 | -l*) |
|---|
| | 896 | lib=`echo $d | sed -e 's/-l\(.*\)/\1/'` |
|---|
| | 897 | libs="$libs lib$lib.$DYNAMICLIB_EXT" |
|---|
| | 898 | ;; |
|---|
| | 899 | esac |
|---|
| | 900 | done |
|---|
| | 901 | |
|---|
| | 902 | $2='' |
|---|
| | 903 | |
|---|
| | 904 | dnl Get the absolute path to each library in $libs. If we cannot find the |
|---|
| | 905 | dnl absolute path for a library, then that library file will not be added |
|---|
| | 906 | dnl to the variable named by $2. Should that occur, however, something is |
|---|
| | 907 | dnl probably wrong with the above code for extracting the libraries and |
|---|
| | 908 | dnl directories from $1. |
|---|
| | 909 | for l in $libs ; do |
|---|
| | 910 | for d in $dirs ; do |
|---|
| | 911 | if test -e "$d/$l" ; then |
|---|
| | 912 | $2="$[$2] $d/$l" |
|---|
| | 913 | break |
|---|
| | 914 | fi |
|---|
| | 915 | done |
|---|
| | 916 | done |
|---|
| | 917 | ]) |
|---|
| | 918 | |
|---|
| | 919 | dnl --------------------------------------------------------------------------- |
|---|