]>
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:
44 m_toolkit
='.*[^u][^d]'
48 m_version
='[0-9]\+\.[0-9]\+'
50 # lists all wx-config scripts that match criteria specified above
51 list_wx_config_scripts
()
53 mask
="${m_toolkit}${m_univ}${m_unicode}${m_debug}-${m_version}"
55 # if wx-config was called via wx$TOOLCHAIN_NAME-config symlink,
56 # try to extract the mask from it:
58 if test $myname != wx
-config ; then
59 toolchain
=`echo $myname | sed 's/wx\(.*\)-config/\1/'`
60 if test -f ${libdir}/wx
/config
/${toolchain} ; then
65 if test -d ${libdir}/wx
/config
; then
66 (cd ${libdir}/wx
/config
/ && ls -1 | grep "$mask" 2>/dev
/null
)
70 # find first wx-config script that matches criteria
71 find_wx_config_script
()
73 all_scripts
=`list_wx_config_scripts`
74 # unless wxBase was explicitly requested, try to find a GUI version:
75 if test "$m_toolkit" != "base" ; then
76 script=`echo $all_scripts | tr ' ' '\n' | grep -v '^base' | head -n 1`
77 if test "x$script" != "x" ; then
78 echo ${libdir}/wx
/config
/${script}
83 # otherwise (or if no GUI script was found), use alphabetically 1st script:
84 script=`echo $all_scripts | head -n 1`
85 if test -z "$script" ; then
86 echo "no suitable wx-config script found" >&2
89 echo ${libdir}/wx
/config
/${script}
95 # arguments to pass to the real wx-config script:
100 -*=*) optarg
=`echo "$i" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
106 prefix
=`makeabs $srcdir`
107 exec_prefix
=`makeabs $builddir`
110 args
="$args --inplace"
114 if test $exec_prefix_set = no
; then
126 # list available wx versions:
127 list_wx_config_scripts
138 if test "x$optarg" = "xyes" ; then
148 if test "x$optarg" = "xyes" ; then
158 if test "x$optarg" = "xyes" ; then
173 args
="$args --prefix=$prefix --exec-prefix=$exec_prefix"
175 script=`find_wx_config_script`;
176 if test "x$script" != "x" ; then