]>
Commit | Line | Data |
---|---|---|
3940008c VB |
1 | # |
2 | # lldp_CONFIG_SUBDIRS | |
3 | # | |
4 | # This is almost like AC_CONFIG_SUBDIRS but it will take additional | |
5 | # arguments for ./configure. Also, ./configure is not delayed. Be sure | |
6 | # to call that late enough. | |
7 | ||
8 | AC_DEFUN([lldp_CONFIG_SUBDIRS], [ | |
e9b22e1e | 9 | AC_CONFIG_SUBDIRS([$1]) |
986bcc69 | 10 | ac_dir="m4_normalize([$1])" |
0a26b53d | 11 | if test -f "$srcdir/$ac_dir/configure"; then |
986bcc69 VB |
12 | ac_sub_configure_args= |
13 | ac_prev= | |
14 | eval "set x $ac_configure_args" | |
15 | shift | |
16 | for ac_arg | |
17 | do | |
18 | if test -n "$ac_prev"; then | |
19 | ac_prev= | |
20 | continue | |
21 | fi | |
3940008c | 22 | case $ac_arg in |
986bcc69 VB |
23 | -cache-file | --cache-file | --cache-fil | --cache-fi \ |
24 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) | |
25 | ac_prev=cache_file ;; | |
26 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | |
27 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | |
28 | | --c=*) | |
29 | ;; | |
30 | --config-cache | -C) | |
31 | ;; | |
32 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) | |
33 | ac_prev=srcdir ;; | |
34 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) | |
35 | ;; | |
36 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
37 | ac_prev=prefix ;; | |
38 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
39 | ;; | |
40 | --disable-option-checking) | |
41 | ;; | |
42 | *) | |
43 | case $ac_arg in | |
44 | *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;; | |
45 | esac | |
46 | AS_VAR_APPEND([ac_sub_configure_args], [" '$ac_arg'"]) ;; | |
3940008c | 47 | esac |
986bcc69 | 48 | done |
3940008c | 49 | |
986bcc69 VB |
50 | # Always prepend --prefix to ensure using the same prefix |
51 | # in subdir configurations. | |
52 | ac_arg="--prefix=$prefix" | |
53 | case $ac_arg in | |
54 | *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;; | |
55 | esac | |
56 | ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" | |
3940008c | 57 | |
986bcc69 VB |
58 | # Always prepend --disable-option-checking to silence warnings, since |
59 | # different subdirs can have different --enable and --with options. | |
60 | ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" | |
3940008c | 61 | |
986bcc69 VB |
62 | # Silent rules |
63 | case $enable_silent_rules in | |
64 | no) ac_sub_configure_args="$ac_sub_configure_args --disable-silent-rules" ;; | |
65 | *) ac_sub_configure_args="$ac_sub_configure_args --enable-silent-rules" ;; | |
66 | esac | |
848cc661 | 67 | |
986bcc69 VB |
68 | # Add additional options |
69 | ac_sub_configure_args="$ac_sub_configure_args $2" | |
3940008c | 70 | |
986bcc69 | 71 | ac_popdir=`pwd` |
3940008c | 72 | |
986bcc69 VB |
73 | ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" |
74 | _AS_ECHO_LOG([$ac_msg]) | |
75 | _AS_ECHO([$ac_msg]) | |
76 | AS_MKDIR_P(["$ac_dir"]) | |
77 | _AC_SRCDIRS(["$ac_dir"]) | |
3940008c | 78 | |
986bcc69 | 79 | cd "$ac_dir" |
3940008c | 80 | |
986bcc69 | 81 | ac_sub_configure=$ac_srcdir/configure |
3940008c | 82 | |
986bcc69 VB |
83 | # Make the cache file name correct relative to the subdirectory. |
84 | case $cache_file in | |
85 | [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;; | |
86 | *) # Relative name. | |
87 | ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; | |
88 | esac | |
3940008c | 89 | |
986bcc69 VB |
90 | AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir]) |
91 | # The eval makes quoting arguments work. | |
92 | eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ | |
93 | --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || | |
94 | AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir]) | |
3940008c | 95 | |
986bcc69 VB |
96 | ac_msg="=== end of configure in $ac_dir (`pwd`/$ac_dir)" |
97 | _AS_ECHO_LOG([$ac_msg]) | |
98 | _AS_ECHO([$ac_msg]) | |
99 | cd "$ac_popdir" | |
100 | fi | |
3940008c | 101 | ]) |
e9b22e1e VB |
102 | |
103 | # Dummy AC_CONFIG_SUBDIRS for autoreconf tracing | |
104 | AC_DEFUN([AC_CONFIG_SUBDIRS], []) |