= OpenLDAP = [[TOC(Projects/OpenLDAP, depth=2)]] '''Status:''' Current status of project. Introduce the main concepts around the project: Theoretical preliminaries, preexisting RTEMS capabilities used or augmented (if any), important concepts, problems/needs the project will try to solve/satisfy. = Goal = Concise statement of the overall goal of the project. Refine this initial statement to include: project deliverables (code, docs, testing), required/suggested methodology, standards of quality, possible goal extensions beyond the main objective. = Requirements = List the requirements and level of expertise you estimate are required by the developer tackling this project will have to have: Required level of programming language(s), specific areas of RTEMS or tools, level of familiarity with RTEMS, cross-development, GNU/Linux, etx., development/documentation/testing tools, mathematical/algorithmic background, other desirable skills. = Resources = Current RTEMS developers, papers, etc that may help you in this project. C Rempel is willing to help = Other sections = If you have more to say about the project that doesn't fit in the proposed sections of this template, feel free to add other sections at will. = Acknowledgements = * who helped add did work = Miscellaneous Sections = = A first stab at building Open LDAP = As the project progresses, you will need to add build instructions, etc and this page will evolve from a project description into a HOWTO. I am building this package because it is simpler than the Apache Runtime, and so is a good way to gain needed experience. I started with using the RTEMS Addon Packages. How to use the RTEMS Addon Packages is outlined [http://www.rtems.com/wiki/index.php/RTEMS_Add-On_Packages]. == Makefile.openldap == I put the following in rtems-addon-packages/Makefile.openldap # # Declare supported terminal types. # This value can be augmented/overridden by the site-configuration file # include ../RTEMS_Makefiles/Makefile.common # # The following will work only if you have the latest ncurses version # of infocmp installed before trying to build for an RTEMS target. # The cf_cv_type_of_bool hack works around a bug when configuring # for a cross-target. # all: ac_cv_member_struct_msghdr_msg_control=no \ ac_cv_func_memcmp_working=yes \ ac_cv_func_initgroups=yes \ ac_cv_func_setuid=no \ ./configure \ --host=$(RTEMS_CPU)-rtems4.11 \ --prefix=$(exec_prefix) \ --libdir=$(exec_prefix)/$(RTEMS_BSP)/lib \ --includedir=$(exec_prefix)/$(RTEMS_BSP)/lib/include \ --without-tls \ --with-yielding_select=yes \ --disable-mdb \ --disable-hdb \ --disable-cleartext \ --disable-overlays \ --enable-proctitle \ --enable-debug \ --disable-shared make make install Next: $ cd ~/rtems-addon-packages $ git clone git://git.openldap.org/openldap.git openldap $ cd openldap $ make -f RTEMS_Makefiles/Makefile.openldap Note: Very insecure! But builds OK. = examples/openldap/BuildTests.sh = Currently openldap/BuilTests.sh builds the programs needed to run the tests, not the tests themselves... Interestingly, I found it necessary to symbolically link the slapd-common header and source to each test, as well as the libutil library. ### examples/openldap/BuildTests.sh ### #!/bin/sh set -x rm -f rtems-grub.cfg SRCDIR=../../openldap/tests/progs ln -s $SRCDIR/slapd-common.h . ln -s $SRCDIR/slapd-common.c . ln -s $SRCDIR/../../libraries/liblutil/liblutil.a . for TEST in \ slapd-tester \ slapd-search \ slapd-read \ slapd-addel \ slapd-modrdn \ slapd-modify \ slapd-bind \ slapd-mtread \ ldif-filter do rm -f $TEST.c ln -s $SRCDIR/$TEST.c . make TEST=$TEST SRCDIR=$SRCDIR rm -f $TEST.c $TEST.o done rm -f slapd-common.h rm -f slapd-common.c rm -f liblutil.a # Generate rtems-grub.cfg echo \# RTEMS Grub configuration for the >> rtems-grub.cfg # The number of executables echo set default = $(ls o-optimize | \ grep '\.'exe | wc -l) >> rtems-grub.cfg # The menuentries ls o-optimize | \ grep '\.'exe | \ sed "s/^/menuentry \"RTEMS \-\" \{\n set root=(hd1,1)\n multiboo$ sed "s/\.exe/\.exe\n\}\n/" >> rtems-grub.cfg = examples/openldap/Makefile = I modified the rtems-addon-packages/examples/ncurses/Makefile to turn openldap programs used to test openldap into stand-alone executables. I had to add slapd-common.c to the C_PIECES, and slapd-common.h to the headers. Also, to link the liblutil.a convienience library, I had to add liblutil.a to C_O_FILES (it's an object file after-all :), I linked the ldap libraries using LD_LIBS, and increased the HeapSize by a factor of ten (because it said networking required more -- online research is needed to get an exact size required). Finally, it's worth noting the $(TEST) parameter is used to identify which test to build, and PGMS stands for programs. # # $Id$ # # Templates/Makefile.leaf # Template leaf node Makefile # SRCDIR=../../openldap/tests/progs # C source names, if any, go here -- minus the .c C_PIECES=slapd-common $(TEST) C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) liblutil.a # C++ source names, if any, go here -- minus the .cc CC_PIECES= CC_FILES=$(CC_PIECES:%=%.cc) CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o) H_FILES= slapd-common.h # Assembly source names, if any, go here -- minus the .s S_PIECES= S_FILES=$(S_PIECES:%=%.s) S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) PGMS=${ARCH}/$(TEST) # # RTEMS managers go here # MANAGERS=io event message semaphore include $(RTEMS_MAKEFILE_PATH)/Makefile.inc include $(RTEMS_CUSTOM) include $(PROJECT_ROOT)/make/leaf.cfg # # (OPTIONAL) Add local stuff here using += # DEFINES += CPPFLAGS += -I$(SRCDIR)/../../include CFLAGS += LD_PATHS += LD_LIBS += -lldap -llber -lldap_r CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0x200000 # network needs more space CFLAGS_DEBUG_V += # # Add your list of files to delete here. The config files # already know how to delete some stuff, so you may want # to just run 'make clean' first to see what gets missed. # 'make clobber' already includes 'make clean' # CLEAN_ADDITIONS += CLOBBER_ADDITIONS += all: ${ARCH} $(SRCS) $(PGMS) ${ARCH}/$(TEST): ${OBJS} ${LINK_FILES} $(make-exe) # Install the program(s), appending _g or _p as appropriate. # for include files, just use $(INSTALL) install: all $(INSTALL_VARIANT) -m 555 ${PGMS} /usr/local/tftpboot/bootfiles/m68360/ To build the executables, I had to change some lines in /opt/rtems-4.11/make/leaf.cfg define default-bsp-post-link - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ endef define default-bsp-post-link + $(NM) -g -n $@.o > $(basename $@).num + $(SIZE) $@.o endef Then, I ran BuildTests.sh ~/rtems-addon-packages/examples/openldap$ ./BuildTests.sh Again this only built the programs used to run the tests as stand-alone executables... Currently looking at how to build the tests -- they're in shell script :)... Hope this helps! = References = * [http://www.openldap.org/ OpenLDAP]