[06/12] configure: Move test_foo() helper functions into canonical order

Message ID 20180417081638.3639-7-diego@biurrun.de
State New
Headers show
Series
  • [01/12] build: Group external library protocols separately
Related show

Commit Message

Diego Biurrun April 17, 2018, 8:16 a.m.
---
 configure | 100 +++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 50 insertions(+), 50 deletions(-)

Patch

diff --git a/configure b/configure
index 0267ad02e2..7c79d80b6e 100755
--- a/configure
+++ b/configure
@@ -797,6 +797,13 @@  hostcc_o(){
     eval printf '%s\\n' $HOSTCC_O
 }
 
+test_cpp(){
+    log test_cpp "$@"
+    cat > $TMPC
+    log_file $TMPC
+    test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
+}
+
 test_cc(){
     log test_cc "$@"
     cat > $TMPC
@@ -811,13 +818,6 @@  test_objcc(){
     test_cmd $objcc $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPC
 }
 
-test_cpp(){
-    log test_cpp "$@"
-    cat > $TMPC
-    log_file $TMPC
-    test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
-}
-
 test_as(){
     log test_as "$@"
     cat > $TMPS
@@ -833,6 +833,49 @@  test_x86asm(){
     test_cmd $x86asmexe $X86ASMFLAGS "$@" $(x86asm_o $TMPO) $TMPASM
 }
 
+test_ld(){
+    log test_ld "$@"
+    flags=$(filter_out '-l*' "$@")
+    libs=$(filter '-l*' "$@")
+    test_cc $($cflags_filter $flags) || return
+    flags=$($ldflags_filter $flags)
+    libs=$($ldflags_filter $libs)
+    test_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
+}
+
+test_cflags(){
+    log test_cflags "$@"
+    set -- $($cflags_filter "$@")
+    test_cc "$@" <<EOF
+int x;
+EOF
+}
+
+test_objcflags(){
+    log test_objcflags "$@"
+    set -- $($objcflags_filter "$@")
+    test_objcc "$@" <<EOF
+int x;
+EOF
+}
+
+test_ldflags(){
+    log test_ldflags "$@"
+    set -- $($ldflags_filter "$@")
+    test_ld "$@" <<EOF
+int main(void){ return 0; }
+EOF
+}
+
+test_stripflags(){
+    log test_stripflags "$@"
+    # call test_cc to get a fresh TMPO
+    test_cc <<EOF
+int main(void) { return 0; }
+EOF
+    test_cmd $strip $STRIPFLAGS "$@" $TMPO
+}
+
 check_cmd(){
     log check_cmd "$@"
     cmd=$1
@@ -877,16 +920,6 @@  check_x86asm(){
     test_x86asm "$@" && enable $name
 }
 
-test_ld(){
-    log test_ld "$@"
-    flags=$(filter_out '-l*' "$@")
-    libs=$(filter '-l*' "$@")
-    test_cc $($cflags_filter $flags) || return
-    flags=$($ldflags_filter $flags)
-    libs=$($ldflags_filter $libs)
-    test_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
-}
-
 check_ld(){
     log check_ld "$@"
     name=$1
@@ -923,54 +956,21 @@  check_cppflags(){
 EOF
 }
 
-test_cflags(){
-    log test_cflags "$@"
-    set -- $($cflags_filter "$@")
-    test_cc "$@" <<EOF
-int x;
-EOF
-}
-
 check_cflags(){
     log check_cflags "$@"
     test_cflags "$@" && add_cflags "$@"
 }
 
-test_objcflags(){
-    log test_objcflags "$@"
-    set -- $($objcflags_filter "$@")
-    test_objcc "$@" <<EOF
-int x;
-EOF
-}
-
 check_objcflags(){
     log check_objcflags "$@"
     test_objcflags "$@" && add_objcflags "$@"
 }
 
-test_ldflags(){
-    log test_ldflags "$@"
-    set -- $($ldflags_filter "$@")
-    test_ld "$@" <<EOF
-int main(void){ return 0; }
-EOF
-}
-
 check_ldflags(){
     log check_ldflags "$@"
     test_ldflags "$@" && add_ldflags "$@"
 }
 
-test_stripflags(){
-    log test_stripflags "$@"
-    # call test_cc to get a fresh TMPO
-    test_cc <<EOF
-int main(void) { return 0; }
-EOF
-    test_cmd $strip $STRIPFLAGS "$@" $TMPO
-}
-
 check_stripflags(){
     log check_stripflags "$@"
     test_stripflags "$@" && add_stripflags "$@"