4 # Try to make process.o various ways.
22 # Here is a test to check if we manage to build process.o
23 # (use this because some sh doesn't have functions)
25 # $CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
29 # Options that you may need to override for your CPU/OS
32 PROCESS_S
="undefined_you_lose"
36 #make sure we build for the right cpu
37 @MACOSX_TRUE@CC
="${CC} -arch $HOST_CPU"
40 # Clean out the process.o
43 $RM -f process.o process.S foo.c
46 # Add PROCESS_S you need
50 arm
*) PROCESS_S
="process.arm.S" ;;
51 sparc
*) PROCESS_S
="process.sparc.S" ;;
52 i
*86*) PROCESS_S
="process.i386.S" ;;
53 m68k
) PROCESS_S
="process.m68k.S" ;;
54 mips
*) PROCESS_S
="process.mips.S" ;;
55 alpha
*) PROCESS_S
="process.alpha.S" ;;
56 hppa
*) PROCESS_S
="process.hpux.S" ;;
57 powerpc|ppc
) PROCESS_S
="process.ppc.S" ;;
58 rs6000
) PROCESS_S
="process.rios.S" ;;
59 vax
) PROCESS_S
="process.vax.S" ;;
60 s390
*) PROCESS_S
="process.s390.S" ;;
61 x86_64|amd_64|amd64
) PROCESS_S
="process.x86_64.S" ;;
63 *) echo "Unknown host_cpu, good luck" ;;
67 # Add OSDEF your OS need
71 *bsd
*) OSDEF
="-DHAVE_PIC -DAFS_BSD_ENV" ;;
72 *darwin
*) OSDEF
="-DHAVE_PIC -DAFS_DARWIN_ENV -DAFS_BSD_ENV" ;;
73 *dux
* |
*osf
*) OSDEF
="-DAFS_OSF_ENV" ;;
74 *linux
*) OSDEF
="-DAFS_LINUX_ENV" ;;
75 *solaris
*) OSDEF
="-DAFS_SUN5_ENV -D_ASM" USE_AS
="yes" ;;
76 *irix
*) OSDEF
="-Dsgi -n32 -DHAVE_PIC"; ASDEF
="-n32" ;;
77 *hpux
*) OSDEF
="-DAFS_HPUX_ENV" ;;
78 aix
*) CPUDEF
=""; OSDEF
="" ;;
80 $CPP $MYDEF -P ${srcdir}/process-vpp.s
> foo.s
81 $AS -o process.o foo.s
&& $RM -f foo.s
&& exit 0
89 # Now try to do the magic stuff.
92 $LN_S ${srcdir}/${PROCESS_S} process.S
95 # Can we use $CC to do the asm for us ? (GCC)
98 if test "X$GCC" = "Xyes" -a "X$USE_AS" = "Xno"; then
99 ${CC} -I..
/include
-I$srcdir -DASSEMBLER $MYDEF $CPUDEF $OSDEF -c process.S
102 $CC -o testprocess testprocess.o process.o preempt.o
${LWP_O} && exit 0
107 # Try to use $AS -P for assably
110 $AS -P -I..
/include
-I$srcdir -DASSEMBLER $MYDEF $CPUDEF $OSDEF process.S
-o process.o
113 $CC -o testprocess testprocess.o process.o preempt.o
${LWP_O} && exit 0
118 # Some $AS does "interesting" things, like ignorings the -o flag
119 # and creats a .i file that is preprocessed. (Digital Unix)
122 if test -s process.i
; then
123 $AS $ASDEF process.i
-o process.o
127 $CC -o testprocess testprocess.o process.o preempt.o
${LWP_O} && exit 0
132 # Try to use $AS (without -P) for assably
135 $AS -I..
/include
-I$srcdir -DASSEMBLER $MYDEF $CPUDEF $OSDEF process.S
-o process.o
138 $CC -o testprocess testprocess.o process.o preempt.o
${LWP_O} && exit 0
143 # Some $AS does "intresting" things, like ignorings the -o flag
144 # and creats a .i file that is preprocessed. (Digital Unix)
147 if test -s process.i
; then
148 $AS process.i
-o process.o
152 $CC -o testprocess testprocess.o process.o preempt.o
${LWP_O} && exit 0
158 # Try to use $CPP to preprocess
161 $CPP -I..
/include
-I$srcdir $MYDEF $CPUDEF $OSDEF process.S
> process.ss
162 $AS process.ss
-o process.o
166 $CC -o testprocess testprocess.o process.o preempt.o
${LWP_O} && exit 0
170 # Try to fool $CC by adding a .c extension.
173 $LN_S process.S foo.c
174 $CPP -I..
/include
-I$srcdir $MYDEF $CPUDEF $OSDEF foo.c
> process.ss
176 $AS process.ss
-o process.o
180 $CC -o testprocess testprocess.o process.o preempt.o
${LWP_O} && exit 0
183 echo "WE HAVE NO process.o !"