I am trying to build my own project, i.e., smart_parking using RabbitMQ C-master. The link to the C APIs is:
https://github.com/alanxz/rabbitmq-c
I made a folder with the name smart_parking in the rabbitmq folder. I also wrote the CMakeLists.txt files and edited the Makefile.am as follows:
CMakeLists.txt:
# vim:set ts=2 sw=2 sts=2 et:
include_directories(${LIBRABBITMQ_INCLUDE_DIRS})
if (WIN32)
set(PLATFORM_DIR win32)
else (WIN32)
set(PLATFORM_DIR unix)
endif (WIN32)
set(COMMON_SRCS
utils.h
utils.c
${PLATFORM_DIR}/platform_utils.c
)
add_executable(client_1 client_1.c ${COMMON_SRCS})
target_link_libraries(client_1 ${RMQ_LIBRARY_TARGET})
add_executable(client_2 client_2.c ${COMMON_SRCS})
target_link_libraries(client_2 ${RMQ_LIBRARY_TARGET})
add_executable(client_3 client_3.c ${COMMON_SRCS})
target_link_libraries(client_3 ${RMQ_LIBRARY_TARGET})
add_executable(client_4 client_4.c ${COMMON_SRCS})
target_link_libraries(client_4 ${RMQ_LIBRARY_TARGET})
Makefile.am:
if SMART_PARKING
noinst_LTLIBRARIES += smart_parking/libutils.la
smart_parking_libutils_la_SOURCES = \
smart_parking/utils.c \
smart_parking/utils.h
smart_parking_libutils_la_CFLAGS = $(AM_CFLAGS)
if OS_UNIX
smart_parking_libutils_la_SOURCES += smart_parking/unix/platform_utils.c
endif
if OS_WIN32
smart_parking_libutils_la_SOURCES += smart_parking/win32/platform_utils.c
smart_parking_libutils_la_CFLAGS += -I$(top_srcdir)/tools/win32/msinttypes
endif
noinst_PROGRAMS = \
smart_parking/client_1 \
smart_parking/client_2 \
smart_parking/client_3 \
smart_parking/client_4
smart_parking_client_1_SOURCES = smart_parking/client_1.c
smart_parking_client_1_LDADD = \
smart_parking/libutils.la \
librabbitmq/librabbitmq.la
smart_parking_client_2_SOURCES = smart_parking/client_2.c
smart_parking_client_2_LDADD = \
smart_parking/libutils.la \
librabbitmq/librabbitmq.la
smart_parking_client_3_SOURCES = smart_parking/client_3.c
smart_parking_client_3_LDADD = \
smart_parking/libutils.la \
librabbitmq/librabbitmq.la
smart_parking_client_4_SOURCES = smart_parking/client_4.c
smart_parking_client_4_LDADD = \
smart_parking/libutils.la \
librabbitmq/librabbitmq.la
endif
But when I try to make the project, I get the following error:
GEN tools/doc/amqp-publish.1
usage: xmlto [OPTION]... FORMAT XML
OPTIONs are:
-v verbose output (-vv for very verbose)
-x stylesheet use the specified stylesheet instead of choosing one
-m fragment use the XSL fragment to customize the stylesheet
-o directory put output in the specified directory instead of
the current working directory
-p postprocopts pass option to postprocessor
--extensions turn on stylesheet extensions for this tool chain
--noautosize do not autodetect paper size via locales or paperconf
--noclean temp files are not deleted automatically
(good for diagnostics)
--noextensions do not use passivetex/fop extensions
--searchpath colon-separated list of fallback directories
--skip-validation
do not attempt to validate the input before processing
--stringparam paramname=paramvalue
pass a named parameter to the stylesheet from the
command line
--with-fop use fop for formatting (if fop available)
--with-dblatex use dblatex for formatting (if dblatex available)
Available FORMATs depend on the type of the XML file (which is
determined automatically).
For documents of type "docbook":
awt dvi epub fo html htmlhelp html-nochunks javahelp man mif pcl pdf ps svg text txt xhtml xhtml-nochunks
For documents of type "xhtml1":
awt dvi fo mif pcl pdf ps svg txt
For documents of type "fo":
awt dvi mif pcl pdf ps svg txt
make[1]: *** [tools/doc/amqp-publish.1] Error 1
make[1]: Leaving directory `/home/l4tmm/Desktop/Smart parking simulation in C/rabbitmq-c'
make: *** [all] Error 2
The usage: xmlto [OPTION]... FORMAT XML error is due to xmlto being called incorrectly from the build script. Disable doc generation by passing in --disable-docs to the configure script.
Related
I'm trying to create filesystem of extension rootfs.img from Yocto. Adding IMAGE_FSTYPE="img" is failing, saying img is not recognized because its definition is not defined in any meta class.
I have looked into using wic, but cant find the command that should go in .wks file
Any ways in which I can create rootfs.img (instead of rootfs.tar.gz or rootfs.ext4) in Yocto?
Tried wic & IMAGE_FSTYPES="img"
Solved it this way :
Added function oe_mkimgfs() similar to https://git.yoctoproject.org/poky/tree/meta/classes/image_types.bbclass#n63
Modified mkfs cmd to mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.img -d ${IMAGE_ROOTFS}
Also added other macros :
EXTRA_IMAGECMD_img ?= "-i 4096"
do_image_img[depends] += "e2fsprogs-native:do_populate_sysroot"
RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4 img"
IMAGE_CMD_img = "oe_mkimgfs ext4 ${EXTRA_IMAGECMD}"
How do you add a new set of custom environment variables to u-boot using buildroot as the os build system?
I attempted to patch the include/configs/rpi.h using an external tree patch to add a new variable but kconfig got grumpy (patch shown after complaining):
The following new ad-hoc CONFIG options were detected:
CONFIG_XXXXXX_ENV_SETTINGS
Please add these via Kconfig instead. Find a suitable Kconfig
file and add a 'config' or 'menuconfig' option.
Makefile:871: recipe for target 'all' failed
--- a/include/configs/rpi.h 2018-03-13 12:02:19.000000000 +0000
+++ b/include/configs/rpi.h 2018-11-19 12:32:15.728000000 +0000
## -140,0 +141,7 ##
+#define CONFIG_XXXXXX_ENV_SETTINGS \
+ "newboard=true" \
+ "hasFailedBoot=false" \
+ "hasFailedBootCount=0" \
+ "maximumFailedBootCount=3"
+
+
## -145 +152,2 ##
- BOOTENV
+ BOOTENV \
+ CONFIG_XXXXXX_ENV_SETTINGS
I can use uboot-menuconfig to set up u-boot specific stuff but am not sure how to create environment variables
You can set CONFIG_USE_DEFAULT_ENV_FILE in uboot-menuconfig and point that to a file that contains the complete default environment.
Since you use Buildroot, don't forget to save the modified U-Boot configuration by changing its location (Buildroot option BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE) and running make uboot-update-defconfig.
I am working on yocto, I want to compile some C files in yocto and install the resulting binary to external filesystem.
Before doing that I tried creating a separate reciepe and compile c code from it.
I am unable to compile it.
I am not sure to understand the question since it is not precise enough.
Including C files in recipe tree
If you want to have the C files in your recipe, having a file tree like this:
recipe-example/example/example_0.1.bb
recipe-example/example/example-0.1/helloworld.c
You can generate this example when you create a new layer using
yocto-layer <your-layer-name>
Your bb file will look like this:
#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#
SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://helloworld.c"
S = "${WORKDIR}"
do_compile() {
${CC} helloworld.c -o helloworld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
It will compile the hello world file and install it into /usr/bin on your image.
From a Git repo
You also can compile from a git repository, I advise you to read the manual and examples in your yocto folder. Here is an example here of wiringPi:
DESCRIPTION = "A library to control Raspberry Pi GPIO channels"
HOMEPAGE = "https://projects.drogon.net/raspberry-pi/wiringpi/"
SECTION = "devel/libs"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"
# tag 2.29
SRCREV = "d79506694d7ba1c3da865d095238289d6175057d"
S = "${WORKDIR}/git"
SRC_URI = "git://git.drogon.net/wiringPi \
file://0001-Add-initial-cross-compile-support.patch \
file://0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch \
"
COMPATIBLE_MACHINE = "raspberrypi"
CFLAGS_prepend = "-I${S}/wiringPi -I${S}/devLib"
EXTRA_OEMAKE += "'INCLUDE_DIR=${D}${includedir}' 'LIB_DIR=${D}${libdir}'"
EXTRA_OEMAKE += "'DESTDIR=${D}/usr' 'PREFIX=""'"
do_compile() {
oe_runmake -C devLib
oe_runmake -C wiringPi
oe_runmake -C gpio 'LDFLAGS=${LDFLAGS} -L${S}/wiringPi -L${S}/devLib'
}
do_install() {
oe_runmake -C devLib install
oe_runmake -C wiringPi install
oe_runmake -C gpio install
}
It is fetching from a git repository, applying patches generated by git, using oe_runmake to compile with the makefiles.
With devtool
It has been asked in a comment on how to add a recipe with devtool.
We will still use wiringPi as an example again. Download it doing
https://github.com/WiringPi/WiringPi
The Makefile is is the folder wiringPi.
You can then do
devtool add <name_of_recipe> <path_to_Makefile_folder>
Take care of the warning from devtool
NOTE: Creating workspace layer in /home/dbensoussan/new_poky/poky/build/workspace
NOTE: Enabling workspace layer in bblayers.conf
NOTE: Using source tree as build directory since that would be the default for this recipe
NOTE: Recipe /home/dbensoussan/new_poky/poky/build/workspace/recipes/project/project.bb has been automatically created; further editing may be required to make it fully functional
This is generating the recipe as follow:
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
#
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
LICENSE = "Unknown"
LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"
# No information for SRC_URI yet (only an external source tree was specified)
SRC_URI = ""
# NOTE: this is a Makefile-only piece of software, so we cannot generate much of the
# recipe automatically - you will need to examine the Makefile yourself and ensure
# that the appropriate arguments are passed in.
do_configure () {
# Specify any needed configure commands here
:
}
do_compile () {
# You will almost certainly need to add additional arguments here
oe_runmake
}
do_install () {
# This is a guess; additional arguments may be required
oe_runmake install 'DESTDIR=${D}'
}
You can then edit your recipe to suit your configuration
With externalsrc
It is possible to use a directory present on the filesystem by using externalsrc.
I did not try it myself, nor have I the workspace ready to do, but #71GA in the comment tested the tutorial from the Koan software company https://wiki.koansoftware.com/index.php/Building_Software_from_an_External_Source and it worked. I will copy the content here:
in this case use the externalsrc class - you can inherit this in the original bb recipe or a bbappend:
inherit externalsrc
EXTERNALSRC = "/path/to/sources"
Depending on the type of build (eg, 'inherit module' for out of tree Linux kernel modules) you may or may not need to set EXTERNALSRC_BUILD.
inherit externalsrc
EXTERNALSRC = "/some/path"
EXTERNALSRC_BUILD = "/some/path"
If you're going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):
INHERIT += "externalsrc"
EXTERNALSRC_pn-<recipename> = "/path/to/sources"
Recipe example using an external source for nInvaders package
#
# Recipe example with externalsrc
#
# (C)2019 Marco Cavallini - KOAN - <https://koansoftware.com>
#
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
inherit externalsrc
EXTERNALSRC = "/home/koan/yocto-qemuarm-sumo/ninvaders-0.1.1"
EXTERNALSRC_BUILD = "${EXTERNALSRC}"
DEPENDS = "ncurses"
EXTRA_OEMAKE = "-e"
do_install() {
install -d ${D}${bindir}
install -m 0755 nInvaders ${D}${bindir}
}
FILES_${PN} = "${bindir}/*"
You can just go to the official documentation to find your answer.
In the chapter 7.3 Writting a New Recipe of the yocto mega-manual, the very first example is exactly is what you need (Single .c File Package (Hello World!)).
I want to use a webservice in C code. I am trying to make a client. I need something to do what Axis2java does and generates the classes from a wsdl files.
I found that Axis2c makes (.c) files generated from wsdl file.
I downloaded it from here . unzipped it. I created the environment variable for AXIS2C_HOME and I created AXIS2C_CLASSPATH.
but I can't make it work.
when I type this command :
WSDL2C -uri -ss -sd -d none -u -f -o
I get this error :
echo off
Error: Could not find or load main class org.apache.axis2.wsdl.WSDL2C
how can I solve this problem. and please tell me how to use this Axis2c tool properly.
Thank you in advance.
#loentar : I installed Axis2/Java and I set the environment variable for it. now I run the wsdl2c.bat I get this :
E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>WSDL2C.bat
E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>echo off
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
-cp
-classpath
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D=
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:...|:]
-enableassertions[:...|:]
enable assertions with specified granularity
-da[:...|:]
-disableassertions[:...|:]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-splash:
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for m
ore details.
after that I run this command :
E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>WSDL2C.bat -uri hello.wsdl
-u -uw
E:\dev\Tools\axis2c-bin-1.6.0-win32\bin\tools\wsdl2c>echo off
Unrecognized option: -uri
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
what can I do ?
I'm using windows 8 by the way.
In addition to Axis2/C you must have Axis2/Java installed.
AXIS2_HOME must point to Axis2/Java installation.
For details please see README of codegen.
The complete list of commands to create and compile client is:
# create stubs
sh $AXIS2C_HOME/bin/tools/wsdl2c/WSDL2C.sh -uri Calculator.wsdl -u -uw
# implement main() in src/your_client.c
# see samples/codegen/client/calculator for example
# compile and link client
gcc -o calculator_client src/*.c -I$AXIS2C_HOME/include/axis2-1.6.0 -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver -ldl -Wl,--rpath -Wl,$AXIS2C_HOME/lib
I set the envinroment variable for JAVA_HOME, AXIS2_HOME, AXIS2C_HOME, and added their lib folder to CLASSPATH. after running this command:
WSDL2C.bat -uri hello.wsdl -u -uw
I got this message:
echo off
Error: Could not find or load main class org.apache.axis2.wsdl.WSDL2C
I found the solution myself. :)
I double checked if I had created the environment variable for AXIS2_HOME and I saw that it is there, correctly.
in spite of it's existence I tried to set it again in command prompt. so I typed:
SET AXIS2_HOME=E:\dev\Tools\axis2-1.6.2
then I typed the command for WSDL2C code generator:
WSDL2C.bat -uri hello.wsdl -u -uw
And BAM ! it worked properly.
Now I can generate C files from WSDL file.
I want all my modules built with a .so extension so that they are shared. However, all my modules are building with a .la extension. Here are the contents of the module directory:
httpd.exp libmod_proxy_ajp.a libmod_speling.a mod_info.la mod_proxy_scgi.la
libmod_cern_meta.a libmod_proxy_balancer.a libmod_ssl.a mod_proxy.la mod_rewrite.la
libmod_dbd.a libmod_proxy_connect.a libmod_vhost_alias.a mod_proxy_ajp.la mod_speling.la
libmod_deflate.a libmod_proxy_ftp.a mod_cern_meta.la mod_proxy_balancer.la mod_ssl.la
libmod_expires.a libmod_proxy_http.a mod_dbd.la mod_proxy_connect.la mod_vhost_alias.la
libmod_info.a libmod_proxy_scgi.a mod_deflate.la mod_proxy_ftp.la
libmod_proxy.a libmod_rewrite.a mod_expires.la mod_proxy_http.la
Here is my configure command:
./configure \
--with-mpm=prefork \
--with-ssl=/opt/freeware \
--enable-cern-meta \
--enable-dbd \
--enable-deflate \
--enable-expires \
--enable-info \
--enable-proxy \
--enable-rewrite \
--enable-speling \
--enable-ssl \
--enable-vhost-alias \
--enable-mods-shared="cern_meta dbd deflate expires info proxy rewrite speling ssl vhost_alias"
I have done this many times in the past on AIX 5.2, 5.3 and 6.1 without issue.
.la files are libtool's library control file syntax. Notice they are really just small scripts. Check for your shared library objects inside the .libs directory. You might also explicitly tell configure that you want shared libraries with --enable-shared