OpenLDAP Installation - Build Configure for LDIF - linux

I want to build openldap on linux, aix, and sun solaris. I require openldap only for use in regression tests on these machines. For this purpose I only need ldif. I want to avoid any potential licensing problems and expenses related to Oracle Berkeley DB.
I have downloaded by FTP the tar file openldap-2.4.40.tgz to a linux machine. I then ran,
tar -zxvf openldap-2.4.40.tgz
cd openldap-2.4.40
To configure the source ready for the build,
./configure --enable-ldif=yes
The log ended in;
...
checking for gethostbyaddr_r... yes
checking number of arguments of ctime_r... 2
checking number of arguments of gethostbyname_r... 6
checking number of arguments of gethostbyaddr_r... 8
checking db.h usability... no
checking db.h presence... no
checking for db.h... no
configure: error: BDB/HDB: BerkeleyDB not available
Can I get OpenLDAP built for only LDIF, or at least not depended on Oracle Berkeley DB? How?

There is no enable-ldif option anymore. You get LDIF format by default.
To disable BerkeleyDB
./configure --enable-bdb=no --enable-hdb=no
make depend
make install
For my purposes I found the --prefix option useful.
So far I have been able to build it on Linux, Solaris, and AIX.
But on AIX could only build static libraries. But that is another question.

Related

How to properly configure `serf` during Subversion compilation?

First of all, I'm aware of this answer, yet as it's quite vague, it didn't help me solve my problem.
I'm working on CentOS machine and as current subversion package is quite old, I needed to compile svn by myself. I've managed to do that, but trying to use one of commands I need, which is:
$ svnsync initialize [...] [...]
Resulted with the following error:
svnsync: E170000: Unrecognized URL scheme for '[url here]'
After some research, I found that I need serf to make it work, so I've installed it by using yum install libserf (I'm not sure if it's it, but name and description sound similar to what I need). Unfortunately, nothing has changed and I later came to a conclusion that maybe I need to recompile svn with serf in place.
I've downloaded subversion source and ran ./configure. Here is the output of it associated with serf:
configure: serf library configuration via pkg-config
checking for serf-2 library... no
checking for serf-1 library... no
checking was serf enabled... no
An appropriate version of serf could not be found, so libsvn_ra_serf
will not be built. If you want to build libsvn_ra_serf, please
install serf 1.3.4 or newer.
There is an argument called --with-serf, but I'm not sure how should I use it. Linking to location of serf binaries, like that:
$ ./configure --with-serf=/usr/lib64/
results with the following output:
configure: serf library configuration via pkg-config
checking for serf-2 library... no
checking for serf-1 library... no
checking was serf enabled... no
An appropriate version of serf could not be found, so libsvn_ra_serf
will not be built. If you want to build libsvn_ra_serf, please
install serf 1.3.4 or newer.
configure: error: Serf was explicitly enabled but an appropriate version was not found.
Can you give me some hints on how can I proceed with this?

How do I install tcpslice from source, released for fedora, on a mac 64 bit?

The newest publicly available tcpslice version 1.2a1 (found on its github) has a bug where it expects 8 bytes for a time field but gets 16 (when in 64 bit). This leads to the error:
tcpslice: problems finding end packet of file ./abc1234.bin
I got my info for this error from: https://bugzilla.redhat.com/show_bug.cgi?id=485670
This led me to grab the updated version (1.2a3) from here and try compiling from source: http://pkgs.fedoraproject.org/repo/pkgs/tcpdump/tcpslice-1.2a3.tar.gz/. I think this is or close to the actual patch
HOWEVER, I couldn't ./configure this on my mac because it says (understandably) this:
checking build system type... configure: error: cannot guess build type; you must specify one
Not one to give up, and becuase I don't wnat to switch over to linux to continue deveolping my wrapper script, I tried to compile like this:
./configure --build=i686-pc-linux-gnu
This configured and make'd!!! However, its 32 bit which still gives the same error when I run the newly made tcpdump!!
Is this possible at all, and what other --build type can I use that is for x86_64 bit systems? No other --build types are compiling for me. I have no idea how to find acceptable build types, and am currently referenceing this: https://gcc.gnu.org/gcc-4.2/buildstat.html
EDIT: I tried Warren Young's suggestion here but libtoolize --force did not remake config.guess, so I manually downloaded the "newest" config.guess from the link on this page with curl. However, now ./configure says:
checking build system type... Invalid configuration `x86_64-apple-darwin15.4.0': machine `x86_64-apple' not recognized
configure: error: /bin/sh ./config.sub x86_64-apple-darwin15.4.0 failed
Am I screwed? Or can I sitll try a default x86_64 -build type (which I still cannot find):
checking build system type... Invalid configuration `x86_64': machine `x86_64' not recognized
configure: error: /bin/sh ./config.sub x86_64 failed
Welp, the answer was to manually download the newest config.guess and config.sub files from here: https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html and to overwrite the ones in the tcpslice directory.
However, the same problem still existed. There must be another reason the time issue is happening on the mac because this version of tcpslice worked fine on ubuntu on the same pcap.
Thanks to Warren Young's post in this question for guiding me in the right (though not successful) direction: Compiling tcpsplice on a 64-bit machine. Guess I'll be using ubuntu to finish my script!

Berkeley DB mismatch error while configuring LDAP

I'm configuring OPENLDAP 2.4.35. on Redhat Linux, I have already installed Berkley DB 4.8.30 as a prerequisite. I also checked the version compatibility from OPENLDAP's README file, which says:
SLAPD:
BDB and HDB backends require Oracle Berkeley DB 4.4 - 4.8,
or 5.0 - 5.1. It is highly recommended to apply the
patches from Oracle for a given release.
Still I'm getting this error:
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking for Berkeley DB major version in db.h... 4
checking for Berkeley DB minor version in db.h... 8
checking if Berkeley DB version supported by BDB/HDB backends... yes
checking for Berkeley DB link (-ldb-4.8)... yes
*checking for Berkeley DB library and header version match... no
configure: error: Berkeley DB version mismatch*
Kindly help
Now the configuration is working fine. I had to export the library path for Berkeley DB properly:
export LD_LIBRARY_PATH="/root/db-6.0.20/build_unix/.libs"
Edit :
The directory build_unix/.libs contains the necessary libs for OpenLDAP but also lots of other files produced during the Berkeley installation. I rather suggest to use the destination Berkeley lib directory which is created during the installation (it should be equal to PREFIX/lib), because you would remove/update your Berkeley source directory one day, breaking OpenLDAP runtime (see the end of my edit)
You can either export the LD_LIBRARY_PATH variable, or set it only at the configure time of OpenLDAP, this way :
LD_LIBRARY_PATH="/root/db-6.0.20.installed/lib" ./configure
Usually there would be other configuration options, I am omitting them here.
Once installed correctly, OpenLDAP may still fail to start with the following error message in the log :
5d34473d bdb_back_initialize: BDB library version mismatch: expected Berkeley DB 5.3.28: (September 9, 2013), got Berkeley DB 5.3.21: (May 11, 2012)
To solve this issue, the solution is again to force the LD_LIBRARY_PATH variable, this time in the startup script (wherever is yours, /etc/init.d/openldap for example). As we are talking about the runtime, it's important here to note we shouldn't call the build_unix/.libs directory which is considered temporary, but the created /lib directory.

How to install C compiler for GCC without Internet connection? (RHEL6)

I'm attempting to build GCC from source on a RHEL6 virtual machine, and have run into a Catch 22. That is, I need a C compiler for successful configuration. The solution seems simple enough - execute yum to solve dependencies. However, this virtual machine cannot have an Internet connection.
Does anybody have any sources for a binary or .rpm containing a pre-compiled compiler, simplifying installation? I've searched, but cannot find one. Alternatively, does a RHEL6 command exist to install a pre-compiled version of GCC? If neither are possible, what C compilers might I pursue to resolve this?
For context, here's the message I receive:
../gcc-4.7.2/configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for libitm support... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/gcc/gcc-build':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
It is not possible to compile gcc source code without any C compiler installed on your VM.
If you can transform files from your host to VM, then you have two ways:
Compile the source code on your host and copy them to your VM. Use ./configure --prefix=/<path>/<to>/<output> to specify the output directory. If your VM CPU arch is different from your host, you may want to look at cross compile.
Download gcc rpm package from a Redhat's rpm repository mirror. Search it in google and you will get an answer.
But it is always a good idea to use yum or rpm to install software in RHEL. I have some questions about your problem:
Why you don't have gcc installed on your RHEL6? It is installed by default.
What VM are you using? The best solution of your problem may be figuring out a way to get network available in your VM.
Since you don't have Internet access on your VM, you probably won't be able to use the dependency resolving yum or rpm. I'll assume you don't want to connect or can't connect the VM to the internet.
From an Internet connected system, you can download a self-contained pre-built version of GCC and the rest of the toolchain here:
http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/
The IA32 GNU/Linux native compiler is here:
http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ia32-gnu-linux
https://sourcery.mentor.com/GNUToolchain/package10871/public/i686-pc-linux-gnu/ia32-2012.09-62-i686-pc-linux-gnu.bin
You will still need to find a way to get the installer onto your VM.

configure does not recognize androideabi

I am trying to compile a library using android-ndk-r5 standalone toolchain and autotools. When doing a ./configure, it fails with:
$ ./configure --host=arm-linux-androideabi
...snip...
checking host system type... Invalid configuration `arm-linux-androideabi': system `androideabi' not recognized
configure: error: /bin/sh ./config.sub arm-linux-androideabi failed
Explicitly setting CC and CXX does not work either (configure says to use --host).
The NDK docs and various materials online seems to indicate that using the standalone toolchain in this manner should be possible. What is wrong here? and how can I resolve it? (besides simply ditching autoconf and going back to Android.mk)
You might need a newer config.sub and config.guess, 2010-05-20 or later.
You can get the newer config.sub and config.guess from here
I took the newest from both, but that lead to errors, so I took the mentioned ones of Peter Eisentraut's date.
You can also grab config.sub and config.guess from the Ubuntu autotools-dev package:
sudo apt-get install autotools-dev
cp /usr/share/misc/config.{sub,guess} .

Resources