Skip to content
This repository has been archived by the owner on Mar 18, 2018. It is now read-only.

Commit

Permalink
Use common m4 macros project.
Browse files Browse the repository at this point in the history
  • Loading branch information
nevali committed Feb 17, 2013
1 parent b6978b3 commit 5cc721d
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -1,3 +1,6 @@
[submodule "uriparser"]
path = uriparser
url = git://uriparser.git.sourceforge.net/gitroot/uriparser/uriparser
[submodule "m4"]
path = m4
url = git://github.com/nevali/m4.git
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -12,7 +12,7 @@
## See the License for the specific language governing permissions and
## limitations under the License.

ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I m4 -I .

SUBDIRS = uriparser . t util m4

Expand Down
25 changes: 5 additions & 20 deletions configure.ac
Expand Up @@ -25,27 +25,12 @@ AC_PROG_CXX
AC_HEADER_STDC
AC_PROG_LIBTOOL

LIBURI_BUILD_DOCS
LIBURI_ENABLE_NLS
LIBURI_CC_WARN
LIBURI_CONFIG_URIPARSER

dnl Determine installation paths so that liburi-config can work
if test x"$prefix" = x"NONE" ; then
prefix="$ac_default_prefix"
fi
dir=`eval echo $prefix`
AC_DEFINE_UNQUOTED([PREFIX], ["$dir"], [Installation prefix])
BT_PROG_CC_WARN
BT_DEFINE_PREFIX
BT_BUILD_DOCS
BT_ENABLE_NLS

if test x"$exec_prefix" = x"NONE" ; then
exec_prefix="$prefix"
fi
dir=`eval echo $exec_prefix`
AC_DEFINE_UNQUOTED([EXEC_PREFIX], ["$dir"], [Platform-specific installation prefix])
dir=`eval echo $libdir`
AC_DEFINE_UNQUOTED([LIBDIR], ["$dir"], [Library installation path])
dir=`eval echo $includedir`
AC_DEFINE_UNQUOTED([INCLUDEDIR], ["$dir"], [C headers installation path])
LIBURI_CONFIG_URIPARSER

AC_CONFIG_FILES([Makefile
m4/Makefile
Expand Down
1 change: 1 addition & 0 deletions m4
Submodule m4 added at f7f0a6
124 changes: 124 additions & 0 deletions uriparser.m4
@@ -0,0 +1,124 @@
dnl Derived from uriparser/configure.ac
dnl
dnl uriparser - RFC 3986 URI parsing library
dnl
dnl Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
dnl Copyright (C) 2007, Sebastian Pipping <webmaster@hartwork.org>
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl
dnl * Redistributions of source code must retain the above
dnl copyright notice, this list of conditions and the following
dnl disclaimer.
dnl
dnl * Redistributions in binary form must reproduce the above
dnl copyright notice, this list of conditions and the following
dnl disclaimer in the documentation and/or other materials
dnl provided with the distribution.
dnl
dnl * Neither the name of the <ORGANIZATION> nor the names of its
dnl contributors may be used to endorse or promote products
dnl derived from this software without specific prior written
dnl permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
dnl FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
dnl COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
dnl INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
dnl (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
dnl SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
dnl OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
AC_DEFUN([LIBURI_CONFIG_URIPARSER],[
## Check for wprintf
AC_MSG_CHECKING(for wprintf)
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <stdio.h>
#include <wchar.h>
int main() {
wprintf((wchar_t *)0, 0);
return 0;
}
])],[
AC_DEFINE([HAVE_WPRINTF],, [Define if your C runtime provides the wprintf function.])
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
])
## Option for URI_SIZEDOWN
AC_ARG_ENABLE(sizedown, [
==============================================================================
Extra options:
AS_HELP_STRING(
[--enable-sizedown], [save space whereever possible])
AS_HELP_STRING(
[], [(resulting in slower code)])], [
URI_SIZE_DOWN_YESNO=${enableval}
if test ${enableval} = yes ; then
AM_CPPFLAGS="${AM_CPPFLAGS} -DURI_SIZEDOWN"
fi
],[
URI_SIZE_DOWN_YESNO=no
])
# Local headers must come very first. Otherwise we
## risk including headers of an already installed
## uriparser version if its path is in CPPFLAGS
AM_CPPFLAGS="-I${srcdir}/include ${AM_CPPFLAGS}"
## Character type selection
AC_ARG_ENABLE(char, [AS_HELP_STRING(
[--disable-char], [disable code for type char *])], [
CHAR_YESNO=${enableval}
],[
CHAR_YESNO=yes
])
AC_ARG_ENABLE(wchar_t, [AS_HELP_STRING(
[--disable-wchar_t], [disable code for type wchar_t *])], [
WCHAR_T_YESNO=${enableval}
],[
WCHAR_T_YESNO=yes
])
if test ${CHAR_YESNO} = no -a ${WCHAR_T_YESNO} = no ; then
AC_MSG_ERROR([Parameters --disable-char and --disable-wchar_t cannot be used together.])
elif test ${CHAR_YESNO} = no -o ${WCHAR_T_YESNO} = no ; then
if test ${CHAR_YESNO} = no ; then
AM_CPPFLAGS="${AM_CPPFLAGS} -DURI_NO_ANSI"
troublemaker='--disable-char'
elif test ${WCHAR_T_YESNO} = no ; then
AM_CPPFLAGS="${AM_CPPFLAGS} -DURI_NO_UNICODE"
troublemaker='--disable-wchar_t'
fi
if test "${URI_TEST_YESNO}" = "yes"; then
AC_MSG_ERROR([The test suite relies on code for both char * and wchar_t *.
Either remove ${troublemaker} or add --disable-test, please.])
fi
fi
AM_CONDITIONAL([URI_GENERATE_DOC], [false])
AM_CONDITIONAL([URI_TEST_ENABLED], [false])
AC_CONFIG_FILES([
uriparser/Makefile:uriparser-Makefile.in
uriparser/liburiparser.pc
uriparser/doc/Makefile
uriparser/doc/Doxyfile
])
AC_CONFIG_FILES([uriparser/doc/release.sh], [chmod a+x uriparser/doc/release.sh])
])dnl

0 comments on commit 5cc721d

Please sign in to comment.