I am using a Yocto recipe to build a cmake project. In the Yocto enviroment, I confirmed that --sysroot=my-app/recipe-sysroot and all dependent libraries have been installed into that location. In my CMakeList.txt, I set link_directories(/usr/lib), but error messages occur while building to indicate the dependent libraries cannot be found.
Does anyone know how to pass the Yocto sysroot environment to cmake?
My recipe,
inherit cmake
DEPENDS = "\
azure-iot-sdk-c \
openssl \
zlib \
curl \
boost \
parson \
gtest \
"
S = "${WORKDIR}/git"
B = "${WORKDIR}/build"
EXTRA_OECMAKE = "\
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SAMPLES=ON \
-DBUILD_TESTS=ON \
-DBUILD_TOOLS=ON \
"
FILES_${PN}-staticdev = "${libdir}/*.a"
FILES_${PN} += "${libdir}/*.so"
FILES_SOLIBSDEV = ""
INSANE_SKIP_${PN} += "dev-so rpaths"
And if I set the real path in my CMakeList, it works,
set(LIBRARY_DIR "${CMAKE_CURRENT_LIST_DIR}/../recipe-sysroot/usr/lib")
set(STATIC_LIBRARY ${LIBRARY_DIR}/libiothub_client.a)
But if I set the related path according to sysroot, it does not work,
set(LIBRARY_DIR "/usr/lib")
Don't do:
set(LIBRARY_DIR "${CMAKE_CURRENT_LIST_DIR}/../recipe-sysroot/usr/lib")
It is usually not necessary to have any yocto specific information in your cmake. Instead add
include(GNUInstallDirs)
In your recipe add:
inherit cmake
If your cmake installs the static library and headers correctly e.g.:
install (TARGETS <yourtarget> DESTINATION ${CMAKE_INSTALL_LIBDIR})
file(GLOB HEADERS include/*.h)
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
My above advice should work, if you not install the static library using cmake you have to define an do_install task in your package recipe. For example
do_install() {
install -m 0755 -d ${D}${libdir}
install -m 0755 ${B}/test-staticlibrary.a ${D}/${libdir}
}
If you post your cmake files I can assist you further
Related
I am new to Yocto and cmake. After looking and searching on internet I was able to make my own recipe and was able to successfully compile the code using cmake from Yocto recipe.
But the binary compiled and generated is in the build folder where the code source files reside. How do I copy over the binaries from the build folder to the custom file system path when the image is generated using Yocto.
My .bb file currently looks like this:
#
# This file is the pscode recipe.
#
SUMMARY = "Simple test application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://src/* \
file://include/* \
file://CMakeLists.txt\
"
S = "${WORKDIR}"
do_configure() {
cmake ../
}
inherit pkgconfig cmake
do_install() {
install -d ${D}/home/first
cp -r ${WORKDIR} ${D}/home/first
#install -m 0755 ${S} ${D}/home/first
}
FILES_${PN} += "/home/first"
This runs into error
cp: cannot copy a directory <path-to-the-test-folder-in-temp> into itself, <path-to-the-test-folder-in-temp/image/home/first>
Can I someone please guide me. Thank you in advance.
Like the comments suggested:
SUMMARY = "Simple test application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://src/* \
file://include/* \
file://CMakeLists.txt \
"
S = "${WORKDIR}"
inherit pkgconfig cmake
If the CMakeLists.txt uses the install command then bitbake will do the install for you and you won't need to define you own do_install. see cmake-documentation-install for details. Here the example for binaries:
install(TARGETS <your cmake target> DESTINATION bin)
From cmake install documentation:
If a full path (with a leading slash or drive letter) is given it is
used directly. If a relative path is given it is interpreted relative
to the value of the CMAKE_INSTALL_PREFIX variable.
This question already has an answer here:
How to tell CMake where to put build files?
(1 answer)
Closed 4 years ago.
I'm trying to build MySQL from source but I hit a configuration error:
CMake Error at CMakeLists.txt:283 (MESSAGE):
Please do not build in-source. Out-of source builds are highly
recommended: you can have multiple builds for the same source, and there is
an easy way to do cleanup, simply remove the build directory (note that
'make clean' or 'make distclean' does *not* work)
You *can* force in-source build by invoking cmake with
-DFORCE_INSOURCE_BUILD=1
-- Source directory /usr/local/mysql-source
-- Binary directory /usr/local/mysql-source
-- Configuring incomplete, errors occurred!
See also "/usr/local/mysql-source/CMakeFiles/CMakeOutput.log".
The command '/bin/sh -c cd /usr/local/mysql-source/ && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/install -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITHOUT_TOKUDB=1 -DMYSQL_DATADIR=/usr/local/mysql/install/data -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/mysql/install/boost -DMYSQL_UNIX_ADDR=/usr/local/mysql/install/tmp/mysql.sock' returned a non-zero code: 1
I thought the CMAKE_INSTALL_PREFIX option was supposed to do exactly that, that is, specify the binary installation directory.
Here are my build commands:
RUN apt-get install -y libncurses-dev
COPY mysql-8.0.15.tar.gz /usr/local/
WORKDIR /usr/local
RUN gzip -d mysql-8.0.15.tar.gz \
&& tar -xvf mysql-8.0.15.tar \
&& mv mysql-8.0.15 mysql-source
RUN mkdir mysql
WORKDIR /usr/local/mysql/
RUN mkdir install \
&& mkdir install/data \
&& mkdir install/var \
&& mkdir install/etc \
&& mkdir install/tmp
RUN cd /usr/local/mysql-source/ \
&& cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/install \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITHOUT_TOKUDB=1 \
-DMYSQL_DATADIR=/usr/local/mysql/install/data \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/local/mysql/install/boost \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/install/tmp/mysql.sock \
&& make \
&& make install \
&& make clean
I read other similar questions but none explained why this CMAKE_INSTALL_PREFIX option was not doing it, nor if there was any other option.
I'm hoping not to have to edit the Makefile as I'm in a Docker environment.
I tried adding the -DDESTDIR=/usr/local/mysql/install \ option but the issue remained the exact same.
The cmake documentation didn't help me.
UPDATE: Following the provided solution I could successfully build with the command:
WORKDIR /usr/local/mysql/
RUN cmake -- -j4 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/install \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITHOUT_TOKUDB=1 \
-DMYSQL_DATADIR=/usr/local/mysql/install/data \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/local/mysql/install/boost \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/install/tmp/mysql.sock \
/usr/local/mysql-source/ \
&& make \
&& make install \
&& make clean
with the -- -j4 option being optional here, as it only tells cmake to use the 4 cores of the computer.
CMake is complaining about the fact you are trying to build MySQL in the source tree and therefore tainting it. A typical scenario is to use a separate builddir (that might be located under the source dir, but not necessarily need to). CMAKE_INSTALL_PREFIX is the place where after a successful build the binaries are installed to.
Create your solutions with
cmake -Hsourcedir -Bbuilddir ....<all your options>
CMake will create the builddir if it does not exist. In your case this could be called from the current source dir with
cmake -H. -Bbuilddir ....<all your options>
Newer CMake versions know about a -S option that is equivalent to -H
Later then the build tool mode of CMake comes very handy.
cmake --build builddir --target all --config Release -- -j4
It uses the default build tool of the platform (make in your case).
(give special options to the build tool after the trailing --, in this case -j4 for a parallel build)
Installing then is done by
cmake --build builddir --target install --config Release
AFAIK if you omit the --config Releaseoption CMake will use the CMAKE_BUILD_TYPE that was specified at configuration time either from CMakeLists.txt or from the command line.
Your entire RUN command then would look as follows:
RUN cd /usr/local/mysql-source/ \
&& cmake -H. -Bbuilddir \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/install \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITHOUT_TOKUDB=1 \
-DMYSQL_DATADIR=/usr/local/mysql/install/data \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/local/mysql/install/boost \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/install/tmp/mysql.sock \
&& cmake --build builddir --target all \
&& cmake --build builddir --target install \
&& cmake --build builddir --target clean
I am trying to use the OV5640 camera driver as a module in yocto. So I took the .c code and made a makefile (based on the example hello-mod)
obj-m += OV5640.o
SRC := $(shell pwd)
all:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules
modules_install:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
clean:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean
I also made a recipe in yocto
DESCRIPTION = "..."
LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM = "\
file:// ${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
"
inherit module
SRCREV = "${AUTOREV}"
BPV = "0.0.0"
PV = "${BPV}+git${SRCREV}"
SRC_URI = "git://git/my-repo;protocol=ssh;user=git;branch=master \
"
S = "${WORKDIR}/git"
In the git repo I have the .c code of the camera and the Makefile.
But when I try to build, it fails on do_compile and says:
fatal error: v4l2-int-device.h: No such file or directory
When I search on the file in the 'tmp' folder of yocto I find one in:
tmp/work-shared/myboard/kernel-source/drivers/media/platform/mxc/capture/v4l2-int-device.h
The question is, How can I modify the recipe to be able to build the module without changing the source code or the makefile?
Note:
I also tried to add snippet below to the recipe but this gave no succes.
CFLAGS_prepend = " -I${STAGING_KERNEL_DIR}/drivers/media/platform/mxc/capture "
You need to modify your Makefile and add:
ccflags-y += -I$(KERNEL_SRC)/drivers/media/platform/mxc/capture/
You can also try to compile it out of the tree, you need to set the variable KERNEL_SRC, source your environment, and compile it.
I have a Makefile generated by CMake. The following path to CMake executable is set in the Makefile:
CMAKE_COMMAND = /home/xyz/opt/cmake/cmake-3.1.1/bin/cmake
How can I integrate Fortify sourceanalyzer with it and run scans?
I had the same challenge but solved it by running it like this:
sourceanalyzer -b project_ID -clean
Go to your build directory and perform make clean or remove all contents including the Makefile
Run cmake by changing CC and CXX variables:
CC="sourceanalyzer -b project_ID gcc" CXX="sourceanalyzer -b project_ID g++" cmake ..
Run make and fortify should be translating files while compilers do their job.
Run sourceanalyzer -b project_ID -scan -f results.fpr
Hope it helps.
I was tasked with integrating our CMake build system with HP Fortify SCA and came across this Thread that gave some insights but lacked specifics as related to HP Fortify so I thought I would share my implementation.
I created a fortify_tools directory at the same level as the source directory. Inside the fortify_tools are a toolchain file and fortify_cc, fortify_cxx, and fortify_ar scripts that will be set as the cmake_compilers via the toolchain file.
fortify_cc
#!/bin/bash
sourceanalyzer -b <PROJECT_ID> gcc $#
fortify_cxx
#!/bin/bash
sourceanalyzer -b <PROJECT_ID> g++ $#
fortify_ar
#!/bin/bash
sourceanalyzer -b <PROJECT_ID> ar $#
NOTE: insert your project name in place of PROJECT_ID
Setting cmake to use the scripts is accomplished in a toolchain file.
fortify_linux_toolchain.cmake
INCLUDE (CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
#specify the compilers
SET(CMAKE_C_COMPILER ${CMAKE_SOURCE_DIR}/fortify_tools/fortify_cc)
SET(CMAKE_CXX_COMPILER ${CMAKE_SOURCE_DIR}/fortify_tools/fortify_cxx)
SET(CMAKE_AR_COMPILER ${CMAKE_SOURCE_DIR}/fortify_tools/fortify_ar)
To generate makefiles using the toolchain file
ccmake -DCMAKE_TOOLCHAIN_FILE=../fortify_tools/foritfy_linux_toolchain.cmake ../
configure and generate your makefiles and build your project.
Once the project is built from within the build directory generate a fortify report by
sourceanalyzer -Xmx2400M -debug -verbose -b <PROJECT_ID> -scan -f <PROJECT_ID>.fpr
I understand the last step is outside of CMake but I am pretty confident a cmake_custom_command can be created to perform the scan step as a post build action.
Finally, this is just the linux implementation but the concept scales well to Windows by creating the necessary batch files and windows specific toolchain file
Fortify doesn't support CMake, I received confirmation from Fortify support team.
This answer is late, but might help someone. This is actually easy to fix - you simply need to run cmake inside sourceanalyzer as well. Make a simple build script that calls cmake and then make, and use sourceanalyzer on that instead. I am using fortify 4.21.
Our old Fortify script for building hand-created Makefiles used a build command that looked like this:
$SOURCEANALYZER $MEMORY $LAUNCHERSWITCHES -b $BUILDID make -f Makefile -j12
I was able to get it working for a project that had been converted to CMake by replacing the above line with this, inspired by a couple of the other answers here:
CC="$SOURCEANALYZER $MEMORY $LAUNCHERSWITCHES -b $BUILDID gcc" \
CXX="$SOURCEANALYZER $MEMORY $LAUNCHERSWITCHES -b $BUILDID g++" \
AR="$SOURCEANALYZER $MEMORY $LAUNCHERSWITCHES -b $BUILDID ar" \
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
make -f Makefile -j12 VERBOSE=1
This is with cmake 2.8.12.2 on Linux.
Below is the script i use for my example project to generate HP Fortify report for Android JNI C/C++ Code.
#!/bin/sh
# Configure NDK version and CMake version
NDK_VERSION=21.0.6113669
CMAKE_VERSION=3.10.2
CMAKE_VERSION_PATH=$CMAKE_VERSION.4988404
PROJECTID="JNI_EXAMPLE"
REPORT_NAME=$PROJECTID"_$(date +'%Y%m%d_%H:%M:%S')"
WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BUILD_HOME=${WORKING_DIR}/../hpfortify_build
FPR="$BUILD_HOME/$REPORT_NAME.fpr"
# Following exports need to be configured according to host machine.
export ANDROID_SDK_HOME=/Library/Android/sdk
export ANDROID_CMAKE_HOME=$ANDROID_SDK_HOME/cmake/$CMAKE_VERSION_PATH/bin
export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk/$NDK_VERSION
# E.g. JniExample/app/hpfortify/build/CMakeFiles/3.10.2
export CMAKE_FILES_PATH=${BUILD_HOME}/CMakeFiles/$CMAKE_VERSION
export HPFORTIFY_HOME="/Applications/Fortify/Fortify_SCA_and_Apps_20.1.0/bin"
export PATH=$PATH:$ANDROID_SDK_HOME:$ANDROID_NDK_HOME:$ANDROID_CMAKE_HOME:$HPFORTIFY_HOME
echo "[========Start Android JNI C/C++ HP Fortify scanning========]"
echo "[========Build Dir: $BUILD_HOME========]"
echo "[========HP Fortify report path: $FPR========]"
function create_build_folder {
rm -rf $BUILD_HOME
mkdir $BUILD_HOME
}
# The standalone cmake build command can be found from below file.
# JniExample/app/.cxx/cmake/release/x86/build_command.txt
# This file is generated after running command
# `➜ JniExample git:(master) ✗ ./gradlew :app:externalNativeBuildRelease`
function configure_cmake_files {
cd $BUILD_HOME
$ANDROID_CMAKE_HOME/cmake -H$BUILD_HOME/. \
-DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions \
-DCMAKE_FIND_ROOT_PATH=$BUILD_HOME/.cxx/cmake/release/prefab/x86/prefab \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_SDK_HOME/ndk/$NDK_VERSION/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=x86 \
-DANDROID_NDK=$ANDROID_SDK_HOME/ndk/$NDK_VERSION \
-DANDROID_PLATFORM=android-16 \
-DCMAKE_ANDROID_ARCH_ABI=x86 \
-DCMAKE_ANDROID_NDK=$ANDROID_SDK_HOME/ndk/$NDK_VERSION \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$BUILD_HOME/intermediates/cmake/release/obj/x86 \
-DCMAKE_MAKE_PROGRAM=$ANDROID_SDK_HOME/cmake/$CMAKE_VERSION_PATH/bin/ninja \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_SYSTEM_VERSION=16 \
-B$BUILD_HOME/.cxx/cmake/release/x86 \
-GNinja ..
}
function build {
cmake --build .
}
function cleanup {
rm -rf $BUILD_HOME/CMakeFiles/native-lib.dir
rm -rf $FPR
$HPFORTIFY_HOME/sourceanalyzer -clean
}
function replace_compiler_paths {
FORTIFY_TOOLS_PATH="$WORKING_DIR"
CLANG_PATH="$ANDROID_SDK_HOME/ndk/$NDK_VERSION/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang"
CLANGXX_PATH="$ANDROID_SDK_HOME/ndk/$NDK_VERSION/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++"
HPFORTIFY_CCPATH="$FORTIFY_TOOLS_PATH/fortify_cc"
HPFORTIFY_CXXPATH="$FORTIFY_TOOLS_PATH/fortify_cxx"\"
sed -i '' 's+'$CLANG_PATH'+'$HPFORTIFY_CCPATH'+g' $CMAKE_FILES_PATH/CMakeCCompiler.cmake
sed -i '' 's+'$CLANG_PATH.*[^")"]'+'$HPFORTIFY_CXXPATH'+g' $CMAKE_FILES_PATH/CMakeCXXCompiler.cmake
}
function scan {
$HPFORTIFY_HOME/sourceanalyzer -b $PROJECTID -scan -f $FPR
# copy the file to $WORKING_DIR
cp $FPR $WORKING_DIR
}
create_build_folder
configure_cmake_files
echo "[========Compile C/C++ using normal compiler ========"]
build
echo "[========Replace the compiler with HP Fortify analyser wrapper compilers ========"]
replace_compiler_paths
echo "[========Clean up the build intermediates and the older build ID and fpr file ========"]
cleanup
echo "[========Recompile C/C++ using HP Fortify analyser wrapper compilers ========"]
build
echo "[========Scan the compiled files and generate final report ========"]
scan
echo "[========Change directory to original working dir ========"]
cd $WORKING_DIR
Need to configure below vars before using it. For my case, I use NDK 21 and CMake 3.10.2 and my project ID is "JNI_EXAMPLE"
# Configure NDK version and CMake version
NDK_VERSION=21.0.6113669
CMAKE_VERSION=3.10.2
CMAKE_VERSION_PATH=$CMAKE_VERSION.4988404
PROJECTID="JNI_EXAMPLE"
# Following exports need to be configured according to host machine.
export ANDROID_SDK_HOME=/Library/Android/sdk
export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk/$NDK_VERSION
export HPFORTIFY_HOME="/Applications/Fortify/Fortify_SCA_and_Apps_20.1.0/bin"
Here is a more detailed explanation: Using HP Fortify to Scan Android JNI C/C++ Code
On recent version of CMake one can use:
CMAKE_<LANG>_COMPILER_LAUNCHER='sourceanalyzer;-b;<PROJECT_ID>'
You can add other arguments (like -Xmx2G for instance), semicolon separated, as mentioned on cmake documentation
You need to check if you don't use the compiler launcher for another tool like ccache. We can probably use both with
CCACHE_PREFIX='.../sourceanalyzer -b ID'
Here is what I've used in CMake project:
project(myFortifiedProject LANGUAGES CXX)
set(CMAKE_CXX_COMPILER_LAUNCHER ${FORTIFY_TOOL} -b ${PROJECT_NAME})
So when running cmake (assuming sourceanalyzer is on the path):
cmake <other args> -DFORTIFY_TOOL=sourceanalyzer
So the normal build command works:
make myFortifiedProject
And you can finally collect results with:
sourceanalyzer -b myFortifiedProject -scan
I'm coming from a Objective-C/Xcode background.
I'm used to working with C projects already imported into XCode, but now I want to analyse an existing implementation of an algorithm I'm interested in integrating with my project.
Only that this project is written completely in C and has nothing to do with Objective-C/Xcode etc.
I'm not sure what is the best way to view a purely C project on Mac, so I installed NetBeans for C/C++.
The problem is that when I try to create a New Project on NetBeans and select C/C++ Project with Existing Sources it complains that
no make files or configure scripts were found
in the root directory.. although it clearly has a Makefile.am
I know that the Balsa project is written for linux, but I'm not interested in building the binary I just want to look at the source code in a IDE kinda way (ie I can click on a function call and see where it's implemented etc etc).
So in short my question is why isn't NetBeans recognising my Makefile.am?
and just for reference here is the content of the Makefile.am
#intl dir needed for tarball --disable-nls build.
DISTCHECK_CONFIGURE_FLAGS=--disable-extra-mimeicons --without-gnome --without-html-widget
SUBDIRS = po sounds images doc libbalsa libinit_balsa src
# set tar in case it is not set by automake or make
man_MANS=balsa.1
pixmapdir = $(datadir)/pixmaps
pixmap_DATA = gnome-balsa2.png
desktopdir = $(datadir)/applications
desktop_in_files = balsa.desktop.in balsa-mailto-handler.desktop.in
desktop_DATA = balsa.desktop balsa-mailto-handler.desktop
#INTLTOOL_DESKTOP_RULE#
balsa_extra_dist = \
GNOME_Balsa.server.in \
HACKING \
balsa-mail-style.xml \
balsa-mail.lang \
balsa.1.in \
balsa.spec.in \
bootstrap.sh \
docs/mh-mail-HOWTO \
docs/pine2vcard \
docs/vconvert.awk \
$(desktop_in_files) \
gnome-balsa2.png \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
mkinstalldirs
if BUILD_WITH_G_D_U
balsa_g_d_u_extra_dist = gnome-doc-utils.make
endif
if !BUILD_WITH_UNIQUE
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_Balsa.server
server_DATA = $(server_in_files:.server.in=.server)
$(server_in_files): $(server_in_files).in
sed -e "s|\#bindir\#|$(bindir)|" $< > $#
endif
EXTRA_DIST = \
$(balsa_extra_dist) \
$(balsa_g_d_u_extra_dist)
if BUILD_WITH_GTKSOURCEVIEW2
gtksourceviewdir = $(BALSA_DATA_PREFIX)/gtksourceview-2.0
gtksourceview_DATA = balsa-mail.lang \
balsa-mail-style.xml
endif
DISTCLEANFILES = $(desktop_DATA) $(server_DATA) \
intltool-extract intltool-merge intltool-update \
gnome-doc-utils.make
dist-hook: balsa.spec
cp balsa.spec $(distdir)
#MAINT#RPM: balsa.spec
#MAINT# rm -f *.rpm
#MAINT# $(MAKE) distdir="$(PACKAGE)-#BALSA_VERSION#" dist
#MAINT# cp $(top_srcdir)/rpm-po.patch $(top_builddir)/rpm-po.patch
#MAINT# rpm -ta "./$(PACKAGE)-#BALSA_VERSION#.tar.gz"
#MAINT# rm $(top_builddir)/rpm-po.patch
#MAINT# -test -f "/usr/src/redhat/SRPMS/$(PACKAGE)-#VERSION#-#BALSA_RELEASE#.src.rpm" \
#MAINT# && cp -f "/usr/src/redhat/SRPMS/$(PACKAGE)-#VERSION#-#BALSA_RELEASE#.src.rpm" .
#MAINT# -for ping in /usr/src/redhat/RPMS/* ; do \
#MAINT# if test -d $$ping ; then \
#MAINT# arch=`echo $$ping |sed -e 's,/.*/\([^/][^/]*\),\1,'` ; \
#MAINT# f="$$ping/$(PACKAGE)-#VERSION#-#BALSA_RELEASE#.$$arch.rpm" ; \
#MAINT# test -f $$f && cp -f $$f . ; \
#MAINT# fi ; \
#MAINT# done
#MAINT#snapshot:
#MAINT# $(MAKE) distdir=$(PACKAGE)-`date +"%y%m%d"` dist
#MAINT#balsa-dcheck:
#MAINT# $(MAKE) BALSA_DISTCHECK_HACK=yes distcheck
## to automatically rebuild aclocal.m4 if any of the macros in
## `macros/' change
bzdist: distdir
#test -n "$(AMTAR)" || { echo "AMTAR undefined. Run make bzdist AMTAR=gtar"; false; }
-chmod -R a+r $(distdir)
$(AMTAR) chojf $(distdir).tar.bz2 $(distdir)
-rm -rf $(distdir)
# macros are not used any more by current configure.in, see also
# post by Ildar Mulyukov to balsa-list, 2006.06.27
# ACLOCAL_AMFLAGS = -I macros
UPDATE
I tried this answer.. but I got the following:
autoreconf --install
configure.in:250: warning: macro `AM_GLIB_GNU_GETTEXT' not found in library
glibtoolize: putting auxiliary files in `.'.
glibtoolize: copying file `./ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
glibtoolize: copying file `m4/libtool.m4'
glibtoolize: copying file `m4/ltoptions.m4'
glibtoolize: copying file `m4/ltsugar.m4'
glibtoolize: copying file `m4/ltversion.m4'
glibtoolize: copying file `m4/lt~obsolete.m4'
glibtoolize: Remember to add `LT_INIT' to configure.in.
glibtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
glibtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
configure.in:250: warning: macro `AM_GLIB_GNU_GETTEXT' not found in library
configure.in:249: error: possibly undefined macro: AC_PROG_INTLTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.in:250: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT
configure.in:301: error: possibly undefined macro: AC_MSG_ERROR
autoreconf: /usr/bin/autoconf failed with exit status: 1
I'm looking into using the suggestions in the output..
Interesting. I just tried downloading "balsa" and noticed that they distributed the Makefile.am and configure.in files instead of a ready to run configure script. You could let the package maintainers know they aren't doing anyone any favors by not precompiling their own autotools sources.
Makefile.am is not a real Makefile. It's the thing that generates Makefile.in, which in turn gets translated into a real Makefile by a configure script.
Try the following steps:
Download the sources to balsa again clean. Then from the command prompt type the following:
autoreconf --install
(If you don't have autoreconf, you likely need to install the autotools packages - ughh...)
That should generate the configure script. Then type:
./configure
It complained about some missing GMime dependencies, so I didn't see it actually generate a Makefile. Once you get to the point in which a Makefile is generated, you should be able to point Netbeans to "open project from existing sources".
As per abbood's request...
Netbeans is not very good for C development. One approach would be to build an XCode project around the source base. The maintainers of the project may even accept the XCode project as a contribution.