a configure's options such as "--extra-cflags" --- I am confused - iphone

# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
the below will build ffmpeg static libraries for i386. but i don't know about the option's means such as "--extra-cflags"、"--extra-ldflags"、"--sysroot="、"--as=".
who can tell me about those options mean ? where i can find the details explanation?
thanks . I am waitting for your help.

You can always run the configure script as configure --help; it will print a usage statement and information about many of the accepted parameters -- and usually, hopefully, the package-specific ones of interest.
That said, --extra-cflags would provide extra command-line switches for the C compiler, --as would give the path to the assembler, --sysroot would give an alternate installation directory, and --extra-ldflags would provide extra flags for the linker. Those are all fairly advanced, and you're unlikely to need to use them.

This is a funny configure script, because usual Autoconf ones use environment variables for such things like C flags (CFLAGS) and the C compiler location (CC). For example:
CC=/path/to/my/specific/gcc/version CFLAGS="-I/additional/include/dir -L/additional/library/dir" \
./configure --prefix=/installation/dir --host=cross-compiler-triplet-if-any \
--enable-something --with-some-feature --disable-something-else

Related

reject-regex in wget

I'm trying to mirror a section of intranet TWiki for offline usage as follows:
wget \
--user=twiki \
--password=******** \
--recursive \
-l 2 \
--adjust-extension \
--page-requisites \
--convert-links \
--reject-regex '\?rev=' \
--reject-regex '/twiki/rdiff/' \
--reject-regex '/twiki/attach/' \
--reject-regex '/twiki/edit/' \
--reject-regex '/twiki/oops/' \
--reject-regex '\?raw=on' \
--reject-regex '\?cover=print' \
http://twiki/cgi-bin/twiki/view/SectionToMirror/
For some reason all --reject-regex are ignored. The content I want to reject appears in the copy. Running the above command without any --reject-regex rules renders the same results.
What am I doing wrong?

No ethernet access on jetson nano with custom yocto image

I've created a very minimal image for the jetson nano with the recepe:
inherit core-image
inherit distro_features_check
REQUIRED_DISTRO_FEATURES = "x11"
IMAGE_FEATURES += "package-management splash"
CORE_OS = "packagegroup-core-boot \
packagegroup-core-x11 \
packagegroup-xfce-base \
kernel-modules \
"
WIFI_SUPPORT = " \
ifupdown \
dropbear\
crda \
iw \
"
DEV_SDK_INSTALL = " \
opencv \
opencv-samples \
gstreamer1.0-omx-tegra \
python-numpy \
binutils \
binutils-symlinks \
coreutils \
cpp \
cpp-symlinks \
diffutils \
elfutils elfutils-binutils \
file \
g++ \
g++-symlinks \
gcc \
gcc-symlinks \
gdb \
gdbserver \
gettext \
git \
ldd \
libstdc++ \
libstdc++-dev \
libtool \
ltrace \
make \
pkgconfig \
python3-modules \
strace \
"
EXTRA_TOOLS_INSTALL = " \
bzip2 \
ethtool \
findutils \
grep \
i2c-tools \
iproute2 \
iptables \
less \
lsof \
nano \
nmap \
tcpdump \
unzip \
util-linux \
wget \
zip \
curl \
"
IMAGE_INSTALL += " \
${CORE_OS} \
${DEV_SDK_INSTALL} \
${EXTRA_TOOLS_INSTALL} \
${WIFI_SUPPORT} \
"
To play around with a raspberry pi v2.1 camera. Everything works so far except ethernet access.
When I run
ifconfig
I get an IPv6 ip-address and everything is looking good (except I would also want a ipv4 address if but haven't looked into that yet). But when I run the command
ping google.com
Is says "ping: bad address 'google.com' and if I run ping on 8.8.8.8 it returns "ping: sendto: network is uncreachable".
It's not the ethernet cable or my router that has a problem, as the same ethernet cable and access works just fine on my PC. When the ethernet is connected to the jetson nano, the green light is constantly on while the orange light is constantly blinking.
What could be causing the problem and how do I fix it and get access to the internet again?
I ran the command:
ifup eth0
I got a ipv4 address and then everything worked.

Build all packages for an image

Is it possible to build all of the packages for a specific image? I know I can build packages individually, but ideally would like to build all of them at once, through a single command.
Alternatively, is there a way to prevent the do_rootfs task from being executed for a particular image.
Cheers, Donal
First make an image that contains a packagegroup (or just list your dependencies there).
$ cat sources/meta-custom/recipes-custom/images/only-packages-image.bb
SUMMARY = "All dependencies no image"
LICENSE = "CLOSED"
version = "##DISTRO_VERSION##"
BB_SCHEDULER = "speed"
# option 1 - packagegroup, package list can be reused in real image
CORE_IMAGE_BASE_INSTALL += "\
packagegroup_all-depends \
"
# option 2 - list deps here, package list can not be reused in real image
CORE_IMAGE_BASE_INSTALL += "\
lshw \
systemd \
cronie \
glibc \
sqlite \
bash \
python3-dev \
python3-2to3 \
python3-misc \
python3-pyvenv \
python3-modules \
python3-pip \
wget \
apt \
pciutils \
file \
tree \
\
wpa-supplicant \
dhcpcd \
networkmanager \
curl-dev \
curl \
hostapd \
iw \
"
# remove the rootfs step
do_rootfs() {
}
Second make your packagegroup if you opted to reuse the list of packages
$ cat sources/meta-custom/recipes-custom/packagegroups/packagegroup-alldeps.bb
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit packagegroup
RDEPENDS_${PN} = " \
lshw \
systemd \
cronie \
glibc \
sqlite \
bash \
python3-dev \
python3-2to3 \
python3-misc \
python3-pyvenv \
python3-modules \
python3-pip \
wget \
apt \
pciutils \
file \
tree \
\
wpa-supplicant \
dhcpcd \
networkmanager \
curl-dev \
curl \
hostapd \
iw \
"
Finally build your new image placeholder
$ bitbake only-packages-image
In Yocto >=4.0 this is actually pretty easy to achieve. The packagegroup method did not work for me at all.
I don't know if this works in older versions though.
Create a new file in your custom layer, e.g. meta-custom/classes/norootfs.bbclass and put the following lines in there (as far as I noticed the order does not matter):
deltask do_deploy
deltask do_image
deltask do_rootfs
deltask do_image_complete
deltask do_image_setscene
then in your meta-custom/recipes-core/images/myimage.bb add norootfs to your other inherit commands
e.g. the most basic one
inherit core-image norootfs
You will notice your number of tasks decreasing by a fair amount (mine from ~4700 to ~3000) and there is no complete rootfs image anymore in build/tmp/deploy/images, except for bzImage and modules, just the plain ipk files in build/tmp/deploy/ipk.
I got this information by looking at https://docs.yoctoproject.org/ref-manual/tasks.html?highlight=do_image and .bbclass files in meta/classes where deltask is frequently used.

STM32CubeMX is generating Makefiles with repeated C_SOURCES

I'm just starting to learn STM32 development (on Ubuntu 16.04).
I've used STM32CubeMX to build a Makefile-based project.
The generated Makefiles have repeated entries in C_SOURCES which (obviously) cause linking to fail because of duplicated symbols.
C_SOURCES = \
Src/stm32f0xx_it.c \
Src/stm32f0xx_hal_msp.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rtc.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c \
Src/stm32f0xx_it.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_uart_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2s.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c \
Src/usbd_conf.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c \
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rtc_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_uart.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c \
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \
Src/usb_device.c \
Src/usbd_desc.c \
Src/stm32f0xx_hal_msp.c \
Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cec.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_crc.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c \
Src/usbd_desc.c \
Src/usbd_conf.c \
Src/system_stm32f0xx.c \
Src/usb_device.c \
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \
Src/main.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_crc_ex.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c \
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c \
Src/main.c
Src/main.c, Src/stm32f0xx_hal_msp.c, Src/stm32f0xx_it.c, Src/usbd_conf.c, Src/usbd_desc.c and Src/usb_device.c are each in this list twice.
If I remove the duplicates from the Makefile, the generated project builds.
Am I doing something wrong, or is this a bug in STM32CubeMX?
This is a bug and it has been already reported at ST Generated Makefile has duplicated entries for some source files.
The correction should be available in CubeMX 4.26.0 version.

ffmpeg on iOS 5.1 Undefined Symbols Error

So I've spent several hours now working through the scant amount of information available online about building ffmpeg for iOS. The building process seems to work well and I end up with fat files for armv6 and armv7 which I drag over into my project.
However, whenever I try to use the "avcodec_init()" command I get the following error:
Undefined symbols for architecture armv7:
"_avcodec_init", referenced from:
-[FirstViewController viewDidLoad] in FirstViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The library files are included in the 'Link Binary with Libraries' of the project settings, so they are definitely compiled into the app. I just can't for the life of me work out why I'm getting an error on this.
I've tried several different projects, and downloaded some existing project files from the web and get the same error.
This is the build script I used:
export PLATFORM="iPhoneOS" export MIN_VERSION="4.0" export
MAX_VERSION="5.1" export
DEVROOT=/Volumes/Lion/Applications/Xcode.app/Contents/Developer/Platforms/${PLATFORM}.platform/Developer
export SDKROOT=$DEVROOT/SDKs/${PLATFORM}${MAX_VERSION}.sdk export
CC=$DEVROOT/usr/bin/llvm-gcc export LD=$DEVROOT/usr/bin/ld export
CPP=$DEVROOT/usr/bin/cpp export CXX=$DEVROOT/usr/bin/llvm-g++ export
AR=$DEVROOT/usr/bin/ar export LIBTOOL=$DEVROOT/usr/bin/libtool export
NM=$DEVROOT/usr/bin/nm export CXXCPP=$DEVROOT/usr/bin/cpp export
RANLIB=$DEVROOT/usr/bin/ranlib
COMMONFLAGS="-pipe -gdwarf-2 -no-cpp-precomp -isysroot ${SDKROOT}
-marm -fPIC" export LDFLAGS="${COMMONFLAGS} -fPIC" export CFLAGS="${COMMONFLAGS} -fvisibility=hidden" export
CXXFLAGS="${COMMONFLAGS} -fvisibility=hidden
-fvisibility-inlines-hidden"
FFMPEG_LIBS="libavcodec libavdevice libavformat libavutil libswscale"
echo "Building armv6..."
make clean ./configure \
--cpu=arm1176jzf-s \
--extra-cflags='-arch armv6 -miphoneos-version-min=${MIN_VERSION} -mthumb' \
--extra-ldflags='-arch armv6 -miphoneos-version-min=${MIN_VERSION}' \
--enable-cross-compile \
--arch=arm \
--target-os=darwin \
--cc=${CC} \
--sysroot=${SDKROOT} \
--prefix=installed \
--disable-network \
--disable-decoders \
--disable-muxers \
--disable-demuxers \
--disable-devices \
--disable-parsers \
--disable-encoders \
--disable-protocols \
--disable-filters \
--disable-bsfs \
--enable-decoder=h264 \
--enable-decoder=svq3 \
--enable-gpl \
--enable-pic \
--disable-doc perl -pi -e 's/HAVE_INLINE_ASM 1/HAVE_INLINE_ASM 0/' config.h make -j3
mkdir -p build.armv6 for i in ${FFMPEG_LIBS}; do cp ./$i/$i.a
./build.armv6/; done
echo "Building armv7..."
make clean ./configure \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7 -miphoneos-version-min=${MIN_VERSION} -mthumb' \
--extra-ldflags='-arch armv7 -miphoneos-version-min=${MIN_VERSION}' \
--enable-cross-compile \
--arch=arm \
--target-os=darwin \
--cc=${CC} \
--sysroot=${SDKROOT} \
--prefix=installed \
--disable-network \
--disable-decoders \
--disable-muxers \
--disable-demuxers \
--disable-devices \
--disable-parsers \
--disable-encoders \
--disable-protocols \
--disable-filters \
--disable-bsfs \
--enable-decoder=h264 \
--enable-decoder=svq3 \
--enable-gpl \
--enable-pic \
--disable-doc perl -pi -e 's/HAVE_INLINE_ASM 1/HAVE_INLINE_ASM 0/' config.h make -j3
mkdir -p build.armv7 for i in ${FFMPEG_LIBS}; do cp ./$i/$i.a
./build.armv7/; done
mkdir -p build.universal for i in ${FFMPEG_LIBS}; do lipo -create
./build.armv7/$i.a ./build.armv6/$i.a -output ./build.universal/$i.a;
done
for i in ${FFMPEG_LIBS}; do cp ./build.universal/$i.a ./$i/$i.a; done
make install
I haven't used ffmpeg yet (even though a number of my bosses have had me thinking about using it), but lemme suggest a couple things that could be happening here.
1)
Let's see if the symbol really exists in your compiled library.
Go to Terminal and "cd" to the directory where your .a library lives.
Then type in "nm -arch armv7 ffmpeg.a | egrep avcodec_init" (where you can replace ffmpeg.a in my sample command with the actual name of the .a library) all on one line. That dumps out the symbols in the library for the armv7 architecture and pipes it into grep, which should show you if avcodec_init really does exist in your library.
If it doesn't appear, then it didn't get compiled into your library.
2)
If the symbol does exist in your library, then make sure the path to your .a file is correct in your project. You may be accidentally only including a simulator-only (i386 architecture) version of ffmpeg.