Changes between Version 32 and Version 33 of Packages/SQLite
- Timestamp:
- 06/27/12 06:29:27 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Packages/SQLite
v32 v33 41 41 = Makefile.sqlite = 42 42 43 43 44 Just figured out how to get SQLite to compile! 45 First, 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. 44 46 45 First, install the rtems-graphics-toolkit/mman_kit, so that SQLite can use shared memory, (shm). 47 To avoid sys/mman.h dependency, I looked for sys/mman.h 46 48 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 48 50 49 Third, copy the Makefile below into rtems-addon-packages/RTEMS_Makefiles/Makefile.sqlite 51 and found that defining SQLITE_OMIT_WAL would eliminate the mmap/munmap dependency. 52 53 I copied the Makefile below into rtems-addon-packages/RTEMS_Makefiles/Makefile.sqlite 50 54 {{{ 51 55 # 52 56 # 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 55 63 56 64 include ../RTEMS_Makefiles/Makefile.common 57 65 58 66 all: 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' 64 68 ../sqlite/configure \ 65 69 --prefix=$(exec_prefix) \ … … 73 77 --libdir=$(exec_prefix)/$(RTEMS_BSP)/lib \ 74 78 --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 }}} 88 83 = Testing Ideas = 89 84