changeset 34047:c8b1318c9647

configure: refactor PIC test using cpp_condition_check()
author diego
date Mon, 26 Sep 2011 10:59:42 +0000
parents b08447652f33
children a9d01ad2210a
files configure
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Mon Sep 26 10:59:41 2011 +0000
+++ b/configure	Mon Sep 26 10:59:42 2011 +0000
@@ -2653,16 +2653,8 @@
 echocheck "PIC"
 def_pic='#define CONFIG_PIC 0'
 pic=no
-cat > $TMPC << EOF
-int main(void) {
-#if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
-#error PIC not enabled
-#endif
-    return 0;
-}
-EOF
-cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC" &&
-  def_pic='#define CONFIG_PIC 1'
+cpp_condition_check 'defined(__PIC__) || defined(__pic__) || defined(PIC)' &&
+  pic=yes && extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
 echores $pic