Changeset 4578

Show
Ignore:
Timestamp:
02/10/07 16:13:05 (2 years ago)
Author:
morris
Message:

Add experimental p7 support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/Makefile.in

    r4564 r4578  
    3131COMPILE                 = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) 
    3232PREPROCESS              = $(CC) -E $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) 
    33 DEPEND                  = $(CC) -MM $(INCLUDES) 
     33DEPEND                  = $(CC) -MM $(INCLUDES) $(CPPFLAGS) 
    3434LINK                    = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 
    3535ARCHIVE                 = ar rcs $@ 
  • libwired/trunk/config.h.in

    r4543 r4578  
    5050#undef HAVE_INTTYPES_H 
    5151 
     52/* Define to 1 if you have the <libxml/parser.h> header file. */ 
     53#undef HAVE_LIBXML_PARSER_H 
     54 
    5255/* Define to 1 if you have the <machine/param.h> header file. */ 
    5356#undef HAVE_MACHINE_PARAM_H 
  • libwired/trunk/config.m4

    r4525 r4578  
    3030                CPPFLAGS="$CPPFLAGS -I/usr/local/include" 
    3131        fi 
    32  
    33         if test -d /usr/local/ssl/include; then 
    34                 CPPFLAGS="$CPPFLAGS -I/usr/local/ssl/include" 
    35         fi 
    36  
    37         if test -d /usr/kerberos/include; then 
    38                 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" 
    39         fi 
    4032]) 
    4133 
     
    4537                LDFLAGS="$LDFLAGS -L/usr/local/lib" 
    4638        fi 
    47  
    48         if test -d /usr/local/ssl/lib; then 
    49                 LDFLAGS="$LDFLAGS -L/usr/local/ssl/lib" 
    50         fi 
     39]) 
     40 
     41 
     42AC_DEFUN([WI_INCLUDE_EXTRA_SSL_PATHS], [ 
     43        if test "$_wi_ssl_paths_added" != yes ; then 
     44                if test -d /usr/local/ssl/include; then 
     45                        CPPFLAGS="$CPPFLAGS -I/usr/local/ssl/include" 
     46                fi 
     47 
     48                if test -d /usr/kerberos/include; then 
     49                        CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" 
     50                fi 
     51 
     52                if test -d /usr/local/ssl/lib; then 
     53                        LDFLAGS="$LDFLAGS -L/usr/local/ssl/lib" 
     54                fi 
     55        fi 
     56 
     57        _wi_ssl_paths_added=yes 
    5158]) 
    5259 
     
    98105 
    99106AC_DEFUN([WI_INCLUDE_CRYPTO_LIBRARY], [ 
     107        WI_INCLUDE_EXTRA_SSL_PATHS 
     108 
    100109        AC_CHECK_HEADERS([openssl/sha.h], [ 
    101110                AC_CHECK_LIB([crypto], [MD5_Init], [ 
     
    111120 
    112121AC_DEFUN([WI_INCLUDE_SSL_LIBRARY], [ 
     122        WI_INCLUDE_EXTRA_SSL_PATHS 
     123 
    113124        AC_CHECK_HEADERS([openssl/ssl.h], [ 
    114125                AC_CHECK_LIB([ssl], [SSL_library_init], [ 
     
    317328        ]) 
    318329]) 
     330 
     331 
     332AC_DEFUN([WI_INCLUDE_LIBXML2_LIBRARY], [ 
     333        if test -d /usr/include/libxml2; then 
     334                CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2" 
     335        fi 
     336 
     337        AC_CHECK_HEADERS([libxml/parser.h], [ 
     338                AC_CHECK_LIB([xml2], [xmlParseFile], [ 
     339                        LIBS="$LIBS -lxml2" 
     340                ], [ 
     341                        _WI_MSG_LIB_ERROR([libxml2]) 
     342                ]) 
     343        ], [ 
     344                _WI_MSG_LIB_ERROR([libxml2]) 
     345        ]) 
     346]) 
  • libwired/trunk/configure

    r4541 r4578  
    854854  --enable-ssl            enable OpenSSL support 
    855855  --enable-iconv          enable iconv support 
     856  --enable-p7             enable experimental P7 support 
    856857 
    857858  --disable-largefile     omit support for large files 
     
    13881389 
    13891390 
     1391 
     1392 
     1393 
     1394 
     1395 
     1396 
    13901397# Get host 
    13911398ac_aux_dir= 
     
    30603067 
    30613068 
     3069# Check for P7 support 
     3070# Check whether --enable-p7 or --disable-p7 was given. 
     3071if test "${enable_p7+set}" = set; then 
     3072  enableval="$enable_p7" 
     3073 
     3074fi; 
     3075 
     3076if test -n "$enable_p7"; then 
     3077        CFLAGS="$CFLAGS -DWI_P7" 
     3078fi 
     3079 
     3080 
    30623081# Check for object directory name 
    30633082 
     
    31183137        fi 
    31193138 
    3120         if test -d /usr/local/ssl/include; then 
    3121                 CPPFLAGS="$CPPFLAGS -I/usr/local/ssl/include" 
    3122         fi 
    3123  
    3124         if test -d /usr/kerberos/include; then 
    3125                 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" 
    3126         fi 
    3127  
    31283139 
    31293140        if test -d /usr/local/lib; then 
    31303141                LDFLAGS="$LDFLAGS -L/usr/local/lib" 
    3131         fi 
    3132  
    3133         if test -d /usr/local/ssl/lib; then 
    3134                 LDFLAGS="$LDFLAGS -L/usr/local/ssl/lib" 
    31353142        fi 
    31363143 
     
    43054312done 
    43064313 
     4314 
     4315 
     4316 
     4317        if test "$_wi_ssl_paths_added" != yes ; then 
     4318                echo pulling extra paths 
     4319                if test -d /usr/local/ssl/include; then 
     4320                        CPPFLAGS="$CPPFLAGS -I/usr/local/ssl/include" 
     4321                fi 
     4322 
     4323                if test -d /usr/kerberos/include; then 
     4324                        CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" 
     4325                fi 
     4326 
     4327                if test -d /usr/local/ssl/lib; then 
     4328                        LDFLAGS="$LDFLAGS -L/usr/local/ssl/lib" 
     4329                fi 
     4330        fi 
     4331 
     4332        _wi_ssl_paths_added=yes 
    43074333 
    43084334 
     
    45634589 
    45644590 
     4591        if test "$_wi_ssl_paths_added" != yes ; then 
     4592                echo pulling extra paths 
     4593                if test -d /usr/local/ssl/include; then 
     4594                        CPPFLAGS="$CPPFLAGS -I/usr/local/ssl/include" 
     4595                fi 
     4596 
     4597                if test -d /usr/kerberos/include; then 
     4598                        CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" 
     4599                fi 
     4600 
     4601                if test -d /usr/local/ssl/lib; then 
     4602                        LDFLAGS="$LDFLAGS -L/usr/local/ssl/lib" 
     4603                fi 
     4604        fi 
     4605 
     4606        _wi_ssl_paths_added=yes 
     4607 
     4608 
     4609 
    45654610for ac_header in openssl/ssl.h 
    45664611do 
     
    65126557rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 
    65136558fi 
     6559 
     6560fi 
     6561 
     6562if test -n "$enable_p7"; then 
     6563 
     6564        if test -d /usr/include/libxml2; then 
     6565                CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2" 
     6566        fi 
     6567 
     6568 
     6569for ac_header in libxml/parser.h 
     6570do 
     6571as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     6572if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     6573  echo "$as_me:$LINENO: checking for $ac_header" >&5 
     6574echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 
     6575if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     6576  echo $ECHO_N "(cached) $ECHO_C" >&6 
     6577fi 
     6578echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 
     6579echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 
     6580else 
     6581  # Is the header compilable? 
     6582echo "$as_me:$LINENO: checking $ac_header usability" >&5 
     6583echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 
     6584cat >conftest.$ac_ext <<_ACEOF 
     6585/* confdefs.h.  */ 
     6586_ACEOF 
     6587cat confdefs.h >>conftest.$ac_ext 
     6588cat >>conftest.$ac_ext <<_ACEOF 
     6589/* end confdefs.h.  */ 
     6590$ac_includes_default 
     6591#include <$ac_header> 
     6592_ACEOF 
     6593rm -f conftest.$ac_objext 
     6594if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 
     6595  (eval $ac_compile) 2>conftest.er1 
     6596  ac_status=$? 
     6597  grep -v '^ *+' conftest.er1 >conftest.err 
     6598  rm -f conftest.er1 
     6599  cat conftest.err >&5 
     6600  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     6601  (exit $ac_status); } && 
     6602         { ac_try='test -z "$ac_c_werror_flag" 
     6603                         || test ! -s conftest.err' 
     6604  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     6605  (eval $ac_try) 2>&5 
     6606  ac_status=$? 
     6607  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     6608  (exit $ac_status); }; } && 
     6609         { ac_try='test -s conftest.$ac_objext' 
     6610  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     6611  (eval $ac_try) 2>&5 
     6612  ac_status=$? 
     6613  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     6614  (exit $ac_status); }; }; then 
     6615  ac_header_compiler=yes 
     6616else 
     6617  echo "$as_me: failed program was:" >&5 
     6618sed 's/^/| /' conftest.$ac_ext >&5 
     6619 
     6620ac_header_compiler=no 
     6621fi 
     6622rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 
     6623echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     6624echo "${ECHO_T}$ac_header_compiler" >&6 
     6625 
     6626# Is the header present? 
     6627echo "$as_me:$LINENO: checking $ac_header presence" >&5 
     6628echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 
     6629cat >conftest.$ac_ext <<_ACEOF 
     6630/* confdefs.h.  */ 
     6631_ACEOF 
     6632cat confdefs.h >>conftest.$ac_ext 
     6633cat >>conftest.$ac_ext <<_ACEOF 
     6634/* end confdefs.h.  */ 
     6635#include <$ac_header> 
     6636_ACEOF 
     6637if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 
     6638  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 
     6639  ac_status=$? 
     6640  grep -v '^ *+' conftest.er1 >conftest.err 
     6641  rm -f conftest.er1 
     6642  cat conftest.err >&5 
     6643  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     6644  (exit $ac_status); } >/dev/null; then 
     6645  if test -s conftest.err; then 
     6646    ac_cpp_err=$ac_c_preproc_warn_flag 
     6647    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag 
     6648  else 
     6649    ac_cpp_err= 
     6650  fi 
     6651else 
     6652  ac_cpp_err=yes 
     6653fi 
     6654if test -z "$ac_cpp_err"; then 
     6655  ac_header_preproc=yes 
     6656else 
     6657  echo "$as_me: failed program was:" >&5 
     6658sed 's/^/| /' conftest.$ac_ext >&5 
     6659 
     6660  ac_header_preproc=no 
     6661fi 
     6662rm -f conftest.err conftest.$ac_ext 
     6663echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     6664echo "${ECHO_T}$ac_header_preproc" >&6 
     6665 
     6666# So?  What about this header? 
     6667case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 
     6668  yes:no: ) 
     6669    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 
     6670echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     6671    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 
     6672echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} 
     6673    ac_header_preproc=yes 
     6674    ;; 
     6675  no:yes:* ) 
     6676    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 
     6677echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} 
     6678    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5 
     6679echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;} 
     6680    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 
     6681echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} 
     6682    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5 
     6683echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;} 
     6684    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 
     6685echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} 
     6686    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 
     6687echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} 
     6688    ( 
     6689      cat <<\_ASBOX 
     6690## ------------------------------------- ## 
     6691## Report this to axel@zankasoftware.com ## 
     6692## ------------------------------------- ## 
     6693_ASBOX 
     6694    ) | 
     6695      sed "s/^/$as_me: WARNING:     /" >&2 
     6696    ;; 
     6697esac 
     6698echo "$as_me:$LINENO: checking for $ac_header" >&5 
     6699echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 
     6700if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     6701  echo $ECHO_N "(cached) $ECHO_C" >&6 
     6702else 
     6703  eval "$as_ac_Header=\$ac_header_preproc" 
     6704fi 
     6705echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 
     6706echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 
     6707 
     6708fi 
     6709if test `eval echo '${'$as_ac_Header'}'` = yes; then 
     6710  cat >>confdefs.h <<_ACEOF 
     6711#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 
     6712_ACEOF 
     6713 
     6714                echo "$as_me:$LINENO: checking for xmlParseFile in -lxml2" >&5 
     6715echo $ECHO_N "checking for xmlParseFile in -lxml2... $ECHO_C" >&6 
     6716if test "${ac_cv_lib_xml2_xmlParseFile+set}" = set; then 
     6717  echo $ECHO_N "(cached) $ECHO_C" >&6 
     6718else 
     6719  ac_check_lib_save_LIBS=$LIBS 
     6720LIBS="-lxml2  $LIBS" 
     6721cat >conftest.$ac_ext <<_ACEOF 
     6722/* confdefs.h.  */ 
     6723_ACEOF 
     6724cat confdefs.h >>conftest.$ac_ext 
     6725cat >>conftest.$ac_ext <<_ACEOF 
     6726/* end confdefs.h.  */ 
     6727 
     6728/* Override any gcc2 internal prototype to avoid an error.  */ 
     6729#ifdef __cplusplus 
     6730extern "C" 
     6731#endif 
     6732/* We use char because int might match the return type of a gcc2 
     6733   builtin and then its argument prototype would still apply.  */ 
     6734char xmlParseFile (); 
     6735int 
     6736main () 
     6737{ 
     6738xmlParseFile (); 
     6739  ; 
     6740  return 0; 
     6741} 
     6742_ACEOF 
     6743rm -f conftest.$ac_objext conftest$ac_exeext 
     6744if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     6745  (eval $ac_link) 2>conftest.er1 
     6746  ac_status=$? 
     6747  grep -v '^ *+' conftest.er1 >conftest.err 
     6748  rm -f conftest.er1 
     6749  cat conftest.err >&5 
     6750  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     6751  (exit $ac_status); } && 
     6752         { ac_try='test -z "$ac_c_werror_flag" 
     6753                         || test ! -s conftest.err' 
     6754  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     6755  (eval $ac_try) 2>&5 
     6756  ac_status=$? 
     6757  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     6758  (exit $ac_status); }; } && 
     6759         { ac_try='test -s conftest$ac_exeext' 
     6760  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     6761  (eval $ac_try) 2>&5 
     6762  ac_status=$? 
     6763  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     6764  (exit $ac_status); }; }; then 
     6765  ac_cv_lib_xml2_xmlParseFile=yes 
     6766else 
     6767  echo "$as_me: failed program was:" >&5 
     6768sed 's/^/| /' conftest.$ac_ext >&5 
     6769 
     6770ac_cv_lib_xml2_xmlParseFile=no 
     6771fi 
     6772rm -f conftest.err conftest.$ac_objext \ 
     6773      conftest$ac_exeext conftest.$ac_ext 
     6774LIBS=$ac_check_lib_save_LIBS 
     6775fi 
     6776echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlParseFile" >&5 
     6777echo "${ECHO_T}$ac_cv_lib_xml2_xmlParseFile" >&6 
     6778if test $ac_cv_lib_xml2_xmlParseFile = yes; then 
     6779 
     6780                        LIBS="$LIBS -lxml2" 
     6781 
     6782else 
     6783 
     6784 
     6785        { { echo "$as_me:$LINENO: error: could not locate libxml2 
     6786 
     6787If you installed libxml2 into a non-standard directory, please run: 
     6788 
     6789    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&5 
     6790echo "$as_me: error: could not locate libxml2 
     6791 
     6792If you installed libxml2 into a non-standard directory, please run: 
     6793 
     6794    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&2;} 
     6795   { (exit 1); exit 1; }; } 
     6796 
     6797 
     6798fi 
     6799 
     6800 
     6801else 
     6802 
     6803 
     6804        { { echo "$as_me:$LINENO: error: could not locate libxml2 
     6805 
     6806If you installed libxml2 into a non-standard directory, please run: 
     6807 
     6808    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&5 
     6809echo "$as_me: error: could not locate libxml2 
     6810 
     6811If you installed libxml2 into a non-standard directory, please run: 
     6812 
     6813    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&2;} 
     6814   { (exit 1); exit 1; }; } 
     6815 
     6816 
     6817fi 
     6818 
     6819done 
     6820 
    65146821 
    65156822fi 
  • libwired/trunk/configure.in

    r4541 r4578  
    8484 
    8585 
     86# Check for P7 support 
     87AC_ARG_ENABLE([p7], AC_HELP_STRING([--enable-p7], [enable experimental P7 support])) 
     88 
     89if test -n "$enable_p7"; then 
     90        CFLAGS="$CFLAGS -DWI_P7" 
     91fi 
     92 
     93 
    8694# Check for object directory name 
    8795AC_ARG_WITH([objdir]) 
     
    146154if test -n "$enable_iconv"; then 
    147155        WI_INCLUDE_ICONV_LIBRARY 
     156fi 
     157 
     158if test -n "$enable_p7"; then 
     159        WI_INCLUDE_LIBXML2_LIBRARY 
    148160fi 
    149161 
  • libwired/trunk/libwired/data/wi-string.c

    r4575 r4578  
    220220 
    221221 
     222wi_string_t * wi_string_with_bytes(const char *buffer, size_t size) { 
     223        return wi_autorelease(wi_string_init_with_bytes(wi_string_alloc(), buffer, size)); 
     224} 
     225 
     226 
     227 
    222228#pragma mark - 
    223229 
     
    304310         
    305311        _wi_string_append_arguments(string, wi_string_cstring(fmt), ap); 
     312         
     313        return string; 
     314} 
     315 
     316 
     317 
     318wi_string_t * wi_string_init_with_base64(wi_string_t *string, wi_string_t *base64) { 
     319        wi_data_t               *data; 
     320         
     321        data = wi_data_init_with_base64(wi_data_alloc(), base64); 
     322        string = wi_string_init_with_bytes(string, wi_data_bytes(data), wi_data_length(data)); 
     323        wi_release(data); 
    306324         
    307325        return string; 
  • libwired/trunk/libwired/data/wi-string.h

    r4557 r4578  
    5656WI_EXPORT wi_string_t *                                         wi_string_with_cstring(const char *); 
    5757WI_EXPORT wi_string_t *                                         wi_string_with_format(wi_string_t *, ...); 
     58WI_EXPORT wi_string_t *                                         wi_string_with_bytes(const char *, size_t); 
    5859 
    5960WI_EXPORT wi_string_t *                                         wi_string_alloc(void);