Makefile next attempt

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1998-09-05 13:59:23 +00:00
parent 5b011451bd
commit f3cb6592e9
10 changed files with 139 additions and 95 deletions

View File

@@ -2,7 +2,8 @@ system.list
bin bin
.gdb_history .gdb_history
Test Test
config.cashe config.cache
config.status config.status
system.list system.list
linux.system.cashe linux.system.cache
wx-config

8
configure vendored
View File

@@ -106,9 +106,9 @@ ac_help="$ac_help
ac_help="$ac_help ac_help="$ac_help
**--with-printarch use printing architecture" **--with-printarch use printing architecture"
ac_help="$ac_help ac_help="$ac_help
**--with-gtk-prefix=PFX Prefix where GTK is installed" **--with-gtk-prefix=PFX Prefix where GTK is installed"
ac_help="$ac_help ac_help="$ac_help
**--with-gtk-exec-prefix=PFX Exec prefix where GTK is installed" **--with-gtk-exec-prefix=PFX Exec prefix where GTK is installed"
ac_help="$ac_help ac_help="$ac_help
**--without-threads Force disabling threads " **--without-threads Force disabling threads "
@@ -6881,7 +6881,7 @@ done
ac_given_srcdir=$srcdir ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL" ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "./setup/substit ./include/wx/gtk/setup.h:./setup/setup.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 trap 'rm -fr `echo "./setup/substit ./wx-config:./wx-config.in ./include/wx/gtk/setup.h:./setup/setup.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF EOF
cat >> $CONFIG_STATUS <<EOF cat >> $CONFIG_STATUS <<EOF
@@ -7006,7 +7006,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"./setup/substit"} CONFIG_FILES=\${CONFIG_FILES-"./setup/substit ./wx-config:./wx-config.in"}
EOF EOF
cat >> $CONFIG_STATUS <<\EOF cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then

View File

@@ -14,9 +14,9 @@ AC_DEFUN(AM_PATH_GTK,
[dnl [dnl
dnl Get the cflags and libraries from the gtk-config script dnl Get the cflags and libraries from the gtk-config script
dnl dnl
AC_ARG_WITH(gtk-prefix,[**--with-gtk-prefix=PFX Prefix where GTK is installed], AC_ARG_WITH(gtk-prefix,[**--with-gtk-prefix=PFX Prefix where GTK is installed],
gtk_config_prefix="$withval", gtk_config_prefix="") gtk_config_prefix="$withval", gtk_config_prefix="")
AC_ARG_WITH(gtk-exec-prefix,[**--with-gtk-exec-prefix=PFX Exec prefix where GTK is installed], AC_ARG_WITH(gtk-exec-prefix,[**--with-gtk-exec-prefix=PFX Exec prefix where GTK is installed],
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
if test x$gtk_config_exec_prefix != x ; then if test x$gtk_config_exec_prefix != x ; then
@@ -1547,6 +1547,6 @@ dnl add OS to list of configured
echo $OS >> system.list echo $OS >> system.list
AC_CONFIG_HEADER(./include/wx/gtk/setup.h:./setup/setup.hin) AC_CONFIG_HEADER(./include/wx/gtk/setup.h:./setup/setup.hin)
AC_OUTPUT(./setup/substit,./setup/general/createall) AC_OUTPUT(./setup/substit ./wx-config:./wx-config.in,./setup/general/createall)
AC_OVERRIDES_DONE AC_OVERRIDES_DONE

View File

@@ -17,7 +17,7 @@ Unix that comes with Posix threads or SGI threads.
Now create your super-application myfoo.app and compile anywhere with Now create your super-application myfoo.app and compile anywhere with
gcc -o -c myfoo.cpp -I/usr/local/include -L/usr/local/lib -lwx_gtk g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
* General * General
----------------------- -----------------------
@@ -256,10 +256,34 @@ will do the work for you.
* Creating a new Project * Creating a new Project
-------------------------- --------------------------
There are two ways to create your own project. The first creates There are two ways to create your own project:
a project within the source code directories of wxWindows: In this
case I propose to put all contributed programs in the directory 1) The first way uses the installed libraries and header files
"/user", with a directory of its own. automatically using wx-config
g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
Using this way, a make file for the minimal sample would look
like this
CC = g++
minimal: minimal.o
$(CC) -o minimal minimal.o `wx-config --libs`
minimal.o: minimal.cpp mondrian.xpm
$(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
clean:
rm -f *.o minimal
This is certain to become the standard way unless we decide
to sitch to tmake.
2) The other way creates a project within the source code
directories of wxWindows: In this case I propose to put
all contributed programs in the directory "/user", with a
directory of its own.
This directory then should include the following files: This directory then should include the following files:
@@ -274,12 +298,6 @@ Makefile.in (This is the base application-Makefile template, from
put ALL your source code along with all the other stuff you need for put ALL your source code along with all the other stuff you need for
your application in this directory (subdirectories are welcome). your application in this directory (subdirectories are welcome).
The other way uses the installed libraries and header files in
/usr/local/include/wx and /usr/local/lib. In this case, just
compile your program like this:
gcc -o -c myfoo.cpp -I/usr/local/include -L/usr/local/lib -lwx_gtk
** Something about Makefiles ** Something about Makefiles
------------------------------ ------------------------------

View File

@@ -25,17 +25,6 @@
// classes // classes
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxMemoryDC;
class wxToolBar;
class wxBitmapButton;
class wxStaticBitmap;
class wxFrame;
class wxDialog;
class wxTreeCtrl;
class wxNotebook;
class wxMask; class wxMask;
class wxBitmap; class wxBitmap;
@@ -55,19 +44,8 @@ class wxMask: public wxObject
wxMask( const wxBitmap& bitmap ); wxMask( const wxBitmap& bitmap );
~wxMask(); ~wxMask();
private: // implementation
friend wxBitmap;
friend wxDC;
friend wxPaintDC;
friend wxToolBar;
friend wxBitmapButton;
friend wxStaticBitmap;
friend wxFrame;
friend wxDialog;
friend wxTreeCtrl;
friend wxNotebook;
GdkBitmap *GetBitmap() const; GdkBitmap *GetBitmap() const;
protected: protected:
@@ -118,11 +96,12 @@ class wxBitmap: public wxObject
wxPalette *GetPalette() const; wxPalette *GetPalette() const;
wxPalette *GetColourMap() const wxPalette *GetColourMap() const
{ return GetPalette(); }; { return GetPalette(); };
// implementation
GdkPixmap *GetPixmap() const; GdkPixmap *GetPixmap() const;
GdkBitmap *GetBitmap() const; GdkBitmap *GetBitmap() const;
private:
void DestroyImage(); void DestroyImage();
void RecreateImage(); void RecreateImage();
void Render(); void Render();

View File

@@ -25,17 +25,6 @@
// classes // classes
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxMemoryDC;
class wxToolBar;
class wxBitmapButton;
class wxStaticBitmap;
class wxFrame;
class wxDialog;
class wxTreeCtrl;
class wxNotebook;
class wxMask; class wxMask;
class wxBitmap; class wxBitmap;
@@ -55,19 +44,8 @@ class wxMask: public wxObject
wxMask( const wxBitmap& bitmap ); wxMask( const wxBitmap& bitmap );
~wxMask(); ~wxMask();
private: // implementation
friend wxBitmap;
friend wxDC;
friend wxPaintDC;
friend wxToolBar;
friend wxBitmapButton;
friend wxStaticBitmap;
friend wxFrame;
friend wxDialog;
friend wxTreeCtrl;
friend wxNotebook;
GdkBitmap *GetBitmap() const; GdkBitmap *GetBitmap() const;
protected: protected:
@@ -118,11 +96,12 @@ class wxBitmap: public wxObject
wxPalette *GetPalette() const; wxPalette *GetPalette() const;
wxPalette *GetColourMap() const wxPalette *GetColourMap() const
{ return GetPalette(); }; { return GetPalette(); };
// implementation
GdkPixmap *GetPixmap() const; GdkPixmap *GetPixmap() const;
GdkBitmap *GetBitmap() const; GdkBitmap *GetBitmap() const;
private:
void DestroyImage(); void DestroyImage();
void RecreateImage(); void RecreateImage();
void Render(); void Render();

View File

@@ -61,18 +61,18 @@ DJPEG_PROG =
GIFTOPNM_PROG = GIFTOPNM_PROG =
NETPBM_PATH = NETPBM_PATH =
# Base directories for installation
prefix = @prefix@ prefix = @prefix@
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
# Directory in which to install scripts. # Directory in which to install headers
#bindir = @bindir@ includedir = @includedir@
# Directory in which to install library files. # Directory in which to install library files
datadir = @datadir@ libdir = @libdir@
acdatadir = $(datadir)/autoconf
# Directory in which to install documentation info files. # Directory in which to install executable files
infodir = @infodir@ bindir = @bindir@
X_CFLAGS = @X_CFLAGS@ X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@ X_LIBS = @X_LIBS@

View File

@@ -25,9 +25,9 @@ s|*AWK*|@AWK@|g
s|*LN_S*|@LN_S@|g s|*LN_S*|@LN_S@|g
s|*prefix*|@prefix@|g s|*prefix*|@prefix@|g
s|*exec_prefix*|@exec_prefix@|g s|*exec_prefix*|@exec_prefix@|g
s|*libdir*|@libdir@|g
s|*bindir*|@bindir@|g s|*bindir*|@bindir@|g
s|*datadir*|@datadir@|g s|*includedir*|@includedir@|g
s|*infodir*|@infodir@|g
s|*X_CFLAGS*|@X_CFLAGS@|g s|*X_CFLAGS*|@X_CFLAGS@|g
s|*X_LIBS*|@X_LIBS@|g s|*X_LIBS*|@X_LIBS@|g
s|*X_EXTRA_LIBS*|@X_EXTRA_LIBS@|g s|*X_EXTRA_LIBS*|@X_EXTRA_LIBS@|g

View File

@@ -18,6 +18,10 @@ RULE=gslib
# include gtk.inc, qt.inc or motif.inc here # include gtk.inc, qt.inc or motif.inc here
include @MAKEINCLUDE@ include @MAKEINCLUDE@
# determine library names
STATIC_LIBRARY=lib$(LIB_TARGET).a
SHARED_LIBRARY=lib$(LIB_TARGET).so.$(LIB_MAJOR).$(LIB_MINOR)
LIB_CPP_ALL_SRC=$(LIB_CPP_SRC) @GTK_JOYSTICK@ @UNIX_THREAD@ LIB_CPP_ALL_SRC=$(LIB_CPP_SRC) @GTK_JOYSTICK@ @UNIX_THREAD@
LIB_C_ALL_SRC=$(LIB_C_SRC) parser.c LIB_C_ALL_SRC=$(LIB_C_SRC) parser.c
@@ -39,7 +43,9 @@ all::
@if test ! -d iodbc; then mkdir iodbc; fi @if test ! -d iodbc; then mkdir iodbc; fi
install:: install::
@echo " "
@echo "Installing library files and headers.." @echo "Installing library files and headers.."
@echo " "
@echo " Creating directories.." @echo " Creating directories.."
@$(WXBASEDIR)/mkinstalldirs \ @$(WXBASEDIR)/mkinstalldirs \
/usr/local/include/wx \ /usr/local/include/wx \
@@ -49,33 +55,37 @@ install::
@echo " Copying headers from /include/wx" @echo " Copying headers from /include/wx"
@cd $(WXBASEDIR)/include/wx ; \ @cd $(WXBASEDIR)/include/wx ; \
for f in *.h ; do \ for f in *.h ; do \
rm -f /usr/local/include/wx/$$f ; \ rm -f $(includedir)/wx/$$f ; \
$(INSTALL_DATA) $$f /usr/local/include/wx/$$f ; \ $(INSTALL_DATA) $$f $(includedir)/wx/$$f ; \
done done
@echo " Copying headers from /include/wx/gtk" @echo " Copying headers from /include/wx/gtk"
@cd $(WXBASEDIR)/include/wx/gtk ; \ @cd $(WXBASEDIR)/include/wx/gtk ; \
for f in *.h ; do \ for f in *.h ; do \
rm -f /usr/local/include/wx/gtk/$$f ; \ rm -f $(includedir)/wx/gtk/$$f ; \
$(INSTALL_DATA) $$f /usr/local/include/wx/gtk/$$f ; \ $(INSTALL_DATA) $$f $(includedir)/wx/gtk/$$f ; \
done done
@echo " Copying headers from /include/wx/generic" @echo " Copying headers from /include/wx/generic"
@cd $(WXBASEDIR)/include/wx/generic ; \ @cd $(WXBASEDIR)/include/wx/generic ; \
for f in *.h ; do \ for f in *.h ; do \
rm -f /usr/local/include/wx/generic/$$f ; \ rm -f $(includedir)/wx/generic/$$f ; \
$(INSTALL_DATA) $$f /usr/local/include/wx/generic/$$f ; \ $(INSTALL_DATA) $$f $(includedir)/wx/generic/$$f ; \
done done
@echo " Copying static libraries files to /usr/local/lib" @echo " Copying wx-config"
@cd $(WXBASEDIR) ; \
rm -f $(bindir)/wx-config ; \
$(INSTALL_PROGRAM) wx-config $(bindir)/wx-config
@echo " Copying static library"
@cd $(WXBASEDIR)/lib/$(OS) ; \ @cd $(WXBASEDIR)/lib/$(OS) ; \
for f in libwx_gtk.a ; do \ rm -f $(libdir)/$(STATIC_LIBRARY) ; \
rm -f /usr/local/lib/$$f ; \ $(INSTALL_DATA) $(STATIC_LIBRARY) $(libdir)/$(STATIC_LIBRARY)
$(INSTALL_DATA) $$f /usr/local/lib/$$f ; \ @echo " Copying shared library"
done
@echo " Copying shared libraries to /usr/local/lib"
@cd $(WXBASEDIR)/lib/$(OS) ; \ @cd $(WXBASEDIR)/lib/$(OS) ; \
for f in libwx_gtk.so* ; do \ rm -f $(libdir)/$(SHARED_LIBRARY) ; \
rm -f /usr/local/lib/$$f ; \ $(INSTALL_PROGRAM) $(SHARED_LIBRARY) $(libdir)/$(SHARED_LIBRARY)
$(INSTALL_PROGRAM) $$f /usr/local/lib/$$f ; \ @echo " "
done @echo "Installation complete. You may have to run ldconfig!"
@echo " "
clean:: clean::
$(RM) -rf gtk $(RM) -rf gtk

57
wx-config.in Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
usage="\
Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo @WXGTK_VERSION@
;;
--cflags)
if test @includedir@ != /usr/include ; then
includes=-I@includedir@
fi
echo $includes -D@TOOLKIT_DEF@ @GUI_TK_INCLUDE@
;;
--libs)
echo -L@libdir@ -lwx_gtk -ldl @GUI_TK_LIBRARY@ @THREADS_LINK@ @EXTRA_LINK@
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done