Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9828 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54443 invoked by uid 1010); 13 May 2004 03:23:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 54419 invoked from network); 13 May 2004 03:23:17 -0000 Received: from unknown (HELO colo.lerdorf.com) (66.198.51.121) by pb1.pair.com with SMTP; 13 May 2004 03:23:17 -0000 Received: from DELL (c-24-6-1-90.client.comcast.net [24.6.1.90]) by colo.lerdorf.com (8.12.11/8.12.11/Debian-5) with ESMTP id i4D3NEin022902; Wed, 12 May 2004 20:23:14 -0700 Date: Wed, 12 May 2004 20:23:34 -0700 (Pacific Standard Time) To: Olivier Hill cc: PHP-Internals In-Reply-To: <40A2DE8D.9040405@php.net> Message-ID: References: <40A2DE8D.9040405@php.net> X-X-Sender: rasmus@lerdorf.com MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00,UPPERCASE_25_50 autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on colo Subject: Re: [PHP-DEV] Compiling with --prefer-non-pic From: rasmus@php.net (Rasmus Lerdorf) On Wed, 12 May 2004, Olivier Hill wrote: > Over a year ago, Rasmus and Ilia had a discussion on the list about > building the Apache DSO with non-PIC code. > > My question is, what is the easiest way to build with --prefer-non-pic > using a release tarball? Would it be possible to add a ./configure > option, because right now I'm editing files manually. Well, the following is what needs to be changed. I have not had the mental energy to figure out the magic incantation to get a configure flag to do this: --- acinclude.m4.orig Tue Nov 11 13:36:31 2003 +++ acinclude.m4 Tue Nov 11 13:35:57 2003 @@ -777,10 +777,10 @@ php_lo=o shared_c_pre='$(LIBTOOL) --mode=compile $(CC)' - shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -prefer-pic' + shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -prefer-non-pic' shared_c_post= shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' - shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -prefer-pic' + shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -prefer-non-pic' shared_cxx_post= shared_lo=lo @@ -1166,7 +1166,7 @@ \$(LIBTOOL) --mode=install cp $3/$1.la \$(phplibdir) $3/$1.la: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES) - \$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) + \$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-non-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) EOF ]) Index: configure.in =================================================================== RCS file: /repository/php-src/configure.in,v retrieving revision 1.396.2.61 diff -u -p -w -r1.396.2.61 configure.in --- configure.in 30 Jul 2003 13:20:49 -0000 1.396.2.61 +++ configure.in 4 Aug 2003 20:26:23 -0000 @@ -818,7 +818,7 @@ program|static) ;; shared) enable_static=no - standard_libtool_flag=-prefer-pic + standard_libtool_flag=-prefer-non-pic EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module" ;; esac