Author Topic: Bootstrap with no wxWidgets packet installed  (Read 24307 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Bootstrap with no wxWidgets packet installed
« on: February 20, 2018, 05:16:45 pm »
Hi,
i try to build codeblocks on linux, without wxWidgets installed, but compiled and installed by myself.

If i run ./bootstrap it can not find the wx-config macro:
Code
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
Now this seems ok, because i can provide the wx-config path by myself (it is /usr/local/bin/wx-config) but the ./configure command has no option --witch-wx-config and fails because it can not find the AM_CONFIG thing

Code
./configure: line 21384: AM_OPTIONS_WXCONFIG: command not found
./configure: line 21385: syntax error near unexpected token `2.8.12,'
./configure: line 21385: `AM_PATH_WXCONFIG(2.8.12, wxWin=1)'

Is there a easy solution beside installing wxWidgets from repo?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7683
    • My Best Post
Re: Bootstrap with no wxWidgets packet installed
« Reply #1 on: February 20, 2018, 05:19:38 pm »
Are you using an Debian based Linux; because it has an easy fix? I posted it somewhere in the Wiki an way to use alternates with self built wxWidgets.

Edit: Added wiki link http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux#Checking_the_presence_of_libwxGTK_library

Tim S.
« Last Edit: February 20, 2018, 05:21:36 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Bootstrap with no wxWidgets packet installed
« Reply #2 on: February 20, 2018, 05:29:13 pm »
thank you!
i also found this article in the mean time and i have tried this:
Code
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
with this i was able to go trought bootstrap and it is now compiling. But i would like to know what this does....

Code
$ update-alternatives --install /usr/bin/wx-config wx-config /opt/wx/2.8/bin/wx-config 50
can you explain what this does? Am i asked every time i run wx-config what version i would like to run? How does this go with autotools, or other tools that do not allow user interaction?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7683
    • My Best Post
Re: Bootstrap with no wxWidgets packet installed
« Reply #3 on: February 20, 2018, 05:47:18 pm »
update-alternatives is used to switch an link to various real files.

I believe update-alternatives is an Debian only command.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Bootstrap with no wxWidgets packet installed
« Reply #4 on: February 20, 2018, 07:39:19 pm »
I believe update-alternatives is an Debian only command.
No, it isn't.
It's copyrighted by Redhat in 2001 or 2002.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7683
    • My Best Post
Re: Bootstrap with no wxWidgets packet installed
« Reply #5 on: February 20, 2018, 07:45:32 pm »
I believe update-alternatives is an Debian only command.
No, it isn't.
It's copyrighted by Redhat in 2001 or 2002.

So, at least Redhat and Debian Linux Distros should have it.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #6 on: February 20, 2018, 08:14:12 pm »
There is an issue about this on the tickets page. The proposed solution there is to copy the file in out m4 folder.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #7 on: August 08, 2018, 04:26:07 am »
OK, I think I hit the same issue here.
I'm on a ubuntu 14.04, I build wx3.1.1 library myself, with such command:
Code
sudo apt-get install libgtk-3-dev
cd wxWidgets-3.1.1/
mkdir gtk-build
cd gtk-build
../configure --enable-unicode --prefix=/home/zyh/code/wx3install/ --enable-monolithic
Then,
Code
make
make install
I can build a simple wx program like:
Code
zyh@zyh:~/code/wxWidgets-3.1.1/gtk-build/samples/minimal$ make
zyh@zyh:~/code/wxWidgets-3.1.1/gtk-build/samples/minimal$ ./minimal

Now, I have cloned the C::B source:
Code
git clone https://github.com/obfuscated/codeblocks_sf.git
Then I run bootstrap, I get failed
Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ ./bootstrap Using 'git log --graph' to get the revision
Found revision: '11442' '2018-08-07 07:14:29'
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:141: warning: macro 'AM_OPTIONS_WXCONFIG' not found in library
configure.ac:142: warning: macro 'AM_PATH_WXCONFIG' not found in library
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:142: error: possibly undefined macro: AM_PATH_WXCONFIG

Since I have no previous wx library installed on my system, I run such command: (I follow this wiki page: Page)
Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ update-alternatives --install /usr/bin/wx-config wx-config /home/zyh/code/wx3install/bin/wx-config 50
But I still get the same bootstrap.

So, any ideas how to step further?
Thanks.
« Last Edit: August 15, 2018, 03:12:23 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #8 on: August 08, 2018, 06:40:57 am »
OK, bootstrap runs OK now.
Some reference link: Re: Error while building codeblocks in unix-style and 4 Code::Blocks installation


Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ export ACLOCAL_FLAGS="-I `wx-config --prefix` -I /home/zyh/code/wx3install/share/aclocal"
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ ./bootstrap Using 'git log --graph' to get the revision
Found revision: '11442' '2018-08-07 07:14:29'
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$

zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ echo $ACLOCAL_FLAGS -I /home/zyh/code/wx3install -I /home/zyh/code/wx3install/share/aclocal


EDIT:
As suggested by blauzahn, the correct command is:

Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"

also, those library need to be installed:
Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ mkdir build
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ cd build
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build$ sudo apt-get install libhunspell-dev
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build$ sudo apt-get install libgamin-dev
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build$ ../configure --prefix=/home/zyh/code/cbinstall/ --with-contrib-plugins=all,-NassiShneiderman

If you need to build NassiShneiderman, some extra library need to be installed.


« Last Edit: August 08, 2018, 08:47:50 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline blauzahn

  • Almost regular
  • **
  • Posts: 179
Re: Bootstrap with no wxWidgets packet installed
« Reply #9 on: August 08, 2018, 07:50:55 am »

Yes that works. This is the way, I always use it in conjunction with wxWidgets trunk
on Ubuntu 16.04 (x86_64), antergos 18.07 (x86_64) and raspbian. During the last week I tried all of
them with current trunks of cb and wxWidgets.

I have a Makefile in a directory above cb trunk. In order to bootstrap and
configure for an out of tree build I use these 2 PHONY Makefile targets:

Code
SRCDIR=trunk
BUILDDIR=build

bootstrap:
(cd $(SRCDIR) && ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal" ./bootstrap )

config:
@mkdir -p $(BUILDDIR)
(cd $(BUILDDIR) && ../$(SRCDIR)/configure --prefix=$(PREFIX) --with-contrib-plugins=all,-NassiShneiderman)

For the record: Your clone command is missing the last letter, ending with .gi instead of .git.

Have a nice day.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #10 on: August 08, 2018, 08:01:59 am »
For the record: Your clone command is missing the last letter, ending with .gi instead of .git.
Oh, a copy paste error, I have fixed it in the post.

Thanks for your makefile, I also do not want to build the NassiShneiderman plugin, because it needs some extra boost related header files.  ;)

Code
ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
I just see this is a string concatenation, in my previous post, I added two "-I", which I think is wrong, thanks.



If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #11 on: August 09, 2018, 01:08:20 pm »
I meet an issue that the new build C::B can not run the debugger. I create a simple console project, when I hit the run bottom, it correctly shows the hello world in the xterm, while I hit the debug botton, C::B just hangs. Do you see the same issue, since I can't copy the debugger plugin log.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #12 on: August 09, 2018, 03:34:23 pm »
Which revision? Can you build an older revision to see if it works? Can you attach gdb to see what is going on?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #13 on: August 09, 2018, 03:38:04 pm »
Which revision?
Found revision: '11442' '2018-08-07 07:14:29', I clone it from your github repo.

Quote
Can you build an older revision to see if it works? Can you attach gdb to see what is going on?
I will try it as soon as I can.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #14 on: August 10, 2018, 02:29:36 am »
Quote
Can you build an older revision to see if it works? Can you attach gdb to see what is going on?
I will try it as soon as I can.
OK, things becomes more strange, that is: debugger plugin works OK if I run C::B under GDB, while debugger plugin(the whole C::B) just hangs if I start C::B directly from command line. :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.