[MacPorts] #34194: geda-gaf: #error "Only <glib.h> can be included directly."

MacPorts noreply at macports.org
Tue Apr 24 09:50:10 PDT 2012


#34194: geda-gaf: #error "Only <glib.h> can be included directly."
-----------------------------------+----------------------------------------
 Reporter:  kato23@…               |       Owner:  emer@…       
     Type:  defect                 |      Status:  new          
 Priority:  Normal                 |   Milestone:               
Component:  ports                  |     Version:  2.0.4        
 Keywords:  geda glib              |        Port:  geda-gaf     
-----------------------------------+----------------------------------------
Changes (by ryandesign@…):

  * owner:  macports-tickets@… => emer@…
 * cc: ryandesign@… (added)


Old description:

> {{{geda-gaf @1.6.2}}} build fails with {{{#error "Only <glib.h> can be
> included directly."}}}:
>

> {{{
>
> # build geda-gaf in /opt/macports-geda-gaf
> # cf. https://trac.macports.org/wiki/Scripts/testport_script
> export PATH="/opt/macports-geda-gaf/bin:/opt/macports-geda-
> gaf/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
> /path/to/testport -n -l /opt/macports-geda-gaf geda-gaf +enable_xdg
>
> }}}
>
> ----
>
> {{{
> :info:build /bin/sh ../../libtool --silent  --tag=CC   --mode=compile
> /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I../..  -DLOCALEDIR=\"/opt
> /macports-geda-gaf/share/locale\"   -I./../include -I./../include/libgeda
> -I../..  -Wall   -D_THREAD_SAFE -I/opt/macports-geda-gaf/include   -I/opt
> /macports-geda-gaf/include/glib-2.0 -I/opt/macports-geda-
> gaf/lib/glib-2.0/include -I/opt/macports-geda-gaf/include   -D_REENTRANT
> -I/opt/macports-geda-gaf/include/gdk-pixbuf-2.0 -I/opt/macports-geda-
> gaf/include/libpng14 -I/opt/macports-geda-gaf/include/glib-2.0 -I/opt
> /macports-geda-gaf/lib/glib-2.0/include -I/opt/macports-geda-gaf/include
> -pipe -O2 -arch x86_64 -MT libgeda_la-s_slib.lo -MD -MP -MF .deps
> /libgeda_la-s_slib.Tpo -c -o libgeda_la-s_slib.lo `test -f 's_slib.c' ||
> echo './'`s_slib.c
> :info:build s_page.c:274:2: warning: #warning FIn file included from
> s_path.c:40:
> :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmem.h:28:2:
> error: #error "Only <glib.h> can be included directly."
> :info:build In file included from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gmem.h:34,
> :info:build                  from s_path.c:40:
> :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gtypes.h:28:2:
> error: #error "Only <glib.h> can be included directly."
> :info:build In file included from /opt/macports-geda-
> gaf/lib/glib-2.0/include/glibconfig.h:9,
> :info:build                  from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gtypes.h:34,
> :info:build                  from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gmem.h:34,
> :info:build                  from s_path.c:40:
> :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmacros.h:32:2:
> error: #error "Only <glib.h> can be included directly."
> :info:build In file included from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gtypes.h:35,
> :info:build                  from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gmem.h:34,
> :info:build                  from s_path.c:40:
> :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmacros.h:32:2:
> error: #error I"Only <glib.h> can be included directly."
> :info:build In file included from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gtypes.h:36,
> :info:build                  from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gmem.h:34,
> :info:build                  from s_path.c:40:
> :info:build /opt/macports-geda-
> gaf/include/glib-2.0/glib/gversionmacros.h:28:2: error: #error "Only
> <glib.h> can be included directly."
> :info:build XME: What do we do?
> :info:build In file included from s_path.c:41:
> :info:build /opt/macports-geda-
> gaf/include/glib-2.0/glib/gmessages.h:28:2: error: #error "Only <glib.h>
> can be included directly."
> :info:build s_page.c: In function ‘s_page_search’:
> :info:build s_page.c:300: warning: ‘g_strcasecmp’ is deprecated
> (declared at /opt/macports-geda-
> gaf/include/glib-2.0/glib/gstrfuncs.h:173)
> :info:build In file included from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gmessages.h:35,
> :info:build                  from s_path.c:41:
> :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gtypes.h:28:2:
> error: #error "Only <glib.h> can be included directly."
> :info:build In file included from /opt/macports-geda-
> gaf/include/glib-2.0/glib/gmessages.h:36,
> :info:build                  from s_path.c:41:
> :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmacros.h:32:2:
> error: #error "Only <glib.h> can be included directly."
> :info:build In file included from s_path.c:42:
> :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gtypes.h:28:2:
> error: #error "Only <glib.h> can be included directly."
> :info:build mv -f .deps/libgeda_la-s_page.Tpo .deps/libgeda_la-s_page.Plo
> :info:build /bin/sh ../../libtool --silent  --tag=CC   --mode=compile
> /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I../..  -DLOCALEDIR=\"/opt
> /macports-geda-gaf/share/locale\"   -I./../include -I./../include/libgeda
> -I../..  -Wall   -D_THREAD_SAFE -I/opt/macports-geda-gaf/include   -I/opt
> /macports-geda-gaf/include/glib-2.0 -I/opt/macports-geda-
> gaf/lib/glib-2.0/include -I/opt/macports-geda-gaf/include   -D_REENTRANT
> -I/opt/macports-geda-gaf/include/gdk-pixbuf-2.0 -I/opt/macports-geda-
> gaf/include/libpng14 -I/opt/macports-geda-gaf/include/glib-2.0 -I/opt
> /macports-geda-gaf/lib/glib-2.0/include -I/opt/macports-geda-gaf/include
> -pipe -O2 -arch x86_64 -MT libgeda_la-s_slot.lo -MD -MP -MF .deps
> /libgeda_la-s_slot.Tpo -c -o libgeda_la-s_slot.lo `test -f 's_slot.c' ||
> echo './'`s_slot.c
> :info:build make[3]: *** [libgeda_la-s_path.lo] Error 1
> :info:build make[3]: *** Waiting for unfinished jobs....
> :info:build mv -f .deps/libgeda_la-s_papersizes.Tpo .deps/libgeda_la-
> s_papersizes.Plo
> :info:build mv -f .deps/libgeda_la-s_slib.Tpo .deps/libgeda_la-s_slib.Plo
> :info:build mv -f .deps/libgeda_la-s_slot.Tpo .deps/libgeda_la-s_slot.Plo
> :info:build make[3]: Leaving directory `/opt/macports-geda-
> gaf/var/macports/build/_opt_macports-geda-
> gaf_var_macports_sources_rsync.macports
> .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-
> gaf-1.6.2/libgeda/src'
> :info:build make[2]: *** [all-recursive] Error 1
> :info:build make[2]: Leaving directory `/opt/macports-geda-
> gaf/var/macports/build/_opt_macports-geda-
> gaf_var_macports_sources_rsync.macports
> .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-
> gaf-1.6.2/libgeda'
> :info:build make[1]: *** [all-recursive] Error 1
> :info:build make[1]: Leaving directory `/opt/macports-geda-
> gaf/var/macports/build/_opt_macports-geda-
> gaf_var_macports_sources_rsync.macports
> .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-
> gaf-1.6.2'
> :info:build make: *** [all] Error 2
> :info:build make: Leaving directory `/opt/macports-geda-
> gaf/var/macports/build/_opt_macports-geda-
> gaf_var_macports_sources_rsync.macports
> .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-
> gaf-1.6.2'
> :info:build shell command " cd "/opt/macports-geda-gaf/var/macports/build
> /_opt_macports-geda-gaf_var_macports_sources_rsync.macports
> .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-
> gaf-1.6.2" && /usr/bin/make -j4 -w all " returned error 2
> :error:build Target org.macports.build returned: shell command failed
> (see log for details)
> :debug:build Backtrace: shell command failed (see log for details)
>     while executing
> "command_exec build"
>     (procedure "portbuild::build_main" line 8)
>     invoked from within
> "$procedure $targetname"
> :info:build Warning: the following items did not execute (for geda-gaf):
> org.macports.activate org.macports.build org.macports.destroot
> org.macports.install
> :notice:build Log for geda-gaf is at: /opt/macports-geda-
> gaf/var/macports/logs/_opt_macports-geda-
> gaf_var_macports_sources_rsync.macports
> .org_release_tarballs_ports_science_geda-gaf/geda-gaf/main.log
>
> }}}
>

> One possible fix is to add {{{configure.cflags-append
> -DGLIB_COMPILATION}}} to the {{{geda-gaf}}} Portfile (but also see
> [https://trac.macports.org/ticket/33947 #33947] and
> [https://trac.macports.org/ticket/33992 #33947] for other solutions).
>
> ----
>
> Adding {{{-DGLIB_COMPILATION}}} to {{{CFLAGS}}} also works for {{{geda-
> gaf 1.7.2}}}:
>
> {{{
>
> # compile geda-gaf 1.7.2 against previously installed /opt/macports-geda-
> gaf
> # http://wiki.geda-project.org/geda:download
> # http://geda.seul.org/wiki/geda:gaf_building_git_version
>
> export PATH="/opt/macports-geda-gaf/bin:/opt/macports-geda-
> gaf/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
> export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib:/opt/macports-geda-
> gaf/lib
> export LTDL_LIBRARY_PATH=/usr/local/lib
> curl -L -O http://geda.seul.org/devel/v1.7/1.7.2/geda-gaf-1.7.2.tar.gz
> tar -xf geda-gaf-1.7.2.tar.gz
> cd geda-gaf-1.7.2
> ./configure --help | less
> CFLAGS="-DGLIB_COMPILATION" ./configure
> make
> sudo make install
> make check
> /usr/local/bin/gschem
>
> }}}

New description:

 {{{geda-gaf @1.6.2}}} build fails with {{{#error "Only <glib.h> can be
 included directly."}}}:


 {{{

 # build geda-gaf in /opt/macports-geda-gaf
 # cf. https://trac.macports.org/wiki/Scripts/testport_script
 export PATH="/opt/macports-geda-gaf/bin:/opt/macports-geda-
 gaf/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
 /path/to/testport -n -l /opt/macports-geda-gaf geda-gaf +enable_xdg

 }}}

 ----

 {{{
 :info:build /bin/sh ../../libtool --silent  --tag=CC   --mode=compile
 /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I../..  -DLOCALEDIR=\"/opt/macports-
 geda-gaf/share/locale\"   -I./../include -I./../include/libgeda -I../..
 -Wall   -D_THREAD_SAFE -I/opt/macports-geda-gaf/include   -I/opt/macports-
 geda-gaf/include/glib-2.0 -I/opt/macports-geda-gaf/lib/glib-2.0/include
 -I/opt/macports-geda-gaf/include   -D_REENTRANT -I/opt/macports-geda-
 gaf/include/gdk-pixbuf-2.0 -I/opt/macports-geda-gaf/include/libpng14
 -I/opt/macports-geda-gaf/include/glib-2.0 -I/opt/macports-geda-
 gaf/lib/glib-2.0/include -I/opt/macports-geda-gaf/include   -pipe -O2
 -arch x86_64 -MT libgeda_la-s_slib.lo -MD -MP -MF .deps/libgeda_la-
 s_slib.Tpo -c -o libgeda_la-s_slib.lo `test -f 's_slib.c' || echo
 './'`s_slib.c
 :info:build s_page.c:274:2: warning: #warning FIn file included from
 s_path.c:40:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmem.h:28:2:
 error: #error "Only <glib.h> can be included directly."
 :info:build In file included from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gmem.h:34,
 :info:build                  from s_path.c:40:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gtypes.h:28:2:
 error: #error "Only <glib.h> can be included directly."
 :info:build In file included from /opt/macports-geda-
 gaf/lib/glib-2.0/include/glibconfig.h:9,
 :info:build                  from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gtypes.h:34,
 :info:build                  from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gmem.h:34,
 :info:build                  from s_path.c:40:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmacros.h:32:2:
 error: #error "Only <glib.h> can be included directly."
 :info:build In file included from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gtypes.h:35,
 :info:build                  from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gmem.h:34,
 :info:build                  from s_path.c:40:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmacros.h:32:2:
 error: #error I"Only <glib.h> can be included directly."
 :info:build In file included from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gtypes.h:36,
 :info:build                  from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gmem.h:34,
 :info:build                  from s_path.c:40:
 :info:build /opt/macports-geda-
 gaf/include/glib-2.0/glib/gversionmacros.h:28:2: error: #error "Only
 <glib.h> can be included directly."
 :info:build XME: What do we do?
 :info:build In file included from s_path.c:41:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmessages.h:28:2:
 error: #error "Only <glib.h> can be included directly."
 :info:build s_page.c: In function ‘s_page_search’:
 :info:build s_page.c:300: warning: ‘g_strcasecmp’ is deprecated
 (declared at /opt/macports-geda-gaf/include/glib-2.0/glib/gstrfuncs.h:173)
 :info:build In file included from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gmessages.h:35,
 :info:build                  from s_path.c:41:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gtypes.h:28:2:
 error: #error "Only <glib.h> can be included directly."
 :info:build In file included from /opt/macports-geda-
 gaf/include/glib-2.0/glib/gmessages.h:36,
 :info:build                  from s_path.c:41:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gmacros.h:32:2:
 error: #error "Only <glib.h> can be included directly."
 :info:build In file included from s_path.c:42:
 :info:build /opt/macports-geda-gaf/include/glib-2.0/glib/gtypes.h:28:2:
 error: #error "Only <glib.h> can be included directly."
 :info:build mv -f .deps/libgeda_la-s_page.Tpo .deps/libgeda_la-s_page.Plo
 :info:build /bin/sh ../../libtool --silent  --tag=CC   --mode=compile
 /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I../..  -DLOCALEDIR=\"/opt/macports-
 geda-gaf/share/locale\"   -I./../include -I./../include/libgeda -I../..
 -Wall   -D_THREAD_SAFE -I/opt/macports-geda-gaf/include   -I/opt/macports-
 geda-gaf/include/glib-2.0 -I/opt/macports-geda-gaf/lib/glib-2.0/include
 -I/opt/macports-geda-gaf/include   -D_REENTRANT -I/opt/macports-geda-
 gaf/include/gdk-pixbuf-2.0 -I/opt/macports-geda-gaf/include/libpng14
 -I/opt/macports-geda-gaf/include/glib-2.0 -I/opt/macports-geda-
 gaf/lib/glib-2.0/include -I/opt/macports-geda-gaf/include   -pipe -O2
 -arch x86_64 -MT libgeda_la-s_slot.lo -MD -MP -MF .deps/libgeda_la-
 s_slot.Tpo -c -o libgeda_la-s_slot.lo `test -f 's_slot.c' || echo
 './'`s_slot.c
 :info:build make[3]: *** [libgeda_la-s_path.lo] Error 1
 :info:build make[3]: *** Waiting for unfinished jobs....
 :info:build mv -f .deps/libgeda_la-s_papersizes.Tpo .deps/libgeda_la-
 s_papersizes.Plo
 :info:build mv -f .deps/libgeda_la-s_slib.Tpo .deps/libgeda_la-s_slib.Plo
 :info:build mv -f .deps/libgeda_la-s_slot.Tpo .deps/libgeda_la-s_slot.Plo
 :info:build make[3]: Leaving directory `/opt/macports-geda-
 gaf/var/macports/build/_opt_macports-geda-
 gaf_var_macports_sources_rsync.macports
 .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-
 gaf-1.6.2/libgeda/src'
 :info:build make[2]: *** [all-recursive] Error 1
 :info:build make[2]: Leaving directory `/opt/macports-geda-
 gaf/var/macports/build/_opt_macports-geda-
 gaf_var_macports_sources_rsync.macports
 .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-
 gaf-1.6.2/libgeda'
 :info:build make[1]: *** [all-recursive] Error 1
 :info:build make[1]: Leaving directory `/opt/macports-geda-
 gaf/var/macports/build/_opt_macports-geda-
 gaf_var_macports_sources_rsync.macports
 .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-gaf-1.6.2'
 :info:build make: *** [all] Error 2
 :info:build make: Leaving directory `/opt/macports-geda-
 gaf/var/macports/build/_opt_macports-geda-
 gaf_var_macports_sources_rsync.macports
 .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-gaf-1.6.2'
 :info:build shell command " cd "/opt/macports-geda-gaf/var/macports/build
 /_opt_macports-geda-gaf_var_macports_sources_rsync.macports
 .org_release_tarballs_ports_science_geda-gaf/geda-gaf/work/geda-gaf-1.6.2"
 && /usr/bin/make -j4 -w all " returned error 2
 :error:build Target org.macports.build returned: shell command failed (see
 log for details)
 :debug:build Backtrace: shell command failed (see log for details)
     while executing
 "command_exec build"
     (procedure "portbuild::build_main" line 8)
     invoked from within
 "$procedure $targetname"
 :info:build Warning: the following items did not execute (for geda-gaf):
 org.macports.activate org.macports.build org.macports.destroot
 org.macports.install
 :notice:build Log for geda-gaf is at: /opt/macports-geda-
 gaf/var/macports/logs/_opt_macports-geda-
 gaf_var_macports_sources_rsync.macports
 .org_release_tarballs_ports_science_geda-gaf/geda-gaf/main.log

 }}}


 One possible fix is to add {{{configure.cflags-append
 -DGLIB_COMPILATION}}} to the {{{geda-gaf}}} Portfile (but also see #33947
 and #33992 for other solutions).

 ----

 Adding {{{-DGLIB_COMPILATION}}} to {{{CFLAGS}}} also works for {{{geda-gaf
 1.7.2}}}:

 {{{

 # compile geda-gaf 1.7.2 against previously installed /opt/macports-geda-
 gaf
 # http://wiki.geda-project.org/geda:download
 # http://geda.seul.org/wiki/geda:gaf_building_git_version

 export PATH="/opt/macports-geda-gaf/bin:/opt/macports-geda-
 gaf/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
 export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib:/opt/macports-geda-
 gaf/lib
 export LTDL_LIBRARY_PATH=/usr/local/lib
 curl -L -O http://geda.seul.org/devel/v1.7/1.7.2/geda-gaf-1.7.2.tar.gz
 tar -xf geda-gaf-1.7.2.tar.gz
 cd geda-gaf-1.7.2
 ./configure --help | less
 CFLAGS="-DGLIB_COMPILATION" ./configure
 make
 sudo make install
 make check
 /usr/local/bin/gschem

 }}}

--

-- 
Ticket URL: <https://trac.macports.org/ticket/34194#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list