compile "obexfs-0.11" under FreeBSD

Help
2007-07-12
2013-05-01
  • Hello!

    Whether probably to compile the "obexfs-0.11" under FreeBSD width "fusefs-libs-2.7.0"?

    ====================================================================
    $ pkg_info -E fusefs\* obex\* ; uname -rsm ; obexftp -V
    fusefs-kmod-0.3.0_5
    fusefs-libs-2.7.0
    fusefs-ntfs-1.417_2
    obexapp-1.4.7
    FreeBSD 6.2-STABLE i386
    ObexFTP 0.22 (rc6)

    $ ls  -1 /usr/local/include/fuse.h /usr/local/include/fuse/ /usr/local/include/obexftp/
    /usr/local/include/fuse.h

    /usr/local/include/fuse/:
    ./
    ../
    fuse.h
    fuse_common.h
    fuse_common_compat.h
    fuse_compat.h
    fuse_kernel.h
    fuse_lowlevel.h
    fuse_lowlevel_compat.h
    fuse_opt.h

    /usr/local/include/obexftp/:
    ./
    ../
    client.h
    obexftp.h
    object.h
    uuid.h

    $ CPPFLAGS="-I/usr/local/include/fuse -I/usr/local/include -I/usr/local/include/obexftp" \ LDFLAGS="-L/usr/local/lib" ; ./configure
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    /SHARED/external/obexfs-0.11/missing: Unknown `--run' option
    Try `/SHARED/external/obexfs-0.11/missing --help' for more information
    configure: WARNING: `missing' script is too old or missing
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for gcc... gcc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    checking for ranlib... ranlib
    checking for a BSD-compatible install... /usr/bin/install -c
    checking for pkg-config... /usr/local/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for OPENOBEX... yes
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating fuse/Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands

    $ gmake
    gmake  all-recursive
    gmake[1]: Entering directory `/SHARED/external/obexfs-0.11'
    Making all in fuse
    gmake[2]: Entering directory `/SHARED/external/obexfs-0.11/fuse'
    if gcc -DHAVE_CONFIG_H -I. -I. -I..     -Wall -W -Wmissing-declarations -Wmissing-prototypes -O2 -D_FILE_OFFSET_BITS=64 -MT obexfs.o -MD -MP -MF ".deps/obexfs.Tpo" \           -c -o obexfs.o `test -f 'obexfs.c' || echo './'`obexfs.c; \         then mv -f ".deps/obexfs.Tpo" ".deps/obexfs.Po"; \         else rm -f ".deps/obexfs.Tpo"; exit 1; \         fi
    obexfs.c:28:18: fuse.h: No such file or directory
    obexfs.c:38:24: sys/statfs.h: No such file or directory
    obexfs.c:44:29: obexftp/obexftp.h: No such file or directory
    obexfs.c:45:28: obexftp/client.h: No such file or directory
    obexfs.c:46:26: obexftp/uuid.h: No such file or directory
    obexfs.c:66: error: syntax error before '*' token
    obexfs.c:66: warning: type defaults to `int' in declaration of `cli'
    obexfs.c:66: warning: data definition has no type or storage class
    <...>skip<...>
    ====================================================================

     
    • Looks good. You don't need to give the obexftp or fuse sub directory though. Also use CFLAGS instead of CPPFLAGS and remove the semicolon:

      CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure

      On the other hand this should be the default if /usr/local is your prefix...

       
    • Ok, there was a bug with 0.22-rc6, try obexfs-0.11-rc2. Switched fuse to pkg-config, too.

       
    • Thanks your. But problems still are available...

      ======================================
      $ tar -xzf obexfs-0.11-rc2.tar.gz

      $ cd obexfs-0.11

      $ CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure
      checking for a BSD-compatible install... /usr/bin/install -c
      checking whether build environment is sane... yes
      /SHARED/external/OBEX/obexfs-0.11/missing: Unknown `--run' option
      Try `/SHARED/external/OBEX/obexfs-0.11/missing --help' for more information
      configure: WARNING: `missing' script is too old or missing
      checking for gawk... gawk
      checking whether make sets $(MAKE)... yes
      checking for gcc... gcc
      checking for C compiler default output file name... a.out
      checking whether the C compiler works... yes
      checking whether we are cross compiling... no
      checking for suffix of executables...
      checking for suffix of object files... o
      checking whether we are using the GNU C compiler... yes
      checking whether gcc accepts -g... yes
      checking for gcc option to accept ISO C89... none needed
      checking for style of include used by make... GNU
      checking dependency style of gcc... gcc3
      checking for ranlib... ranlib
      checking for a BSD-compatible install... /usr/bin/install -c
      checking for pkg-config... /usr/local/bin/pkg-config
      checking pkg-config is at least version 0.9.0... yes
      checking for FUSE... yes
      checking for OPENOBEX... yes
      checking for obexftp_open in -lobexftp... yes
      checking for obexftp_browse_bt_src in -lobexftp... yes
      configure: creating ./config.status
      config.status: creating Makefile
      config.status: creating fuse/Makefile
      config.status: creating config.h
      config.status: executing depfiles commands

      $ gmake
      gmake  all-recursive
      gmake[1]: Entering directory `/SHARED/external/OBEX/obexfs-0.11'
      Making all in fuse
      gmake[2]: Entering directory `/SHARED/external/OBEX/obexfs-0.11/fuse'
      if gcc -DHAVE_CONFIG_H -I. -I. -I..    -Wall -W -Wmissing-declarations -Wmissing-prototypes -O2 -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse   -I/usr/local/include -MT obexfs.o -MD -MP -MF ".deps/obexfs.Tpo" \           -c -o obexfs.o `test -f 'obexfs.c' || echo './'`obexfs.c; \         then mv -f ".deps/obexfs.Tpo" ".deps/obexfs.Po"; \         else rm -f ".deps/obexfs.Tpo"; exit 1; \         fi
      In file included from /usr/local/include/fuse/fuse.h:23,
                       from obexfs.c:28:
      /usr/local/include/fuse/fuse_common.h:210:14: #error On FreeBSD API version 25 or greater must be used
      obexfs.c:38:24: sys/statfs.h: No such file or directory
      obexfs.c:469: error: variable `ofs_oper' has initializer but incomplete type
      obexfs.c:470: error: unknown field `getattr' specified in initializer
      <...>skip<...>
      =================================================================

      I have looked an example of patches in FreeBSD-ports at other programs. (I am not assured, that I did it correctly). But I have changed some lines in files:
      /fuse/obexfs.c & ./fuse/obexautofs.c

      =================================================================
      $ diff  ./fuse/obexfs.c.orig ./fuse/obexfs.c
      27c27
      < #define FUSE_USE_VERSION 22
      ---
      > #define FUSE_USE_VERSION 25
      38c38
      < #include <sys/statfs.h>
      ---
      > //#include <sys/statfs.h>

      $ gmake
      gmake  all-recursive
      gmake[1]: Entering directory `/SHARED/external/OBEX/obexfs-0.11'
      Making all in fuse
      gmake[2]: Entering directory `/SHARED/external/OBEX/obexfs-0.11/fuse'
      if gcc -DHAVE_CONFIG_H -I. -I. -I..    -Wall -W -Wmissing-declarations -Wmissing-prototypes -O2 -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse   -I/usr/local/include -MT obexfs.o -MD -MP -MF ".deps/obexfs.Tpo" \           -c -o obexfs.o `test -f 'obexfs.c' || echo './'`obexfs.c; \         then mv -f ".deps/obexfs.Tpo" ".deps/obexfs.Po"; \         else rm -f ".deps/obexfs.Tpo"; exit 1; \         fi
      obexfs.c: In function `ofs_read':
      obexfs.c:337: warning: cast to pointer from integer of different size
      obexfs.c: In function `ofs_write':
      obexfs.c:365: warning: cast to pointer from integer of different size
      obexfs.c: In function `ofs_release':
      obexfs.c:396: warning: cast to pointer from integer of different size
      gcc -Wall -W -Wmissing-declarations -Wmissing-prototypes -O2 -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse   -I/usr/local/include  -L/usr/local/lib -o obexfs  obexfs.o -pthread /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib -lfuse -lobexftp -lmulticobex -lbfb -L/usr/local/lib -lopenobex -lbluetooth -lobexftp -lobexftp
      if gcc -DHAVE_CONFIG_H -I. -I. -I..    -Wall -W -Wmissing-declarations -Wmissing-prototypes -O2 -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse   -I/usr/local/include -MT obexautofs.o -MD -MP -MF ".deps/obexautofs.Tpo" \           -c -o obexautofs.o `test -f 'obexautofs.c' || echo './'`obexautofs.c; \         then mv -f ".deps/obexautofs.Tpo" ".deps/obexautofs.Po"; \         else rm -f ".deps/obexautofs.Tpo"; exit 1; \         fi
      obexautofs.c:49:33: bluetooth/bluetooth.h: No such file or directory
      obexautofs.c:50:27: bluetooth/hci.h: No such file or directory
      obexautofs.c:51:31: bluetooth/hci_lib.h: No such file or directory
      obexautofs.c:53:27: bluetooth/sdp.h: No such file or directory
      obexautofs.c:54:31: bluetooth/sdp_lib.h: No such file or directory
      obexautofs.c: In function `discover_bt':
      obexautofs.c:141: error: `inquiry_info' undeclared (first use in this function)
      obexautofs.c:141: error: (Each undeclared identifier is reported only once
      obexautofs.c:141: error: for each function it appears in.)
      obexautofs.c:141: error: `info' undeclared (first use in this function)
      obexautofs.c:152: warning: implicit declaration of function `hci_inquiry'
      obexautofs.c:159: warning: implicit declaration of function `hci_open_dev'
      obexautofs.c:168: warning: implicit declaration of function `baswap'
      obexautofs.c:169: warning: implicit declaration of function `batostr'
      obexautofs.c:169: warning: assignment makes pointer from integer without a cast
      obexautofs.c:171: warning: implicit declaration of function `hci_read_remote_name'
      obexautofs.c: In function `ofs_read':
      obexautofs.c:635: warning: cast to pointer from integer of different size
      obexautofs.c: In function `ofs_write':
      obexautofs.c:667: warning: cast to pointer from integer of different size
      obexautofs.c: In function `ofs_release':
      obexautofs.c:700: warning: cast to pointer from integer of different size
      gmake[2]: *** [obexautofs.o] Ошибка 1
      gmake[2]: Leaving directory `/SHARED/external/OBEX/obexfs-0.11/fuse'
      gmake[1]: *** [all-recursive] Ошибка 1
      gmake[1]: Leaving directory `/SHARED/external/OBEX/obexfs-0.11'
      gmake: *** [all] Ошибка 2
      =================================================================

      I have found an example of a patch in FreeBSD-ports(openobex), for the decision of it. But I not the programmer, and for me it am difficult.

      Probably, that the necessary patches for "bluetooth" are here:
      http://www.freebsd.org/cgi/cvsweb.cgi/ports/comms/openobex/files/

      P.S.
      I am sorry for my English. I am compelled to use the electronic translator

       
    • obexautofs uses Bluez HCI library calls. This needs to be rewritten to netgraph for FreeBsd. Quick fix options:

      1) remove obexautofs from fuse/Makefile.am ; autoreconf ; ./configure ; make
      or
      2) remove all #include bluetooth... lines and the body of discover_bt() from fuse/obexautofs.c

      In neither case obexautofs will be any good for bt.

      This does not affect obexfs. Mounting your phone manually will work fine on FreeBsd.