summaryrefslogtreecommitdiff
path: root/lib/make/configure.in
blob: 61b806c75ca114986822fc5a93be9d639e360d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
dnl @@
dnl    @file      configure.in
dnl    @date      Sun Jan 17 15:54:23 1999
dnl    @author    Tom Goodale
dnl    @desc 
dnl    
dnl    @enddesc 
dnl    @version $Id$
dnl  @@
dnl Process this file with autoconf to produce a configure script.

AC_REVISION($Id$)

dnl It looks like older versions of Autoconf don't quite work properly under 
dnl cygwin.
AC_PREREQ(2.13)

dnl Starts here
AC_INIT()
AC_CONFIG_HEADER(cctk_Config.h)

dnl Check the system type
AC_CANONICAL_SYSTEM

# See if there are any preferred compilers for this system

CCTK_CONFIG_STAGE="preferred-compilers"

if test -r $srcdir/known-architectures/$host_os ; then
. $srcdir/known-architectures/$host_os
else
  echo "Warning: "
  echo "  Cactus has not been previously compiled on this architecture: "
  echo "    ($host_os)"
  echo "  The currently known architectures can be found in "
  echo "    $srcdir/known-architectures"
  echo "  The configuration will try to do its best to work things out."
  echo "  If you create a known-architectures file for this architecture, "
  echo "  please send it to cactusmaint@cactuscode.org and we'll include "
  echo "  it in the next release."
fi

# Save these for future use.

if test -n "$LIBS" ; then
  KNOWN_LIBS="$LIBS"
  unset LIBS
fi

if test -n "$LDFLAGS" ; then
  KNOWN_LDFLAGS="$LDFLAGS"
  unset LDFLAGS
fi


dnl Checks for programs.
AC_PROG_MAKE_SET

#if test -z "$CC" ; then
AC_PROG_CC
#fi

#if test -z "$CXX" ; then
AC_PROG_CXX
#fi

if test -z "$RANLIB" ; then
AC_PROG_RANLIB
fi

dnl Look for a standalone CPP

if test -z "$CPP" ; then
AC_PATH_PROGS(CPP, cpp, echo, /lib:/usr/lib:/usr/local/lib:$PATH)
fi

if test -z "$PERL" ; then
AC_CHECK_PROGS(PERL, perl)
fi

if test -z "$F90" ; then
AC_CHECK_PROGS(F90, f90 pgf90 xlf90)
fi

if test -z "$F77" ; then
AC_CHECK_PROGS(F77, f77 pgf77 g77 f90 pgf90 xlf90)
fi

if test -z "$AR" ; then
AC_CHECK_PROGS(AR, ar)
fi

if test -z "$MKDIR" ; then
AC_CHECK_PROGS(MKDIR, mkdir)
fi

if test -z "$SHELL" ; then
AC_CHECK_PROGS(SHELL, sh bash)
fi

if test -z "$LD" ; then
AC_SUBST(LD)
LD=$CXX
fi

# Restore the values we saved earlier

if test -n "$KNOWN_LIBS" ; then
  LIBS="$KNOWN_LIBS"
  unset KNOWN_LIBS
fi

if test -n "$KNOWN_LDFLAGS" ; then
  LDFLAGS="$KNOWN_LDFLAGS"
  unset KNOWN_LDFLAGS
fi

# Include some CCTK auxiliary functions

. $srcdir/CCTK_Functions.sh


#########################################################################
# If this is a known architecture, setup any specific flags.
# This has to be done here as flags given to the compiler may
# change the things detected later.

# Create a file to put any #defines etc needed for this architecture
# known architecture stuff should use cat >> etc to append to this file.
cat > cctk_Archdefs.h <<EOF
/* Stuff from known architectures */
#ifndef _CCTK_ARCHDEFS_H_
#define _CCTK_ARCHDEFS_H_
EOF

cat > make.arch.defn <<EOF
# Stuff from known architectures 
EOF

CCTK_CONFIG_STAGE="misc"

if test -r $srcdir/known-architectures/$host_os ; then
. $srcdir/known-architectures/$host_os
fi

# Finish the architecture stuff
cat >> cctk_Archdefs.h <<EOF
#endif /* _CCTK_ARCHDEFS_H_ */
EOF


#########################################################################
#Check for extra stuff
#########################################################################
cat > cctk_Extradefs.h <<EOF
/* Stuff from extra packages */
#ifndef _CCTK_EXTRADEFS_H_
#define _CCTK_EXTRADEFS_H_
EOF

cat > make.extra.defn <<EOF
# Stuff from extra packages 
EOF

for extra in `ls $srcdir/extras`
do
  if test -d $srcdir/extras/$extra ; then
    if test -x $srcdir/extras/$extra/setup.sh ; then
        # Put some comment lines in the files.
        CCTK_WriteLine cctk_Extradefs.h ""
        CCTK_WriteLine cctk_Extradefs.h "/*$extra definitions*/"
        CCTK_WriteLine make.extra.defn ""
        CCTK_WriteLine make.extra.defn "# $extra definitions"
        # Call the setup script
        . $srcdir/extras/$extra/setup.sh
        # Put some more comments in
        CCTK_WriteLine make.extra.defn "#End of $extra definitions"
        CCTK_WriteLine make.extra.defn ""
    fi
  fi
done

# Finish the cctk_Extradefs.h file
cat >> cctk_Extradefs.h <<EOF
#endif /*_CCTK_EXTRADEFS_H_*/
EOF



##########################################################################
#########################################################################

# Deal with the Fortran compiler issues.
# If there's a Fortran 90 compiler use that for all the Fortran.
if test "x$F90" != "x" ; then
F77=$F90 
F77FLAGS=$F90FLAGS ;
fi

# The known architecture stuff has probably set the LIBS variable
# So remember what it is and set it to blank to prevent any problems with the
# rest of the configure stuff.

KNOWN_LIBS="$LIBS"
unset LIBS

KNOWN_LDFLAGS="$LDFLAGS"
unset LDFLAGS

dnl Checks for libraries.

dnl Checks for header files.

AC_HEADER_STDC

dnl Checks for typedefs, structures, and compiler characteristics.

AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_C_LONG_DOUBLE

# Check for sizes of integer types
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(short int)

# Check for sizes of floating point types
AC_CHECK_SIZEOF(long double)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(float)

# Check for sizes of pointers.  
AC_CHECK_SIZEOF(char *)

# See if there's a null device, and what it's called

CCTK_FIND_NULLDEVICE

# Find the X libraries in case people need them

AC_PATH_X

AC_SUBST(X_LIB_DIR)
AC_SUBST(X_INC_DIR)

X_LIB_DIR="$x_libraries"
X_INC_DIR="$x_includes"

# Various flags

AC_SUBST(ARFLAGS)
: ${ARFLAGS=rucs}


AC_SUBST(F90FLAGS)
AC_SUBST(F77FLAGS)

#: ${F90FLAGS="$CFLAGS"}
#: ${F77FLAGS="$CFLAGS"}

dnl Checks for library functions.

AC_CHECK_FUNCS(mkdir) 
AC_CHECK_FUNCS(scandir) 

# Check if we have mode_t available 
AC_MSG_CHECKING([if mode_t is defined])
AC_CACHE_VAL(cctk_cv_have_mode_t,
[AC_TRY_COMPILE([#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>],
[mode_t foo; return 0], eval "cctk_cv_have_mode_t=yes",
eval "cctk_cv_have_mode_t=no")
])
if test "$cctk_cv_have_mode_t" = "yes"; then
  AC_DEFINE(HAVE_MODE_T)	
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi


dnl Check some timing stuff

CCTK_TIME_GETTIMEOFDAY
CCTK_TIME_GETRUSAGE
CCTK_TIME__FTIME

dnl Include file stuff

CCTK_CHECK_HEADERS(sys/time.h)
CCTK_CHECK_HEADERS(unistd.h)
CCTK_CHECK_HEADERS(string.h)

AC_HEADER_TIME

# C++ STL stuff

AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CCTK_CHECK_HEADERS(vector vector.h)
AC_LANG_RESTORE

dnl Misc stuff

AC_SUBST(LIBDIRS)

AC_SUBST(PACKAGE_DIR)
AC_SUBST(BUILD_DIR)
AC_SUBST(CCTK_LIBDIR)
AC_SUBST(EXEDIR)
AC_SUBST(EXE)

: ${PACKAGE_DIR=arrangements}
: ${BUILD_DIR=build}
: ${CCTK_LIBDIR=lib}
: ${EXEDIR='$(CCTK_HOME)/exe'}
: ${EXE=cactus-unknown}

# Integer types

case "x$ac_cv_sizeof_long_int" in
    "x8")
      CCTK_INT8="long int" ;;
    "x4")
      CCTK_INT4="long int" ;;
    "x2")
      CCTK_INT2="long int" ;;
esac

case "x$ac_cv_sizeof_int" in
    "x8")
      CCTK_INT8="int" ;;
    "x4")
      CCTK_INT4="int" ;;
    "x2")
      CCTK_INT2="int" ;;
esac

case "x$ac_cv_sizeof_short_int" in
    "x8")
      CCTK_INT8="short int" ;;
    "x4")
      CCTK_INT4="short int" ;;
    "x2")
      CCTK_INT2="short int" ;;
esac

if test -n  "$CCTK_INT8" ; then
AC_DEFINE_UNQUOTED(CCTK_INT8, $CCTK_INT8)
fi

if test -n  "$CCTK_INT4" ; then
AC_DEFINE_UNQUOTED(CCTK_INT4, $CCTK_INT4)
fi

if test -n  "$CCTK_INT2" ; then
AC_DEFINE_UNQUOTED(CCTK_INT2, $CCTK_INT2)
fi

# Float types

case "x$ac_cv_sizeof_long_double" in
    "x16")
      CCTK_REAL16="long double" ;;
    "x8")
      CCTK_REAL8="long double" ;;
    "x4")
      CCTK_REAL4="long double" ;;
esac

case "x$ac_cv_sizeof_double" in
    "x16")
      CCTK_REAL16="double" ;;
    "x8")
      CCTK_REAL8="double" ;;
    "x4")
      CCTK_REAL4="double" ;;
esac

case "x$ac_cv_sizeof_float" in
    "x16")
      CCTK_REAL16="float" ;;
    "x8")
      CCTK_REAL8="float" ;;
    "x4")
      CCTK_REAL4="float" ;;
esac

if test -n  "$CCTK_REAL16" ; then
AC_DEFINE_UNQUOTED(CCTK_REAL16, $CCTK_REAL16)
fi

if test -n  "$CCTK_REAL8" ; then
AC_DEFINE_UNQUOTED(CCTK_REAL8, $CCTK_REAL8)
fi

if test -n  "$CCTK_REAL4" ; then
AC_DEFINE_UNQUOTED(CCTK_REAL4, $CCTK_REAL4)
fi


# Define the default floating point and integer precisions
case "x$REAL_PRECISION" in
    "x16")
	AC_DEFINE(CCTK_REAL_PRECISION_16) ;;
    "x8")
	AC_DEFINE(CCTK_REAL_PRECISION_8) ;;
    "x4")
	AC_DEFINE(CCTK_REAL_PRECISION_4) ;;
    *)
	AC_DEFINE(CCTK_REAL_PRECISION_8) ;;
esac

case "x$INTEGER_PRECISION" in
    "x8")
	AC_DEFINE(CCTK_INTEGER_PRECISION_8) ;;
    "x4")
	AC_DEFINE(CCTK_INTEGER_PRECISION_4) ;;
    "x2")
	AC_DEFINE(CCTK_INTEGER_PRECISION_2) ;;
    *)
	AC_DEFINE(CCTK_INTEGER_PRECISION_4) ;;
esac

# Define any code needed before the definition of a Fortran subroutine
# This is empty on most architectures.

: ${CCTK_FCALL=""}

AC_DEFINE_UNQUOTED(CCTK_FCALL, $CCTK_FCALL) 

# DEPRECATED IN BETA 9

: ${FMODIFIER=""}

AC_DEFINE_UNQUOTED(FMODIFIER, $FMODIFIER) 

# Define the type of debugging to use

if test -n  "$DEBUG" ; then
  case "$DEBUG" in
    MEMORY) 
	AC_DEFINE(CCTK_TRACEMEMORY)
      ;;
    FLAGS)
	AC_DEFINE(CCTK_DEBUG)
      ;;
    DEFINES)
	AC_DEFINE(DEBUG)
      ;;
    ALL)
	AC_DEFINE(CCTK_TRACEMEMORY)
	AC_DEFINE(CCTK_DEBUG)
	AC_DEFINE(DEBUG)
      ;;
   esac

AC_DEFINE_UNQUOTED(DEBUG, $DEBUG)
fi

# Define how to make a directory in the config.h file

AC_DEFINE_UNQUOTED(MKDIR, "$MKDIR") 

AC_SUBST(MKDIRFLAGS)

: ${MKDIRFLAGS="-p"}

AC_DEFINE_UNQUOTED(MKDIRFLAGS, " $MKDIRFLAGS ") 


# The perl scripts run by the make system need to have their names
# changed if under cygwin - e.g. //d/foo needs to be d:/foo

PERL_CONFIGURE_SCRIPT=`echo $srcdir/configure.pl | sed 's,^//\(.\)/,\1:/,'`

AC_SUBST(BUILD_ACTIVETHORNS)
BUILD_ACTIVETHORNS='$(CCTK_HOME)/lib/sbin/BuildActiveThorns.pl'

AC_SUBST(CST)
CST='$(CCTK_HOME)/lib//sbin/CST'

AC_SUBST(F_FILE_PROCESSOR)
F_FILE_PROCESSOR='$(CCTK_HOME)/lib/sbin/f_file_processor.pl'
AC_SUBST(C_FILE_PROCESSOR)
C_FILE_PROCESSOR='$(CCTK_HOME)/lib/sbin/c_file_processor.pl'

# Put the libraries from the known-architectures onto the LIB variable.
LIBS="$KNOWN_LIBS $LIBS"
LDFLAGS="$KNOWN_LDFLAGS $LDFLAGS"

#Set the compileonly flags if they've not been set by now

AC_SUBST(CCOMPILEONLY)
AC_SUBST(FCOMPILEONLY)

: ${CCOMPILEONLY="-c -o"}
: ${FCOMPILEONLY="-c -o"}

# Set the debug flags if they've not been set by now

AC_SUBST(DEBUG_MODE)

if test -n "$DEBUG" ; then
  DEBUG_MODE=$DEBUG
else
  DEBUG_MODE="no"
fi


AC_SUBST(C_DEBUG_FLAGS)

if test -z "$C_DEBUG_FLAGS" ; then
  case "$CC" in
    gcc) 
      C_DEBUG_FLAGS="-g"
      ;;
    pgcc)
      C_DEBUG_FLAGS="-g"
      ;;
    *)
#     This should be a reasonable default.
      C_DEBUG_FLAGS="-g"      
      ;;
   esac
fi

AC_SUBST(CXX_DEBUG_FLAGS)

if test -z "CXX_DEBUG_FLAGS" ; then
  case "$CXX" in
    g++) 
      CXX_DEBUG_FLAGS="-g"
      ;;
    pgCC)
      CXX_DEBUG_FLAGS="-g"
      ;;
    *)
#     This should be a reasonable default.
      CXX_DEBUG_FLAGS="-g"      
      ;;
   esac
fi

AC_SUBST(F77_DEBUG_FLAGS)

if test -z "F77_DEBUG_FLAGS" ; then
  case "$F77" in
    g77) 
      F77_DEBUG_FLAGS="-g"
      ;;
    pgf77)
      F77_DEBUG_FLAGS="-g"
      ;;
    *)
#     This should be a reasonable default.
      F77_DEBUG_FLAGS="-g"      
      ;;
   esac
fi

AC_SUBST(F90_DEBUG_FLAGS) 

if test -z "F90_DEBUG_FLAGS" ; then
  case "$F90" in
    pgf90)
      F90_DEBUG_FLAGS="-g"
      ;;
    *)
#     This should be a reasonable default.
      F90_DEBUG_FLAGS="-g"      
      ;;
   esac
fi

# Set the optimization flags if they've not been set by now

AC_SUBST(OPTIMISE_MODE)

if test -n "$OPTIMISE" ; then
  OPTIMISE_MODE=$OPTIMISE
else
  OPTIMISE_MODE="yes"
fi


AC_SUBST(C_OPTIMISE_FLAGS)

if test -z "$C_OPTIMISE_FLAGS" ; then
  case "$CC" in
    gcc) 
      C_OPTIMISE_FLAGS="-O2"
      ;;
    *)
#     This should be a reasonable default.
      C_OPTIMISE_FLAGS="-O2"      
      ;;
   esac
fi

AC_SUBST(CXX_OPTIMISE_FLAGS)

if test -z "CXX_OPTIMISE_FLAGS" ; then
  case "$CXX" in
    g++) 
      CXX_OPTIMISE_FLAGS="-O2"
      ;;
    *)
#     This should be a reasonable default.
      CXX_OPTIMISE_FLAGS="-O2"      
      ;;
   esac
fi

AC_SUBST(F77_OPTIMISE_FLAGS)

if test -z "F77_OPTIMISE_FLAGS" ; then
  case "$F77" in
    g77) 
      F77_OPTIMISE_FLAGS="-O"
      ;;
    *)
#     Don't know a reasonable default.
      F77_OPTIMISE_FLAGS=""      
      ;;
   esac
fi

AC_SUBST(F90_OPTIMISE_FLAGS) 

if test -z "F90_OPTIMISE_FLAGS" ; then
  case "$F90" in
    *)
#     Don't know a reasonable default.
      F90_OPTIMISE_FLAGS=""      
      ;;
   esac
fi

# Set the warning flags if they've not been set by now

AC_SUBST(C_WARN_FLAGS)

if test -z "C_WARN_FLAGS" ; then
  case "$CC" in
    gcc) 
      C_WARN_FLAGS="-Wall"
      ;;
    *)
#     Not sure what should be a reasonable default.
      C_WARN_FLAGS=""      
      ;;
   esac
fi

AC_SUBST(CXX_WARN_FLAGS) 

if test -z "CXX_WARN_FLAGS" ; then
  case "$CXX" in
    g++) 
      CXX_WARN_FLAGS="-Wall"
      ;;
    *)
#     Not sure what should be a reasonable default.
      CXX_WARN_FLAGS=""      
      ;;
   esac
fi

AC_SUBST(F77_WARN_FLAGS) 

if test -z "F77_WARN_FLAGS" ; then
  case "$F77" in
    g77) 
      F77_WARN_FLAGS="-Wall"
      ;;
    *)
#     Not sure what should be a reasonable default.
      F77_WARN_FLAGS=""      
      ;;
   esac
fi

AC_SUBST(F90_WARN_FLAGS) 

if test -z "F90_WARN_FLAGS" ; then
  case "$F90" in
    *)
#     Not sure what should be a reasonable default.
      F90_WARN_FLAGS=""      
      ;;
   esac
fi


# Set the createexe flag if it's not been set by now

AC_SUBST(CREATEEXE)

: ${CREATEEXE="-o"}

# Set the directory seperator for this architecture
AC_SUBST(DIRSEP)

: ${DIRSEP="/"}

# Set the option seperator for this architecture.  Hopefully it is the same for all compilers.
AC_SUBST(OPTIONSEP)

: ${OPTIONSEP='$(EMPTY_VAR) # a single space'}

# How to link the cactus libraries
AC_SUBST(CACTUSLIBLINKLINE)

: ${CACTUSLIBLINKLINE='-L$(CCTK_LIBDIR) $(addprefix -l, $(ALLCACTUSLIBS))'}

# How to generate C dependency info
AC_SUBST(C_DEPEND)

: ${C_DEPEND='$(CC) -E -M $(CPPFLAGS)'}

AC_SUBST(C_DEPEND_OUT)

: ${C_DEPEND_OUT=' > $@'}

# How to generate C++ dependency info
AC_SUBST(CXX_DEPEND)

: ${CXX_DEPEND='$(CXX) -E -M $(CPPFLAGS)'}

AC_SUBST(CXX_DEPEND_OUT)

: ${CXX_DEPEND_OUT=' > $@'}

# How to generate F77 dependency info
AC_SUBST(F77_DEPEND)

: ${F77_DEPEND='$(CPP) -M $(CPPFLAGS)'}

AC_SUBST(F77_DEPEND_OUT)

: ${F77_DEPEND_OUT=' > $@'}

# How to generate F90 dependency info
AC_SUBST(F_DEPEND)

: ${F_DEPEND='$(CPP) -M $(CPPFLAGS)'}

AC_SUBST(F_DEPEND_OUT)

: ${F_DEPEND_OUT=' > $@'}

# Postprocessing of object files.  Most architectures don't need to do this at all.

AC_SUBST(C_POSTPROCESSING)

: ${C_POSTPROCESSING=""}

AC_SUBST(CXX_POSTPROCESSING)

: ${CXX_POSTPROCESSING=""}

AC_SUBST(F77_POSTPROCESSING)

: ${F77_POSTPROCESSING=""}

AC_SUBST(F_POSTPROCESSING)

: ${F_POSTPROCESSING=""}

AC_SUBST(F90_POSTPROCESSING)

: ${F90_POSTPROCESSING=""}

# How to generate an intermediate C++ name (some compilers are very picky).

AC_SUBST(CXX_WORKING_NAME)

: ${CXX_WORKING_NAME='$(notdir $<)'}

# How to get the current working directory when in the shell
AC_SUBST(GET_WD)
: ${GET_WD="pwd"}

# Any additional system include directories.
AC_SUBST(SYS_INC_DIRS)
: ${SYS_INC_DIRS=" "}

# How to link in the non-Cactus libraries
AC_SUBST(GENERAL_LIBRARIES)
: ${GENERAL_LIBRARIES='$(LIBDIRS:%=-L%) $(LIBS:%=-l%)'}

# Do we need to make sure Perl makes a backup when editting in place ?
AC_SUBST(PERL_BACKUP_NECESSARY)

: ${PERL_BACKUP_NECESSARY=""}

# Cache stuff - this will probably change 

# L2 Cache
: ${L2_CACHELINE_BYTES="0"}
: ${L2_CACHE_SIZE="0"}

AC_DEFINE_UNQUOTED(CCTK_L2_CACHELINE_BYTES, $L2_CACHELINE_BYTES) 
AC_DEFINE_UNQUOTED(CCTK_L2_CACHE_SIZE, $L2_CACHE_SIZE) 


dnl Run any other scripts necessary

AC_OUTPUT_COMMANDS(,$PERL -s $PERL_CONFIGURE_SCRIPT -compiler="$F77" -opts="$F77FLAGS" .) 

dnl Output everything
AC_OUTPUT(make.config.defn make.config.deps make.config.rules)