]> git.saurik.com Git - wxWidgets.git/blobdiff - wx-config.in
added OpenGL libs for gcc and watcom (other don't require it)
[wxWidgets.git] / wx-config.in
index 7fd7a85af5aa383a55994a783f3da677422008b1..74ba23e94d024adb8b6ac7bfeff1b9e83873bd5a 100755 (executable)
@@ -7,15 +7,34 @@ CC="@CC@"
 GCC="@GCC@"
 CXX="@CXX@"
 LD="@SHARED_LD@"
 GCC="@GCC@"
 CXX="@CXX@"
 LD="@SHARED_LD@"
+srcdir=@top_srcdir@
+builddir=@top_builddir_wxconfig@
 cross_compiling=@cross_compiling@
 target=@host_alias@
 static_flag=@STATIC_FLAG@
 
 cross_compiling=@cross_compiling@
 target=@host_alias@
 static_flag=@STATIC_FLAG@
 
+# return the absolute path prepending builddir to it if needed
+makeabs()
+{
+    path=$1
+    # TODO: this only works under Unix and even there it could be
+    #       enhanced to remove ".." and "."
+    if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
+        if [ $path = "." ]; then
+            path=$builddir
+        else
+            path="$builddir/$path"
+        fi
+    fi
+
+    echo $path
+}
+
 usage()
 {
     cat <<EOF
 usage()
 {
     cat <<EOF
-Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--static]
-                 [--libs] [--gl-libs]
+Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--release]
+                 [--basename] [--static] [--libs] [--gl-libs]
                  [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
                  [--cc] [--cxx] [--ld]
 
                  [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
                  [--cc] [--cxx] [--ld]
 
@@ -88,6 +107,11 @@ while test $# -gt 0; do
   esac
 
   case $1 in
   esac
 
   case $1 in
+    --inplace)
+      prefix=`makeabs $srcdir`
+      exec_prefix=`makeabs $builddir`
+      exec_prefix_set=yes
+      ;;
     --prefix=*)
       prefix=$optarg
       if test $exec_prefix_set = no ; then
     --prefix=*)
       prefix=$optarg
       if test $exec_prefix_set = no ; then
@@ -107,6 +131,14 @@ while test $# -gt 0; do
     --version)
       echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@
       ;;
     --version)
       echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@
       ;;
+    --release)
+      # Should echo @WX_RELEASE@ instead, but that doesn't seem to be replaced after 
+      # configure has run on this file.
+      echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@
+      ;;
+    --basename)
+      echo @WX_LIBRARY_BASENAME@
+      ;;
     --static)
       static_flag=yes
       ;;
     --static)
       static_flag=yes
       ;;
@@ -123,7 +155,7 @@ while test $# -gt 0; do
       echo @LDFLAGS_EXE@
       ;;
     --rezflags)
       echo @LDFLAGS_EXE@
       ;;
     --rezflags)
-      echo @LIBWXMACRESWXCONFIG@
+      echo @MACRESWXCONFIG@
       ;;
     --libs)
       if test "@libdir@" != "/usr/lib" \
       ;;
     --libs)
       if test "@libdir@" != "/usr/lib" \
@@ -134,7 +166,7 @@ while test $# -gt 0; do
       fi
 
       if test $static_flag = yes ; then
       fi
 
       if test $static_flag = yes ; then
-          echo "$libs @LDFLAGS@ @WXCONFIG_RPATH@ @libdir@/@WXCONFIG_LIBS_STATIC@ @LIBS@ @DMALLOC_LIBS@"
+          echo "$libs @LDFLAGS@ @WXCONFIG_RPATH@ @libdir@/@WXCONFIG_LIBS_STATIC@ @EXTRALIBS_GUI@ @LIBS@ @DMALLOC_LIBS@"
       else
           echo $libs @LDFLAGS@ @WXCONFIG_RPATH@ @WXCONFIG_LIBS@ @DMALLOC_LIBS@
       fi
       else
           echo $libs @LDFLAGS@ @WXCONFIG_RPATH@ @WXCONFIG_LIBS@ @DMALLOC_LIBS@
       fi