]>
git.saurik.com Git - wxWidgets.git/blob - wx-config-wrapper.in
3 # -------------------------------------------------------------------------
5 # -------------------------------------------------------------------------
9 includedir
="@includedir@"
13 exec_prefix
="@exec_prefix@"
17 builddir
="@top_builddir_wxconfig@"
20 # -------------------------------------------------------------------------
22 # -------------------------------------------------------------------------
26 # return the absolute path prepending builddir to it if needed
30 # TODO: this only works under Unix and even there it could be
31 # enhanced to remove ".." and "."
32 if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
33 if [ $path = "." ]; then
36 path
="$builddir/$path"
43 # these determine wx-config script to use:
46 m_unicode
='\(unicode\|ansi\)'
47 m_debug
='\(debug\|release\)'
48 m_version
='[0-9]\+\.[0-9]\+'
51 # lists all wx-config scripts that match criteria specified above
52 list_wx_config_scripts
()
54 mask
="^${m_toolkit}${m_univ}-${m_unicode}-${m_debug}-${m_version}${m_host}$"
56 # if wx-config was called via wx$TOOLCHAIN_NAME-config symlink,
57 # try to extract the mask from it:
59 if test $myname != wx
-config ; then
60 toolchain
=`echo $myname | sed 's/wx\(.*\)-config/\1/'`
61 if test -f ${libdir}/wx
/config
/${toolchain} ; then
66 if test -d ${libdir}/wx
/config
; then
67 (cd ${libdir}/wx
/config
/ && ls -1 | grep "$mask" 2>/dev
/null
)
71 # find first wx-config script that matches criteria
72 find_wx_config_script
()
74 all_scripts
=`list_wx_config_scripts`
75 # unless wxBase was explicitly requested, try to find a GUI version:
76 if test "$m_toolkit" != "base" ; then
77 script=`echo $all_scripts | tr ' ' '\n' | grep -v '^base' | head -n 1`
78 if test "x$script" != "x" ; then
79 echo ${libdir}/wx
/config
/${script}
84 # otherwise (or if no GUI script was found), use alphabetically 1st script:
85 script=`echo $all_scripts | head -n 1`
86 if test -z "$script" ; then
87 echo "no suitable wx-config script found" >&2
90 echo ${libdir}/wx
/config
/${script}
96 # arguments to pass to the real wx-config script:
101 -*=*) optarg
=`echo "$i" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
107 prefix
=`makeabs $srcdir`
108 exec_prefix
=`makeabs $builddir`
111 args
="$args --inplace"
115 if test $exec_prefix_set = no
; then
127 # list available wx versions:
128 list_wx_config_scripts
139 if test "x$optarg" = "xyes" ; then
149 if test "x$optarg" = "xyes" ; then
159 if test "x$optarg" = "xyes" ; then
177 args
="--prefix=$prefix --exec-prefix=$exec_prefix $args"
179 script=`find_wx_config_script`;
180 if test "x$script" != "x" ; then