Skip to content

Commit

Permalink
Fixing some automake problems related to boost and cygwin
Browse files Browse the repository at this point in the history
configure script was failing for cygwin. new version of boost-related m4
fixed it
  • Loading branch information
jpbarrette committed Oct 12, 2016
1 parent 692533f commit ef7011d
Show file tree
Hide file tree
Showing 7 changed files with 1,247 additions and 490 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -57,3 +57,5 @@ examples/example23
examples/example24
examples/example25


*.exe
18 changes: 9 additions & 9 deletions Makefile.am
@@ -1,9 +1,9 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src include examples doc
EXTRA_DIST = curlpp.VC8.vcproj curlpp.VC8.sln CHANGES curlpp.spec README.win32 win32/*

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = curlpp.pc

bin_SCRIPTS = curlpp-config

ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
SUBDIRS = src include examples doc
EXTRA_DIST = curlpp.VC8.vcproj curlpp.VC8.sln CHANGES curlpp.spec README.win32 win32/*

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = curlpp.pc

bin_SCRIPTS = curlpp-config

186 changes: 95 additions & 91 deletions examples/Makefile.am
@@ -1,91 +1,95 @@
if MAINTENER_CODE
maintener_programs =
endif

if HAVE_BOOST
boost_programs = example18 example20
endif

EXTRA_DIST = Makefile.msvc

noinst_PROGRAMS = \
example01 \
example02 \
example03 \
example04 \
example05 \
example06 \
example07 \
example08 \
example09 \
example10 \
example11 \
example12 \
example13 \
example14 \
example15 \
example16 \
example17 \
example19 \
example21 \
example22 \
example23 \
example24 \
${maintener_programs} ${boost_programs}



example01_SOURCES = example01.cpp

example02_SOURCES = example02.cpp

example03_SOURCES = example03.cpp

example04_SOURCES = example04.cpp

example05_SOURCES = example05.cpp

example06_SOURCES = example06.cpp

example07_SOURCES = example07.cpp

example08_SOURCES = example08.cpp

example09_SOURCES = example09.cpp

example10_SOURCES = example10.cpp

example11_SOURCES = example11.cpp

example12_SOURCES = example12.cpp

example13_SOURCES = example13.cpp

example14_SOURCES = example14.cpp

example15_SOURCES = example15.cpp

example16_SOURCES = example16.cpp

example17_SOURCES = example17.cpp

example18_SOURCES = example18.cpp

example19_SOURCES = example19.cpp

example20_SOURCES = example20.cpp

example21_SOURCES = example21.cpp

example22_SOURCES = example22.cpp

example23_SOURCES = example23.cpp

example24_SOURCES = example24.cpp

AM_LDFLAGS = -L../src/curlpp/ -lcurlpp -static

AM_CPPFLAGS = -I$(top_builddir)/include



if MAINTENER_CODE
maintener_programs =
endif

if HAVE_BOOST
boost_programs = example18 example20
endif

EXTRA_DIST = Makefile.msvc

noinst_PROGRAMS = \
example01 \
example02 \
example03 \
example04 \
example05 \
example06 \
example07 \
example08 \
example09 \
example10 \
example11 \
example12 \
example13 \
example14 \
example15 \
example16 \
example17 \
example19 \
example21 \
example22 \
example23 \
example24 \
${maintener_programs} ${boost_programs}



example01_SOURCES = example01.cpp

example02_SOURCES = example02.cpp

example03_SOURCES = example03.cpp

example04_SOURCES = example04.cpp

example05_SOURCES = example05.cpp

example06_SOURCES = example06.cpp

example07_SOURCES = example07.cpp

example08_SOURCES = example08.cpp

example09_SOURCES = example09.cpp

example10_SOURCES = example10.cpp

example11_SOURCES = example11.cpp

example12_SOURCES = example12.cpp

example13_SOURCES = example13.cpp

example14_SOURCES = example14.cpp

example15_SOURCES = example15.cpp

example16_SOURCES = example16.cpp

example17_SOURCES = example17.cpp

if HAVE_BOOST
example18_SOURCES = example18.cpp
endif

example19_SOURCES = example19.cpp

if HAVE_BOOST
example20_SOURCES = example20.cpp
endif

example21_SOURCES = example21.cpp

example22_SOURCES = example22.cpp

example23_SOURCES = example23.cpp

example24_SOURCES = example24.cpp

AM_LDFLAGS = -L../src/curlpp/ -lcurlpp -static

AM_CPPFLAGS = -I$(top_builddir)/include



2 changes: 2 additions & 0 deletions examples/example18.cpp
Expand Up @@ -31,7 +31,9 @@
#include <sstream>
#include <cstdlib>

#ifdef HAVE_BOOST
#include <boost/bind.hpp>
#endif
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
Expand Down
149 changes: 74 additions & 75 deletions examples/example20.cpp
@@ -1,75 +1,74 @@
/*
* Copyright (c) <2002-2005> <Jean-Philippe Barrette-LaPierre>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (curlpp), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/**
* \file
* Using WriteStream option.
*
*/


#include <sstream>

#include <cstdlib>

#include <boost/bind.hpp>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
#include <curlpp/Exception.hpp>

int main(int argc, char *argv[])
{
if(argc != 2) {
std::cerr << argv[0] << ": Wrong number of arguments" << std::endl
<< argv[0] << ": Usage: " << " url "
<< std::endl;
return EXIT_FAILURE;
}

char *url = argv[1];

try {
curlpp::Cleanup cleaner;
curlpp::Easy request;

// Set the writer callback to enable cURL
// to write result in a memory area
request.setOpt(new curlpp::options::WriteStream(&std::cout));

// Setting the URL to retrive.
request.setOpt(new curlpp::options::Url(url));

request.perform();

return EXIT_SUCCESS;
}
catch ( curlpp::LogicError & e ) {
std::cout << e.what() << std::endl;
}
catch ( curlpp::RuntimeError & e ) {
std::cout << e.what() << std::endl;
}

return EXIT_FAILURE;
}
/*
* Copyright (c) <2002-2005> <Jean-Philippe Barrette-LaPierre>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (curlpp), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/**
* \file
* Using WriteStream option.
*
*/


#include <sstream>

#include <cstdlib>

#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
#include <curlpp/Exception.hpp>

int main(int argc, char *argv[])
{
if(argc != 2) {
std::cerr << argv[0] << ": Wrong number of arguments" << std::endl
<< argv[0] << ": Usage: " << " url "
<< std::endl;
return EXIT_FAILURE;
}

char *url = argv[1];

try {
curlpp::Cleanup cleaner;
curlpp::Easy request;

// Set the writer callback to enable cURL
// to write result in a memory area
request.setOpt(new curlpp::options::WriteStream(&std::cout));

// Setting the URL to retrive.
request.setOpt(new curlpp::options::Url(url));

request.perform();

return EXIT_SUCCESS;
}
catch ( curlpp::LogicError & e ) {
std::cout << e.what() << std::endl;
}
catch ( curlpp::RuntimeError & e ) {
std::cout << e.what() << std::endl;
}

return EXIT_FAILURE;
}

0 comments on commit ef7011d

Please sign in to comment.