X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74b8433210c15d1dabeb5cc90e076b64867b9b42..a2c6537e60ab5564d6bf33bb14ac8c42744aa93c:/wx-config.in diff --git a/wx-config.in b/wx-config.in index 0123a724cd..579bcf0d63 100755 --- a/wx-config.in +++ b/wx-config.in @@ -144,31 +144,15 @@ get_ldflags_gui() echo $flags_to_ret } -# 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 <&2 fi + +# handle libraries list: + +libs_list="" + +for arg in $*; do + case "$arg" in + -*) + ;; + *) + libs_list="$libs_list `echo "$arg" | tr ',' ' '`" + ;; + esac +done + +if test "x$libs_list" = "x" ; then + if test "$is_monolithic" = "0" ; then + # link against all libs if none given explicitly: + libs_list="$CORE_GUI_LIBS $CORE_BASE_LIBS" + fi +else + # always add wxBase, any wxApp needs it: + libs_list="$libs_list base" +fi + +# determine if at least one gui lib was used: +nogui_flag="yes" +for i in $libs_list; do + case $i in + base|net) + ;; + *) + nogui_flag="no" + ;; + esac +done + + +# handle options: + while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; @@ -264,11 +294,7 @@ while test $# -gt 0; do case $1 in --inplace) - prefix=`makeabs $srcdir` - exec_prefix=`makeabs $builddir` - exec_prefix_set=yes inplace_flag=yes - update_prefixes ;; --prefix=*) prefix=$optarg @@ -316,19 +342,7 @@ while test $# -gt 0; do echo `eval echo ${MACRESWXCONFIG}` ;; - --libs*) - # find if the argument was --libs=list,of,libs or --libs: - if test "x$optarg" = "x" ; then - if test "$is_monolithic" = "0" ; then - # link against all libs if none given explicitly: - libs_list="$CORE_GUI_LIBS $CORE_BASE_LIBS" - fi - else - libs_list=`echo "$optarg" | tr ',' ' '` - # always add wxBase, any wxApp needs it: - libs_list="$libs_list base" - fi - + --libs) # include install directory only if it is not default: if test "${libdir}" != "/usr/lib" \ -a \( "${cross_compiling}" != "yes" \ @@ -337,7 +351,7 @@ while test $# -gt 0; do libs="-L${libdir}" fi - # it's simpler to avoid handling "bae" itself at all as we add it in the + # it's simpler to avoid handling "base" itself at all as we add it in the # end to the list of libraries anyhow # in monolithic build, link against the main library: if test "$is_monolithic" = "1" ; then @@ -373,7 +387,7 @@ while test $# -gt 0; do # if we have std, we're going to add base anyhow, avoid # having it twice in the end if [ $hadstd = 0 ]; then - newlist="$newlist $i"; + newlist="$newlist $i" fi ;; @@ -406,7 +420,11 @@ while test $# -gt 0; do --ld) echo $LD ;; - *) + --help|-h) + usage 1 1>&2 + ;; + -*) + # unrecognized flag is error usage 1 1>&2 ;; esac