Changes between Version 32 and Version 33 of Packages/SQLite


Ignore:
Timestamp:
06/27/12 06:29:27 (12 years ago)
Author:
C Rempel
Comment:

/* Makefile.sqlite */

Legend:

Unmodified
Added
Removed
Modified
  • Packages/SQLite

    v32 v33  
    4141=  Makefile.sqlite  =
    4242
     43
    4344Just figured out how to get SQLite to compile!
     45First, the sqlite command shell executable may NOT be necessary, which bypasses the need to figure out how to implement popen and pclose.  To NOT build the command shell executable, I looked at the Makefile, and built the non sqlite3 make targets.  Namely, lib_intall, and the sqlite3.h.
    4446
    45 First, install the rtems-graphics-toolkit/mman_kit, so that SQLite can use shared memory, (shm).
     47To avoid sys/mman.h dependency, I looked for sys/mman.h
    4648
    47 Second, comment out the references to popen and pclose in rtems-addon-packages/sqlite/src/shell.c
     49 $ grep -r "sys\/mman.h" rtems-addon-packages/sqlite
    4850
    49 Third, copy the Makefile below into rtems-addon-packages/RTEMS_Makefiles/Makefile.sqlite
     51and found that defining SQLITE_OMIT_WAL would eliminate the mmap/munmap dependency.
     52
     53I copied the Makefile below into rtems-addon-packages/RTEMS_Makefiles/Makefile.sqlite
    5054{{{
    5155#
    5256# Configure/build/install the sqlite library
    53 # note: comment out the references to popen and pclose in src/shell.c
    54 # until a reasonable substitution can be found
     57# -DSQLITE_OMIT_WAL removes mman dependency
     58# -DSQLITE_ENABLE_COLUMN_METADATA taken from sqlite/mkso.sh
     59# --disable-largefile makes a library for a 32-bit target on a 64-bit host
     60# --disable-amalgamation keeps the source code in separate files for the build
     61# copy the public header to the include directory
     62# finally, install the library
    5563
    5664include ../RTEMS_Makefiles/Makefile.common
    5765
    5866all:
    59         CFLAGS='-DPROT_READ=0x01' \
    60         CFLAGS='-DPROT_WRITE=0x02' \
    61         CFLAGS='-DMAP_SHARED=0x001' \
    62         CFLAGS='-DSQLITE_OMIT_ALTERTABLE=2 ' \
    63         LDFLAGS='-lmmap_kit' \
     67        CFLAGS='-DSQLITE_OMIT_WAL=1 DSQLITE_ENABLE_COLUMN_METADATA=1'
    6468        ../sqlite/configure \
    6569                --prefix=$(exec_prefix) \
     
    7377                --libdir=$(exec_prefix)/$(RTEMS_BSP)/lib \
    7478                --includedir=$(exec_prefix)/$(RTEMS_BSP)/lib/include
    75         make
    76         make install
    77 }}}=  Flags Explained  =
    78 
    79 # PROT_READ, PROT_WRITE, and MAP_SHARED all relate to shared memory support, and they're definitions can be found in the FreeBSD sys/mman.h header.
    80 # The SQLite omit altertable was defined to enhance security and reduce code size.
    81 # The mmap_kit was linked to provide definitions for mmap and munmap for shared memory support.
    82 =  Configurations Explained  =
    83 
    84 # The build had to be defined because the June 2012 sqlite developer repository couldn't recognize the build of my laptop.
    85 # As RTEMS is mostly on 32-bit (or smaller) architectures, I disabled largfile support.  # Cross-thread connections looked useful for RTEMS, so I put it in there.
    86 # I disabled tcl and readline support to reduce dependencies, and
    87 # I disabled amalgamation to isolate porting issues.
     79        make sqlite3.h libsqlite3.la
     80        cp sqlite3.h $(exec_prefix)/$(RTEMS_BSP)/lib/include
     81        make lib_install
     82}}}
    8883=  Testing Ideas  =
    8984