Implements a Proxy detection (WPAD) interface for Linux, Mac OSX and Windows. Offers a GUI for manual proxy settings and automatic WPAD detection. The GUI is based on QT.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
216 lines
6.9 KiB
216 lines
6.9 KiB
# $Id$ |
|
m4_include(ax_cxx_compile_stdcxx_11.m4) |
|
AC_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) |
|
AC_DEFUN([AX_DEFINE_DIR], [ |
|
prefix_NONE= |
|
exec_prefix_NONE= |
|
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix |
|
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix |
|
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn |
|
dnl refers to ${prefix}. Thus we have to use `eval' twice. |
|
eval ax_define_dir="\"[$]$2\"" |
|
eval ax_define_dir="\"$ax_define_dir\"" |
|
AC_SUBST($1, "$ax_define_dir") |
|
AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3]) |
|
test "$prefix_NONE" && prefix=NONE |
|
test "$exec_prefix_NONE" && exec_prefix=NONE |
|
]) |
|
|
|
AC_INIT([README]) |
|
SRC_DIR=src |
|
TST_DIR= |
|
DOC_DIR=doc |
|
|
|
m4_define(x_packagename, proxyface) |
|
m4_define(x_major, 1) |
|
m4_define(x_minor, 0) |
|
PACKAGENAME=x_packagename |
|
MAJOR=x_major |
|
MINOR=x_minor |
|
BUILDDATE=$(date "+%d.%m.%Y/%H.%M") |
|
|
|
if svn info . 2>&1 > /dev/null; then |
|
LEAST=$(LANG= svn info $path | sed -n 's/Revision: //p') |
|
break; |
|
else |
|
LEAST=[$(pwd | sed -n 's,^.*/'${PACKAGENAME}'-'${MAJOR}'\.'${MINOR}'\.\([0-9]*\).*$,\1,p')] |
|
if test -z "${LEAST}"; then |
|
LEAST="ERROR_CANNOT_DETERMINE_REVISION_NUMBER from $(pwd)" |
|
fi |
|
fi |
|
|
|
AM_INIT_AUTOMAKE($PACKAGENAME, $MAJOR.$MINOR.$LEAST, [marc@waeckerlin.org]) |
|
|
|
# files to create |
|
AC_CONFIG_FILES([makefile ${PACKAGENAME}.spec src/version.cxx |
|
src/makefile examples/makefile |
|
doc/doxyfile doc/makefile |
|
src/${PACKAGENAME}.pc debian/changelog]) |
|
|
|
# copy M4 to shell |
|
AC_SUBST(MAJOR) |
|
AC_SUBST(MINOR) |
|
AC_SUBST(LEAST) |
|
AC_SUBST(BUILDDATE) |
|
|
|
# libtool versioning |
|
LIB_MAJOR=m4_eval(x_major+x_minor) |
|
LIB_MINOR=${LEAST} |
|
LIB_LEAST=x_minor |
|
LIB_VERSION="${LIB_MAJOR}:${LIB_MINOR}:${LIB_LEAST}" |
|
AC_SUBST(LIB_VERSION) |
|
|
|
# home |
|
AC_SUBST(HOME) |
|
|
|
# datadir for languages |
|
AX_DEFINE_DIR([DATADIR], [datadir]) |
|
#AC_SUBST(DATADIR) |
|
|
|
# macros |
|
README=README |
|
AC_SUBST_FILE(README) |
|
CHANGE_LOG=ChangeLog |
|
AC_SUBST_FILE(CHANGE_LOG) |
|
|
|
LIBS="${LIBS}" |
|
CPPFLAGS="${CPPFLAGS} -DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'" |
|
|
|
# Get rid of that stupid -O2 -g opions! |
|
CXXFLAGS="${CXXFLAGS:-}" |
|
|
|
# languages |
|
AC_LANG(C++) |
|
|
|
# programs |
|
AC_PROG_CXX |
|
AC_PROG_CPP |
|
AC_PROG_INSTALL |
|
AC_PROG_LN_S |
|
AC_PROG_MAKE_SET |
|
AC_PROG_LIBTOOL |
|
AC_CHECK_PROG(have_doxygen, doxygen, yes, no) |
|
AC_CHECK_PROG(have_dot, dot, yes, no) |
|
PKG_PROG_PKG_CONFIG |
|
|
|
# libraries |
|
case $host in |
|
(*mac*|*darwin*) |
|
;; |
|
(*mingw*|*win*) |
|
LIBS+=" -lwinhttp" |
|
CXXFLAGS+=" -DQ_OS_WIN32" |
|
;; |
|
(*) |
|
PKG_CHECK_MODULES([PROXY], [libproxy-1.0], |
|
[LIBS+=" ${PROXY_LIBS}" |
|
CXXFLAGS+=" ${PROXY_CFLAGS}" |
|
have_proxy=1]) |
|
;; |
|
esac |
|
PKG_CHECK_MODULES([QT], [Qt5Core Qt5Gui Qt5Widgets Qt5Network], |
|
[AC_DEFINE([HAVE_QT]) |
|
UIC=${UIC:-$(pkg-config --variable=uic_location Qt5Core)} |
|
MOC=${MOC:-$(pkg-config --variable=moc_location Qt5Core)} |
|
RCC=${RCC:-$(pkg-config --variable=rcc_location Qt5Core)} |
|
LUPDATE=${LUPDATE:-$(pkg-config --variable=lupdate_location Qt5Core)} |
|
LRELEASE=${LRELEASE:-$(pkg-config --variable=lrelease_location Qt5Core)} |
|
CXXFLAGS+=" -DQT_NETWORK_LIB ${QT_CFLAGS}" |
|
LIBS+=" ${QT_LIBS}" |
|
have_qt=1], |
|
[PKG_CHECK_MODULES([QT], [QtCore QtGui QtNetwork], |
|
[AC_DEFINE([HAVE_QT]) |
|
UIC=${UIC:-$(pkg-config --variable=uic_location QtCore)} |
|
MOC=${MOC:-$(pkg-config --variable=moc_location QtCore)} |
|
RCC=${RCC:-$(pkg-config --variable=rcc_location QtCore)} |
|
LUPDATE=${LUPDATE:-$(pkg-config --variable=lupdate_location QtCore)} |
|
LRELEASE=${LRELEASE:-$(pkg-config --variable=lrelease_location QtCore)} |
|
CXXFLAGS+=" -DQT_NETWORK_LIB ${QT_CFLAGS}" |
|
LIBS+=" ${QT_LIBS}" |
|
have_qt=1], |
|
[have_qt=0])]) |
|
AM_CONDITIONAL(HAVE_QT, test "$have_qt" = "1") |
|
if test "$have_qt" = "1" \ |
|
&& ! which "$UIC" "$MOC" "$RCC" "$LUPDATE" "$LRELEASE"; then |
|
if test -n "$MOC" \ |
|
&& which "${UIC:=${MOC/moc/uic}}" "${RCC:=${MOC/moc/rcc}}" \ |
|
"${LUPDATE:=${MOC/moc/lupdate}}" \ |
|
"${LRELEASE:=${MOC/moc/lrelease}}"; then |
|
AC_MSG_NOTICE([Detected: "$UIC" "$MOC" "$RCC" "$LUPDATE" "$LRELEASE"]) |
|
else |
|
AC_MSG_ERROR([Missing QT Programs. |
|
- Needed: uic moc rcc lupdate lrelease |
|
- Found: $UIC $MOC $RCC $LUPDATE $LRELEASE |
|
You can specify the missing programs by passing one of the variables: |
|
\$UIC \$MOC \$RCC \$LUPDATE \$LRELEASE |
|
Often it is sufficient to specify MOC=/path/to/moc ./configure)]) |
|
fi |
|
fi |
|
AC_SUBST(UIC) |
|
AC_SUBST(MOC) |
|
AC_SUBST(RCC) |
|
AC_SUBST(LUPDATE) |
|
AC_SUBST(LRELEASE) |
|
AC_ARG_VAR(LUPDATE_ARGS, [arguments for qt lupdate command, e.g. -no-obsolete]) |
|
|
|
AC_ARG_ENABLE(pedantic, |
|
[AS_HELP_STRING([--enable-pedantic], |
|
[enable all warnings and checks, abort on warnings])], |
|
[have_pedantic="$enableval"; test "$enableval" = "yes" && \ |
|
CXXFLAGS+=" -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"]) |
|
dnl problem in libs: -Wshadow -Wcast-qual |
|
dnl auto.hpp: -Wno-ctor-dtor-privacy (removed) |
|
AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes") |
|
AC_ARG_ENABLE(dot, |
|
[AS_HELP_STRING([--disable-dot], |
|
[disable dot graphic tools for documentation])], |
|
[have_dot="$enableval"]) |
|
test "$enableval" = "yes" && HAVE_DOT="YES" || HAVE_DOT="NO"; |
|
AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"]) |
|
|
|
MINGW32=no |
|
MAC=no |
|
case $host_os in |
|
*mingw32*) MINGW32=yes;; |
|
*darwin* | *rhapsody* | *macosx*) MAC=yes;; |
|
esac |
|
AM_CONDITIONAL(MINGW32, test "$MINGW32" = "yes") |
|
AM_CONDITIONAL(MAC, test "$MAC" = "yes") |
|
|
|
# author for signing packages |
|
if test -z "$PACKAGERID"; then |
|
PACKAGERID="Marc Wäckerlin (http://marc.waeckerlin.org) <marc@waeckerlin.org>" |
|
fi |
|
AC_ARG_VAR(PACKAGERID, [Signature identification of the package author.]) |
|
BUILDDATE=$(date --rfc-2822) |
|
|
|
# export macros |
|
SRCDIR=${srcdir} |
|
AC_SUBST(SRCDIR) |
|
AC_SUBST(SRC_DIR) |
|
AC_SUBST(TST_DIR) |
|
AC_SUBST(DOC_DIR) |
|
AC_SUBST(HAVE_DOT) |
|
AC_SUBST(THREADS) |
|
AC_SUBST(PACKAGENAME) |
|
|
|
# create output |
|
AC_OUTPUT |
|
# infos and warnings |
|
if test "$have_doxygen" = "no"; then |
|
AC_MSG_WARN([Missing program doxygen! |
|
- you cannot rebuild the documentation with make doc |
|
- there are precompiled derived files in the distribution]); fi |
|
if test "$have_dot" = "no"; then |
|
AC_MSG_WARN([Missing program dot! |
|
- when you rebild documentation with make doc, there are no generated images |
|
- there are precompiled derived files in the distribution]); fi |
|
if test "$have_cppunit" = "no"; then |
|
AC_MSG_WARN([Missing cppunit development library! |
|
- you cannot check the library using "make check" |
|
- everything else works perfectly]); fi |
|
if test "$have_pedantic" == "yes"; then |
|
AC_MSG_NOTICE([Pedantic compile mode enabled! |
|
- all warnings for GNU g++ are enabled |
|
- all warnings result in an error |
|
- doxygen warnings are treated as error too]); fi
|
|
|