equal
deleted
inserted
replaced
48 if test ! -e $custom_hook; then |
48 if test ! -e $custom_hook; then |
49 echo "CUSTOM_CONFIG_DIR not pointing to a proper custom config dir." |
49 echo "CUSTOM_CONFIG_DIR not pointing to a proper custom config dir." |
50 echo "Error: Cannot continue" 1>&2 |
50 echo "Error: Cannot continue" 1>&2 |
51 exit 1 |
51 exit 1 |
52 fi |
52 fi |
53 build_support_dir="$CUSTOM_ROOT/.build" |
53 fi |
|
54 |
|
55 CURRENT_DIR=`pwd` |
|
56 if test "x$CURRENT_DIR" = "x$TOPDIR"; then |
|
57 # We are running configure from the src root. |
|
58 # Create '.configure-support' under $TOPDIR/build |
|
59 build_support_dir="$TOPDIR/build/.configure-support" |
|
60 elif test "x$CURRENT_DIR" = "x$CUSTOM_ROOT"; then |
|
61 # We are running configure from the custom root. |
|
62 # Create '.configure-support' under $CUSTOM_ROOT/build |
|
63 build_support_dir="$CUSTOM_ROOT/build/.configure-support" |
54 else |
64 else |
55 build_support_dir="$TOPDIR/.build" |
65 # We are running configure from outside of the src dir. |
|
66 # Create 'build_support_dir' in the current directory. |
|
67 build_support_dir="$CURRENT_DIR/configure-support" |
56 fi |
68 fi |
57 |
69 |
58 conf_script_dir="$TOPDIR/make/autoconf" |
70 conf_script_dir="$TOPDIR/make/autoconf" |
59 generated_script="$build_support_dir/generated-configure.sh" |
71 generated_script="$build_support_dir/generated-configure.sh" |
60 |
72 |
112 custom_patcher='sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|"' |
124 custom_patcher='sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|"' |
113 else |
125 else |
114 custom_patcher='cat' |
126 custom_patcher='cat' |
115 fi |
127 fi |
116 |
128 |
117 mkdir -p `dirname $generated_script` |
129 mkdir -p $build_support_dir |
118 # Call autoconf but replace the "magic" variable in configure.ac if requested. |
130 # Call autoconf but replace the "magic" variable in configure.ac if requested. |
119 cat $conf_script_dir/configure.ac | eval $custom_patcher | \ |
131 cat $conf_script_dir/configure.ac | eval $custom_patcher | \ |
120 ${AUTOCONF} -W all -I$conf_script_dir - > $generated_script |
132 ${AUTOCONF} -W all -I$conf_script_dir - > $generated_script |
121 rm -rf autom4te.cache |
133 rm -rf autom4te.cache |
122 |
134 |
162 run_autoconf=true |
174 run_autoconf=true |
163 fi |
175 fi |
164 fi |
176 fi |
165 |
177 |
166 if test "x$run_autoconf" = xtrue; then |
178 if test "x$run_autoconf" = xtrue; then |
167 echo "Generating runnable configure script" |
179 echo "Generating runnable configure script at $generated_script" |
168 generate_configure_script |
180 generate_configure_script |
169 fi |
181 fi |
170 |
182 |
171 # Autoconf calls the configure script recursively sometimes. |
183 # Autoconf calls the configure script recursively sometimes. |
172 # Don't start logging twice in that case |
184 # Don't start logging twice in that case |