| 1 | 
 | 
|---|
| 2 | dnl Copied from libtool.m4
 | 
|---|
| 3 | AC_DEFUN(AC_PROG_LD_GNU,
 | 
|---|
| 4 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
 | 
|---|
| 5 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 | 
|---|
| 6 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
 | 
|---|
| 7 |   ac_cv_prog_gnu_ld=yes
 | 
|---|
| 8 | else
 | 
|---|
| 9 |   ac_cv_prog_gnu_ld=no
 | 
|---|
| 10 | fi])
 | 
|---|
| 11 | ])
 | 
|---|
| 12 | 
 | 
|---|
| 13 | dnl Removes -I/usr/include/? from given variable
 | 
|---|
| 14 | AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
 | 
|---|
| 15 |   ac_new_flags=""
 | 
|---|
| 16 |   for i in [$]$1; do
 | 
|---|
| 17 |     case [$]i in
 | 
|---|
| 18 |     -I/usr/include|-I/usr/include/) ;;
 | 
|---|
| 19 |     *) ac_new_flags="[$]ac_new_flags [$]i" ;;
 | 
|---|
| 20 |     esac
 | 
|---|
| 21 |   done
 | 
|---|
| 22 |   $1=[$]ac_new_flags
 | 
|---|
| 23 | ])
 | 
|---|
| 24 |     
 | 
|---|
| 25 | dnl Removes '-L/usr/lib[/]', '-Wl,-rpath,/usr/lib[/]'
 | 
|---|
| 26 | dnl and '-Wl,-rpath -Wl,/usr/lib[/]' from given variable
 | 
|---|
| 27 | AC_DEFUN(LIB_REMOVE_USR_LIB,[
 | 
|---|
| 28 |   ac_new_flags=""
 | 
|---|
| 29 |   l=""
 | 
|---|
| 30 |   for i in [$]$1; do
 | 
|---|
| 31 |     case [$]l[$]i in
 | 
|---|
| 32 |     -L/usr/lib) ;;
 | 
|---|
| 33 |     -L/usr/lib/) ;;
 | 
|---|
| 34 |     -L/usr/lib64) ;;
 | 
|---|
| 35 |     -L/usr/lib64/) ;;
 | 
|---|
| 36 |     -Wl,-rpath,/usr/lib) l="";;
 | 
|---|
| 37 |     -Wl,-rpath,/usr/lib/) l="";;
 | 
|---|
| 38 |     -Wl,-rpath,/usr/lib64) l="";;
 | 
|---|
| 39 |     -Wl,-rpath,/usr/lib64/) l="";;
 | 
|---|
| 40 |     -Wl,-rpath) l=[$]i;;
 | 
|---|
| 41 |     -Wl,-rpath-Wl,/usr/lib) l="";;
 | 
|---|
| 42 |     -Wl,-rpath-Wl,/usr/lib/) l="";;
 | 
|---|
| 43 |     -Wl,-rpath-Wl,/usr/lib64) l="";;
 | 
|---|
| 44 |     -Wl,-rpath-Wl,/usr/lib64/) l="";;
 | 
|---|
| 45 |     *)
 | 
|---|
| 46 |         s=" "
 | 
|---|
| 47 |         if test x"[$]ac_new_flags" = x""; then
 | 
|---|
| 48 |             s="";
 | 
|---|
| 49 |         fi
 | 
|---|
| 50 |         if test x"[$]l" = x""; then
 | 
|---|
| 51 |             ac_new_flags="[$]ac_new_flags[$]s[$]i";
 | 
|---|
| 52 |         else
 | 
|---|
| 53 |             ac_new_flags="[$]ac_new_flags[$]s[$]l [$]i";
 | 
|---|
| 54 |         fi
 | 
|---|
| 55 |         l=""
 | 
|---|
| 56 |         ;;
 | 
|---|
| 57 |     esac
 | 
|---|
| 58 |   done
 | 
|---|
| 59 |   $1=[$]ac_new_flags
 | 
|---|
| 60 | ])
 | 
|---|
| 61 | 
 | 
|---|
| 62 | m4_include(../lib/replace/libreplace.m4)
 | 
|---|
| 63 | m4_include(build/m4/ax_cflags_gcc_option.m4)
 | 
|---|
| 64 | m4_include(build/m4/ax_cflags_irix_option.m4)
 | 
|---|
| 65 | m4_include(build/m4/public.m4)
 | 
|---|