Building libical-1.0 on OS X fails - c

I'm trying to use libical for a C-project. Unfortunately, the make command gives me the following output:
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in design-data
make[2]: Nothing to be done for `all'.
Making all in doc
make[2]: Nothing to be done for `all'.
Making all in scripts
make[2]: Nothing to be done for `all'.
Making all in test-data
make[2]: Nothing to be done for `all'.
Making all in src
Making all in libical
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
/bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../src -I../../src -I../../src/libical -I../../src/libical -I. -DPACKAGE_DATA_DIR=\""/usr/local/libical/share/libical"\" -g -O2 -MT icalderivedparameter.lo -MD -MP -MF .deps/icalderivedparameter.Tpo -c -o icalderivedparameter.lo icalderivedparameter.c
mv -f .deps/icalderivedparameter.Tpo .deps/icalderivedparameter.Plo
mv: rename .deps/icalderivedparameter.Tpo to .deps/icalderivedparameter.Plo: No such file or directory
make[4]: *** [icalderivedparameter.lo] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I'm not sure whats wrong here. I'm running OS X 10.9 and gcc.
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

You must call ./bootstrap.
./bootstrap
./configure
make
make install
Bootstrap was the key for me.

Related

Makefile crashed while making after pass the ./configure --host=mingw32

Everyone: situation: MacOS with x86_64-w64-mingw32 compiling toolchain I tried to compile GDB for Windows from the source code of GDB. But, after ./configure, I got
/bin/sh ./libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wno-format -I./../zlib -Iincludedir -D__USE_MINGW_ACCESS -release `cat libtool-soversion` -Llibdir -Wl,--stack,12582912 -o libbfd.la -rpath /usr/local/lib archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo `cat ofiles` -L./../zlib -lz
./libtool: line 5208: cd: libdir: No such file or directory
libtool: link: cannot determine absolute directory name of `libdir'
make[4]: *** [libbfd.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-bfd] Error 2
I am sure my MingW32 is fully built and capable.
x86_64-w64-mingw32-addr2line x86_64-w64-mingw32-dllwrap x86_64-w64-mingw32-gcc-ranlib x86_64-w64-mingw32-ld.bfd x86_64-w64-mingw32-size
x86_64-w64-mingw32-ar x86_64-w64-mingw32-elfedit x86_64-w64-mingw32-gcov x86_64-w64-mingw32-lto-dump x86_64-w64-mingw32-strings
x86_64-w64-mingw32-as x86_64-w64-mingw32-g++ x86_64-w64-mingw32-gcov-dump x86_64-w64-mingw32-nm x86_64-w64-mingw32-strip
x86_64-w64-mingw32-c++ x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcov-tool x86_64-w64-mingw32-objcopy x86_64-w64-mingw32-windmc
x86_64-w64-mingw32-c++filt x86_64-w64-mingw32-gcc-10.2.0 x86_64-w64-mingw32-gfortran x86_64-w64-mingw32-objdump x86_64-w64-mingw32-windres
x86_64-w64-mingw32-cpp x86_64-w64-mingw32-gcc-ar x86_64-w64-mingw32-gprof x86_64-w64-mingw32-ranlib
x86_64-w64-mingw32-dlltool x86_64-w64-mingw32-gcc-nm x86_64-w64-mingw32-ld x86_64-w64-mingw32-readelf
I install it via HomeBrew And here is the config for libdir in my Makefile
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
LDFLAGS = -Llibdir
...
"libdir=$(libdir)" \
...
Totally have no idea how to fix this. Any idea? Or if you need some more information to figure it out, just let me know.
And just download the source code of GDB, I think you could duplicate the same scenario.
./libtool: line 5208: cd: libdir: No such file or directory
libtool: link: cannot determine absolute directory name of `libdir'
make[4]: *** [libbfd.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-bfd] Error 2
make: *** [all] Error 2
As the command line and error message say, you give libtool not the right path.
The command line contains -Llibdir and the error message says "cannot determine absolute directory name of 'libdir'".
So you wrote your Makefile to use libdir literally and not as the variable as it should be. Change it into:
LDFLAGS = -L$(libdir)
or
LDFLAGS = -L${libdir}
There is no real difference between parentheses and braces, just don't mix them up. Helpful links are:
The difference between parentheses and curly braces in GNU Make and
What's the difference between parenthesis $() and curly bracket ${} syntax in Makefile?

Building GCC cross-compiler for PowerPC AIX 7.1

I'm just trying to build gcc cross-compiler for AIX7.1. Have successfully built binutils-2.25.1, but have problems with building gcc-6.3.0. It successfully compile target all-gcc but fails on compiling all-target-libgcc. I get this error:
In file included from /home/zakkurasov/aix-sysroot/usr/include/sys/inttypes.h:51:0,
from /home/zakkurasov/cross-aix/build-gcc/gcc/include-fixed/sys/types.h:70,
from /home/zakkurasov/cross-aix/build-gcc/gcc/include-fixed/stdio.h:489,
from ../../../../gcc-6.3.0/libgcc/../gcc/tsystem.h:87,
from ../../../../gcc-6.3.0/libgcc/libgcc2.c:27:
/home/zakkurasov/cross-aix/build-gcc/gcc/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
^
compilation terminated.
Makefile:467: recipe for target '_lshrdi3.o' failed
make[4]: *** [_lshrdi3.o] Error 1
make[4]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/pthread/libgcc'
Makefile:1161: recipe for target 'multi-do' failed
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/libgcc'
Makefile:118: recipe for target 'all-multi' failed
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/libgcc'
Makefile:12321: recipe for target 'all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc'
Makefile:882: recipe for target 'all' failed
make: *** [all] Error 2
Configure with command:
../gcc-6.3.0/configure --prefix=$PREFIX --host=$MACHTYPE --build=$MACHTYPE --target=$TARGET --with-sysroot=$SYSROOT --with-gnu-as --with-gnu-ld --enable-multilib --enable-languages=c,c++ -v
where
$PREFIX=/opt/aix
$TARGET=powerpc-ibm-aix7.1.0.0
$MACHTYPE=x86_64-pc-linux-gnu
$SYSROOT contain includes and libs from AIX 7.1
Sorry, have checked and saw that files in $SYSROOT/usr just broken symbolic links. Replaced it with files, and get new error:
/home/zakkurasov/cross-aix/build-gcc/./gcc/xgcc -B/home/zakkurasov/cross-aix/build-gcc/./gcc/ -B/opt/aix/powerpc-ibm-aix7.1.0.0/bin/ -B/opt/aix/powerpc-ibm-aix7.1.0.0/lib/ -isystem /opt/aix/powerpc-ibm-aix7.1.0.0/include -isystem /opt/aix/powerpc-ibm-aix7.1.0.0/sys-include -g -O2 -maix64 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -mlong-double-128 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -mlong-double-128 -I. -I. -I../../.././gcc -I../../../../gcc-6.3.0/libgcc -I../../../../gcc-6.3.0/libgcc/. -I../../../../gcc-6.3.0/libgcc/../gcc -I../../../../gcc-6.3.0/libgcc/../include -DHAVE_CC_TLS -DUSE_EMUTLS -o _mulsc3.o -MT _mulsc3.o -MD -MP -MF _mulsc3.dep -DL_mulsc3 -c ../../../../gcc-6.3.0/libgcc/libgcc2.c
/tmp/ccuoaSIc.s: Assembler messages:
/tmp/ccuoaSIc.s:545: Error: junk at end of line: `4'
/tmp/ccuoaSIc.s:548: Error: junk at end of line: `1'
Makefile:467: recipe for target '_mulsc3.o' failed

build error using CMake

I get a build error when trying to build a flex and lemon project with CMake. Can you help me find what is wrong?
$ make
/usr/bin/cmake -H/home/dac/ClionProjects/openshell -B/home/dac/ClionProjects/openshell --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/dac/ClionProjects/openshell/CMakeFiles /home/dac/ClionProjects/openshell/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/dac/ClionProjects/openshell'
make -f CMakeFiles/lemon.dir/build.make CMakeFiles/lemon.dir/depend
make[2]: Entering directory '/home/dac/ClionProjects/openshell'
cd /home/dac/ClionProjects/openshell && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell/CMakeFiles/lemon.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/dac/ClionProjects/openshell'
make -f CMakeFiles/lemon.dir/build.make CMakeFiles/lemon.dir/build
make[2]: Entering directory '/home/dac/ClionProjects/openshell'
make[2]: Nothing to be done for 'CMakeFiles/lemon.dir/build'.
make[2]: Leaving directory '/home/dac/ClionProjects/openshell'
/usr/bin/cmake -E cmake_progress_report /home/dac/ClionProjects/openshell/CMakeFiles 1
[ 16%] Built target lemon
make -f CMakeFiles/openshell.dir/build.make CMakeFiles/openshell.dir/depend
make[2]: Entering directory '/home/dac/ClionProjects/openshell'
cd /home/dac/ClionProjects/openshell && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell /home/dac/ClionProjects/openshell/CMakeFiles/openshell.dir/DependInfo.cmake --color=
Scanning dependencies of target openshell
make[2]: Leaving directory '/home/dac/ClionProjects/openshell'
make -f CMakeFiles/openshell.dir/build.make CMakeFiles/openshell.dir/build
make[2]: Entering directory '/home/dac/ClionProjects/openshell'
/usr/bin/cmake -E cmake_progress_report /home/dac/ClionProjects/openshell/CMakeFiles 2
[ 33%] Building C object CMakeFiles/openshell.dir/main.c.o
/usr/bin/cc -Wall -Werror -O3 -std=c99 -I/usr/include/readline -o CMakeFiles/openshell.dir/main.c.o -c /home/dac/ClionProjects/openshell/main.c
Linking C executable openshell
/usr/bin/cmake -E cmake_link_script CMakeFiles/openshell.dir/link.txt --verbose=1
/usr/bin/cc -Wall -Werror -O3 -std=c99 CMakeFiles/openshell.dir/main.c.o CMakeFiles/openshell.dir/errors.c.o CMakeFiles/openshell.dir/util.c.o CMakeFiles/openshell.dir/stack.c.o CMakeFiles/openshell.dir/flex/shellparser.c.o -o openshell -rdynamic -lreadline
CMakeFiles/openshell.dir/main.c.o: In function `main':
main.c:(.text.startup+0xef): undefined reference to `yylex_init'
main.c:(.text.startup+0x100): undefined reference to `yyset_in'
main.c:(.text.startup+0x12e): undefined reference to `yylex'
main.c:(.text.startup+0x13a): undefined reference to `yyget_text'
main.c:(.text.startup+0x178): undefined reference to `yylex_destroy'
collect2: error: ld returned 1 exit status
CMakeFiles/openshell.dir/build.make:188: recipe for target 'openshell' failed
make[2]: *** [openshell] Error 1
make[2]: Leaving directory '/home/dac/ClionProjects/openshell'
CMakeFiles/Makefile2:98: recipe for target 'CMakeFiles/openshell.dir/all' failed
make[1]: *** [CMakeFiles/openshell.dir/all] Error 2
make[1]: Leaving directory '/home/dac/ClionProjects/openshell'
Makefile:78: recipe for target 'all' failed
make: *** [all] Error 2
My CMake build file is
cmake_minimum_required (VERSION 2.6)
project (openshell)
set(CMAKE_VERBOSE_MAKEFILE on)
include_directories(/usr/include/readline)
#### Lemon bootstrap ####
ADD_EXECUTABLE(lemon lemon.c)
file(GLOB SOURCES "./*.c")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -O3 -std=c99")
add_executable(openshell main.c openshell.h errors.c errors.h util.c util.h stack.c stack.h flex/shellparser.c flex/shellscanner.l flex/shellscanner.h)
target_link_libraries(openshell readline)
You're not linking the Flex library, so you will get linker errors for any Flex functions you use, such as yyset_in.
You can use find_package(FLEX) and after using FLEX_TARGET to define your Flex targets, you can then use something like the following:
# Note: I use "ShellScanner" below as in FLEX_TARGET(ShellScanner flex/shellscanner.l ...)
add_executable(openshell
...
flex/shellparser.c
${FLEX_ShellScanner_OUTPUTS}
)
target_link_libraries(openshell ${READLINE_LIBRARY} ${FLEX_LIBRARIES})
See FindFLEX for more information.
However, I don't see a FindReadline.cmake module with the other modules that CMake provides by default, so you might have to create one yourself or use an existing one such as the one I just linked. There's also the Editline library, which provides similar functionality, and you can use an existing FindEditline.cmake file for that too.

Error in makefile, compile multiple C files

I am trying to create a makefile so I can compile multiple C files. this makefile doesn't work as expected and do only compile ex1 when i run make alland gives error about ex3 (See error log)
CFLAGS=-Wall -g
all:
make ex1
make ex3
clean:
rm -f ex1
rm -f ex3
Error:
make all
make ex1
make[1]: Entering directory '/home/daniel/ownCloud/code/Learn C the hard way/Make'
cc -Wall -g ex1.c -o ex1
make[1]: Leaving directory '/home/daniel/ownCloud/code/Learn C the hard way/Make'
make ex3
make[1]: Entering directory '/home/daniel/ownCloud/code/Learn C the hard way/Make'
make[1]: *** No rule to make target 'ex3'. Stop.
make[1]: Leaving directory '/home/daniel/ownCloud/code/Learn C the hard way/Make'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2
it is a bad idea recursively invoke make. You should write your makefile as follows:
CFLAGS=-Wall -g
all: ex1 ex3
clean:
rm -f ex1 ex3

Axis2/c error in instalaltion

My problem is the following one:
When installing Axis2/c under the guidance of http://petio.org/ws/web_services_page7.html , which seems to be an adjusted manual from the official site I have a problem right after executing the make command in terminal.
At exactly this point:
$ cd /tmp/axis/axis2c-src-1.6.0
$ ./configure --prefix=${AXIS2C_HOME} --enable-libxml2=yes
$ make
I get this error:
XXX#XXXPC:~/Tools/axis2c/axis2c-src-1.5.0$ make
make all-recursive
make[1]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0'
Making all in util
make[2]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make all-recursive
make[3]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
Making all in src
make[4]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src'
Making all in platforms/unix
make[5]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src/platforms/unix'
/bin/bash ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Werror -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Werror -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c -fPIC -DPIC -o .libs/uuid_gen_unix.o
**uuid_gen_unix.c: In function ‘axutil_uuid_gen_v1’:
uuid_gen_unix.c:62:20: error: variable ‘tv’ set but not used [-Werror=unused-but-set-variable]**
cc1: all warnings being treated as errors
make[5]: *** [uuid_gen_unix.lo] Error 1
make[5]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src/platforms/unix'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0'
make: *** [all] Error 2
I am not able to understand the reason why this error is being produced.
Because 1.6.0 version is down, I am using the 1.5.0 source version of axis2/c from the official site : http://axis.apache.org/axis2/c/core/download.cgi .
I have additionally installed Apache2 and libxml2, OpenSSL, cURL, libiconv, and zlib.
libraries.
I need your help because I am trying to build a serious project.
Thanks in advance.
Link to mirror of original Axis2/C-1.6.0 source distribution is here.
The main problem is with -Werror flag.
To compile original Axis2/C with modern compiler you must remove -Werror string from build scripts. To do that run this command after unpacking tarball:
find -type f -name configure -exec sed -i '/CFLAGS/s/-Werror//g' {} \;
Then configure and make Axis2/C.
Note: Original Axis2/C-1.6.0 has many issues like memory leaks and crashes. Consider using Axis2/C unofficial project instead. Most critical Axis2/C-1.6.0's issues is fixed within that project.
Also it have additional features https://code.google.com/p/axis2c-unofficial/wiki/IssuesList like JSON support and enhanced CURL-based transport authentication (and some other features).
There is an manual on how to install Axis2/C unofficial on Linux.

Resources