Author: jhorwitz
Date: Fri Sep 14 13:25:03 2007
New Revision: 253
Modified:
mod_parrot/trunk/Configure.pl
mod_parrot/trunk/Makefile.in
Log:
build process now uses libtool directly, and apxs for installation
Modified: mod_parrot/trunk/Configure.pl
==============================================================================
--- mod_parrot/trunk/Configure.pl (original)
+++ mod_parrot/trunk/Configure.pl Fri Sep 14 13:25:03 2007
@@ -53,8 +53,13 @@
# defines to pass to compiler
my $defines;
-# where are apache includes?
+# apache configs
my $apache_include_dir = `$apxs -q INCLUDEDIR`;
+my $apr_include_dir = `$apxs -q APR_INCLUDEDIR`;
+my $apu_include_dir = `$apxs -q APU_INCLUDEDIR`;
+my $libexec_dir = `$apxs -q LIBEXECDIR`;
+my $cc = `$apxs -q CC`;
+my $libtool = `$apxs -q LIBTOOL`;
# discover mpm -- we don't use this yet, but we might
my $mpm = `$apxs -q MPM_NAME`;
@@ -65,9 +70,10 @@
# we can't use the config verbatim -- apxs chokes on it, so we use what we can
my $cflags = " -I$parrot_build_dir/include -Iinclude";
$cflags .= " -DMPM_IS_THREADED" if (mpm_is_threaded($mpm));
-my $ldflags = parrot_config('libparrot_ldflags');
my $libs = parrot_config('libs') . " -lparrot";
my $blib_dir = parrot_config('blib_dir');
+my $ldflags = parrot_config('libparrot_ldflags') .
+ " -R$parrot_build_dir/$blib_dir";;
print "Generating Makefile...";
my $template;
@@ -77,16 +83,21 @@
$template = <MAKEFILE_IN>;
close(MAKEFILE_IN);
}
+$template =~ s/\@CC\@/$cc/g;
+$template =~ s/\@LIBTOOL\@/$libtool/g;
$template =~ s/\@DEFINES\@/$defines/g;
$template =~ s/\@CFLAGS\@/$cflags/g;
$template =~ s/\@LDFLAGS\@/$ldflags/g;
$template =~ s/\@LIBS\@/$libs/g;
+$template =~ s/\@LIBEXECDIR\@/$libexec_dir/g;
$template =~ s/\@APXS\@/$apxs/g;
$template =~ s/\@PERL\@/$perl/g;
$template =~ s/\@PARROT_SOURCE\@/$parrot_build_dir/g;
$template =~ s/\@PARROT_BLIB_DIR\@/$parrot_build_dir\/$blib_dir/g;
$template =~ s/\@PARROT\@/$parrot_build_dir\/parrot/g;
$template =~ s/\@APACHE_INCLUDE_DIR\@/$apache_include_dir/g;
+$template =~ s/\@APR_INCLUDE_DIR\@/$apache_include_dir/g;
+$template =~ s/\@APU_INCLUDE_DIR\@/$apache_include_dir/g;
$template =~ s/\@CALLING_CONVENTIONS\@/$calling_conventions/g;
open(MAKEFILE, ">Makefile") or die $!;
print MAKEFILE $template;
Modified: mod_parrot/trunk/Makefile.in
==============================================================================
--- mod_parrot/trunk/Makefile.in (original)
+++ mod_parrot/trunk/Makefile.in Fri Sep 14 13:25:03 2007
@@ -2,17 +2,21 @@
# This file is autogenerated. Changes will be lost after reconfiguration.
+CC=@CC@
+LIBTOOL=@LIBTOOL@
+APR_INCLUDE_DIR=@APR_INCLUDE_DIR@
+APU_INCLUDE_DIR=@APU_INCLUDE_DIR@
DEFINES=@DEFINES@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
+LIBEXECDIR=@LIBEXECDIR@
PERL=@PERL@
APXS=@APXS@
PARROT_SOURCE=@PARROT_SOURCE@
PARROT_BLIB_DIR=@PARROT_BLIB_DIR@
PARROT=@PARROT@
APACHE_INCLUDE_DIR=@APACHE_INCLUDE_DIR@
-CALLING_CONVENTIONS=@CALLING_CONVENTIONS@
SRC_DIR = src
TEST_SRC_DIR = t/src
@@ -24,7 +28,12 @@
$(SRC_DIR)/nci.c \
$(SRC_DIR)/context.c
-PARROT_OBJS=
+OBJ_FILES= \
+ $(SRC_DIR)/mod_parrot.lo \
+ $(SRC_DIR)/parrot_util.lo \
+ $(SRC_DIR)/modparrot_config.lo \
+ $(SRC_DIR)/nci.lo \
+ $(SRC_DIR)/context.lo
MPLIBS= lib/Apache/RequestRec \
lib/Apache/Constants \
@@ -34,10 +43,13 @@
lib/ModParrot/HLL/perl6 \
lib/ModParrot/HLL/nqp
-all: gen-src src/mod_parrot.la
+all: gen-src $(SRC_DIR)/mod_parrot.la
-$(SRC_DIR)/mod_parrot.la: $(SOURCE_FILES)
- $(APXS) -c $(DEFINES) $(CFLAGS) $(LDFLAGS) $(LIBS) $(SOURCE_FILES) $(PARROT_OBJS)
+%.lo: %.c
+ $(LIBTOOL) --mode=compile $(CC) -o $@ $(CFLAGS) -I$(CFG_INCLUDEDIR) -I$(APR_INCLUDE_DIR) -I$(APU_INCLUDE_DIR) $(DEFINES) -c $<
+
+$(SRC_DIR)/mod_parrot.la: $(OBJ_FILES)
+ $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(OBJ_FILES) $(LIBS) -rpath $(LIBEXECDIR) -module -avoid-version
files-clean:
rm -f $(SRC_DIR)/*.o $(SRC_DIR)/*.lo $(SRC_DIR)/*.slo $(SRC_DIR)/*.la core core.*
@@ -78,4 +90,4 @@
test: $(SRC_DIR)/mod_parrot.la libraries
$(PARROT) -o t/lib/handlers.pbc t/lib/handlers.pir
- LD_LIBRARY_PATH=$(PARROT_BLIB_DIR) $(PERL) t/TEST
+ $(PERL) t/TEST
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.