autotools

How can I define #define in my Make files

爱⌒轻易说出口 提交于 2019-12-03 12:21:47
In my c/c++ files, there are multiple #define. As an example: #ifdef LIBVNCSERVER_HAVE_LIBZ /* some code */ #ifdef LIBVNCSERVER_HAVE_LIBJPEG /* some more code */ Can you please tell me how can I modify my Makefile.in so that I have those #define in ALL files during compilation? Thank you. -DLIBVNCSERVER_HAVE_LIBZ -DLIBVNCSERVER_HAVE_LIBJPEG You could pass those in CPPFLAGS , CPPFLAGS = -DLIBVNCSERVER_HAVE_LIBZ -DLIBVNCSERVER_HAVE_LIBJPEG or make new variable CUSTOMDEFINES = -DLIBVNCSERVER_HAVE_LIBZ -DLIBVNCSERVER_HAVE_LIBJPEG and pass it to CPPFLAGS = -DEXISTINGFLAGS $(CUSTOMDEFINES) Those are

Why has nobody created an open source build system for the brain dead? [closed]

匆匆过客 提交于 2019-12-03 11:05:07
I want to build a shared library. GNU/Linux is the development and target platform. C is the implementation language. I can't decide how I want to setup the build system and keep flitting around three options each of which have lots of reasons to dislike: hand crafted Makefiles - I've worked this way almost exclusively in the past GNU Autotools - I used autotools earlier this year to build a shared C library, but have forgotten how I did it and where all the many hundreds of tutorials were I used for pickings. waf - supposedly simple but not so easy I've got it working this afternoon. I can't

How do you create tests for “make check” with GNU autotools

六眼飞鱼酱① 提交于 2019-12-03 08:20:16
问题 I'm using GNU autotools for the build system on a particular project. I want to start writing automated tests for verifcation. I would like to just type "make check" to have it automatically run these. My project is in C++, although I am still curious about writing automated tests for other languages as well. Is this compatible with pretty much every unit testing framework out there (I was thinking of using cppunit)? How do I hook these unit testing frameworks into make check? Can I make sure

Relative or independent paths in libtool .la file

帅比萌擦擦* 提交于 2019-12-03 07:46:48
My .la file has full pathnames in both the dependency_libs= section and the libdir= section which makes it difficult to copy my libraries to a different machine (same arch but different path structure). What is the solution to this, besides having some script to hack the .la file to adjust for the paths on the new machine? ==Details== When I ./configure; make; make install my libfoo , depending on how I use the --prefix , --exec-prefix , and DESTDIR= flags, I'll get an entry in the libfoo.la file that reads libdir=/dir1/lib and I'll have the actual .so files in the same dir as libfoo.la . All

Cross-compile Apache Portable Runtime to the iPhone

天涯浪子 提交于 2019-12-03 06:46:50
This is a followup to a previous question on cross-compiling for the iPhone: Cross-compile Autotools-based Libraries for Official iPhone SDK Basically, I am trying to compile the Apache Portable Runtime (APR) version 1.3.8 (latest) for the iPhone. I am currently running into the following error during the configuration step: checking for working PROCESS_SHARED locks... configure: error: in `/Users/michaelsafyan/Downloads/apr-1.3.8': configure: error: cannot run test program while cross compiling See `config.log' for more details. I am invoking the "configure" script via "iphone3.1-configure -

Autoconf — including a static library (newbie)

这一生的挚爱 提交于 2019-12-03 05:28:32
I am trying to migrate my application from manual build to autoconf, which is working very nicely so far. But I have one static library that I can't figure out how to integrate. That library will NOT be located in the usual library locations - the location of the binary (.a file) and header (.h file) will be given as a configure argument. (Notably, even if I move the .a file to /usr/lib or anywhere else I can think of, it still won't work.) It is also not named traditionally (it does not start with "lib" or "l"). Manual compilation is working with these (directory is not predictable - this is

Howto add a link to a library in autoconf configure script / makefile

耗尽温柔 提交于 2019-12-03 05:19:17
I am an autotools newb and I have difficulties figuring out howto easily link a specific library into one of the configured targets. I have a source package that I want to build the usual way: ./configure && make && make install Unfortunately one of the cpps has a missing reference to another library. Compiling it by hand (adjusting the commandline) works. But I would rather "patch" the compile script. Where is the standard place to edit linking references? undefined reference to `boost::system::get_system_category() That is my error message btw. You need to add the relevant -l flag to AM

Automake error './ltmain.sh' not found

蓝咒 提交于 2019-12-03 03:13:46
问题 I've installed mingw and msys by using mingw-get-setup.exe . I've also installed Autotools(autoconf, automake,m4,libtool) into C:\/opt/autotools . When I run automake, the following error always occurs: configure.ac:11: error: required file './ltmain.sh' not found If I copy ltmain.sh from libtool’s installed tree, execution will finish normally. How can I configuure automake to find ltmain.sh without copying? 回答1: In an autoconf / automake / libtool project you have to invoke: libtoolize :

Debugging the error “gcc: error: x86_64-linux-gnu-gcc: No such file or directory”

不打扰是莪最后的温柔 提交于 2019-12-03 02:34:30
问题 I'm trying to build: https://github.com/kanzure/nanoengineer But it looks like it errors out on: gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/python2.7 -std=c99 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -MT libstructcompare_a-structcompare.o -MD -MP -MF .deps/libstructcompare_a-structcompare.Tpo -c -o libstructcompare_a-structcompare.o `test -f 'structcompare.c' || echo './'`structcompare.c gcc: error: x86_64-linux-gnu-gcc: No

Building a library using autotools from cmake

风格不统一 提交于 2019-12-03 02:18:00
问题 This is my first try with cmake and I would like to have, if possible, some feedbacks about what I did since some problems remain. In the CMakeLists.txt of the library folder, I created two makefile targets: configure-antlr3c and antlr3c . The first target runs the autotools configuration shell script, the second one runs the make executable to build the library: # CMakeLists.txt in libantlr3c-3.1.3 add_custom_target( configure-antlr3c ${SHELL_EXECUTABLE} configure WORKING_DIRECTORY ${CMAKE