summaryrefslogtreecommitdiffstats
path: root/source4/aclocal.m4
blob: 240a994f9df6de71a30bfe63236a0b76aae48665 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

dnl Copied from libtool.m4
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  ac_cv_prog_gnu_ld=yes
else
  ac_cv_prog_gnu_ld=no
fi])
])

dnl Removes -I/usr/include/? from given variable
AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
  ac_new_flags=""
  for i in [$]$1; do
    case [$]i in
    -I/usr/include|-I/usr/include/) ;;
    *) ac_new_flags="[$]ac_new_flags [$]i" ;;
    esac
  done
  $1=[$]ac_new_flags
])
    
dnl Removes '-L/usr/lib[/]', '-Wl,-rpath,/usr/lib[/]'
dnl and '-Wl,-rpath -Wl,/usr/lib[/]' from given variable
AC_DEFUN(LIB_REMOVE_USR_LIB,[
  ac_new_flags=""
  l=""
  for i in [$]$1; do
    case [$]l[$]i in
    -L/usr/lib) ;;
    -L/usr/lib/) ;;
    -Wl,-rpath,/usr/lib) ;;
    -Wl,-rpath,/usr/lib/) ;;
    -Wl,-rpath) l=[$]i;;
    -Wl,-rpath-Wl,/usr/lib) l="";;
    -Wl,-rpath-Wl,/usr/lib/) l="";;
    *)
    	s=" "
        if test x"[$]ac_new_flags" = x""; then
            s="";
	fi
        if test x"[$]l" = x""; then
            ac_new_flags="[$]ac_new_flags[$]s[$]i";
        else
            ac_new_flags="[$]ac_new_flags[$]s[$]l [$]i";
        fi
        l=""
        ;;
    esac
  done
  $1=[$]ac_new_flags
])

m4_include(../lib/replace/libreplace.m4)
m4_include(build/m4/ax_cflags_gcc_option.m4)
m4_include(build/m4/ax_cflags_irix_option.m4)
m4_include(build/m4/public.m4)