NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
grob115
Joined: 13 Dec 2011 Posts: 37
|
Posted: Mon Mar 05, 2012 4:36 pm Post subject: How to build C/C++ Project with Existing Sources |
|
|
Hi, am trying to build the Apache APR lib from withing the IDE rather than from the command line but the IDE for some reason never generated the final lib.
If I'm doing it from Putty I'll enter the following, which will then generate the libs (ie .a file) in the directory specified with the --prefix option.
./configure --prefix=/appvol/NetBeansProjects/lib/apache/apr-1.4.6/out
make
make install
However, when I tried to do this from the IDE, it ran the "configure", "make clean", and "make install" part pretty much all successfully. The only exception is that it didn't run the very last bit of the "make install" part that would have run as if I'm doing manually. Exact bit missing is pasted below.
I used the following steps:
1) Add Project -> C/C++ Project with Existing Sources
2) Select the directory downloaded from Apache
Select Configuration Mode: Custom
3) Select Using the makefile generated by the 'configure' script
Here I added the --prefix=/appvol/NetBeansProjects/lib/apache/apr-1.4.6/out
4) Select Next for the rest of the steps.
| Code: | /appvol/NetBeansProjects/lib/apache/apr-1.4.6/build/mkdir.sh /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/bin /appvol/NetBeansProjects/lib/apache/
apr-1.4.6/out/build-1 \
/appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/pkgconfig /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/include/apr-1
mkdir /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out
mkdir /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib
mkdir /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/bin
mkdir /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/build-1
mkdir /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/pkgconfig
mkdir /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/include
mkdir /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/include/apr-1
/usr/bin/install -c -m 644 /appvol/NetBeansProjects/lib/apache/apr-1.4.6/include/apr.h /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/include/apr-1
for f in /appvol/NetBeansProjects/lib/apache/apr-1.4.6/include/apr_*.h; do \
/usr/bin/install -c -m 644 ${f} /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/include/apr-1; \
done
/bin/sh /appvol/NetBeansProjects/lib/apache/apr-1.4.6/libtool --mode=install /usr/bin/install -c -m 755 libapr-1.la /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.so.0.4.6 /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/libapr-1.so.0.4.6
libtool: install: (cd /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib && { ln -s -f libapr-1.so.0.4.6 libapr-1.so.0 || { rm -f libapr-1.so.0 && ln -s libapr-1.so.0.4.6 libapr-1.so.0; }; })
libtool: install: (cd /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib && { ln -s -f libapr-1.so.0.4.6 libapr-1.so || { rm -f libapr-1.so && ln -s libapr-1.so.0.4.6 libapr-1.so; }; })
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.lai /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/libapr-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.a /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/libapr-1.a
libtool: install: chmod 644 /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/libapr-1.a
libtool: install: ranlib /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/libapr-1.a
libtool: finish: PATH="/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/java/bin:/usr/games:/opt/gnome/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/sbin" ldconfig -n /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib
----------------------------------------------------------------------
Libraries have been installed in:
/appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 apr.exp /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
if test -f ${f}; then /usr/bin/install -c -m 755 ${f} /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/build-1; fi; \
done
/usr/bin/install -c -m 755 /appvol/NetBeansProjects/lib/apache/apr-1.4.6/build/mkdir.sh /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/build-1
for f in make_exports.awk make_var_export.awk; do \
/usr/bin/install -c -m 644 /appvol/NetBeansProjects/lib/apache/apr-1.4.6/build/${f} /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/build-1; \
done
/usr/bin/install -c -m 644 build/apr_rules.out /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/build-1/apr_rules.mk
/usr/bin/install -c -m 755 apr-config.out /appvol/NetBeansProjects/lib/apache/apr-1.4.6/out/bin/apr-1-config
|
|
|
| Back to top |
|
 |
grob115
Joined: 13 Dec 2011 Posts: 37
|
Posted: Fri Mar 09, 2012 6:34 pm Post subject: |
|
|
Noticed the "Makefile" generated by manually running "./configure" or building from Netbeans is the same. The thing that is different however, is the build/mkdir.sh file generated when building from Netbeans. The build/mkdir.sh for some reason turns out to be of the file type "data" as follow:
file build/mkdir.sh
build/mkdir.sh: data
This is unexpected as it should be of a script type, which is the case if I generate by hand manually. Any ideas? |
|
| Back to top |
|
 |
grob115
Joined: 13 Dec 2011 Posts: 37
|
Posted: Sun Mar 11, 2012 12:01 pm Post subject: |
|
|
Hi, please dis-regard the previous post about the build/mkdir.sh issue. Not sure how that happened.
Found the solution. Turns out when adding C/C++ Project with Existing Sources, I have to explicitly do the following
1. Choose Project
2. Select Mode
Choose Custom (Default is Automatic)
3. Build Tool
Choose "Using the makefile generated by the 'configure' script (Default is "Using an existing makefile") instead and specify the "--prefix=<dir name>" option in the list of "Configure Arguments".
4. Build Actions
Build Command
Change from the following
${MAKE} -f Makefile
To the following
${MAKE} -f Makefile install
If the Default Option is used in Step 3 above, this will by default place the build output under /usr/local provided of course that the username Netbeans is using has write access to /usr/local. Otherwise, it'd be placed in the folder specified with the "--prefix=<dir name>" option.
Vladimir, saw you have sent me a reply via e-mail but not sure why it's not synced up with this forum. Can you put the above guide in the Wiki? The site surely can benefit from better C++ Wiki. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|