aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m441
-rwxr-xr-xbuildconf1
-rw-r--r--configure.ac2
-rw-r--r--tests/symbol-scan.pl21
4 files changed, 61 insertions, 4 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 225fb9d1d..9f790522a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -3246,3 +3246,44 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
fi
fi
])
+
+
+dnl CURL_GENERATE_CONFIGUREHELP_PM
+dnl -------------------------------------------------
+dnl Generate test harness configurehelp.pm module, defining and
+dnl initializing some perl variables with values which are known
+dnl when the configure script runs. For portability reasons, test
+dnl harness needs information on how to run the C preprocessor.
+
+AC_DEFUN([CURL_GENERATE_CONFIGUREHELP_PM], [
+ AC_REQUIRE([AC_PROG_CPP])dnl
+ tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null`
+ if test -z "$tmp_cpp"; then
+ tmp_cpp='cpp'
+ fi
+ cat >./tests/configurehelp.pm <<_EOF
+[@%:@] This is a generated file. Do not edit.
+
+package configurehelp;
+
+use strict;
+use warnings;
+use Exporter;
+
+use vars qw(
+ @ISA
+ @EXPORT_OK
+ \$Cpreprocessor
+ );
+
+@ISA = qw(Exporter);
+
+@EXPORT_OK = qw(
+ \$Cpreprocessor
+ );
+
+\$Cpreprocessor = '$tmp_cpp';
+
+1;
+_EOF
+])
diff --git a/buildconf b/buildconf
index 1bb769747..f77ed7665 100755
--- a/buildconf
+++ b/buildconf
@@ -293,6 +293,7 @@ for fname in .deps \
config.status \
config.sub \
configure \
+ configurehelp.pm \
curl-config \
curlbuild.h \
depcomp \
diff --git a/configure.ac b/configure.ac
index 1e802fdf8..c75f4d156 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2873,6 +2873,8 @@ AC_CONFIG_FILES([Makefile \
])
AC_OUTPUT
+CURL_GENERATE_CONFIGUREHELP_PM
+
AC_MSG_NOTICE([Configured to build curl/libcurl:
curl version: ${VERSION}
diff --git a/tests/symbol-scan.pl b/tests/symbol-scan.pl
index dea1f73b8..cda9b7383 100644
--- a/tests/symbol-scan.pl
+++ b/tests/symbol-scan.pl
@@ -21,16 +21,25 @@
#
###########################################################################
#
-# This script grew out of help from Przemysław Iskra and Bálint Szilakszi
+# This script grew out of help from Przemyslaw Iskra and Balint Szilakszi
# a late evening in the #curl IRC channel on freenode.
#
+use strict;
+use warnings;
+
+#
+# configurehelp perl module is generated by configure script
+#
+use configurehelp qw(
+ $Cpreprocessor
+ );
+
# we may get the dir root pointed out
my $root=$ARGV[0] || ".";
# need an include directory when building out-of-tree
-my $i=$ARGV[1];
-$i="-I$i " if $i;
+my $i = ($ARGV[1]) ? "-I$ARGV[1] " : '';
my $h = "$root/include/curl/curl.h";
my $mh = "$root/include/curl/multi.h";
@@ -39,7 +48,11 @@ my $verbose=0;
my $summary=0;
my $misses=0;
-open H_IN, "-|", "cpp $i$h" || die "Cannot preprocess curl.h";
+my @syms;
+my %doc;
+my %rem;
+
+open H_IN, "-|", "$Cpreprocessor $i$h" || die "Cannot preprocess curl.h";
while ( <H_IN> ) {
if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
s/^\s+//;