Move first_prereq test to m4 code.
[ira/wip.git] / source / aclocal.m4
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     -Wl,-rpath,/usr/lib) ;;
35     -Wl,-rpath,/usr/lib/) ;;
36     -Wl,-rpath) l=[$]i;;
37     -Wl,-rpath-Wl,/usr/lib) l="";;
38     -Wl,-rpath-Wl,/usr/lib/) l="";;
39     *)
40         s=" "
41         if test x"[$]ac_new_flags" = x""; then
42             s="";
43         fi
44         if test x"[$]l" = x""; then
45             ac_new_flags="[$]ac_new_flags[$]s[$]i";
46         else
47             ac_new_flags="[$]ac_new_flags[$]s[$]l [$]i";
48         fi
49         l=""
50         ;;
51     esac
52   done
53   $1=[$]ac_new_flags
54 ])
55
56 m4_include(lib/replace/libreplace.m4)
57 m4_include(build/m4/ax_cflags_gcc_option.m4)
58 m4_include(build/m4/ax_cflags_irix_option.m4)
59 m4_include(build/m4/public.m4)