66c68a3
#!/bin/sh -
66c68a3
0c1e1f9
# mingw-scripts
66c68a3
# Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones.
b8c5804
# Copyright (C) 2008 Levente Farkas
66c68a3
#
66c68a3
# This program is free software; you can redistribute it and/or modify
66c68a3
# it under the terms of the GNU General Public License as published by
0c1e1f9
# the Free Software Foundation; either version 2, or (at your option)
0c1e1f9
# any later version.
66c68a3
#
66c68a3
# This program is distributed in the hope that it will be useful,
66c68a3
# but WITHOUT ANY WARRANTY; without even the implied warranty of
66c68a3
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
66c68a3
# GNU General Public License for more details.
66c68a3
#
66c68a3
# You should have received a copy of the GNU General Public License
66c68a3
# along with this program; if not, write to the Free Software
0c1e1f9
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
0c1e1f9
# 02111-1307, USA.
66c68a3
b8c5804
# This is a useful command-line script through which one can use the
0c1e1f9
# macros from /etc/rpm/macros.cross, macros.mingw32 and macros.mingw64
66c68a3
0c1e1f9
if [ "`basename $0`" = "i686-w64-mingw32-pkg-config" ] ; then
0c1e1f9
    NAME="mingw32_pkg_config"
0c1e1f9
elif [ "`basename $0`" = "x86_64-w64-mingw32-pkg-config" ] ; then
0c1e1f9
    NAME="mingw64_pkg_config"
0c1e1f9
else
0c1e1f9
    NAME="`basename $0|tr -- - _`"
0c1e1f9
fi
5051797
7daa010
# When using the CMake wrappers, prevent CFLAGS and CXXFLAGS from being set
7daa010
# unless they're already set in the current environment (RHBZ #1136069)
7daa010
if [[ $NAME == *cmake* ]] ; then
7daa010
    MINGW32_CFLAGS=${MINGW32_CFLAGS:-""}
7daa010
    MINGW32_CXXFLAGS=${MINGW32_CXXFLAGS:-""}
7daa010
    MINGW64_CFLAGS=${MINGW64_CFLAGS:-""}
7daa010
    MINGW64_CXXFLAGS=${MINGW64_CXXFLAGS:-""}
7daa010
fi
7daa010
5051797
# NOTE: The use of 'eval' in combination with '$@' is a potential security risk
5051797
#       We should find a more safe replacement for this command
5051797
#       Suggestions are welcome at the Fedora MinGW mailing list
f185f58
eval "MINGW_CMAKE_NO_VERBOSE=1 `rpm --eval "%{$NAME}"`" '"$@"'