From 3fb694b9787f665c77a6ee24c7146f39638299af Mon Sep 17 00:00:00 2001 From: Bruce Guenter Date: Fri, 24 Nov 2006 03:47:57 +0000 Subject: [PATCH] Only compile library files with the -fPIC flags. --- TODO | 5 - alloc=l | 4 +- auto-ccld.sh.do | 3 +- conf-cc | 2 +- conf-cclo | 4 + conf-ldso | 5 +- default.do | 4 +- default.lo.do | 4 + error=l | 4 +- fs=l | 12 +-- getln=l | 4 +- libezmlm=l | 254 ++++++++++++++++++++++----------------------- make-libcompile.sh | 3 + make-makeso.sh | 2 +- open=l | 6 +- str=l | 26 ++--- stralloc=l | 18 ++-- strerr=l | 6 +- sub-mysql=so | 5 + sub-pgsql=so | 4 + sub-std=so | 2 +- substdio=l | 14 +-- 22 files changed, 204 insertions(+), 187 deletions(-) create mode 100644 conf-cclo create mode 100644 default.lo.do create mode 100644 make-libcompile.sh create mode 100644 sub-mysql=so create mode 100644 sub-pgsql=so diff --git a/TODO b/TODO index 2b2daf4..458db25 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,3 @@ -Figure out how to get rid of -fPIC in conf-cc - Maybe make conf-ccso and conf-ldso, with flags to add to the normal - conf-cc and conf-ld ? -Only compile files in lib/ and *=so with PIC flags - Fixup man pages and FAQ.idx regarding modsub and remote contents ?Remove "dir" argument from getconf? diff --git a/alloc=l b/alloc=l index 8848ab3..496fe03 100644 --- a/alloc=l +++ b/alloc=l @@ -1,2 +1,2 @@ -lib/alloc.o -lib/alloc_re.o +lib/alloc.lo +lib/alloc_re.lo diff --git a/auto-ccld.sh.do b/auto-ccld.sh.do index dbe1183..f6b1c12 100644 --- a/auto-ccld.sh.do +++ b/auto-ccld.sh.do @@ -1,6 +1,7 @@ -dependon conf-cc conf-ld conf-ldso warn-auto.sh +dependon conf-cc conf-cclo conf-ld conf-ldso warn-auto.sh formake '( cat warn-auto.sh; \' formake 'echo CC=\'\''`head -n 1 conf-cc`\'\''; \' +formake 'echo CCLO=\'\''`head -n 1 conf-cclo`\'\''; \' formake 'echo LD=\'\''`head -n 1 conf-ld`\'\''; \' formake 'echo LDSO=\'\''`head -n 1 conf-ldso`\'\''; \' formake ') > auto-ccld.sh' diff --git a/conf-cc b/conf-cc index 9092fc2..503fc70 100644 --- a/conf-cc +++ b/conf-cc @@ -1,3 +1,3 @@ -gcc -O -g -fPIC -I/usr/include/mysql -I/usr/include/pgsql -Wall -Wcast-align -Wwrite-strings -Wunused-parameter -Wsign-compare +gcc -O -g -I/usr/include/mysql -I/usr/include/pgsql -Wall -Wcast-align -Wwrite-strings -Wunused-parameter -Wsign-compare This will be used to compile .c files. diff --git a/conf-cclo b/conf-cclo new file mode 100644 index 0000000..a82f70a --- /dev/null +++ b/conf-cclo @@ -0,0 +1,4 @@ +-fPIC + +These flags will be added to the command line given in conf-cc when +compiling library files. diff --git a/conf-ldso b/conf-ldso index df7d242..b076798 100644 --- a/conf-ldso +++ b/conf-ldso @@ -1,3 +1,4 @@ -gcc -shared -L/usr/local/pgsql/lib -L/usr/lib/mysql +-shared -This will be used to link .o files into a shared object. +These flags will be added to the command line given in conf-ld when +linking shared objects. diff --git a/default.do b/default.do index a3de30b..890eab9 100644 --- a/default.do +++ b/default.do @@ -35,12 +35,12 @@ then fi case "$1" in - compile|load|makelib|makeso) + compile|libcompile|load|makelib|makeso) dependon make-$1 warn-auto.sh systype formake "( cat warn-auto.sh; ./make-$1 "'"`cat systype`"'" ) > $1" formake "chmod 755 $1" ;; - make-compile|make-load|make-makelib|make-makeso) + make-compile|make-libcompile|make-load|make-makelib|make-makeso) dependon $1.sh auto-ccld.sh formake "cat auto-ccld.sh $1.sh > $1" formake "chmod 755 $1" diff --git a/default.lo.do b/default.lo.do new file mode 100644 index 0000000..8a20e83 --- /dev/null +++ b/default.lo.do @@ -0,0 +1,4 @@ +directtarget +dependon libcompile +dependcc $2.c +formake ./libcompile $2.c diff --git a/error=l b/error=l index 66e8b39..6d6dbfa 100644 --- a/error=l +++ b/error=l @@ -1,2 +1,2 @@ -lib/error.o -lib/error_str.o +lib/error.lo +lib/error_str.lo diff --git a/fs=l b/fs=l index 8c8f8da..a1eb091 100644 --- a/fs=l +++ b/fs=l @@ -1,6 +1,6 @@ -lib/fmt_str.o -lib/fmt_uint.o -lib/fmt_uint0.o -lib/fmt_ulong.o -lib/scan_ulong.o -lib/scan_8long.o +lib/fmt_str.lo +lib/fmt_uint.lo +lib/fmt_uint0.lo +lib/fmt_ulong.lo +lib/scan_ulong.lo +lib/scan_8long.lo diff --git a/getln=l b/getln=l index 1b5800f..d04ce1c 100644 --- a/getln=l +++ b/getln=l @@ -1,2 +1,2 @@ -lib/getln.o -lib/getln2.o +lib/getln.lo +lib/getln2.lo diff --git a/libezmlm=l b/libezmlm=l index 9596dce..ba7a806 100644 --- a/libezmlm=l +++ b/libezmlm=l @@ -1,127 +1,127 @@ -lib/alloc.o -lib/alloc_re.o -lib/altpath.o -lib/author.o -lib/auto_bin.o -lib/auto_cron.o -lib/auto_etc.o -lib/auto_lib.o -lib/auto_qmail.o -lib/auto_version.o -lib/byte_chr.o -lib/byte_copy.o -lib/byte_cr.o -lib/byte_diff.o -lib/byte_rchr.o -lib/byte_zero.o -lib/case_diffb.o -lib/case_diffs.o -lib/case_lowerb.o -lib/case_startb.o -lib/case_starts.o -lib/concatHDR.o -lib/config.o -lib/constmap.o -lib/cookie.o -lib/copy.o -lib/date2yyyymm.o -lib/date822fmt.o -lib/dateline.o -lib/datetime.o -lib/decodeB.o -lib/decodeHDR.o -lib/decodeQ.o -lib/die_badaddr.o -lib/die_badformat.o -lib/die_dow.o -lib/die_nomem.o -lib/die_sender.o -lib/die_usage.o -lib/encodeB.o -lib/encodeQ.o -lib/env.o -lib/envread.o -lib/error.o -lib/error_str.o -lib/fd_copy.o -lib/fd_move.o -lib/fmt_str.o -lib/fmt_uint.o -lib/fmt_uint0.o -lib/fmt_ulong.o -lib/getconf.o -lib/getconf_ulong.o -lib/getln.o -lib/getln2.o -lib/hdr_add.o -lib/hdr_boundary.o -lib/hdr_ctboundary.o -lib/hdr_datemsgid.o -lib/hdr_from.o -lib/hdr_listsubject.o -lib/hdr_mime.o -lib/hdr_transferenc.o -lib/idxthread.o -lib/lock_ex.o -lib/lock_exnb.o -lib/lockfile.o -lib/log.o -lib/makehash.o -lib/makepath.o -lib/now.o -lib/open_append.o -lib/open_read.o -lib/open_trunc.o -lib/qmail.o -lib/qmail_copy.o -lib/quote.o -lib/scan_8long.o -lib/scan_ulong.o -lib/seek_set.o -lib/sgetopt.o -lib/sig_catch.o -lib/sig_pipe.o -lib/slurp.o -lib/slurpclose.o -lib/str_chr.o -lib/str_cpy.o -lib/str_diff.o -lib/str_diffn.o -lib/str_len.o -lib/str_rchr.o -lib/str_start.o -lib/stralloc_arts.o -lib/stralloc_cat.o -lib/stralloc_catb.o -lib/stralloc_cats.o -lib/stralloc_copy.o -lib/stralloc_eady.o -lib/stralloc_num.o -lib/stralloc_opyb.o -lib/stralloc_opys.o -lib/stralloc_pend.o -lib/strerr.o -lib/strerr_die.o -lib/strerr_sys.o -lib/subdb.o -lib/subfderr.o -lib/subfdin.o -lib/subfdout.o -lib/subgetopt.o -lib/subhash.o -lib/substdi.o -lib/substdio.o -lib/substdio_copy.o -lib/substdo.o -lib/surf.o -lib/surfpcs.o -lib/unfoldHDR.o -lib/wait_pid.o -lib/wrap_chdir.o -lib/wrap_execbin.o -lib/wrap_execsh.o -lib/wrap_execv.o -lib/wrap_exitcode.o -lib/wrap_fork.o -lib/wrap_stat.o -lib/wrap_waitpid.o +lib/alloc.lo +lib/alloc_re.lo +lib/altpath.lo +lib/author.lo +lib/auto_bin.lo +lib/auto_cron.lo +lib/auto_etc.lo +lib/auto_lib.lo +lib/auto_qmail.lo +lib/auto_version.lo +lib/byte_chr.lo +lib/byte_copy.lo +lib/byte_cr.lo +lib/byte_diff.lo +lib/byte_rchr.lo +lib/byte_zero.lo +lib/case_diffb.lo +lib/case_diffs.lo +lib/case_lowerb.lo +lib/case_startb.lo +lib/case_starts.lo +lib/concatHDR.lo +lib/config.lo +lib/constmap.lo +lib/cookie.lo +lib/copy.lo +lib/date2yyyymm.lo +lib/date822fmt.lo +lib/dateline.lo +lib/datetime.lo +lib/decodeB.lo +lib/decodeHDR.lo +lib/decodeQ.lo +lib/die_badaddr.lo +lib/die_badformat.lo +lib/die_dow.lo +lib/die_nomem.lo +lib/die_sender.lo +lib/die_usage.lo +lib/encodeB.lo +lib/encodeQ.lo +lib/env.lo +lib/envread.lo +lib/error.lo +lib/error_str.lo +lib/fd_copy.lo +lib/fd_move.lo +lib/fmt_str.lo +lib/fmt_uint.lo +lib/fmt_uint0.lo +lib/fmt_ulong.lo +lib/getconf.lo +lib/getconf_ulong.lo +lib/getln.lo +lib/getln2.lo +lib/hdr_add.lo +lib/hdr_boundary.lo +lib/hdr_ctboundary.lo +lib/hdr_datemsgid.lo +lib/hdr_from.lo +lib/hdr_listsubject.lo +lib/hdr_mime.lo +lib/hdr_transferenc.lo +lib/idxthread.lo +lib/lock_ex.lo +lib/lock_exnb.lo +lib/lockfile.lo +lib/log.lo +lib/makehash.lo +lib/makepath.lo +lib/now.lo +lib/open_append.lo +lib/open_read.lo +lib/open_trunc.lo +lib/qmail.lo +lib/qmail_copy.lo +lib/quote.lo +lib/scan_8long.lo +lib/scan_ulong.lo +lib/seek_set.lo +lib/sgetopt.lo +lib/sig_catch.lo +lib/sig_pipe.lo +lib/slurp.lo +lib/slurpclose.lo +lib/str_chr.lo +lib/str_cpy.lo +lib/str_diff.lo +lib/str_diffn.lo +lib/str_len.lo +lib/str_rchr.lo +lib/str_start.lo +lib/stralloc_arts.lo +lib/stralloc_cat.lo +lib/stralloc_catb.lo +lib/stralloc_cats.lo +lib/stralloc_copy.lo +lib/stralloc_eady.lo +lib/stralloc_num.lo +lib/stralloc_opyb.lo +lib/stralloc_opys.lo +lib/stralloc_pend.lo +lib/strerr.lo +lib/strerr_die.lo +lib/strerr_sys.lo +lib/subdb.lo +lib/subfderr.lo +lib/subfdin.lo +lib/subfdout.lo +lib/subgetopt.lo +lib/subhash.lo +lib/substdi.lo +lib/substdio.lo +lib/substdio_copy.lo +lib/substdo.lo +lib/surf.lo +lib/surfpcs.lo +lib/unfoldHDR.lo +lib/wait_pid.lo +lib/wrap_chdir.lo +lib/wrap_execbin.lo +lib/wrap_execsh.lo +lib/wrap_execv.lo +lib/wrap_exitcode.lo +lib/wrap_fork.lo +lib/wrap_stat.lo +lib/wrap_waitpid.lo diff --git a/make-libcompile.sh b/make-libcompile.sh new file mode 100644 index 0000000..cd07cbd --- /dev/null +++ b/make-libcompile.sh @@ -0,0 +1,3 @@ +echo 'source=$1; shift' +echo 'base=`echo "$source" | sed -e s:\\\\.c$::`' +echo exec "$CC $CCLO" '-I. -o "$base".lo -c "$source" ${1+"$@"}' diff --git a/make-makeso.sh b/make-makeso.sh index 5b0b541..52bf7ae 100644 --- a/make-makeso.sh +++ b/make-makeso.sh @@ -1 +1 @@ -echo exec "$LDSO" -L. -o '${1+"$@"}' +echo exec "$LD $LDSO" -L. -o '${1+"$@"}' diff --git a/open=l b/open=l index e3f3996..f888f04 100644 --- a/open=l +++ b/open=l @@ -1,3 +1,3 @@ -lib/open_append.o -lib/open_read.o -lib/open_trunc.o +lib/open_append.lo +lib/open_read.lo +lib/open_trunc.lo diff --git a/str=l b/str=l index 0a36b95..bc96db9 100644 --- a/str=l +++ b/str=l @@ -1,13 +1,13 @@ -lib/str_len.o -lib/str_diff.o -lib/str_diffn.o -lib/str_cpy.o -lib/str_chr.o -lib/str_rchr.o -lib/str_start.o -lib/byte_chr.o -lib/byte_rchr.o -lib/byte_diff.o -lib/byte_copy.o -lib/byte_cr.o -lib/byte_zero.o +lib/str_len.lo +lib/str_diff.lo +lib/str_diffn.lo +lib/str_cpy.lo +lib/str_chr.lo +lib/str_rchr.lo +lib/str_start.lo +lib/byte_chr.lo +lib/byte_rchr.lo +lib/byte_diff.lo +lib/byte_copy.lo +lib/byte_cr.lo +lib/byte_zero.lo diff --git a/stralloc=l b/stralloc=l index 929f5ba..54316fc 100644 --- a/stralloc=l +++ b/stralloc=l @@ -1,10 +1,10 @@ -lib/stralloc_eady.o -lib/stralloc_pend.o -lib/stralloc_copy.o -lib/stralloc_opys.o -lib/stralloc_opyb.o -lib/stralloc_cat.o -lib/stralloc_cats.o +lib/stralloc_eady.lo +lib/stralloc_pend.lo +lib/stralloc_copy.lo +lib/stralloc_opys.lo +lib/stralloc_opyb.lo +lib/stralloc_cat.lo +lib/stralloc_cats.lo lib/stralloc_catb.o -lib/stralloc_arts.o -lib/stralloc_num.o +lib/stralloc_arts.lo +lib/stralloc_num.lo diff --git a/strerr=l b/strerr=l index 9c60834..72a667e 100644 --- a/strerr=l +++ b/strerr=l @@ -1,3 +1,3 @@ -lib/strerr.o -lib/strerr_sys.o -lib/strerr_die.o +lib/strerr.lo +lib/strerr_sys.lo +lib/strerr_die.lo diff --git a/sub-mysql=so b/sub-mysql=so new file mode 100644 index 0000000..1cd4751 --- /dev/null +++ b/sub-mysql=so @@ -0,0 +1,5 @@ +sub-mysql.lo +-lezmlm +mysqlclient.lib +nsl.lib +m.lib diff --git a/sub-pgsql=so b/sub-pgsql=so new file mode 100644 index 0000000..6f9daf7 --- /dev/null +++ b/sub-pgsql=so @@ -0,0 +1,4 @@ +sub-pgsql.lo +-lezmlm +pq.lib +crypt.lib diff --git a/sub-std=so b/sub-std=so index e855841..105b3e3 100644 --- a/sub-std=so +++ b/sub-std=so @@ -1,2 +1,2 @@ -sub-std.o +sub-std.lo -lezmlm diff --git a/substdio=l b/substdio=l index 29cb481..44bc706 100644 --- a/substdio=l +++ b/substdio=l @@ -1,7 +1,7 @@ -lib/substdio.o -lib/substdi.o -lib/substdo.o -lib/subfderr.o -lib/subfdin.o -lib/subfdout.o -lib/substdio_copy.o +lib/substdio.lo +lib/substdi.lo +lib/substdo.lo +lib/subfderr.lo +lib/subfdin.lo +lib/subfdout.lo +lib/substdio_copy.lo