Re: Question about autogen.sh



On Tue, 16 Nov 1999 15:03:49 -0800 (PST), Derek Simkowiak wrote:
>      Is there an argument to GNU's ./autogen.sh or ./configure script
> to have it compile a statically linked binary executable?

No.

>      I've used Glade to build a U.I., now I want to link the GTK+ libs
> statically into my program.  I'm used to just going into the Makefile and
> adding "--static" to the CFLAGS variable, but that doesn't seem to work
> here (adding --static to the GTK_CFLAGS variable in the Makefile didn't
> work).

No, because it should be in the linker flags, not in the compiler flags.
It is also possible that it just doesn't work on your platform. Yes,
-static works on Linux, but it fails miserably on IRIX.

>      I also didn't see anything in config.h that looked like it
> applied.
> 
>      Any suggestions?  

Assumed that you use Linux (you didn't tell us), you can use:

  gcc -o foo foo.o bar.o gnu.o gnats.o -Wl,-B,static -lgtk -lgdk -lglib \
    -Wl,-B,dynamic -lXext -lX11 -lm

This switches back and forth between static (gtk, gdk, and glib) and
dynamic linking (all other libraries).


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/




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