Greetings. Independant of whether mkinstalldirs should/will be integrated into `missing' and whether or not calling rmdir -p during uninstall is a good idea (I guess not), I thunk there ought to be macros to handle these situations in any case. So I sat down and wrote some. If there's any interest for them now or in the future, let me know. (Any comments about coding practices are welcome as well.) -- Peter Eisentraut Sernanders väg 10:115 [EMAIL PROTECTED] 75262 Uppsala http://yi.org/peter-e/ Sweden
# AC_PROG_MKDIR_P # --------------- AC_DEFUN(AC_PROG_MKDIR_P, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Find a mkdir program that can handle the -p switch (to create a # hierarchy). AC_MSG_CHECKING(for mkdir -p) if test -z "$MKDIR_P"; then AC_CACHE_VAL(ac_cv_path_MKDIR_P, [ ac_save_IFS=$IFS; IFS=':' for ac_dir in $PATH; do if test -f $ac_dir/mkdir; then mkdir -p conftestdir.$$/abc/def >/dev/null 2>&1 ac_save_exit_status=$? rmdir conftestdir.$$/abc/def >/dev/null 2>&1 rmdir conftestdir.$$/abc >/dev/null 2>&1 rmdir conftestdir.$$ >/dev/null 2>&1 if test 0 -eq $ac_save_exit_status; then ac_cv_path_MKDIR_P="$ac_dir/mkdir -p" break fi fi done IFS=$ac_save_IFS ])dnl if test "${ac_cv_path_MKDIR_P+set}" = set; then MKDIR_P=$ac_cv_path_MKDIR_P else # Alternatively, use a shell script implementation. XXX Use # mkinstalldirs, or perhaps `missing mkdir -p' here. XXX Should # probably be handled in AC_CONFIG_AUX_*. MKDIR_P="$SHELL $ac_aux_dir/mkinstalldirs" fi fi AC_MSG_RESULT($MKDIR_P) AC_SUBST(MKDIR_P)dnl ])# AC_PROG_MKDIR_P # AC_PROG_RMDIR_P # --------------- AC_DEFUN(AC_PROG_RMDIR_P, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Find a rmdir program that can handle the -p switch (to remove a # hierarchy). AC_MSG_CHECKING(for rmdir -p) if test -z "$RMDIR_P"; then AC_CACHE_VAL(ac_cv_path_RMDIR_P, [ ac_save_IFS=$IFS; IFS=':' mkdir conftestdir.$$ && mkdir conftestdir.$$/abc && mkdir conftestdir.$$/abc/def || AC_MSG_ERROR(cannot create test directory) for ac_dir in $PATH; do if test -f $ac_dir/rmdir; then rmdir -p conftestdir.$$/abc/def >/dev/null 2>&1 if test 0 -eq $? ; then ac_cv_path_RMDIR_P="$ac_dir/rmdir -p" break fi fi done if test -d conftestdir.$$ ; then rmdir conftestdir.$$/abc/def >/dev/null 2>&1 rmdir conftestdir.$$/abc >/dev/null 2>&1 rmdir conftestdir.$$ >/dev/null 2>&1 fi IFS=$ac_save_IFS ])dnl if test "${ac_cv_path_RMDIR_P+set}" = set; then RMDIR_P=$ac_cv_path_RMDIR_P else # Alternatively, use a shell script implementation. # XXX see also PROG_MKDIR_P RMDIR_P="$SHELL $ac_aux_dir/rminstalldirs" fi fi AC_MSG_RESULT($RMDIR_P) AC_SUBST(RMDIR_P)dnl ])# AC_PROG_RMDIR_P