Changeset 3469

Show
Ignore:
Timestamp:
01/10/06 19:25:25 (3 years ago)
Author:
morris
Message:

Clean up configure script

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/trunk/configure

    r3446 r3469  
    25022502fi 
    25032503 
    2504  
    2505 if test "$cross_compiling" = yes; then 
    2506   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 
    2507 See \`config.log' for more details." >&5 
    2508 echo "$as_me: error: cannot run test program while cross compiling 
    2509 See \`config.log' for more details." >&2;} 
    2510    { (exit 1); exit 1; }; } 
    2511 else 
    2512   cat >conftest.$ac_ext <<_ACEOF 
    2513 /* confdefs.h.  */ 
    2514 _ACEOF 
    2515 cat confdefs.h >>conftest.$ac_ext 
    2516 cat >>conftest.$ac_ext <<_ACEOF 
    2517 /* end confdefs.h.  */ 
    2518  
    2519         #include <sys/types.h> 
    2520         #include <pwd.h> 
    2521         int main(void) { 
    2522                 struct passwd *pwd = getpwnam("$wd_user"); 
    2523                 if(!pwd) 
    2524                         return 1; 
    2525                 return 0; 
    2526         } 
    2527  
    2528 _ACEOF 
    2529 rm -f conftest$ac_exeext 
    2530 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
    2531   (eval $ac_link) 2>&5 
    2532   ac_status=$? 
    2533   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    2534   (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 
    2535   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
    2536   (eval $ac_try) 2>&5 
    2537   ac_status=$? 
    2538   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    2539   (exit $ac_status); }; }; then 
    2540   : 
    2541 else 
    2542   echo "$as_me: program exited with status $ac_status" >&5 
    2543 echo "$as_me: failed program was:" >&5 
    2544 sed 's/^/| /' conftest.$ac_ext >&5 
    2545  
    2546 ( exit $ac_status ) 
    2547  
     2504perl -e "exit(!defined(getpwnam('$wd_user')))" 
     2505 
     2506if test $? = 1; then 
    25482507        if test -n "$with_user"; then 
    25492508                { { echo "$as_me:$LINENO: error: no such user \"$with_user\", please set another --with-user" >&5 
     
    25532512                wd_user=`id -un` 
    25542513        fi 
    2555  
    2556 fi 
    2557 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 
    25582514fi 
    25592515 
     
    25852541fi 
    25862542 
    2587 if test "$cross_compiling" = yes; then 
    2588   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 
    2589 See \`config.log' for more details." >&5 
    2590 echo "$as_me: error: cannot run test program while cross compiling 
    2591 See \`config.log' for more details." >&2;} 
    2592    { (exit 1); exit 1; }; } 
    2593 else 
    2594   cat >conftest.$ac_ext <<_ACEOF 
    2595 /* confdefs.h.  */ 
    2596 _ACEOF 
    2597 cat confdefs.h >>conftest.$ac_ext 
    2598 cat >>conftest.$ac_ext <<_ACEOF 
    2599 /* end confdefs.h.  */ 
    2600  
    2601         #include <sys/types.h> 
    2602         #include <grp.h> 
    2603         int main(void) { 
    2604                 struct group *grp = getgrnam("$wd_group"); 
    2605                 if(!grp) 
    2606                         return 1; 
    2607                 return 0; 
    2608         } 
    2609  
    2610 _ACEOF 
    2611 rm -f conftest$ac_exeext 
    2612 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
    2613   (eval $ac_link) 2>&5 
    2614   ac_status=$? 
    2615   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    2616   (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 
    2617   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
    2618   (eval $ac_try) 2>&5 
    2619   ac_status=$? 
    2620   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    2621   (exit $ac_status); }; }; then 
    2622   : 
    2623 else 
    2624   echo "$as_me: program exited with status $ac_status" >&5 
    2625 echo "$as_me: failed program was:" >&5 
    2626 sed 's/^/| /' conftest.$ac_ext >&5 
    2627  
    2628 ( exit $ac_status ) 
    2629  
     2543perl -e "exit(!defined(getgrnam('$wd_group')))" 
     2544 
     2545if test $? = 1; then 
    26302546        if test -n "$with_group"; then 
    26312547                { { echo "$as_me:$LINENO: error: no such group \"$with_group\", please set another --with-group" >&5 
     
    26352551                wd_group=`id -un` 
    26362552        fi 
    2637  
    2638 fi 
    2639 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 
    26402553fi 
    26412554 
     
    26632576 
    26642577if test -n "$enable_warnings"; then 
     2578 
    26652579 
    26662580        OLD_CFLAGS="$CFLAGS" 
     
    55965510echo $ECHO_N "checking for pthreads... $ECHO_C" >&6 
    55975511 
    5598         # try to compile with the following libraries linked 
     5512        # Try to compile with the following libraries linked 
    55995513 
    56005514        if test "$wd_pthreads_found" != yes ; then 
    5601                 # save libs 
    5602                 old_LIBS="$LIBS" 
     5515                # Save libs 
     5516                OLD_LIBS="$LIBS" 
    56035517                LIBS=" $LIBS" 
    56045518 
    5605                 # try to run it 
     5519                # Try to run it 
    56065520                if test "$cross_compiling" = yes; then 
    56075521 
     
    56205534        } 
    56215535 
    5622 int 
    5623 main () 
    5624 { 
    5625  
    5626         pthread_t tid; 
    5627  
    5628         if(pthread_create(&tid, 0, thread, NULL) < 0) 
    5629                 return errno; 
    5630  
    5631         return 0; 
    5632  
    5633   ; 
    5634   return 0; 
    5635 } 
    56365536_ACEOF 
    56375537rm -f conftest.$ac_objext conftest$ac_exeext 
     
    56735573else 
    56745574  cat >conftest.$ac_ext <<_ACEOF 
    5675 /* confdefs.h.  */ 
    5676 _ACEOF 
    5677 cat confdefs.h >>conftest.$ac_ext 
    5678 cat >>conftest.$ac_ext <<_ACEOF 
    5679 /* end confdefs.h.  */ 
    56805575 
    56815576 
     
    57275622fi 
    57285623 
    5729                 # restore libs 
    5730                 LIBS="$old_LIBS" 
    5731  
    5732                 # did we find something? 
    5733                 if test $wd_pthreads_test = yes ; then 
     5624                # Restore libs 
     5625                LIBS="$OLD_LIBS" 
     5626 
     5627                # Did we find something? 
     5628                if test "$wd_pthreads_test" = yes ; then 
    57345629                        wd_pthreads_found=yes 
    57355630                        wd_pthreads_libs="" 
     
    57395634 
    57405635        if test "$wd_pthreads_found" != yes ; then 
    5741                 # save libs 
    5742                 old_LIBS="$LIBS" 
     5636                # Save libs 
     5637                OLD_LIBS="$LIBS" 
    57435638                LIBS="-pthread $LIBS" 
    57445639 
    5745                 # try to run it 
     5640                # Try to run it 
    57465641                if test "$cross_compiling" = yes; then 
    57475642 
     
    57605655        } 
    57615656 
    5762 int 
    5763 main () 
    5764 { 
    5765  
    5766         pthread_t tid; 
    5767  
    5768         if(pthread_create(&tid, 0, thread, NULL) < 0) 
    5769                 return errno; 
    5770  
    5771         return 0; 
    5772  
    5773   ; 
    5774   return 0; 
    5775 } 
    57765657_ACEOF 
    57775658rm -f conftest.$ac_objext conftest$ac_exeext 
     
    58135694else 
    58145695  cat >conftest.$ac_ext <<_ACEOF 
    5815 /* confdefs.h.  */ 
    5816 _ACEOF 
    5817 cat confdefs.h >>conftest.$ac_ext 
    5818 cat >>conftest.$ac_ext <<_ACEOF 
    5819 /* end confdefs.h.  */ 
    58205696 
    58215697 
     
    58675743fi 
    58685744 
    5869                 # restore libs 
    5870                 LIBS="$old_LIBS" 
    5871  
    5872                 # did we find something? 
    5873                 if test $wd_pthreads_test = yes ; then 
     5745                # Restore libs 
     5746                LIBS="$OLD_LIBS" 
     5747 
     5748                # Did we find something? 
     5749                if test "$wd_pthreads_test" = yes ; then 
    58745750                        wd_pthreads_found=yes 
    58755751                        wd_pthreads_libs="-pthread" 
     
    58795755 
    58805756        if test "$wd_pthreads_found" != yes ; then 
    5881                 # save libs 
    5882                 old_LIBS="$LIBS" 
     5757                # Save libs 
     5758                OLD_LIBS="$LIBS" 
    58835759                LIBS="-lpthread $LIBS" 
    58845760 
    5885                 # try to run it 
     5761                # Try to run it 
    58865762                if test "$cross_compiling" = yes; then 
    58875763 
     
    59005776        } 
    59015777 
    5902 int 
    5903 main () 
    5904 { 
    5905  
    5906         pthread_t tid; 
    5907  
    5908         if(pthread_create(&tid, 0, thread, NULL) < 0) 
    5909                 return errno; 
    5910  
    5911         return 0; 
    5912  
    5913   ; 
    5914   return 0; 
    5915 } 
    59165778_ACEOF 
    59175779rm -f conftest.$ac_objext conftest$ac_exeext 
     
    59535815else 
    59545816  cat >conftest.$ac_ext <<_ACEOF 
    5955 /* confdefs.h.  */ 
    5956 _ACEOF 
    5957 cat confdefs.h >>conftest.$ac_ext 
    5958 cat >>conftest.$ac_ext <<_ACEOF 
    5959 /* end confdefs.h.  */ 
    59605817 
    59615818 
     
    60075864fi 
    60085865 
    6009                 # restore libs 
    6010                 LIBS="$old_LIBS" 
    6011  
    6012                 # did we find something? 
    6013                 if test $wd_pthreads_test = yes ; then 
     5866                # Restore libs 
     5867                LIBS="$OLD_LIBS" 
     5868 
     5869                # Did we find something? 
     5870                if test "$wd_pthreads_test" = yes ; then 
    60145871                        wd_pthreads_found=yes 
    60155872                        wd_pthreads_libs="-lpthread" 
     
    60185875 
    60195876 
    6020         # did we find something? 
     5877        # Did we find something? 
    60215878        if test "$wd_pthreads_found" = yes ; then 
    60225879                echo "$as_me:$LINENO: result: yes" >&5 
  • wired/trunk/configure.in

    r3446 r3469  
    5454fi 
    5555 
    56 AC_TRY_RUN([ 
    57         #include <sys/types.h> 
    58         #include <pwd.h> 
    59         int main(void) { 
    60                 struct passwd *pwd = getpwnam("$wd_user"); 
    61                 if(!pwd) 
    62                         return 1; 
    63                 return 0; 
    64         } 
    65 ], [], [ 
     56perl -e "exit(!defined(getpwnam('$wd_user')))" 
     57 
     58if test $? = 1; then 
    6659        if test -n "$with_user"; then 
    6760                AC_MSG_ERROR([no such user "$with_user", please set another --with-user]) 
     
    6962                wd_user=`id -un` 
    7063        fi 
    71 ]) 
     64fi 
    7265 
    7366AC_MSG_RESULT([$wd_user]) 
     
    8679fi 
    8780 
    88 AC_TRY_RUN([ 
    89         #include <sys/types.h> 
    90         #include <grp.h> 
    91         int main(void) { 
    92                 struct group *grp = getgrnam("$wd_group"); 
    93                 if(!grp) 
    94                         return 1; 
    95                 return 0; 
    96         } 
    97 ], [], [ 
     81perl -e "exit(!defined(getgrnam('$wd_group')))" 
     82 
     83if test $? = 1; then 
    9884        if test -n "$with_group"; then 
    9985                AC_MSG_ERROR([no such group "$with_group", please set another --with-group]) 
     
    10187                wd_group=`id -un` 
    10288        fi 
    103 ]) 
     89fi 
    10490 
    10591AC_MSG_RESULT([$wd_group]) 
     
    11298AC_ARG_ENABLE([warnings], AC_HELP_STRING([--enable-warnings], [enable warnings])) 
    11399 
    114 AC_DEFUN([WR_WARNING_TRY], [ 
     100AC_DEFUN([WD_WARNING_TRY], [ 
    115101        OLD_CFLAGS="$CFLAGS" 
    116102        CFLAGS="$CFLAGS $1" 
     
    128114 
    129115if test -n "$enable_warnings"; then 
    130         WR_WARNING_TRY([-W]) 
    131         WR_WARNING_TRY([-Wall]) 
    132         WR_WARNING_TRY([-Wno-unknown-pragmas]) 
    133         WR_WARNING_TRY([-Wno-unused-parameter]) 
    134         WR_WARNING_TRY([-Wsign-compare]) 
    135         WR_WARNING_TRY([-Wstrict-prototypes]) 
    136         WR_WARNING_TRY([-Wmissing-prototypes]) 
    137         WR_WARNING_TRY([-Wmissing-declarations]) 
    138         WR_WARNING_TRY([-Wredundant-decls]) 
     116        WD_WARNING_TRY([-W]) 
     117        WD_WARNING_TRY([-Wall]) 
     118        WD_WARNING_TRY([-Wno-unknown-pragmas]) 
     119        WD_WARNING_TRY([-Wno-unused-parameter]) 
     120        WD_WARNING_TRY([-Wsign-compare]) 
     121        WD_WARNING_TRY([-Wstrict-prototypes]) 
     122        WD_WARNING_TRY([-Wmissing-prototypes]) 
     123        WD_WARNING_TRY([-Wmissing-declarations]) 
     124        WD_WARNING_TRY([-Wredundant-decls]) 
    139125 
    140126        AC_MSG_RESULT([$WARNFLAGS]) 
     
    339325AC_DEFUN([WD_PTHREAD_TRY], [ 
    340326        if test "$wd_pthreads_found" != yes ; then 
    341                 # save libs 
    342                 old_LIBS="$LIBS" 
     327                # Save libs 
     328                OLD_LIBS="$LIBS" 
    343329                LIBS="$1 $LIBS" 
    344330 
    345                 # try to run it 
    346                 AC_TRY_RUN(WD_PTHREAD_TEST_PROGRAM, [ 
     331                # Try to run it 
     332                AC_RUN_IFELSE([WD_PTHREAD_TEST_PROGRAM], [ 
    347333                        wd_pthreads_test=yes 
    348334                ], [ 
    349335                        wd_pthreads_test=no 
    350336                ], [ 
    351                         AC_TRY_LINK(WD_PTHREAD_TEST_INCLUDES, WD_PTHREAD_TEST_FUNCTION, [ 
     337                        AC_LINK_IFELSE([AC_LANG_SOURCE([WD_PTHREAD_TEST_INCLUDES], [WD_PTHREAD_TEST_FUNCTION])], [ 
    352338                                wd_pthreads_test=yes 
    353339                        ], [ 
     
    356342                ]) 
    357343 
    358                 # restore libs 
    359                 LIBS="$old_LIBS" 
    360  
    361                 # did we find something? 
    362                 if test $wd_pthreads_test = yes ; then 
     344                # Restore libs 
     345                LIBS="$OLD_LIBS" 
     346 
     347                # Did we find something? 
     348                if test "$wd_pthreads_test" = yes ; then 
    363349                        wd_pthreads_found=yes 
    364350                        wd_pthreads_libs="$1" 
     
    372358        AC_MSG_CHECKING([for pthreads]) 
    373359 
    374         # try to compile with the following libraries linked 
     360        # Try to compile with the following libraries linked 
    375361        WD_PTHREAD_TRY([]) 
    376362        WD_PTHREAD_TRY([-pthread]) 
    377363        WD_PTHREAD_TRY([-lpthread]) 
    378364 
    379         # did we find something? 
     365        # Did we find something? 
    380366        if test "$wd_pthreads_found" = yes ; then 
    381367                AC_MSG_RESULT([yes])