[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't compile on FreeBSD

From: Andrew W. Nosenko
Subject: Re: Can't compile on FreeBSD
Date: Thu, 19 May 2011 11:32:27 +0300

On Thu, May 19, 2011 at 11:03, Yoshiaki Kasahara
<address@hidden> wrote:
> Hello,
> Currently I cannot compile rev 104284 on FreeBSD (8.2-RELEASE).
> gcc -std=gnu99   -Wimplicit-function-declaration -Wold-style-definition 
> -Wdeclaration-after-statement  -DHAVE_CONFIG_H -I. -I../src -I../lib 
> -I/usr/local/src/Emacs24/emacs/lib-src 
> -I/usr/local/src/Emacs24/emacs/lib-src/../src 
> -I/usr/local/src/Emacs24/emacs/lib-src/../lib  -Wl,-znocombreloc 
> -L/usr/local/lib  -g -O2 /usr/local/src/Emacs24/emacs/lib-src/profile.c 
> ../lib/libgnu.a -lutil -o profile
> In file included from /usr/local/src/Emacs24/emacs/lib-src/profile.c:31:
> ../src/config.h:1366:1: warning: "alloca" redefined
> In file included from ../lib/stdlib.h:35,
>                 from ../src/config.h:1361,
>                 from /usr/local/src/Emacs24/emacs/lib-src/profile.c:31:
> /usr/include/stdlib.h:237:1: warning: this is the location of the previous 
> definition
> In file included from /usr/local/src/Emacs24/emacs/lib-src/profile.c:33:
> ../src/systime.h:34:20: error: X11/X.h: No such file or directory
> gmake[2]: *** [profile] Error 1
> gmake[2]: Leaving directory `/usr/local/src/Emacs24/emacs/lib-src'
> gmake[1]: *** [lib-src] Error 2
> gmake[1]: Leaving directory `/usr/local/src/Emacs24/emacs'
> gmake: *** [bootstrap] Error 2
> On FreeBSD, X-related include files are under /usr/local/include/X11,
> and the compiler doesn't search /usr/local/include by default.  I'm
> not sure how it should be fixed...(add C_SWITCH_X_SITE for compiling
> profile.c ?)

Workaroud at your side:

You may add
to the configure command line.

    $ configure CPPFLAGS='-I/usr/local/include' LDFLAGS='-L/usr/local/lib'

Also, note that if you build with Gtk+ interface, these flags added
automatically by Gtk+ pkg-config "magic".

Proper fix: should be at the 'configure.in' side.  Somethig like following:


    # Workaround OS related problems in the default search path:
    #   o  FreeBSD bug: GCC on FreeBSD doesn't search
    #      /usr/local/include and /usr/local/lib directories.
    #   o  MacOS X/Darwin problem: GCC on Darwin doesn't search
    #      /opt/local/include and /opt/local/lib directories.
    case "$host_os" in
        CPPFLAGS="$CPPFLAGS -I/usr/local/include"
        LDFLAGS="$LDFLAGS -L/usr/local/lib"
        CPPFLAGS="$CPPFLAGS -I/opt/local/include"
        LDFLAGS="$LDFLAGS -L/opt/local/lib"

Andrew W. Nosenko <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]