diff --git a/src/Makefile.in b/src/Makefile.in index a2e2c49..0cf458f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,10 +1,6 @@ CC=@CC@ -SWIG=@SWIG@ -PYDEV=@PYDEV@ -PYLIB=@PYLIB@ SONAME=@SONAME@ FRAMEWORK=@FRAMEWORK@ -BUILD=@BUILD@ LDFLAGS=@LDFLAGS@ CFLAGS=@CFLAGS@ LIBFTDI1=@LIBFTDI1@ @@ -12,17 +8,17 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ LIBDIR=@libdir@ INCDIR=@includedir@ -INC=-I$(PYDEV) TARGET=mpsse -all: $(TARGET) py$(BUILD)-build +.PHONY: examples install uninstall clean distclean + +all: $(TARGET) $(TARGET): mpsse.o fast.o - $(CC) $(CFLAGS) -shared -Wl,$(SONAME),lib$(TARGET).so $(TARGET).o fast.o support.o \ - -o lib$(TARGET).so $(LDFLAGS) - ar rcs lib$(TARGET).a $(TARGET).o fast.o support.o + $(CC) $(CFLAGS) -shared -Wl,$(SONAME),lib$(TARGET).so *.o -o lib$(TARGET).so $(LDFLAGS) + ar rcs lib$(TARGET).a *.o -example-code: +examples: make -C examples mpsse.o: support.o @@ -34,30 +30,7 @@ fast.o: support.o support.o: $(CC) $(CFLAGS) $(LDFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c support.c -pyswig-build: - $(CC) $(CFLAGS) $(LDFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c support.c - $(CC) $(CFLAGS) $(LDFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c - $(SWIG) -python $(TARGET).i - $(CC) $(CFLAGS) -c -DLIBFTDI1=$(LIBFTDI1) $(TARGET)_wrap.c $(INC) - $(CC) $(CFLAGS) -shared $(FRAMEWORK) $(TARGET)_wrap.o mpsse.o support.o \ - -o _pylib$(TARGET).so $(LDFLAGS) $(INC) - -pyswig-install: - install -D -m644 pylib$(TARGET).py $(DESTDIR)/$(PYLIB)/pylib$(TARGET).py - install -D -m644 _pylib$(TARGET).so $(DESTDIR)/$(PYLIB)/_pylib$(TARGET).so - install -D -m644 $(TARGET).py $(DESTDIR)/$(PYLIB)/$(TARGET).py - -pyswig-uninstall: - rm -f $(DESTDIR)/$(PYLIB)/$(TARGET).* \ - $(DESTDIR)/$(PYLIB)/pylib$(TARGET).* \ - $(DESTDIR)/$(PYLIB)/_pylib$(TARGET).* - -# Dummy rules for when $BUILD == "" (if --disable-python was passed to ./configure) -py-build: -py-install: -py-uninstall: - -install: py$(BUILD)-install +install: install -D -m644 lib$(TARGET).so $(DESTDIR)/$(LIBDIR)/lib$(TARGET).so install -D -m644 lib$(TARGET).a $(DESTDIR)/$(LIBDIR)/lib$(TARGET).a install -D -m644 $(TARGET).h $(DESTDIR)/$(INCDIR)/$(TARGET).h @@ -69,7 +42,7 @@ uninstall: py$(BUILD)-uninstall clean: make -C examples clean - rm -rf *.o *.so *.a _$(TARGET).py* pylib$(TARGET).py* $(TARGET)_wrap.c *.pyc + rm -rf *.o *.so *.a distclean: clean rm -rf *.cache config.* Makefile diff --git a/src/configure b/src/configure index 7d49e2e..ab5cc7b 100755 --- a/src/configure +++ b/src/configure @@ -1,13 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for libmpsse 1.3. +# Generated by GNU Autoconf 2.68 for libmpsse 1.3. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -91,6 +91,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -216,11 +217,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -319,7 +327,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -359,19 +367,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -533,7 +541,7 @@ test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -598,10 +606,6 @@ ac_subst_vars='LTLIBOBJS LIBFTDI1 FRAMEWORK SONAME -PYLIB -PYDEV -SWIG -BUILD LIBOBJS EGREP GREP @@ -654,7 +658,6 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_python ' ac_precious_vars='build_alias host_alias @@ -727,8 +730,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -773,7 +777,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -799,7 +803,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1003,7 +1007,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1019,7 +1023,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1049,8 +1053,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1058,7 +1062,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1068,7 +1072,7 @@ Try \`$0 --help' for more information." $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1076,13 +1080,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1105,7 +1109,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1119,8 +1123,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1135,9 +1139,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1176,11 +1180,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1220,7 +1224,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1271,12 +1275,6 @@ if test -n "$ac_init_help"; then esac cat <<\_ACEOF -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-python Do not build Python wrappers - Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -1354,9 +1352,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libmpsse configure 1.3 -generated by GNU Autoconf 2.65 +generated by GNU Autoconf 2.68 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1400,7 +1398,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1414,7 +1412,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1455,7 +1453,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -1480,7 +1478,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1491,7 +1489,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1533,7 +1531,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1547,7 +1545,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1565,7 +1563,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1577,10 +1575,10 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1616,7 +1614,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1639,17 +1637,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## --------------------------------------------- ## +( $as_echo "## --------------------------------------------- ## ## Report this to http://libmpsse.googlecode.com ## -## --------------------------------------------- ## -_ASBOX +## --------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1658,7 +1654,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1703,7 +1699,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1712,7 +1708,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libmpsse $as_me 1.3, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -1822,11 +1818,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1860,11 +1854,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1877,11 +1869,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -1895,11 +1885,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -1954,7 +1942,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -1969,7 +1962,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2045,7 +2042,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2059,17 +2056,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Check whether --enable-python was given. -if test "${enable_python+set}" = set; then : - enableval=$enable_python; -fi - -if test "x$enable_python" != "xno"; then : - BUILD="swig" -else - BUILD="" -fi - ac_ext=c @@ -2082,7 +2068,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2122,7 +2108,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2175,7 +2161,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2215,7 +2201,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2274,7 +2260,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2318,7 +2304,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2372,8 +2358,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -2487,9 +2473,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -2531,8 +2516,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -2589,9 +2574,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -2602,7 +2587,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2642,8 +2627,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -2653,7 +2638,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2690,7 +2675,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -2768,7 +2753,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -2883,7 +2868,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -2913,7 +2898,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -2929,11 +2914,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -2972,7 +2957,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -2988,18 +2973,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3011,7 +2996,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3060,7 +3045,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -3074,7 +3059,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3126,7 +3111,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -3141,7 +3126,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3258,8 +3243,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -3270,7 +3254,7 @@ done ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : +if test "x$ac_cv_type_size_t" = xyes; then : else @@ -3283,7 +3267,7 @@ fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : +if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF @@ -3294,7 +3278,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : +if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -3353,7 +3337,7 @@ CFLAGS="-Wall -fPIC -fno-strict-aliasing $CFLAGS" for ac_header in libftdi1/ftdi.h do : ac_fn_c_check_header_mongrel "$LINENO" "libftdi1/ftdi.h" "ac_cv_header_libftdi1_ftdi_h" "$ac_includes_default" -if test "x$ac_cv_header_libftdi1_ftdi_h" = x""yes; then : +if test "x$ac_cv_header_libftdi1_ftdi_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFTDI1_FTDI_H 1 _ACEOF @@ -3370,7 +3354,7 @@ then for ac_header in ftdi.h do : ac_fn_c_check_header_mongrel "$LINENO" "ftdi.h" "ac_cv_header_ftdi_h" "$ac_includes_default" -if test "x$ac_cv_header_ftdi_h" = x""yes; then : +if test "x$ac_cv_header_ftdi_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FTDI_H 1 _ACEOF @@ -3383,7 +3367,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftdi_init in -lftdi" >&5 $as_echo_n "checking for ftdi_init in -lftdi... " >&6; } -if test "${ac_cv_lib_ftdi_ftdi_init+set}" = set; then : +if ${ac_cv_lib_ftdi_ftdi_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3417,7 +3401,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ftdi_ftdi_init" >&5 $as_echo "$ac_cv_lib_ftdi_ftdi_init" >&6; } -if test "x$ac_cv_lib_ftdi_ftdi_init" = x""yes; then : +if test "x$ac_cv_lib_ftdi_ftdi_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFTDI 1 _ACEOF @@ -3432,7 +3416,7 @@ fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftdi_init in -lftdi1" >&5 $as_echo_n "checking for ftdi_init in -lftdi1... " >&6; } -if test "${ac_cv_lib_ftdi1_ftdi_init+set}" = set; then : +if ${ac_cv_lib_ftdi1_ftdi_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3466,7 +3450,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ftdi1_ftdi_init" >&5 $as_echo "$ac_cv_lib_ftdi1_ftdi_init" >&6; } -if test "x$ac_cv_lib_ftdi1_ftdi_init" = x""yes; then : +if test "x$ac_cv_lib_ftdi1_ftdi_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFTDI1 1 _ACEOF @@ -3480,56 +3464,6 @@ fi LDFLAGS="-lftdi1 $LDFLAGS" fi -if test $BUILD -then - if ! test $SWIG - then - SWIG="$(which swig)" - fi - - if ! test $SWIG - then - echo "error: could not locate swig" - exit 1 - fi - - if ! test $PYDEV - then - PYDEV="/usr/include/python$(python -V 2>&1 | awk '{print $2}' | cut -d'.' -f1,2)" - fi - - for ac_header in $PYDEV/Python.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - echo "error: missing python header files" && exit 1 -fi - -done - - - if ! test $PYLIB - then - echo "import sys" > pylib.py - echo "for path in sys.path: print path" >> pylib.py - PYLIB="$(python pylib.py | grep -e '-packages$' | head -1)" - rm -f pylib.py - fi - - if ! test -d $PYLIB - then - echo "error: could not locate python library path" - exit 1 - fi -fi - if test "$(uname)" == "Darwin" then SONAME="-install_name" @@ -3541,14 +3475,6 @@ fi cp confdefs.h config.h -BUILD=$BUILD - -SWIG=$SWIG - -PYDEV=$PYDEV - -PYLIB=$PYLIB - SONAME=$SONAME FRAMEWORK=$FRAMEWORK @@ -3621,10 +3547,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -3676,6 +3613,7 @@ DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -3691,7 +3629,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -3792,6 +3730,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3837,19 +3776,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -4045,7 +3984,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -4099,7 +4038,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by libmpsse $as_me 1.3, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4152,10 +4091,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libmpsse config.status 1.3 -configured by $0, generated by GNU Autoconf 2.65, +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4170,11 +4109,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -4196,6 +4140,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -4206,7 +4151,7 @@ do ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -4257,7 +4202,7 @@ do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -4278,9 +4223,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -4288,12 +4234,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -4310,12 +4257,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -4324,18 +4271,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -4343,7 +4290,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -4391,7 +4338,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -4423,21 +4370,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -4455,7 +4410,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -4474,7 +4429,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -4483,7 +4438,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -4509,8 +4464,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -4635,23 +4590,24 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -4666,7 +4622,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -4687,7 +4643,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/src/configure.ac b/src/configure.ac index 7c3130a..8ca30f0 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1,9 +1,6 @@ AC_PREREQ([2.65]) AC_INIT([libmpsse],[1.3],[http://libmpsse.googlecode.com]) -AC_ARG_ENABLE([python],AS_HELP_STRING([--disable-python], [Do not build Python wrappers])) -AS_IF([test "x$enable_python" != "xno"], [BUILD="swig"], [BUILD=""]) - AC_CONFIG_SRCDIR([mpsse.c]) AC_PROG_CC @@ -29,42 +26,6 @@ else LDFLAGS="-lftdi1 $LDFLAGS" fi -if test $BUILD -then - if ! test $SWIG - then - SWIG="$(which swig)" - fi - - if ! test $SWIG - then - echo "error: could not locate swig" - exit 1 - fi - - if ! test $PYDEV - then - PYDEV="/usr/include/python$(python -V 2>&1 | awk '{print $2}' | cut -d'.' -f1,2)" - fi - - AC_CHECK_HEADERS([$PYDEV/Python.h],[],[echo "error: missing python header files" && exit 1]) - - if ! test $PYLIB - then - dnl This is a hack to get a valid python library path - echo "import sys" > pylib.py - echo "for path in sys.path: print path" >> pylib.py - PYLIB="$(python pylib.py | grep -e '-packages$' | head -1)" - rm -f pylib.py - fi - - if ! test -d $PYLIB - then - echo "error: could not locate python library path" - exit 1 - fi -fi - dnl OSX specific compiler flags if test "$(uname)" == "Darwin" then @@ -77,10 +38,6 @@ fi cp confdefs.h config.h -AC_SUBST(BUILD, $BUILD) -AC_SUBST(SWIG, $SWIG) -AC_SUBST(PYDEV, $PYDEV) -AC_SUBST(PYLIB, $PYLIB) AC_SUBST(SONAME, $SONAME) AC_SUBST(FRAMEWORK, $FRAMEWORK) AC_SUBST(LIBFTDI1, $LIBFTDI1) diff --git a/src/mpsse.i b/src/mpsse.i deleted file mode 100644 index 976a583..0000000 --- a/src/mpsse.i +++ /dev/null @@ -1,24 +0,0 @@ -%module pylibmpsse -%{ -#include "mpsse.h" -%} - -%typemap(in) (char *data, int size) -{ - if(!PyString_Check($input)) - { - PyErr_SetString(PyExc_ValueError, "String value required"); - return NULL; - } - - $1 = PyString_AsString($input); - $2 = PyString_Size($input); -} - -%typemap(out) swig_string_data -{ - $result = PyString_FromStringAndSize($1.data, $1.size); - free($1.data); -} - -%include "mpsse.h" diff --git a/src/mpsse.py b/src/python/mpsse.py similarity index 69% rename from src/mpsse.py rename to src/python/mpsse.py index bc67f8b..9c13369 100644 --- a/src/mpsse.py +++ b/src/python/mpsse.py @@ -1,57 +1,64 @@ -import pylibmpsse as _mpsse - -MPSSE_OK = _mpsse.MPSSE_OK -MPSSE_FAIL = _mpsse.MPSSE_FAIL +import os +import sys +import glob +import ctypes +import ctypes.util + +MPSSE_OK = 0 +MPSSE_FAIL = -1 -MSB = _mpsse.MSB -LSB = _mpsse.LSB - -ACK = _mpsse.ACK -NACK = _mpsse.NACK - -SPI0 = _mpsse.SPI0 -SPI1 = _mpsse.SPI1 -SPI2 = _mpsse.SPI2 -SPI3 = _mpsse.SPI3 -I2C = _mpsse.I2C -GPIO = _mpsse.GPIO -BITBANG = _mpsse.BITBANG - -GPIOL0 = _mpsse.GPIOL0 -GPIOL1 = _mpsse.GPIOL1 -GPIOL2 = _mpsse.GPIOL2 -GPIOL3 = _mpsse.GPIOL3 -GPIOH0 = _mpsse.GPIOH0 -GPIOH1 = _mpsse.GPIOH1 -GPIOH2 = _mpsse.GPIOH2 -GPIOH3 = _mpsse.GPIOH3 -GPIOH4 = _mpsse.GPIOH4 -GPIOH5 = _mpsse.GPIOH5 -GPIOH6 = _mpsse.GPIOH6 -GPIOH7 = _mpsse.GPIOH7 - -IFACE_ANY = _mpsse.IFACE_ANY -IFACE_A = _mpsse.IFACE_A -IFACE_B = _mpsse.IFACE_B -IFACE_C = _mpsse.IFACE_C -IFACE_D = _mpsse.IFACE_D - -ONE_HUNDRED_KHZ = _mpsse.ONE_HUNDRED_KHZ -FOUR_HUNDRED_KHZ = _mpsse.FOUR_HUNDRED_KHZ -ONE_MHZ = _mpsse.ONE_MHZ -TWO_MHZ = _mpsse.TWO_MHZ -FIVE_MHZ = _mpsse.FIVE_MHZ -SIX_MHZ = _mpsse.SIX_MHZ -TEN_MHZ = _mpsse.TEN_MHZ -TWELVE_MHZ = _mpsse.TWELVE_MHZ -FIFTEEN_MHZ = _mpsse.FIFTEEN_MHZ -THIRTY_MHZ = _mpsse.THIRTY_MHZ +MSB = 0x00 +LSB = 0x08 + +ACK = 0 +NACK = 1 + +SPI0 = 1 +SPI1 = 2 +SPI2 = 3 +SPI3 = 4 +I2C = 5 +GPIO = 6 +BITBANG = 7 + +GPIOL0 = 0 +GPIOL1 = 1 +GPIOL2 = 2 +GPIOL3 = 3 +GPIOH0 = 4 +GPIOH1 = 5 +GPIOH2 = 6 +GPIOH3 = 7 +GPIOH4 = 8 +GPIOH5 = 9 +GPIOH6 = 10 +GPIOH7 = 11 + +IFACE_ANY = 0 +IFACE_A = 1 +IFACE_B = 2 +IFACE_C = 3 +IFACE_D = 4 + +ONE_HUNDRED_KHZ = 100000, +FOUR_HUNDRED_KHZ = 400000 +ONE_MHZ = 1000000 +TWO_MHZ = 2000000 +FIVE_MHZ = 5000000 +SIX_MHZ = 6000000 +TEN_MHZ = 10000000 +TWELVE_MHZ = 12000000 +FIFTEEN_MHZ = 15000000 +THIRTY_MHZ = 30000000 +SIXTY_MHZ = 60000000 class MPSSE(object): """ Python class wrapper for libmpsse. """ + LIBRARY = 'mpsse' + def __init__(self, mode=None, frequency=ONE_HUNDRED_KHZ, endianess=MSB): """ Class constructor. @@ -64,8 +71,12 @@ def __init__(self, mode=None, frequency=ONE_HUNDRED_KHZ, endianess=MSB): Returns None. """ self.context = None - if mode is not None: - self.context = _mpsse.MPSSE(mode, frequency, endianess) + self.libmpsse = self._load_library(self.LIBRARY) + if not self.libmpsse: + raise Exception("Failed to load library 'lib$s'" % self.LIBRARY) + + if mode is not None: + self.context = self.libmpsse.MPSSE(mode, frequency, endianess) if self.context.open == 0: raise Exception, self.ErrorString() @@ -80,6 +91,43 @@ def __del__(self): if self.context: self.Close() + def _load_library(self, library): + ''' + Locates and loads the specified library. + + @library - Library name (e.g., 'magic' for libmagic). + + Returns a handle to the library. + ''' + lib_path = None + system_paths = { + 'linux' : ['/usr/local/lib/lib%s.so' % library], + 'linux2' : ['/usr/local/lib/lib%s.so' % library], + 'linux3' : ['/usr/local/lib/lib%s.so' % library], + 'darwin' : ['/opt/local/lib/lib%s.dylib' % library, + '/usr/local/lib/lib%s.dylib' % library, + ] + glob.glob('/usr/local/Cellar/lib%s/*/lib/lib%s.dylib' % (library, library)), + + 'win32' : ['%s.dll' % library] + } + + try: + lib = ctypes.cdll.LoadLibrary(ctypes.util.find_library(library)) + if lib: + return lib + except OSError: + pass + + for path in system_paths[sys.platform]: + if os.path.exists(path): + lib_path = path + break + + if not lib_path: + raise Exception("Failed to locate library '%s'" % library) + + return ctypes.cdll.LoadLibrary(lib_path) + def Open(self, vid, pid, mode, frequency=ONE_HUNDRED_KHZ, endianess=MSB, interface=IFACE_A, description=None, serial=None, index=0): """ Opens the specified FTDI device. @@ -98,7 +146,7 @@ def Open(self, vid, pid, mode, frequency=ONE_HUNDRED_KHZ, endianess=MSB, interfa Returns MPSSE_OK on success. Raises an exeption on failure. """ - self.context = _mpsse.OpenIndex(vid, pid, mode, frequency, endianess, interface, description, serial, index) + self.context = self.libmpsse.OpenIndex(vid, pid, mode, frequency, endianess, interface, description, serial, index) if self.context.open == 0: raise Exception, self.ErrorString() return MPSSE_OK @@ -109,14 +157,14 @@ def Close(self): Returns None. """ - retval = _mpsse.Close(self.context) + retval = self.libmpsse.Close(self.context) self.context = None def ErrorString(self): """ Returns the last libftdi error string. """ - return _mpsse.ErrorString(self.context) + return self.libmpsse.ErrorString(self.context) def SetMode(self, mode, endianess): """ @@ -129,7 +177,7 @@ def SetMode(self, mode, endianess): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.SetMode(self.context, mode, endianess) == MPSSE_FAIL: + if self.libmpsse.SetMode(self.context, mode, endianess) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -142,7 +190,7 @@ def EnableBitmode(self, tf): Returns None. """ - _mpsse.EnableBitmode(self.context, tf) + self.libmpsse.EnableBitmode(self.context, tf) def FlushAfterRead(self, tf): """ @@ -152,7 +200,7 @@ def FlushAfterRead(self, tf): Returns None. """ - return _mpsse.FlushAfterRead(self.context, tf) + return self.libmpsse.FlushAfterRead(self.context, tf) def SetClock(self, frequency): """ @@ -164,7 +212,7 @@ def SetClock(self, frequency): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.SetClock(self.context, frequency) == MPSSE_FAIL: + if self.libmpsse.SetClock(self.context, frequency) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -172,26 +220,26 @@ def GetClock(self): """ Returns the currently configured clock rate, in hertz. """ - return _mpsse.GetClock(self.context) + return self.libmpsse.GetClock(self.context) def GetVid(self): """ Returns the vendor ID of the FTDI chip. """ - return _mpsse.GetVid(self.context) + return self.libmpsse.GetVid(self.context) def GetPid(self): """ Returns the product ID of the FTDI chip. """ - return _mpsse.GetPid(self.context) + return self.libmpsse.GetPid(self.context) def GetDescription(self): """ Returns the description of the FTDI chip, if any. This will only be populated if __init__ was used to open the device. """ - return _mpsse.GetDescription(self.context) + return self.libmpsse.GetDescription(self.context) def SetLoopback(self, enable): """ @@ -202,7 +250,7 @@ def SetLoopback(self, enable): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.SetLoopback(self.context, enable) == MPSSE_FAIL: + if self.libmpsse.SetLoopback(self.context, enable) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -214,7 +262,7 @@ def SetCSIdle(self, idle): Returns None. """ - _mpsse.SetCSIdle(self.context, idle) + self.libmpsse.SetCSIdle(self.context, idle) def Start(self): """ @@ -223,7 +271,7 @@ def Start(self): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.Start(self.context) == MPSSE_FAIL: + if self.libmpsse.Start(self.context) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -234,7 +282,7 @@ def Stop(self): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.Stop(self.context) == MPSSE_FAIL: + if self.libmpsse.Stop(self.context) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -247,7 +295,7 @@ def Write(self, data): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.Write(self.context, data) == MPSSE_FAIL: + if self.libmpsse.Write(self.context, data) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -259,7 +307,7 @@ def Read(self, size): Returns a string of size bytes. """ - return _mpsse.Read(self.context, size) + return self.libmpsse.Read(self.context, size) def Transfer(self, data): """ @@ -270,7 +318,7 @@ def Transfer(self, data): Returns a string of len(data) bytes. """ - return _mpsse.Transfer(self.context, data) + return self.libmpsse.Transfer(self.context, data) def SetAck(self, ack): """ @@ -281,7 +329,7 @@ def SetAck(self, ack): Returns None. """ - _mpsse.SetAck(self.context, ack) + self.libmpsse.SetAck(self.context, ack) def SendAcks(self): """ @@ -289,7 +337,7 @@ def SendAcks(self): Returns None. """ - _mpsse.SendAcks(self.context) + self.libmpsse.SendAcks(self.context) def SendNacks(self): """ @@ -297,7 +345,7 @@ def SendNacks(self): Returns None. """ - return _mpsse.SendNacks(self.context) + return self.libmpsse.SendNacks(self.context) def GetAck(self): """ @@ -305,7 +353,7 @@ def GetAck(self): Returns one of: ACK, NACK. """ - return _mpsse.GetAck(self.context) + return self.libmpsse.GetAck(self.context) def PinHigh(self, pin): """ @@ -317,7 +365,7 @@ def PinHigh(self, pin): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.PinHigh(self.context, pin) == MPSSE_FAIL: + if self.libmpsse.PinHigh(self.context, pin) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -331,7 +379,7 @@ def PinLow(self, pin): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.PinLow(self.context, pin) == MPSSE_FAIL: + if self.libmpsse.PinLow(self.context, pin) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -345,7 +393,7 @@ def SetDirection(self, direction): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.SetDirection(self.context, direction) == MPSSE_FAIL: + if self.libmpsse.SetDirection(self.context, direction) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -359,7 +407,7 @@ def WriteBits(self, bits, n): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.WriteBits(self.context, bits, n) == MPSSE_FAIL: + if self.libmpsse.WriteBits(self.context, bits, n) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -371,7 +419,7 @@ def ReadBits(self, n): Returns an integer value with the read bits set. """ - return ord(_mpsse.ReadBits(self.context, n)) + return ord(self.libmpsse.ReadBits(self.context, n)) def WritePins(self, data): """ @@ -383,7 +431,7 @@ def WritePins(self, data): Returns MPSSE_OK on success. Raises an exception on failure. """ - if _mpsse.WritePins(self.context, data) == MPSSE_FAIL: + if self.libmpsse.WritePins(self.context, data) == MPSSE_FAIL: raise Exception, self.ErrorString() return MPSSE_OK @@ -394,7 +442,7 @@ def ReadPins(self): Returns an integer with the corresponding pin's bits set. """ - return _mpsse.ReadPins(self.context) + return self.libmpsse.ReadPins(self.context) def PinState(self, pin, state=-1): """ @@ -406,17 +454,17 @@ def PinState(self, pin, state=-1): Returns a 1 if the pin is high, 0 if the pin is low. """ - return _mpsse.PinState(self.context, pin, state) + return self.libmpsse.PinState(self.context, pin, state) def Tristate(self): """ Puts all I/O pins into a tristate mode (FT232H only). """ - return _mpsse.Tristate(self.context) + return self.libmpsse.Tristate(self.context) def Version(self): """ Returns the libmpsse version number. High nibble is major, low nibble is minor. """ - return _mpsse.Version() + return self.libmpsse.Version()