* Can't compile on FreeBSD
@ 2011-05-19 8:03 Yoshiaki Kasahara
2011-05-19 8:32 ` Andrew W. Nosenko
0 siblings, 1 reply; 6+ messages in thread
From: Yoshiaki Kasahara @ 2011-05-19 8:03 UTC (permalink / raw)
To: emacs-devel
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 ?)
Regards,
--
Yoshiaki Kasahara
Research Institute for Information Technology, Kyushu University
kasahara@nc.kyushu-u.ac.jp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't compile on FreeBSD
2011-05-19 8:03 Can't compile on FreeBSD Yoshiaki Kasahara
@ 2011-05-19 8:32 ` Andrew W. Nosenko
2011-05-19 9:10 ` Yoshiaki Kasahara
0 siblings, 1 reply; 6+ messages in thread
From: Andrew W. Nosenko @ 2011-05-19 8:32 UTC (permalink / raw)
To: Yoshiaki Kasahara; +Cc: emacs-devel
On Thu, May 19, 2011 at 11:03, Yoshiaki Kasahara
<kasahara@nc.kyushu-u.ac.jp> 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
CPPFLAGS='-I/usr/local/include'
and
LDFLAGS='-L/usr/local/lib'
to the configure command line.
I.e.:
$ 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:
AC_CANONICAL_HOST
# 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
freebsd*)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
darwin*)
CPPFLAGS="$CPPFLAGS -I/opt/local/include"
LDFLAGS="$LDFLAGS -L/opt/local/lib"
;;
esac
--
Andrew W. Nosenko <andrew.w.nosenko@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't compile on FreeBSD
2011-05-19 8:32 ` Andrew W. Nosenko
@ 2011-05-19 9:10 ` Yoshiaki Kasahara
2011-05-19 10:22 ` Yoshiaki Kasahara
2011-05-20 6:49 ` Paul Eggert
0 siblings, 2 replies; 6+ messages in thread
From: Yoshiaki Kasahara @ 2011-05-19 9:10 UTC (permalink / raw)
To: andrew.w.nosenko; +Cc: emacs-devel
On Thu, 19 May 2011 11:32:27 +0300,
"Andrew W. Nosenko" <andrew.w.nosenko@gmail.com> said:
> Proper fix: should be at the 'configure.in' side. Somethig like following:
>
> AC_CANONICAL_HOST
>
> # 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.
Thank you for your suggestion. But I believe that this behavior is
not a bug, because X is not a part of the base system of FreeBSD.
configure correctly detect that -I/usr/local/include is needed when X
is involved. The problem is that recently "#include <X11/X.h>" was
added to src/systime.h, but compilation of lib-src/profile.c (which
includes src/systime.h) didn't reflect that change. Before the
change, there was no problem compiling Emacs on FreeBSD. So I'm
wondering about the proper fix for that...
Regards,
--
Yoshiaki Kasahara
Research Institute for Information Technology, Kyushu University
kasahara@nc.kyushu-u.ac.jp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't compile on FreeBSD
2011-05-19 9:10 ` Yoshiaki Kasahara
@ 2011-05-19 10:22 ` Yoshiaki Kasahara
2011-05-20 6:49 ` Paul Eggert
1 sibling, 0 replies; 6+ messages in thread
From: Yoshiaki Kasahara @ 2011-05-19 10:22 UTC (permalink / raw)
To: andrew.w.nosenko; +Cc: emacs-devel
On Thu, 19 May 2011 18:10:42 +0900 (JST),
Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> said:
> Thank you for your suggestion. But I believe that this behavior is
> not a bug, because X is not a part of the base system of FreeBSD.
Now I'm feeling that maybe it is better to add -I/usr/local/include
and -L/usr/local/lib for FreeBSD, because most 3rd-party files will be
installed there and building Emacs needs some of them anyway...
--
Yoshiaki Kasahara
Research Institute for Information Technology, Kyushu University
kasahara@nc.kyushu-u.ac.jp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't compile on FreeBSD
2011-05-19 9:10 ` Yoshiaki Kasahara
2011-05-19 10:22 ` Yoshiaki Kasahara
@ 2011-05-20 6:49 ` Paul Eggert
2011-05-20 10:01 ` Yoshiaki Kasahara
1 sibling, 1 reply; 6+ messages in thread
From: Paul Eggert @ 2011-05-20 6:49 UTC (permalink / raw)
To: Yoshiaki Kasahara; +Cc: andrew.w.nosenko, emacs-devel
On 05/19/2011 02:10 AM, Yoshiaki Kasahara wrote:
> recently "#include <X11/X.h>" was
> added to src/systime.h, but compilation of lib-src/profile.c (which
> includes src/systime.h) didn't reflect that change.
I think I caused that with my recent changes for time overflow checking.
Sorry about that. I committed a small patch to fix that in bzr 104294;
please give it a try.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't compile on FreeBSD
2011-05-20 6:49 ` Paul Eggert
@ 2011-05-20 10:01 ` Yoshiaki Kasahara
0 siblings, 0 replies; 6+ messages in thread
From: Yoshiaki Kasahara @ 2011-05-20 10:01 UTC (permalink / raw)
To: eggert; +Cc: andrew.w.nosenko, emacs-devel
On Thu, 19 May 2011 23:49:48 -0700,
Paul Eggert <eggert@cs.ucla.edu> said:
> I think I caused that with my recent changes for time overflow
> checking.
> Sorry about that. I committed a small patch to fix that in bzr
> 104294;
> please give it a try.
Now I can build Emacs on FreeBSD without workaround. Thank you!
--
Yoshiaki Kasahara
Research Institute for Information Technology, Kyushu University
kasahara@nc.kyushu-u.ac.jp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-20 10:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-19 8:03 Can't compile on FreeBSD Yoshiaki Kasahara
2011-05-19 8:32 ` Andrew W. Nosenko
2011-05-19 9:10 ` Yoshiaki Kasahara
2011-05-19 10:22 ` Yoshiaki Kasahara
2011-05-20 6:49 ` Paul Eggert
2011-05-20 10:01 ` Yoshiaki Kasahara
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.