Logo Notes on Rebuilding Glade Projects

Description

There seems to be a lot of confusion on how to get various source code projects to build when using a different version of autotools (automake etc.). Typically this problem happens after a system upgrade or when trying to build a project from source on a different version of tools than the author was using. This text is an attempt to help get projects to build properly. If you are new to building from source, you will probably run into several issues. You will need the appropriate development tools installed ( ie. glade-2, the C compiler, sometimes various -dev development packages and so on ). It takes a bit of experience to decode the sometimes cryptic error messages produced by the source tools. If you see errors about missing header files, you are probably missing a -dev development package. If you see errors about file not found... usually this means you do not have a particular compiler or tool installed that is needed. This tutorial leads one through stripping a glade project down to it essential components and rebuilding it.

Symptoms

It is typical to see some warnings when running ./autogen.sh, but errors are a problem.

Running automake-1.4...

cp: cannot stat `COPYING': No such file or directory

cp: cannot stat `INSTALL': No such file or directory

cp: cannot create regular file `./install-sh': No such file or directoryautomake: configure.in: installing `./install-sh'

error while copying


cp: cannot create regular file `./mkinstalldirs': No such file or directoryautomake: configure.in: installing `./mkinstalldirs'

error while copying

and so on....

The above errors are the result of links in the distributed source file that dont exist on the users system.

Typical Project Cleanup and Rebuild

In this section, we will expand a compressed source tar file for a project and work through regenerating it from scratch. All the work will be done in a temporary directory I called trash. Dont be afraid of messing something up.. if you delete a file by mistake, you can always start over by re-expanding the tar file (.tgz). Once you have done this on a few projects, building from source will become easier.
$ mkdir trash
$ cp ge-x2212-2-27sept-2004.tgz trash
$ cd trash
$ tar -xzvf ge-x2212-2-27sept-2004.tgz
$ cd ge-x2212-2
$ ls -lia
8962066 drwxr-sr-x 4 lg lg   4096 2004-09-27 14:12 .
8962060 drwxr-sr-x 3 lg lg   4096 2007-07-17 10:22 ..
8962094 -rw-r--r-- 1 lg lg    142 2004-09-23 21:42 acconfig.h
8962095 -rw-r--r-- 1 lg lg  42915 2004-09-27 12:35 aclocal.m4
8962091 -rw-r--r-- 1 lg lg      0 2004-09-23 21:42 AUTHORS
8962086 -rwxr-xr-x 1 lg lg    439 2004-09-23 21:42 autogen.sh
8962096 drwxr-sr-x 2 lg lg   4096 2004-09-27 12:35 autom4te-2.53.cache
8962092 -rw-r--r-- 1 lg lg      0 2004-09-23 21:42 ChangeLog
8962100 -rw-r--r-- 1 lg lg    775 2004-09-27 12:36 config.h.in
8962108 -rwxr-xr-x 1 lg lg 152781 2004-09-27 12:36 configure
8962087 -rw-r--r-- 1 lg lg    410 2004-09-23 21:42 configure.in
8962105 lrwxrwxrwx 1 lg lg     31 2007-07-17 10:22 COPYING -> /usr/share/automake-1.6/COPYING
8962107 lrwxrwxrwx 1 lg lg     31 2007-07-17 10:22 depcomp -> /usr/share/automake-1.6/depcomp
8962068 -rw-r--r-- 1 lg lg 152804 2004-09-27 14:08 ge-x2212-2.glade
8962070 -rw-r--r-- 1 lg lg 152804 2004-09-27 14:08 ge-x2212-2.glade.bak
8962067 -rw-r--r-- 1 lg lg    285 2004-09-27 14:08 ge-x2212-2.gladep
8962069 -rw-r--r-- 1 lg lg    285 2004-09-27 14:08 ge-x2212-2.gladep.bak
8962104 lrwxrwxrwx 1 lg lg     31 2007-07-17 10:22 INSTALL -> /usr/share/automake-1.6/INSTALL
8962101 lrwxrwxrwx 1 lg lg     34 2007-07-17 10:22 install-sh -> /usr/share/automake-1.6/install-sh
8962088 -rw-r--r-- 1 lg lg    665 2004-09-23 21:42 Makefile.am
8962106 -rw-r--r-- 1 lg lg  14076 2004-09-27 12:36 Makefile.in
8962103 lrwxrwxrwx 1 lg lg     31 2007-07-17 10:22 missing -> /usr/share/automake-1.6/missing
8962102 lrwxrwxrwx 1 lg lg     37 2007-07-17 10:22 mkinstalldirs -> /usr/share/automake-1.6/mkinstalldirs
8962089 -rw-r--r-- 1 lg lg      0 2004-09-23 21:42 NEWS
8962090 -rw-r--r-- 1 lg lg      0 2004-09-23 21:42 README
8962071 drwxr-sr-x 2 lg lg   4096 2004-09-27 14:12 src
8962093 -rw-r--r-- 1 lg lg     10 2004-09-23 21:42 stamp-h.in
Most of the above files are not needed when rebuilding the glade project as they are generated by the glade build command. Only the .glade and the .gladep files are needed along with the src directory. Go ahead and delete all the extra files until your directory listing looks like...
8962066 drwxr-sr-x 3 lg lg   4096 2007-07-17 10:39 .
8962060 drwxr-sr-x 3 lg lg   4096 2007-07-17 10:22 ..
8962068 -rw-r--r-- 1 lg lg 152804 2004-09-27 14:08 ge-x2212-2.glade
8962067 -rw-r--r-- 1 lg lg    285 2004-09-27 14:08 ge-x2212-2.gladep
8962071 drwxr-sr-x 2 lg lg   4096 2004-09-27 14:12 src
Now we need to remove a couple of files from the src directory...
$ rm src/Makefile.am src/Makefile.in src/*.bak
Now lets rebuild the glade project from scratch..
$ glade-2 ge-x2212-2.glade
click on the Build menu bar button and then close glade. When you do a directory listing, you should see a bunch of the files that glade generated.
$ ls -lia
8962066 drwxr-sr-x 3 lg lg   4096 2007-07-17 10:45 .
8962060 drwxr-sr-x 3 lg lg   4096 2007-07-17 10:22 ..
8962088 -rw-r--r-- 1 lg lg      0 2007-07-17 10:45 AUTHORS
8962072 -rwxr-xr-x 1 lg lg   4476 2007-07-17 10:45 autogen.sh
8962089 -rw-r--r-- 1 lg lg      0 2007-07-17 10:45 ChangeLog
8962080 -rw-r--r-- 1 lg lg    386 2007-07-17 10:45 configure.in
8962070 -rw-r--r-- 1 lg lg 160181 2007-07-17 10:45 ge-x2212-2.glade
8962068 -rw-r--r-- 1 lg lg 152804 2004-09-27 14:08 ge-x2212-2.glade.bak
8962069 -rw-r--r-- 1 lg lg    285 2007-07-17 10:45 ge-x2212-2.gladep
8962067 -rw-r--r-- 1 lg lg    285 2004-09-27 14:08 ge-x2212-2.gladep.bak
8962082 -rw-r--r-- 1 lg lg    665 2007-07-17 10:45 Makefile.am
8962086 -rw-r--r-- 1 lg lg      0 2007-07-17 10:45 NEWS
8962087 -rw-r--r-- 1 lg lg      0 2007-07-17 10:45 README
8962071 drwxr-sr-x 2 lg lg   4096 2007-07-17 10:45 src
8962090 -rw-r--r-- 1 lg lg     10 2007-07-17 10:45 stamp-h.in
OK. now we should be able to rebuild the project using the normal sequence of...
$ ./autogen.sh
$ make
At this point you can install the file using
$ sudo make install
or you can run the file in place to test it by using...
$ sudo src/ge-x2212-2
Note that in this example, we are using sudo to run the file because it needs root access to the parallel port programmer. Sudo is not needed to run most glade programs.

cheers and good luck

home.jpg Back to Lawrence's Software Stuff Page