
ilya at math
Sep 19, 1995, 6:34 PM
Post #2 of 2
(73 views)
Permalink
|
Andy Dougherty writes: > > The Configure/configure debate reminds me that the latest metaconfig includes > beginnings of support of OS/2, mostly thanks to the efforts of Ilya > Zakharevich <ilya [at] math> and, of course, Raphael. I had sent > the newest Configure off to Larry before my system died, but not posted it to > the list in general. > Here is the differences of Configure for "clean" OS/2 build with respect to one Andy mentioned above. Note that earlier I send out patches for building tools too. The latter patches are in fact independent of the Configure patch. The patch below corrects missing $ldflags, and introduces new variables $path_sep, $ar, $lib_ext, $obj_ext, $exe_ext. Three additional variables are used during build: $cldlibs for miniperl, $plibext for the extension for Perl library (it may be different from DLL extension if it is an import library) and $archobjs to get additional object files to build on given architecture. Additional formats of library dumpers are recognized too. Enjoy, Ilya *** Configure.orig.orig Tue Sep 19 17:26:34 1995 --- Configure Tue Sep 19 18:32:28 1995 *************** *** 549,554 **** --- 549,561 ---- defvoidused='' voidflags='' CONFIG='' + archobjs='' + obj_ext='o' + lib_ext='a' + exe_ext= + ar='ar' + plibext= + path_sep=$p_ define='define' undef='undef' *************** *** 1345,1351 **** say=offhand for file in $trylist; do xxx=`./loc $file $file $pth` ! eval $file=$xxx eval _$file=$xxx case "$xxx" in /*) --- 1352,1360 ---- say=offhand for file in $trylist; do xxx=`./loc $file $file $pth` ! if test "X$file" != "X$xxx" ; then ! eval $file=$xxx ! fi eval _$file=$xxx case "$xxx" in /*) *************** *** 2138,2144 **** exit(0); } EOM ! if $cc -o gccvers gccvers.c >/dev/null 2>&1; then gccversion=`./gccvers` case "$gccversion" in '') echo "You are not using GNU cc." ;; --- 2147,2153 ---- exit(0); } EOM ! if $cc -o gccvers gccvers.c $ldflags >/dev/null 2>&1; then gccversion=`./gccvers` case "$gccversion" in '') echo "You are not using GNU cc." ;; *************** *** 2962,2967 **** --- 2971,2982 ---- *"-l$thislib "*);; *) dflt="$dflt -l$thislib";; esac + elif xxx=`./loc $thislib.lib X $libpth`; $test -f "$xxx"; then + echo "Found -l$thislib." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac else echo "No -l$thislib." fi *************** *** 3075,3086 **** : elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then : ! elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then : elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then : elif try=`./loc $thislib X $libpth`; $test -f "$try"; then : elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then : else --- 3090,3103 ---- : elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then : ! elif try=`./loc lib$thislib.$lib_ext X $libpth`; $test -f "$try"; then : elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then : elif try=`./loc $thislib X $libpth`; $test -f "$try"; then : + elif try=`./loc $thislib.$lib_ext X $libpth`; $test -f "$try"; then + : elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then : else *************** *** 3129,3139 **** fi elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then echo "Your C library seems to be in $libc, as you said before." ! elif $test -r $incpath/usr/lib/libc.a; then ! libc=$incpath/usr/lib/libc.a; echo "Your C library seems to be in $libc. That's fine." ! elif $test -r /lib/libc.a; then ! libc=/lib/libc.a; echo "Your C library seems to be in $libc. You're normal." else if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then --- 3146,3156 ---- fi elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then echo "Your C library seems to be in $libc, as you said before." ! elif $test -r $incpath/usr/lib/libc.$lib_ext; then ! libc=$incpath/usr/lib/libc.$lib_ext; echo "Your C library seems to be in $libc. That's fine." ! elif $test -r /lib/libc.$lib_ext; then ! libc=/lib/libc.$lib_ext; echo "Your C library seems to be in $libc. You're normal." else if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then *************** *** 3246,3251 **** --- 3263,3272 ---- eval $xscan;\ $contains '^fprintf$' libc.list >/dev/null 2>&1; then eval $xrun + elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun else nm -p $* 2>/dev/null >libc.tmp $grep fprintf libc.tmp > libc.ptf *************** *** 3256,3278 **** eval $xrun else echo " " ! echo "nm didn't seem to work right. Trying ar instead..." >&4 com='' ! if ar t $libc > libc.tmp; then for thisname in $libnames; do ! ar t $thisname >>libc.tmp done ! $sed -e 's/\.o$//' < libc.tmp > libc.list echo "Ok." >&4 else ! echo "ar didn't seem to work right." >&4 echo "Maybe this is a Cray...trying bld instead..." >&4 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list then for thisname in $libnames; do bld t $libnames | \ $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list ! ar t $thisname >>libc.tmp done echo "Ok." >&4 else --- 3277,3300 ---- eval $xrun else echo " " ! echo "nm didn't seem to work right. Trying $ar instead..." >&4 com='' ! if test "X$osname" = "Xos2"; then ar_opt=tv ; else ar_opt=t ;fi ! if $ar $ar_opt $libc > libc.tmp; then for thisname in $libnames; do ! $ar $ar_opt $thisname >>libc.tmp done ! $sed -e 's/\.o$//' -e 's/^ \+//' < libc.tmp | grep -v "^IMPORT#" > libc.list echo "Ok." >&4 else ! echo "$ar didn't seem to work right." >&4 echo "Maybe this is a Cray...trying bld instead..." >&4 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list then for thisname in $libnames; do bld t $libnames | \ $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list ! $ar t $thisname >>libc.tmp done echo "Ok." >&4 else *************** *** 3840,3846 **** printf("%d\n", sizeof(int)); } EOCP ! if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then dflt=`./try` else dflt='4' --- 3862,3868 ---- printf("%d\n", sizeof(int)); } EOCP ! if $cc $ccflags try.c -o try $ldflags >/dev/null 2>&1 ; then dflt=`./try` else dflt='4' *************** *** 3922,3928 **** exit(result); } EOCP ! if $cc -o try $ccflags try.c >/dev/null 2>&1; then ./try yyy=$? else --- 3944,3950 ---- exit(result); } EOCP ! if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then ./try yyy=$? else *************** *** 4003,4009 **** } EOCP ! if $cc -o try $ccflags try.c >/dev/null 2>&1; then ./try castflags=$? else --- 4025,4031 ---- } EOCP ! if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then ./try castflags=$? else *************** *** 4042,4048 **** exit((unsigned long)vsprintf(buf,"%s",args) > 10L); } EOF ! if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then echo "Your vsprintf() returns (int)." >&4 val2="$undef" else --- 4064,4070 ---- exit((unsigned long)vsprintf(buf,"%s",args) > 10L); } EOF ! if $cc $ccflags vprintf.c $ldflags -o vprintf >/dev/null 2>&1 && ./vprintf; then echo "Your vsprintf() returns (int)." >&4 val2="$undef" else *************** *** 4112,4118 **** cryptlib=-lcrypt fi if $test -z "$cryptlib"; then ! cryptlib=`./loc libcrypt.a "" $libpth` else cryptlib=-lcrypt fi --- 4134,4140 ---- cryptlib=-lcrypt fi if $test -z "$cryptlib"; then ! cryptlib=`./loc libcrypt.$lib_ext "" $libpth` else cryptlib=-lcrypt fi *************** *** 4602,4608 **** } EOM if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && ! $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 && $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then xxx=`./fred` case $xxx in --- 4624,4630 ---- } EOM if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && ! $ld $lddlflags -o dyna.$dlext dyna.$obj_ext > /dev/null 2>&1 && $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then xxx=`./fred` case $xxx in *************** *** 5073,5079 **** y*|true) usemymalloc='y' mallocsrc='malloc.c' ! mallocobj='malloc.o' d_mymalloc="$define" case "$libs" in *-lmalloc*) --- 5095,5101 ---- y*|true) usemymalloc='y' mallocsrc='malloc.c' ! mallocobj="malloc.$obj_ext" d_mymalloc="$define" case "$libs" in *-lmalloc*) *************** *** 5161,5167 **** EOCP : check sys/file.h first to get FREAD on Sun if $test `./findhdr sys/file.h` && \ ! $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then h_sysfile=true; echo "<sys/file.h> defines the O_* constants..." >&4 if ./open3; then --- 5183,5189 ---- EOCP : check sys/file.h first to get FREAD on Sun if $test `./findhdr sys/file.h` && \ ! $cc $cppflags $ldflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then h_sysfile=true; echo "<sys/file.h> defines the O_* constants..." >&4 if ./open3; then *************** *** 5172,5178 **** val="$undef" fi elif $test `./findhdr fcntl.h` && \ ! $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then h_fcntl=true; echo "<fcntl.h> defines the O_* constants..." >&4 if ./open3; then --- 5194,5200 ---- val="$undef" fi elif $test `./findhdr fcntl.h` && \ ! $cc "-DI_FCNTL" $ldflags open3.c -o open3 >/dev/null 2>&1 ; then h_fcntl=true; echo "<fcntl.h> defines the O_* constants..." >&4 if ./open3; then *************** *** 5605,5614 **** : we will have to assume that it supports the 4.2 BSD interface d_oldsock="$undef" else ! echo "You don't have Berkeley networking in libc.a..." >&4 ! if test -f /usr/lib/libnet.a; then ! ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \ ! ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list if $contains socket libc.list >/dev/null 2>&1; then echo "...but the Wollongong group seems to have hacked it in." >&4 socketlib="-lnet" --- 5627,5636 ---- : we will have to assume that it supports the 4.2 BSD interface d_oldsock="$undef" else ! echo "You don't have Berkeley networking in libc.$lib_ext..." >&4 ! if test -f /usr/lib/libnet.$lib_ext; then ! ( (nm $nm_opt /usr/lib/libnet.$lib_ext | eval $nm_extract) || \ ! $ar t /usr/lib/libnet.$lib_ext) 2>/dev/null >> libc.list if $contains socket libc.list >/dev/null 2>&1; then echo "...but the Wollongong group seems to have hacked it in." >&4 socketlib="-lnet" *************** *** 5621,5627 **** d_oldsock="$define" fi else ! echo "or even in libnet.a, which is peculiar." >&4 d_socket="$undef" d_oldsock="$undef" fi --- 5643,5649 ---- d_oldsock="$define" fi else ! echo "or even in libnet.$lib_ext, which is peculiar." >&4 d_socket="$undef" d_oldsock="$undef" fi *************** *** 6294,6300 **** printf("%d\n", (char *)&try.bar - (char *)&try.foo); } EOCP ! if $cc $ccflags try.c -o try >/dev/null 2>&1; then dflt=`./try` else dflt='8' --- 6316,6322 ---- printf("%d\n", (char *)&try.bar - (char *)&try.foo); } EOCP ! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then dflt=`./try` else dflt='8' *************** *** 6372,6378 **** printf("\n"); } EOCP ! if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then dflt=`./try` case "$dflt" in ????|????????) echo "(The test program ran ok.)";; --- 6394,6400 ---- printf("\n"); } EOCP ! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 ; then dflt=`./try` case "$dflt" in ????|????????) echo "(The test program ran ok.)";; *************** *** 7091,7097 **** printf("%d\n",i); } EOCP ! if $cc try.c -o try >/dev/null 2>&1 ; then dflt=`try` else dflt='?' --- 7113,7119 ---- printf("%d\n",i); } EOCP ! if $cc $ldflags try.c -o try >/dev/null 2>&1 ; then dflt=`try` else dflt='?' *************** *** 7118,7135 **** $cc $ccflags -c bar1.c >/dev/null 2>&1 $cc $ccflags -c bar2.c >/dev/null 2>&1 $cc $ccflags -c foo.c >/dev/null 2>&1 ! ar rc bar.a bar2.o bar1.o >/dev/null 2>&1 ! if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 && ./foobar >/dev/null 2>&1; then ! echo "ar appears to generate random libraries itself." orderlib=false ranlib=":" ! elif ar ts bar.a >/dev/null 2>&1 && ! $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 && ./foobar >/dev/null 2>&1; then echo "a table of contents needs to be added with 'ar ts'." orderlib=false ! ranlib="ar ts" else case "$ranlib" in :) ranlib='';; --- 7140,7157 ---- $cc $ccflags -c bar1.c >/dev/null 2>&1 $cc $ccflags -c bar2.c >/dev/null 2>&1 $cc $ccflags -c foo.c >/dev/null 2>&1 ! $ar rc bar.$lib_ext bar2.$obj_ext bar1.$obj_ext >/dev/null 2>&1 ! if $cc $ccflags $ldflags -o foobar foo.$obj_ext bar.$lib_ext $libs > /dev/null 2>&1 && ./foobar >/dev/null 2>&1; then ! echo "$ar appears to generate random libraries itself." orderlib=false ranlib=":" ! elif $ar ts bar.$lib_ext >/dev/null 2>&1 && ! $cc $ccflags $ldflags -o foobar foo.$obj_ext bar.$lib_ext $libs > /dev/null 2>&1 && ./foobar >/dev/null 2>&1; then echo "a table of contents needs to be added with 'ar ts'." orderlib=false ! ranlib="$ar ts" else case "$ranlib" in :) ranlib='';; *************** *** 7323,7329 **** #endif } EOCP ! if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then d_fds_bits="$define" d_fd_set="$define" echo "Well, your system knows about the normal fd_set typedef..." >&4 --- 7345,7351 ---- #endif } EOCP ! if $cc $ccflags $ldflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then d_fds_bits="$define" d_fd_set="$define" echo "Well, your system knows about the normal fd_set typedef..." >&4 *************** *** 7340,7346 **** $cat <<'EOM' Hmm, your compiler has some difficulty with fd_set. Checking further... EOM ! if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then d_fds_bits="$undef" d_fd_set="$define" echo "Well, your system has some sort of fd_set available..." >&4 --- 7362,7368 ---- $cat <<'EOM' Hmm, your compiler has some difficulty with fd_set. Checking further... EOM ! if $cc $ccflags $ldflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then d_fds_bits="$undef" d_fd_set="$define" echo "Well, your system has some sort of fd_set available..." >&4 *************** *** 7917,7923 **** else echo "false" fi ! $rm -f varargs.o EOP chmod +x varargs --- 7939,7945 ---- else echo "false" fi ! $rm -f varargs.$obj_ext EOP chmod +x varargs *************** *** 8060,8070 **** echo " " echo "Stripping down executable paths..." >&4 for file in $loclist $trylist; do ! eval $file="\$file" done ;; esac : create config.sh file echo " " echo "Creating config.sh..." >&4 --- 8082,8095 ---- echo " " echo "Stripping down executable paths..." >&4 for file in $loclist $trylist; do ! if test X$file != Xln -o X$osname != Xos2; then eval $file="\$file"; fi done ;; esac + # Setup libraries for linking miniperl (if not set already) + : ${cldlibs="$libs $cryptlib"} + : create config.sh file echo " " echo "Creating config.sh..." >&4 *************** *** 8119,8124 **** --- 8144,8150 ---- chmod='$chmod' chown='$chown' clocktype='$clocktype' + cldlibs='$cldlibs' comm='$comm' compress='$compress' contains='$contains' *************** *** 8312,8317 **** --- 8338,8344 ---- expr='$expr' extensions='$extensions' find='$find' + firstmakefile='$firstmakefile' flex='$flex' fpostype='$fpostype' freetype='$freetype' *************** *** 8514,8519 **** --- 8541,8553 ---- voidflags='$voidflags' xlibpth='$xlibpth' zcat='$zcat' + archobjs='$archobjs' + obj_ext='$obj_ext' + lib_ext='$lib_ext' + exe_ext='$exe_ext' + ar='$ar' + plibext='$plibext' + path_sep='$path_sep' EOT : add special variables
|