autoconf
[Top][All Lists]
Advanced

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

Cannot build application with pkg-config using autoconf, automake


From: mi16
Subject: Cannot build application with pkg-config using autoconf, automake
Date: Sun, 11 Dec 2011 00:09:03 -0800 (PST)

I've developed a gtkmm application under Linux and now am trying to port it
to Win32
(Windows 7).
To do so I installed MinGW with msys (mingw-get-inst-20111118.exe),
and gtkmm (gtkmm-win32-devel-2.22.0-2.exe) on Windows 7.
To test the installation I wrote very simple test (it just opens an empty
Gtk::Windows).

If I build and launch the test directly by doing such commands:

$ g++ gtkmm001.cc -ogtkmm001.exe `pkg-config --cflags --libs gtkmm-2.4`
$ ./gtkmm001.exe

everything works fine. I see an empty Gtk::Window on the screen. 

But I get an error while trying to build this test using GNU autoconf,
automake tools:

$ autoreconf --verbose --force --install
$ ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
./configure: line 2958: syntax error near unexpected token `MGTKMM,'
./configure: line 2958: `PKG_CHECK_MODULES(MGTKMM, gtkmm-2.4 >= 2.22.0)'

Can anybody tell me what I am doing wrong?

Thank you, Mikhail


Here are my environment vars, and files content (Sorry for long post).

$ echo $PATH
.:/usr/local/bin:/mingw/bin:/bin:/c/Tools/gtkmm/bin:/c/Windows/system32:\
/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:\
/c/Program Files/jEdit:/mingw/bin:/c/Tools/PostgreSQL/9.1/bin

$ echo $GTK_CONFIG_PATH
/c/Tools/gtkmm/lib/pkgconfig

$ cat configure.ac | grep -v '^#'
AC_INIT([gtkmm001],[0.0.1],address@hidden,[gtkmm001],[http://mi16.ru/devel/gtkmm])
AC_PREREQ([2.68])
AM_INIT_AUTOMAKE(1.11.1 no-define)
AC_CONFIG_HEADERS(config.h)
AC_PROG_CXX
PKG_CHECK_MODULES([MGTKMM], [gtkmm-2.4 >= 2.22.0])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

$ cat Makefile.am | grep -v '^#'
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
AM_CPPFLAGS = $(MGTKMM_CFLAGS)
bin_PROGRAMS = gtkmm001
gtkmm001_SOURCES = gtkmm001.cc
gtkmm001_LDADD = $(MGTKMM_LIBS)
dist_noinst_SCRIPTS = autogen.sh

$ cat gtkmm001.cc | grep -v '^//'
#include <gtkmm.h>
int main(int argc,char** argv)
{
  Gtk::Main app(argc,argv);
  Gtk::Window win;
  Gtk::Main::run(win);
  return 0;
}

$ cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by gtkmm001 configure 0.0.1, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = MIS
uname -m = i686
uname -r = 1.0.17(0.48/3/2)
uname -s = MINGW32_NT-6.1
uname -v = 2011-04-24 23:39

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: .
PATH: /usr/local/bin
PATH: /mingw/bin
PATH: /bin
PATH: /c/Tools/gtkmm/bin
PATH: /c/Windows/system32
PATH: /c/Windows
PATH: /c/Windows/System32/Wbem
PATH: /c/Windows/System32/WindowsPowerShell/v1.0/
PATH: /c/Program Files/jEdit
PATH: /mingw/bin
PATH: /c/Tools/PostgreSQL/9.1/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1806: checking for a BSD-compatible install
configure:1874: result: /bin/install -c
configure:1885: checking whether build environment is sane
configure:1935: result: yes
configure:2076: checking for a thread-safe mkdir -p
configure:2115: result: /bin/mkdir -p
configure:2128: checking for gawk
configure:2144: found /bin/gawk
configure:2155: result: gawk
configure:2166: checking whether make sets $(MAKE)
configure:2188: result: yes
configure:2319: checking for g++
configure:2335: found /mingw/bin/g++
configure:2346: result: g++
configure:2373: checking for C++ compiler version
configure:2382: g++ --version >&5
g++.exe (GCC) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2393: $? = 0
configure:2382: g++ -v >&5
Using built-in specs.
COLLECT_GCC=F:\MinGW\bin\g++.exe
COLLECT_LTO_WRAPPER=f:/mingw/bin/../libexec/gcc/mingw32/4.6.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.1/configure
--enable-languages=c,c++,fortran,objc,obj-c++ --disable-sjlj-exceptions
--with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry
--enable-libstdcxx-debug --enable-version-specific-runtime-libs
--build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.1 (GCC) 
configure:2393: $? = 0
configure:2382: g++ -V >&5
g++.exe: error: unrecognized option '-V'
g++.exe: fatal error: no input files
compilation terminated.
configure:2393: $? = 1
configure:2382: g++ -qversion >&5
g++.exe: error: unrecognized option '-qversion'
g++.exe: fatal error: no input files
compilation terminated.
configure:2393: $? = 1
configure:2413: checking whether the C++ compiler works
configure:2435: g++    conftest.cpp  >&5
configure:2439: $? = 0
configure:2487: result: yes
configure:2490: checking for C++ compiler default output file name
configure:2492: result: a.exe
configure:2498: checking for suffix of executables
configure:2505: g++ -o conftest.exe    conftest.cpp  >&5
configure:2509: $? = 0
configure:2531: result: .exe
configure:2553: checking whether we are cross compiling
configure:2561: g++ -o conftest.exe    conftest.cpp  >&5
configure:2565: $? = 0
configure:2572: ./conftest.exe
configure:2576: $? = 0
configure:2591: result: no
configure:2596: checking for suffix of object files
configure:2618: g++ -c   conftest.cpp >&5
configure:2622: $? = 0
configure:2643: result: o
configure:2647: checking whether we are using the GNU C++ compiler
configure:2666: g++ -c   conftest.cpp >&5
configure:2666: $? = 0
configure:2675: result: yes
configure:2684: checking whether g++ accepts -g
configure:2704: g++ -c -g  conftest.cpp >&5
configure:2704: $? = 0
configure:2745: result: yes
configure:2779: checking for style of include used by make
configure:2807: result: GNU
configure:2832: checking dependency style of g++
configure:2942: result: gcc3

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=.exe
ac_cv_objext=o
ac_cv_path_install='/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_cxx_g=yes
ac_cv_prog_make_make_set=yes
am_cv_CXX_dependencies_compiler_type=gcc3

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/mikhail/devel/gtkmm/missing --run aclocal-1.11'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='${SHELL} /home/mikhail/devel/gtkmm/missing --run tar'
AUTOCONF='${SHELL} /home/mikhail/devel/gtkmm/missing --run autoconf'
AUTOHEADER='${SHELL} /home/mikhail/devel/gtkmm/missing --run autoheader'
AUTOMAKE='${SHELL} /home/mikhail/devel/gtkmm/missing --run automake-1.11'
AWK='gawk'
CPPFLAGS=''
CXX='g++'
CXXDEPMODE='depmode=gcc3'
CXXFLAGS='-g -O2'
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT='.exe'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /home/mikhail/devel/gtkmm/missing --run makeinfo'
MKDIR_P='/bin/mkdir -p'
OBJEXT='o'
PACKAGE='gtkmm001'
PACKAGE_BUGREPORT='address@hidden'
PACKAGE_NAME='gtkmm001'
PACKAGE_STRING='gtkmm001 0.0.1'
PACKAGE_TARNAME='gtkmm001'
PACKAGE_URL='http://mi16.ru/devel/gtkmm'
PACKAGE_VERSION='0.0.1'
PATH_SEPARATOR=':'
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.0.1'
ac_ct_CXX='g++'
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCXX_FALSE='#'
am__fastdepCXX_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/mikhail/devel/gtkmm/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='/bin/mkdir -p'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "gtkmm001"
#define PACKAGE_TARNAME "gtkmm001"
#define PACKAGE_VERSION "0.0.1"
#define PACKAGE_STRING "gtkmm001 0.0.1"
#define PACKAGE_BUGREPORT "address@hidden"
#define PACKAGE_URL "http://mi16.ru/devel/gtkmm";

configure: exit 258

-- 
View this message in context: 
http://old.nabble.com/Cannot-build-application-with-pkg-config-using-autoconf%2C-automake-tp32953972p32953972.html
Sent from the Gnu - Autoconf - General mailing list archive at Nabble.com.




reply via email to

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