1

I know that this should probably be very easy, and I have looked into the read me files and other files in cgdb like INSTALL that talk about isntalling cgdb. I was trying to install cgdb and the instructions said:

$ ./configure --prefix=/usr/local
$ make
$ sudo make install

However, there is no such file inside of the file I got from running the git clone command. i.e. from running:

$ git clone git://github.com/cgdb/cgdb.git

I went inside that file to see the installation instructions and it says the following:

Basic Installation
==================

   These are generic installation instructions.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

    The simplest way to compile this package is:  

1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.  If you're
     using `csh' on an old version of System V, you might need to type
     `sh ./configure' instead to prevent `csh' from trying to execute
     `configure' itself.

     Running `configure' takes awhile.  While running, it prints some
     messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Optionally, type `make check' to run any self-tests that come with
     the package.

  4. Type `make install' to install the programs and any data files and
     documentation.

  5. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.  To also remove the
     files that `configure' created (so you can compile the package for
     a different kind of computer), type `make distclean'.  There is
     also a `make maintainer-clean' target, but that is intended mainly
     for the package's developers.  If you use it, you may have to get
     all sorts of other programs in order to regenerate files that came
     with the distribution.

and there is more I didn't paste.

The part that confuses me is the following paragraph:

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

does it mean I should run ./configure.in? I am honeslty a little scared of running it because I need to run it in as sudo plus, that file doesn't even exit in the code I got from git clone. This is what I do have in that directory:

➜  cgdb git:(master) ls
AUTHORS          Makefile.am      autogen.sh       doc              roadmap.txt
COPYING          NEWS             autorelease.sh   indent.sh        test
ChangeLog        README           cgdb             lib
FAQ              README.md        config           packages
INSTALL          TODO             configure.init   release-todo.txt
➜  cgdb git:(master)

I did grep for config or config.in in that directory and it didn't yield anything useful.

I have also tried brew installing it but I ran into problems. When I cgdb the file and hit run it frozen at a print statment instead of moving on to the next command prompt for gdb as in (gdb). Anyone knows whats up? Is it because I am using go source file?

What have people done to have cgdb working on a mac?

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323

3 Answers3

1

Неу, yeah, the git source for cgdb doesn't come with the configure script pre-built. (The official release distributions do, however.)

If you have the right tools installed, you can fix this by running:

./autogen.sh

This will generate the configure script, and then you can install it as you would any other autoconf-based source package.

Mike Mueller
  • 2,072
  • 15
  • 16
  • Hi mike, I tried running it but in the middle it said: `./autogen.sh: line 15: aclocal: command not found`, will that cause any problems? I then followed instructions at http://cgdb.github.io/ but it seems that even running `./configure.in` or `./configure.init` doesnt work, even when sudoed – Charlie Parker Aug 09 '14 at 16:54
  • For OSX, assuming you use homebrew, you can `brew install` the following packages to build cgdb: automake, autoconf, readline. You may have to tell configure where to find readline: `./configure --with-readline=/usr/local/Cellar/readline/6.2.4` Sorry, we should document this officially somewhere. – Mike Mueller Aug 12 '14 at 23:14
  • lol, yea I discovered that later at some point and posted it as an answer to my question :P thanks anyway. – Charlie Parker Aug 13 '14 at 01:19
1

Forget about all that aggro with configuration and dependency libraries; install MacPorts and do:

$ sudo port install cgdb

They have 0.6.7 at the time of writing.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • I installed MacPort, but it complains about port not existing :( `➜ ~ sudo port install cgdb sudo: port: command not found` – Charlie Parker Aug 09 '14 at 16:44
  • @Pinocchio That's a `$PATH` issue. Macports should have modified your shell proflile (`~/.bash_profile`) to include `/opt/local/bin` which is where `port` and any installed Macports binaries are installed. It might just be a case of restarting *Terminal.app* or doing `. ~/.bash_profile`. – trojanfoe Aug 09 '14 at 17:08
  • Macports? You'll have to see the documentation on their website. – trojanfoe Aug 09 '14 at 17:52
1

What worked for me was doing:

brew install cgdb

However, for me that was not enough to get it going. I needed to sudo it for it to run:

sudo cgdb

I would have never guessed I needed to sudo it...I figured it out because it was throwing me the error talked about in the following question:

gdb fails with "Unable to find Mach task port for process-id" error

Community
  • 1
  • 1
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323