]> git.saurik.com Git - wxWidgets.git/commitdiff
Makefile next attempt
authorRobert Roebling <robert@roebling.de>
Sat, 5 Sep 1998 13:59:23 +0000 (13:59 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 5 Sep 1998 13:59:23 +0000 (13:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

.cvsignore
configure
configure.in
docs/gtk/install.txt
include/wx/gtk/bitmap.h
include/wx/gtk1/bitmap.h
setup/maketmpl.in
setup/substit.in
src/Makefile.in
wx-config.in [new file with mode: 0755]

index a4555c2e926c31ee1c2b4fdb09511bd9a3ca3245..47bc8bb59d3f9fe8c3fdb8a3b3e5fb3d457f0d61 100644 (file)
@@ -2,7 +2,8 @@ system.list
 bin
 .gdb_history
 Test
-config.cashe
+config.cache
 config.status
 system.list
-linux.system.cashe
\ No newline at end of file
+linux.system.cache
+wx-config
index 792f25a6242c57b0d816beb68d9a34517251d8ee..67440e60432a2f8c56f08fa4cf39f658a9f676eb 100755 (executable)
--- a/configure
+++ b/configure
@@ -106,9 +106,9 @@ ac_help="$ac_help
 ac_help="$ac_help
 **--with-printarch        use printing architecture"
 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
-**--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
 **--without-threads       Force disabling threads "
 
@@ -6881,7 +6881,7 @@ done
 ac_given_srcdir=$srcdir
 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
 cat >> $CONFIG_STATUS <<EOF
 
@@ -7006,7 +7006,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"./setup/substit"}
+CONFIG_FILES=\${CONFIG_FILES-"./setup/substit ./wx-config:./wx-config.in"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
index 230bcbdcb8c1b698c239f5cd6969e46be789cc06..5cb887560ba4eadc14cdaa9ca44b4603b728f3f7 100644 (file)
@@ -14,9 +14,9 @@ AC_DEFUN(AM_PATH_GTK,
 [dnl 
 dnl Get the cflags and libraries from the gtk-config script
 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="")
-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="")
 
   if test x$gtk_config_exec_prefix != x ; then
@@ -1547,6 +1547,6 @@ dnl add OS to list of configured
 echo $OS >> system.list
 
 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
index 0eb9f235a2e1975fcedebc2d26e00e97a588252a..05daf515a8b270616ea8a6ecc8165d5f25f097e7 100644 (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
 
-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
 -----------------------
@@ -256,10 +256,34 @@ will do the work for you.
 * Creating a new Project
 --------------------------
 
-There are two ways to create your own project. The first 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.
+There are two ways to create your own project:
+
+1) The first way uses the installed libraries and header files
+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:
 
@@ -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
 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
 ------------------------------
index 689f30ce9fae6f1421d9759f5f12e2a7e3f520a8..7baf8849f35ebdfb8bed0d7f7f3ce3af20a7f007 100644 (file)
 // classes
 //-----------------------------------------------------------------------------
 
-class wxDC;
-class wxPaintDC;
-class wxMemoryDC;
-class wxToolBar;
-class wxBitmapButton;
-class wxStaticBitmap;
-class wxFrame;
-class wxDialog;
-class wxTreeCtrl;
-class wxNotebook;
-
 class wxMask;
 class wxBitmap;
 
@@ -55,19 +44,8 @@ class wxMask: public wxObject
     wxMask( const wxBitmap& bitmap );
     ~wxMask();
 
-  private:
-
-    friend wxBitmap;
-    friend wxDC;
-    friend wxPaintDC;
-    friend wxToolBar;
-    friend wxBitmapButton;
-    friend wxStaticBitmap;
-    friend wxFrame;
-    friend wxDialog;
-    friend wxTreeCtrl;
-    friend wxNotebook;
-
+  // implementation
+    
     GdkBitmap *GetBitmap() const;
 
   protected:
@@ -118,11 +96,12 @@ class wxBitmap: public wxObject
     wxPalette *GetPalette() const;
     wxPalette *GetColourMap() const
       { return GetPalette(); };
+      
+  // implementation      
 
     GdkPixmap *GetPixmap() const;
     GdkBitmap *GetBitmap() const;
 
-  private:
     void DestroyImage();
     void RecreateImage();
     void Render();
index 689f30ce9fae6f1421d9759f5f12e2a7e3f520a8..7baf8849f35ebdfb8bed0d7f7f3ce3af20a7f007 100644 (file)
 // classes
 //-----------------------------------------------------------------------------
 
-class wxDC;
-class wxPaintDC;
-class wxMemoryDC;
-class wxToolBar;
-class wxBitmapButton;
-class wxStaticBitmap;
-class wxFrame;
-class wxDialog;
-class wxTreeCtrl;
-class wxNotebook;
-
 class wxMask;
 class wxBitmap;
 
@@ -55,19 +44,8 @@ class wxMask: public wxObject
     wxMask( const wxBitmap& bitmap );
     ~wxMask();
 
-  private:
-
-    friend wxBitmap;
-    friend wxDC;
-    friend wxPaintDC;
-    friend wxToolBar;
-    friend wxBitmapButton;
-    friend wxStaticBitmap;
-    friend wxFrame;
-    friend wxDialog;
-    friend wxTreeCtrl;
-    friend wxNotebook;
-
+  // implementation
+    
     GdkBitmap *GetBitmap() const;
 
   protected:
@@ -118,11 +96,12 @@ class wxBitmap: public wxObject
     wxPalette *GetPalette() const;
     wxPalette *GetColourMap() const
       { return GetPalette(); };
+      
+  // implementation      
 
     GdkPixmap *GetPixmap() const;
     GdkBitmap *GetBitmap() const;
 
-  private:
     void DestroyImage();
     void RecreateImage();
     void Render();
index 25051c1affc0b6be5bdb942993411b5d98dcd2ee..9c6592865d2cb2c0adbf68a06787dad5989198b2 100644 (file)
@@ -61,18 +61,18 @@ DJPEG_PROG =
 GIFTOPNM_PROG = 
 NETPBM_PATH = 
 
+# Base directories for installation
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 
-# Directory in which to install scripts.
-#bindir = @bindir@
+# Directory in which to install headers
+includedir = @includedir@
 
-# Directory in which to install library files.
-datadir = @datadir@
-acdatadir = $(datadir)/autoconf
+# Directory in which to install library files
+libdir = @libdir@
 
-# Directory in which to install documentation info files.
-infodir = @infodir@
+# Directory in which to install executable files
+bindir = @bindir@
 
 X_CFLAGS = @X_CFLAGS@
 X_LIBS = @X_LIBS@
index cce03fde0960b4f321bdbd520a3a38597af0ffab..ad28b81a66fdac1b48a80ea43e18eb083c1ff6f5 100644 (file)
@@ -25,9 +25,9 @@ s|*AWK*|@AWK@|g
 s|*LN_S*|@LN_S@|g
 s|*prefix*|@prefix@|g
 s|*exec_prefix*|@exec_prefix@|g
+s|*libdir*|@libdir@|g
 s|*bindir*|@bindir@|g
-s|*datadir*|@datadir@|g
-s|*infodir*|@infodir@|g
+s|*includedir*|@includedir@|g
 s|*X_CFLAGS*|@X_CFLAGS@|g
 s|*X_LIBS*|@X_LIBS@|g
 s|*X_EXTRA_LIBS*|@X_EXTRA_LIBS@|g
index c9dac317330188026cac241d6308d2ee0f044ef7..0f3b3378aa8804347c968e9b6c9d0977dc8c749b 100644 (file)
@@ -18,6 +18,10 @@ RULE=gslib
 # include gtk.inc, qt.inc or motif.inc here
 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_C_ALL_SRC=$(LIB_C_SRC) parser.c
@@ -39,7 +43,9 @@ all::
        @if test ! -d iodbc; then mkdir iodbc; fi
 
 install::
+       @echo " "
        @echo "Installing library files and headers.."
+       @echo " "
        @echo "  Creating directories.."
        @$(WXBASEDIR)/mkinstalldirs \
           /usr/local/include/wx \
@@ -49,33 +55,37 @@ install::
        @echo "  Copying headers from /include/wx"
        @cd $(WXBASEDIR)/include/wx ; \
        for f in *.h ; do \
-         rm -f /usr/local/include/wx/$$f ; \
-         $(INSTALL_DATA) $$f /usr/local/include/wx/$$f ; \
+         rm -f $(includedir)/wx/$$f ; \
+         $(INSTALL_DATA) $$f $(includedir)/wx/$$f ; \
        done
        @echo "  Copying headers from /include/wx/gtk"
        @cd $(WXBASEDIR)/include/wx/gtk ; \
        for f in *.h ; do \
-         rm -f /usr/local/include/wx/gtk/$$f ; \
-         $(INSTALL_DATA) $$f /usr/local/include/wx/gtk/$$f ; \
+         rm -f $(includedir)/wx/gtk/$$f ; \
+         $(INSTALL_DATA) $$f $(includedir)/wx/gtk/$$f ; \
        done
        @echo "  Copying headers from /include/wx/generic"
        @cd $(WXBASEDIR)/include/wx/generic ; \
        for f in *.h ; do \
-         rm -f /usr/local/include/wx/generic/$$f ; \
-         $(INSTALL_DATA) $$f /usr/local/include/wx/generic/$$f ; \
+         rm -f $(includedir)/wx/generic/$$f ; \
+         $(INSTALL_DATA) $$f $(includedir)/wx/generic/$$f ; \
        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) ; \
-       for f in libwx_gtk.a ; do \
-         rm -f /usr/local/lib/$$f ; \
-         $(INSTALL_DATA) $$f /usr/local/lib/$$f ; \
-       done
-       @echo "  Copying shared libraries to /usr/local/lib"
+         rm -f $(libdir)/$(STATIC_LIBRARY) ; \
+         $(INSTALL_DATA) $(STATIC_LIBRARY) $(libdir)/$(STATIC_LIBRARY)
+       @echo "  Copying shared library"
        @cd $(WXBASEDIR)/lib/$(OS) ; \
-       for f in libwx_gtk.so* ; do \
-         rm -f /usr/local/lib/$$f ; \
-         $(INSTALL_PROGRAM) $$f /usr/local/lib/$$f ; \
-       done
+         rm -f $(libdir)/$(SHARED_LIBRARY) ; \
+         $(INSTALL_PROGRAM) $(SHARED_LIBRARY) $(libdir)/$(SHARED_LIBRARY)
+       @echo " "
+       @echo "Installation complete. You may have to run ldconfig!"
+       @echo " "
+       
        
 clean::
        $(RM) -rf gtk
diff --git a/wx-config.in b/wx-config.in
new file mode 100755 (executable)
index 0000000..21b379e
--- /dev/null
@@ -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
+