libyal / libpff

Library and tools to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format
GNU Lesser General Public License v3.0
289 stars 74 forks source link

Can't build source on OSX #26

Closed kramer65 closed 8 years ago

kramer65 commented 8 years ago

I'm trying to build libpff on OSX from the latest sources. As far as I know I've got all dependencies installed correctly, but I now get an error when running make:

$ make
Making all in include
make[1]: Nothing to be done for `all'.
Making all in common
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
make[2]: Nothing to be done for `all-am'.
Making all in libcstring
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../common  -I../include -I../common -I/usr/local/include  -g -O2 -Wall -MT libcstring_support.lo -MD -MP -MF .deps/libcstring_support.Tpo -c -o libcstring_support.lo libcstring_support.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../common -I../include -I../common -I/usr/local/include -g -O2 -Wall -MT libcstring_support.lo -MD -MP -MF .deps/libcstring_support.Tpo -c libcstring_support.c  -fno-common -DPIC -o .libs/libcstring_support.o
In file included from libcstring_support.c:25:
./libcstring_definitions.h:48:37: warning: missing terminating '"' character [-Winvalid-pp-token]
#define LIBCSTRING_VERSION_STRING                       " [20160425],
                                                        ^
./libcstring_definitions.h:49:1: warning: missing terminating '"' character [-Winvalid-pp-token]
"
^
./libcstring_definitions.h:49:1: error: expected identifier or '('
2 warnings and 1 error generated.
make[1]: *** [libcstring_support.lo] Error 1
make: *** [all-recursive] Error 1

A paste of the full output for ./configure is here: http://pastebin.com/Q4QGV2ga

Does anybody know what could possibly be wrong here? All tips are welcome!

joachimmetz commented 8 years ago

As far as I know I've got all dependencies installed correctly

How did install all dependencies?

Note that how to build is described here

kramer65 commented 8 years ago

@joachimmetz - I first installed the dependencies using brew. Since that obviously didn't work, I just installed the dependencies using the suggested method with macports. They all installed without a problem, so then I ran ./autogen.sh, which ends in:

glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
.libtoolize:   error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with ACLOCAL_AMFLAGS=-I m4
autoreconf: glibtoolize failed with exit status: 1

So I then tried on a simple Ubuntu server (on both 14.04 and 16.04). There I immediately have a problem with installing the dependencies:

$ sudo apt-get install aclocal autoconf automake libtoolize pkg-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package aclocal
E: Unable to locate package libtoolize

I tried continuing without installing aclocal and libtoolize, but when running ./autogen.sh it ends in:

configure.ac:22: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:31: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1

Any ideas how I can continue on either OSX or Linux?

joachimmetz commented 8 years ago

Any ideas how I can continue on either OSX or Linux?

FYI the Travis-CI build does directly build from source: https://travis-ci.org/libyal/libpff

.libtoolize: error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with ACLOCAL_AMFLAGS=-I m4

Google search for this error, some explanations indicate that there might be carriage return where they don't belong due to the configuration of the git client.

E: Unable to locate package aclocal E: Unable to locate package libtoolize

Find the right package names that contain these tools, try build-essential

I tried continuing without installing aclocal and libtoolize, but when running ./autogen.sh it ends in:

You cannot

kramer65 commented 8 years ago

I looked at the travis.yml file and I have no idea how it can build without installing the needed dependencies.

After some fiddling around, I finally did manage to get it working on 14.04 though. For this I had to install the following packages:

sudo apt install git autotools-dev automake autoconf libtool pkg-config make python-dev autopoint

Maybe you could possibly add it to the docs?

For any future reference (both others and myself), these are all the commands that I ran:

sudo apt install git autotools-dev automake autoconf libtool pkg-config make python-dev autopoint
git clone https://github.com/libyal/libpff.git
cd libpff/
./synclibs.sh
./autogen.sh
./configure --enable-python
make
sudo make install
sudo ldconfig
joachimmetz commented 8 years ago

I looked at the travis.yml file and I have no idea how it can build without installing the needed dependencies.

They come pre installed ;)

Maybe you could possibly add it to the docs?

I can and will, thx for providing the list in the issue. The idea is that most people use the distribution source package, but I'll add that to a documentation update as well.